锦标赛优化
This commit is contained in:
parent
a8945997f7
commit
61e40b800e
@ -608,16 +608,16 @@ func (c *ChampshipMgr) inRank(m *msg.Msg) (interface{}, error) {
|
||||
inRank := false
|
||||
notify := make(map[int]int)
|
||||
for k, v := range rankList {
|
||||
notify[v.Uid] = k
|
||||
if v.Uid == data.Uid {
|
||||
if v.Score < data.Score {
|
||||
v.Score = data.Score
|
||||
v.Time = GoUtil.Now()
|
||||
inRank = true
|
||||
break
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
notify[v.Uid] = k
|
||||
}
|
||||
if !inRank {
|
||||
rankList = append(rankList, &ChampshipRank{
|
||||
@ -652,6 +652,7 @@ func (c *ChampshipMgr) inRank(m *msg.Msg) (interface{}, error) {
|
||||
End: GoUtil.Now() + onehour,
|
||||
})
|
||||
}
|
||||
c.SetRankCache(data.Uid)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user