This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user