This commit is contained in:
aozhiwei 2024-03-21 11:44:37 +08:00
parent 19df707e84
commit fc0b397007

View File

@ -233,26 +233,27 @@ func (this *playerMgr) GetPlayerByAccountId(accountId string) common.Player {
}
}
func (this *playerMgr) GetPlayerBySocket(socket f5.WspCliConn) common.Player {
hum := this.internalGetPlayerBySocket(socket)
if hum != nil {
return hum
} else {
return nil
}
}
func (this *playerMgr) internalGetPlayerByAccountId(accountId string) *player {
player, ok := this.accountIdHash[accountId]
hum, ok := this.accountIdHash[accountId]
if ok {
return player
return hum
}
return nil
}
func (this *playerMgr) internalGetPlayerBySocket(socket f5.WspCliConn) *player {
player, ok := this.socketHash[socket]
hum, ok := this.socketHash[socket]
if ok {
return player
}
return nil
}
func (this *playerMgr) getPlayerBySocket(socket f5.WspCliConn) *player {
player, ok := this.socketHash[socket]
if ok {
return player
return hum
}
return nil
}