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 { type PlayerMgr interface {
GetPlayerByAccountId(string) Player GetPlayerByAccountId(string) Player
ForceCreatePlayer(string, string) Player
} }
type Mail interface { type Mail interface {

View File

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

View File

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