随机方法修改
This commit is contained in:
parent
4dd7f0f4ee
commit
78758b33c9
@ -1,6 +1,7 @@
|
||||
package equipment
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
@ -10,8 +11,7 @@ import (
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"go_dreamfactory/sys/db"
|
||||
"math"
|
||||
"math/rand"
|
||||
"time"
|
||||
"math/big"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
)
|
||||
@ -622,8 +622,10 @@ func (this *Equipment) GetForgeEquip(session comm.IUserSession, suiteId int32, p
|
||||
}
|
||||
return
|
||||
}
|
||||
r := rand.New(rand.NewSource(time.Now().Unix()))
|
||||
index := r.Perm(len(lvs))[0]
|
||||
// 随机方法修改
|
||||
n, _ := rand.Int(rand.Reader, big.NewInt(int64(len(lvs))))
|
||||
index := n.Int64() //rand.New(rand.NewSource(time.Now().Unix()))
|
||||
//index := r.Perm(len(lvs))[0]
|
||||
if eruip, err = this.modelEquipment.newEquipment(session.GetUserId(), lvs[index], dyweight, isepic); err == nil {
|
||||
errdata = this.AddEquipment(session, eruip)
|
||||
// this.equipmentsChangePush(session, []*pb.DB_Equipment{eruip})
|
||||
|
Loading…
Reference in New Issue
Block a user