1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-07 00:18:14 +08:00
parent 637a49e274
commit 3947fbce4b
14 changed files with 61 additions and 44 deletions

View File

@@ -5,6 +5,7 @@ import (
"blazing/cool"
"fmt"
"blazing/logic/service/fight/info"
"blazing/logic/service/space"
"context"
"time"
@@ -26,7 +27,12 @@ func (p *Player) Save() {
p.Info.TimeToday = p.Info.TimeToday + newtime - uint32(p.Logintime) //保存电池时间
p.Info.OnlineTime = p.Info.OnlineTime + (newtime-uint32(p.Logintime))/60 //每次退出时候保存已经在线的分钟数
if p.FightC != nil {
go p.FightC.Over(p, info.BattleOverReason.PlayerOffline) //玩家逃跑,但是不能锁线程
}
p.IsLogin = false
p.Service.Info.Save(*p.Info)
space.GetSpace(p.Info.MapID).LeaveMap(p)