修复锦标赛bug

This commit is contained in:
hahwu 2025-01-06 17:56:47 +08:00
parent b328f9b6ea
commit bb4f3716ce
3 changed files with 14 additions and 9 deletions

View File

@ -1,6 +1,7 @@
package game
import (
"math"
"server/GoUtil"
champshipCfg "server/conf/champship"
randnameCfg "server/conf/randname"
@ -143,21 +144,21 @@ func (c *ChampshipMgr) ai(m *msg.Msg) (interface{}, error) {
Notify := make(map[int]int)
for e, r := range v {
if r.Type == RANK_PLAYER_ROBOT {
AddScore := 0
AddScore := 0.0
Robot := ChampshipData.Robot[r.Uid]
if Robot == nil {
continue
}
if Robot.Type == 2 && Robot.Time+60 < Now {
AddScore = int(Robot.PerScore)
AddScore = Robot.PerScore
Robot.Time = Now
}
if Robot.Type == 3 && Robot.Time+1800 < Now {
AddScore = int(Robot.PerScore)
AddScore = Robot.PerScore
Robot.Time = Now
}
r.Score += float64(AddScore)
r.Score += AddScore
} else {
Notify[r.Uid] = e
}
@ -692,12 +693,12 @@ func CreateRobot(M float64, GroupId int) *ChampshipRobot {
Score := M / 10
PerScore := 0.0
if Type == 2 {
PerScore = (M / 10 * 0.34) / float64(GoUtil.NextZeroTimestampDuration()) / 60
PerScore = math.Round((M/10*0.34)/(float64(GoUtil.NextZeroTimestampDuration())/60)*100) / 100
Score = M / 10 * 0.66
}
if Type == 3 {
PerScore = (M / 10 * 0.34) / float64(GoUtil.NextZeroTimestampDuration()) / 1800
Score = 0
PerScore = math.Round((M/10*0.34)/(float64(GoUtil.NextZeroTimestampDuration())/1800)*100) / 100
Score = 2
}
return &ChampshipRobot{

View File

@ -103,6 +103,7 @@ func (gl *GameLogic) ZeroFlush() {
var a1 = []interface{}{gl.DailyTaskTimestamp}
GoUtil.CallEvent(MergeConst.Notify_Daily_Renew, a1)
gl.RankMgrSend(MsgMod.MSG_ZERO_UPDATE) // 零点更新排行榜
gl.ChampshipMgrSend(MsgMod.MSG_ZERO_UPDATE) // 零点更新锦标赛
gl.VarMgrSend(MsgMod.MSG_ZERO_UPDATE) // 零点更新变量
gl.NotifyAll(MsgMod.MSG_ZERO_UPDATE)
gl.CreateDailyLogFile()

View File

@ -691,6 +691,9 @@ func (p *Player) GetSimpleData(Uid int, simple *PlayerSimpleData) error {
p.M_DwUin = int64(Uid)
p.InitPlayerOnly()
Base := p.GetPlayerBaseMod()
if Base == nil {
return errors.New("GetSimpleData failed")
}
simple.Name = p.GetPlayerBaseMod().GetName()
simple.Avatar = p.PlayMod.getAvatarMod().SetId
simple.Face = p.PlayMod.getFaceMod().SetId