Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
c97e2745ad
@ -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"
|
||||
)
|
||||
@ -589,8 +589,8 @@ func (this *Equipment) GetForgeEquip(session comm.IUserSession, num int32, suite
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if pos == -1 {
|
||||
|
||||
lvs = make([]*cfg.GameEquipData, 0)
|
||||
for _, v := range configures {
|
||||
if v.Color == lv {
|
||||
@ -622,9 +622,7 @@ func (this *Equipment) GetForgeEquip(session comm.IUserSession, num int32, suite
|
||||
eruips = make([]*pb.DB_Equipment, num)
|
||||
for i := 0; i < int(num); i++ {
|
||||
if pos != -1 {
|
||||
for _, v := range configures {
|
||||
if v.Pos == pos && v.Color == lv {
|
||||
if eruips[i], err = this.modelEquipment.newEquipment(session.GetUserId(), v, dyweight, isepic); err != nil {
|
||||
if eruips[i], err = this.modelEquipment.newEquipment(session.GetUserId(), configure, dyweight, isepic); err != nil {
|
||||
this.Errorf("err%v", err)
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_SystemError,
|
||||
@ -632,12 +630,11 @@ func (this *Equipment) GetForgeEquip(session comm.IUserSession, num int32, suite
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
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()
|
||||
if eruips[i], err = this.modelEquipment.newEquipment(session.GetUserId(), lvs[index], dyweight, isepic); err != nil {
|
||||
this.Errorf("err%v", err)
|
||||
errdata = &pb.ErrorData{
|
||||
|
Loading…
Reference in New Issue
Block a user