championship cleartime 由活动配置决定

This commit is contained in:
hahwu 2026-04-13 15:53:59 +08:00
parent 1052fbc273
commit 82636c7dd6
3 changed files with 15 additions and 21 deletions

View File

@ -21,11 +21,6 @@ type ChampshipMod struct {
func (c *ChampshipMod) InitData() {}
// isActive 判断当前是否在冠军赛活跃时段(零点后 5 分钟内为结算期,不计分)
func (c *ChampshipMod) isActive() bool {
return GoUtil.Now()-GoUtil.ZeroTimestamp() >= 300
}
func (c *ChampshipMod) ZeroUpdate(aid int) {
c.PreMax = c.Reward
c.Score = 0
@ -56,9 +51,6 @@ func (c *ChampshipMod) HasRankReward() bool {
}
func (c *ChampshipMod) AddScore(chess []int) {
if !c.isActive() {
return
}
score := 0
for _, v := range chess {
Lv := mergeDataCfg.GetLvById(v)

View File

@ -313,8 +313,6 @@ func (p *Player) BackChampship() {
res := ChampshipMod.BackData(rank, preRank, todayActivityId, yesterdayActivityId)
cfg := G_GameLogicPtr.ActivityMgr.GetChampshipCfg(todayActivityId)
if GoUtil.Now()-GoUtil.ZeroTimestamp() >= int64(cfg.ClearTime) {
res.Status = 2
} else {
res.Status = 1
}
res.Cfg = cfg

View File

@ -377,6 +377,9 @@ func ReqRewardOrder(player *Player, req *msg.ReqRewardOrder) error {
// 锦标赛增加积分
if player.GetPlayerBaseMod().GetLevel() >= 17 {
todayActivityId, _ := player.GetChampshipActivityId()
cfg := G_GameLogicPtr.ActivityMgr.GetChampshipCfg(todayActivityId)
if GoUtil.Now()-GoUtil.ZeroTimestamp() >= int64(cfg.ClearTime) {
chessList := make([]int, 0)
for _, v := range mergeList {
color := mergeDataCfg.GetColorById(v)
@ -391,6 +394,7 @@ func ReqRewardOrder(player *Player, req *msg.ReqRewardOrder) error {
ChampshipMod.AddScore(chessList)
player.HandleInChampshipRank()
}
}
FriendTreasureMod := player.PlayMod.getFriendTreasureMod()
FriendTreasureMod.AddStar(star/20, player.GetOrderFactor())
player.PushClientRes(FriendTreasureMod.NotifyStar())