Compare commits
No commits in common. "dfe093b03e1172a90b0cc6e926597d990f4efd22" and "f98949201942fa15e53a71adcc08914837f55358" have entirely different histories.
dfe093b03e
...
f989492019
|
@ -216,7 +216,7 @@ func (this *Player) IsAuto() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) IsGameing() bool {
|
func (this *Player) IsGameing() bool {
|
||||||
return !this.IsMarkFlag(PlayerState_WaitNext) && !this.IsMarkFlag(PlayerState_GameBreak) && !this.IsMarkFlag(PlayerState_Audience)
|
return !this.IsMarkFlag(PlayerState_WaitNext) && !this.IsMarkFlag(PlayerState_GameBreak) && !this.IsMarkFlag(PlayerState_Bankruptcy) && !this.IsMarkFlag(PlayerState_Audience)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) IsAllFollow() bool {
|
func (this *Player) IsAllFollow() bool {
|
||||||
|
|
|
@ -2,17 +2,15 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"mongo.games.com/goserver/core/basic"
|
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
"mongo.games.com/goserver/core/module"
|
"time"
|
||||||
"mongo.games.com/goserver/core/netlib"
|
|
||||||
"mongo.games.com/goserver/core/task"
|
|
||||||
|
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/worldsrv/internal"
|
"mongo.games.com/goserver/core/basic"
|
||||||
|
"mongo.games.com/goserver/core/module"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
"mongo.games.com/goserver/core/task"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -238,7 +236,6 @@ func (this *LoginStateMgr) LogoutAllBySession(session *netlib.Session) {
|
||||||
p := PlayerMgrSington.GetOnlinePlayer(sid)
|
p := PlayerMgrSington.GetOnlinePlayer(sid)
|
||||||
if p != nil {
|
if p != nil {
|
||||||
p.DropLine()
|
p.DropLine()
|
||||||
internal.FirePlayerDropLine[*Player, *Scene](p)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@ type Player struct {
|
||||||
changeIconTime time.Time //上次修改头像时间
|
changeIconTime time.Time //上次修改头像时间
|
||||||
enterts time.Time //进入时间
|
enterts time.Time //进入时间
|
||||||
lastChangeScene time.Time //上次换桌时间
|
lastChangeScene time.Time //上次换桌时间
|
||||||
dropTime time.Time // 掉线时间
|
|
||||||
isAudience bool //是否是观众
|
isAudience bool //是否是观众
|
||||||
customerToken string //客服会话token
|
customerToken string //客服会话token
|
||||||
isDelete bool //是否已删档用户
|
isDelete bool //是否已删档用户
|
||||||
|
@ -1156,7 +1155,6 @@ func (this *Player) Kick(reason int32) {
|
||||||
|
|
||||||
LoginStateMgrSington.LogoutBySid(this.sid)
|
LoginStateMgrSington.LogoutBySid(this.sid)
|
||||||
this.DropLine()
|
this.DropLine()
|
||||||
internal.FirePlayerDropLine[*Player, *Scene](this)
|
|
||||||
}
|
}
|
||||||
TournamentMgr.ForceQuit(this.Platform, this.SnId)
|
TournamentMgr.ForceQuit(this.Platform, this.SnId)
|
||||||
}
|
}
|
||||||
|
@ -1634,19 +1632,10 @@ func (this *Player) OnSecTimer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) OnMiniTimer() {
|
func (this *Player) OnMiniTimer() {
|
||||||
if this.IsOnLine() {
|
TaskSubjectSingleton.Touch(common.TaskTypeOnlineTs, &TaskData{
|
||||||
TaskSubjectSingleton.Touch(common.TaskTypeOnlineTs, &TaskData{
|
SnId: this.SnId,
|
||||||
SnId: this.SnId,
|
Num: 60,
|
||||||
Num: 60,
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
// 长时间掉线又没有删除缓存
|
|
||||||
if !this.dropTime.IsZero() && time.Now().Sub(this.dropTime).Minutes() > 20 {
|
|
||||||
logger.Logger.Errorf("清除缓存异常玩家 snid:%v dirty:%v lastLogoutTime:%v lastGameId:%v", this.SnId, this.dirty, this.LastLogoutTime, this.LastGameId)
|
|
||||||
if this.scene != nil {
|
|
||||||
logger.Logger.Errorf("清除缓存异常玩家 sceneId:%v", this.scene.sceneId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) OnHourTimer() {
|
func (this *Player) OnHourTimer() {
|
||||||
|
@ -3895,12 +3884,10 @@ func (this *Player) SCDataConfig(tp int) {
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
internal.RegisterPlayerListenerFunc(&internal.PlayerListenerFunc[*Player, *Scene]{
|
internal.RegisterPlayerListenerFunc(&internal.PlayerListenerFunc[*Player, *Scene]{
|
||||||
ClockFunc: common.ClockFunc{},
|
ClockFunc: common.ClockFunc{},
|
||||||
OnPlayerLoginedFunc: nil,
|
OnPlayerLoginedFunc: nil,
|
||||||
OnPlayerLogoutedFunc: nil,
|
OnPlayerLogoutedFunc: nil,
|
||||||
OnPlayerDropLineFunc: func(p *Player) {
|
OnPlayerDropLineFunc: nil,
|
||||||
p.dropTime = time.Now()
|
|
||||||
},
|
|
||||||
OnPlayerReholdFunc: nil,
|
OnPlayerReholdFunc: nil,
|
||||||
OnPlayerEnterSceneBeforeFunc: nil,
|
OnPlayerEnterSceneBeforeFunc: nil,
|
||||||
OnPlayerEnterSceneAfterFunc: nil,
|
OnPlayerEnterSceneAfterFunc: nil,
|
||||||
|
|
|
@ -21,7 +21,6 @@ import (
|
||||||
serverproto "mongo.games.com/game/protocol/server"
|
serverproto "mongo.games.com/game/protocol/server"
|
||||||
webapiproto "mongo.games.com/game/protocol/webapi"
|
webapiproto "mongo.games.com/game/protocol/webapi"
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
"mongo.games.com/game/worldsrv/internal"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlayerGameCtx struct {
|
type PlayerGameCtx struct {
|
||||||
|
@ -194,9 +193,6 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal.FirePlayerEnterSceneBefore(p, this)
|
|
||||||
defer internal.FirePlayerEnterSceneAfter(p, this)
|
|
||||||
|
|
||||||
// 非百人,设置座位
|
// 非百人,设置座位
|
||||||
if !this.IsHundredScene() {
|
if !this.IsHundredScene() {
|
||||||
if pos != -1 {
|
if pos != -1 {
|
||||||
|
@ -519,9 +515,6 @@ func (this *Scene) lastScene(p *Player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Scene) DelPlayer(p *Player) bool {
|
func (this *Scene) DelPlayer(p *Player) bool {
|
||||||
internal.FirePlayerLeaveSceneBefore(p, this)
|
|
||||||
defer internal.FirePlayerLeaveSceneAfter(p, this)
|
|
||||||
|
|
||||||
if p.scene != this {
|
if p.scene != this {
|
||||||
roomId := 0
|
roomId := 0
|
||||||
if p.scene != nil {
|
if p.scene != nil {
|
||||||
|
|
Loading…
Reference in New Issue