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
|
err error
|
||||||
room *pb.DBPracticeRoom
|
room *pb.DBPracticeRoom
|
||||||
confs []*cfg.GamePandamasMrylData
|
confs []*cfg.GamePandamasMrylData
|
||||||
|
temp []*cfg.GamePandamasMrylData
|
||||||
refreshAtns []*cfg.Gameatn
|
refreshAtns []*cfg.Gameatn
|
||||||
atn *cfg.Gameatn
|
atn *cfg.Gameatn
|
||||||
)
|
)
|
||||||
@ -46,11 +47,11 @@ func (this *apiComp) GymRefresh(session comm.IUserSession, req *pb.PracticeGymRe
|
|||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
temp = make([]*cfg.GamePandamasMrylData, 0)
|
||||||
//过滤掉当前的buff
|
//过滤掉当前的buff
|
||||||
for i, v := range confs {
|
for _, v := range confs {
|
||||||
if v.Id == room.Gymaction {
|
if v.Id != room.Gymaction {
|
||||||
confs = append(confs[0:i], confs[i+1:]...)
|
temp = append(temp, v)
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(confs) == 0 {
|
if len(confs) == 0 {
|
||||||
@ -58,7 +59,7 @@ func (this *apiComp) GymRefresh(session comm.IUserSession, req *pb.PracticeGymRe
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
r := rand.New(rand.NewSource(configure.Now().Unix()))
|
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.Gymrefresh++
|
||||||
room.Lastrefresh = configure.Now().Unix()
|
room.Lastrefresh = configure.Now().Unix()
|
||||||
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
||||||
|
Loading…
Reference in New Issue
Block a user