This commit is contained in:
aozhiwei 2024-04-27 08:59:35 +08:00
parent a6200b2778
commit 4d844dbea0
3 changed files with 7 additions and 2 deletions

View File

@ -39,6 +39,7 @@ type Player interface {
type PlayerMgr interface {
GetPlayerByAccountId(string) Player
ForceCreatePlayer(string, string) Player
}
type Mail interface {

View File

@ -7,10 +7,10 @@ import (
func CaAuth(c *gin.Context) {
accountId := c.DefaultQuery("account_id", "")
//_ := c.DefaultQuery("session_id", "")
sessionId := c.DefaultQuery("session_id", "")
hum := GetPlayerMgr().GetPlayerByAccountId(accountId)
if hum == nil {
hum = GetPlayerMgr().ForceCreatePlayer(accountId, sessionId)
}
hum.Lock()
c.Next()

View File

@ -18,3 +18,7 @@ func (this *playerMgr) UnInit() {
func (this *playerMgr) GetPlayerByAccountId() common.Player {
return nil
}
func (this *playerMgr) ForceCreatePlayer(string, string) common.Player {
return nil
}