锦标赛优化

This commit is contained in:
hahwu 2026-03-30 22:22:32 +08:00
parent a8945997f7
commit 61e40b800e

View File

@ -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
}