fix: 修复登录空指针及战斗效果
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -41,7 +41,14 @@ func (h Controller) Login(data *user.MAIN_LOGIN_IN, c gnet.Conn) (result *user.L
|
||||
}
|
||||
}
|
||||
|
||||
currentPlayer := c.Context().(*player.ClientData).GetPlayer(data.Head.UserID)
|
||||
data1, ok := c.Context().(*player.ClientData)
|
||||
if !ok {
|
||||
cool.Logger.Error(context.Background(), "已空指针", data.Head.UserID)
|
||||
|
||||
defer c.Close()
|
||||
return
|
||||
}
|
||||
currentPlayer := data1.GetPlayer(data.Head.UserID)
|
||||
|
||||
if currentPlayer == nil {
|
||||
cool.Logger.Error(context.Background(), "获取玩家失败", data.Head.UserID)
|
||||
|
||||
Reference in New Issue
Block a user