mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:52:27 +08:00
修复重连导致的新用户注册失败
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/gate/entity/gm"
|
||||
"hk4e/gate/kcp"
|
||||
"hk4e/gs/dao"
|
||||
@@ -8,8 +9,6 @@ import (
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameManager struct {
|
||||
@@ -74,11 +73,6 @@ func (g *GameManager) Stop() {
|
||||
// 保存玩家数据
|
||||
g.userManager.SaveUser()
|
||||
|
||||
// 踢出所有在线玩家
|
||||
for userId := range g.userManager.GetAllOnlineUserList() {
|
||||
g.DisconnectPlayer(userId)
|
||||
}
|
||||
|
||||
//g.worldManager.worldStatic.SaveTerrain()
|
||||
}
|
||||
|
||||
@@ -110,6 +104,7 @@ func (g *GameManager) DisconnectPlayer(userId uint32) {
|
||||
g.SendMsg(cmd.ServerDisconnectClientNotify, userId, 0, new(proto.ServerDisconnectClientNotify))
|
||||
}
|
||||
|
||||
// 踢出玩家
|
||||
func (g *GameManager) KickPlayer(userId uint32) {
|
||||
info := new(gm.KickPlayerInfo)
|
||||
info.UserId = userId
|
||||
|
||||
@@ -38,7 +38,6 @@ func (r *RouteManager) doRoute(cmdId uint16, userId uint32, clientSeq uint32, pa
|
||||
player := r.gameManager.userManager.GetOnlineUser(userId)
|
||||
if player == nil {
|
||||
logger.LOG.Error("player is nil, uid: %v", userId)
|
||||
r.gameManager.ReconnectPlayer(userId)
|
||||
return
|
||||
}
|
||||
player.ClientSeq = clientSeq
|
||||
|
||||
Reference in New Issue
Block a user