mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-23 14:32:27 +08:00
修复一些小问题
This commit is contained in:
@@ -34,6 +34,9 @@ func (r *RouteManager) doRoute(cmdId uint16, userId uint32, clientSeq uint32, pa
|
||||
}
|
||||
player := r.gameManager.userManager.GetOnlineUser(userId)
|
||||
if player == nil {
|
||||
// 当gs重启后玩家并未退出gate 会持续触发nil
|
||||
r.gameManager.ReconnectPlayer(userId)
|
||||
|
||||
logger.LOG.Error("player is nil, uid: %v", userId)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -363,7 +363,10 @@ func (g *GameManager) CreatePlayer(userId uint32, nickName string, mainCharAvata
|
||||
// 添加选定的主角
|
||||
player.AddAvatar(mainCharAvatarId)
|
||||
// 添加初始武器
|
||||
avatarDataConfig := gdc.CONF.AvatarDataMap[int32(mainCharAvatarId)]
|
||||
avatarDataConfig, ok := gdc.CONF.AvatarDataMap[int32(mainCharAvatarId)]
|
||||
if !ok {
|
||||
logger.LOG.Error("avatarDataConfig error, mainCharAvatarId: %v", mainCharAvatarId)
|
||||
}
|
||||
weaponId := uint64(g.snowflake.GenId())
|
||||
player.AddWeapon(uint32(avatarDataConfig.InitialWeapon), weaponId)
|
||||
// 角色装上初始武器
|
||||
|
||||
@@ -89,7 +89,7 @@ func (g *GameManager) MarkMapReq(player *model.Player, payloadMsg pb.Message) {
|
||||
posYInt, err := strconv.ParseInt(req.Mark.Name, 10, 64)
|
||||
if err != nil {
|
||||
logger.LOG.Error("parse pos y error: %v", err)
|
||||
posYInt = 0
|
||||
posYInt = 300
|
||||
}
|
||||
|
||||
// 传送玩家
|
||||
|
||||
Reference in New Issue
Block a user