create RNG in token module

This commit is contained in:
wish
2023-03-12 23:29:50 +11:00
parent cce558db9c
commit ccfd2ac36f
5 changed files with 19 additions and 15 deletions

View File

@@ -1,8 +1,8 @@
package channelserver
import (
"erupe-ce/common/token"
"math"
"math/rand"
"time"
"erupe-ce/common/byteframe"
@@ -95,9 +95,9 @@ func generateFeatureWeapons(count int) activeFeature {
}
nums := make([]int, 0)
var result int
r := rand.New(rand.NewSource(time.Now().UnixNano()))
rng := token.RNG()
for len(nums) < count {
num := r.Intn(14)
num := rng.Intn(14)
exist := false
for _, v := range nums {
if v == num {