Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
b6e489501f
@ -20,6 +20,7 @@ func (this *apiComp) GymRefresh(session comm.IUserSession, req *pb.PracticeGymRe
|
||||
err error
|
||||
room *pb.DBPracticeRoom
|
||||
confs []*cfg.GamePandamasMrylData
|
||||
temp []*cfg.GamePandamasMrylData
|
||||
refreshAtns []*cfg.Gameatn
|
||||
atn *cfg.Gameatn
|
||||
)
|
||||
@ -46,11 +47,11 @@ func (this *apiComp) GymRefresh(session comm.IUserSession, req *pb.PracticeGymRe
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
temp = make([]*cfg.GamePandamasMrylData, 0)
|
||||
//过滤掉当前的buff
|
||||
for i, v := range confs {
|
||||
if v.Id == room.Gymaction {
|
||||
confs = append(confs[0:i], confs[i+1:]...)
|
||||
break
|
||||
for _, v := range confs {
|
||||
if v.Id != room.Gymaction {
|
||||
temp = append(temp, v)
|
||||
}
|
||||
}
|
||||
if len(confs) == 0 {
|
||||
@ -58,7 +59,7 @@ func (this *apiComp) GymRefresh(session comm.IUserSession, req *pb.PracticeGymRe
|
||||
return
|
||||
}
|
||||
r := rand.New(rand.NewSource(configure.Now().Unix()))
|
||||
room.Gymaction = confs[r.Perm(len(confs))[0]].Id
|
||||
room.Gymaction = temp[r.Perm(len(temp))[0]].Id
|
||||
room.Gymrefresh++
|
||||
room.Lastrefresh = configure.Now().Unix()
|
||||
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
||||
|
Loading…
Reference in New Issue
Block a user