| | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | '''
|
| | | 登录流程
|
| | | MapServer
|
| | | ChPlayer:def PlayerLogin(index, tick)
|
| | | DoPlayerLogin
|
| | | curPlayer.Sync_ClientPlayerLogin()
|
| | | curPlayer.Sync_GameServer_MapID() #同步GameServer自己的地图ID
|
| | | curPlayer.BalanceServer_PlayerLoginInitOK()
|
| | | |
| | | GameServer
|
| | | ChPlayer:def PlayerLoadMapState(index, tick) pack.GetLoadState()=0 此时的 LoadState 为0
|
| | | curPlayer.SetIsLoadMap(True) 设置在加载地图
|
| | | |
| | | ChPlayer:def PlayerLogin(index, tick)
|
| | | curPlayer.MapServer_InitOK() 通知地图自己OK了
|
| | | |
| | | MapServer
|
| | | PlayerEventCounter:def GameServer_InitOK(index, tick)
|
| | | curPlayer.SendToBServerServerInitOK() #通知BServer自己OK了
|
| | | ChPlayer:def OnAllServerInitOK(curPlayer, tick)
|
| | |
|
| | | ChPlayer:def LoadMapOK(curPlayer, tick)
|
| | | curPlayer.GameServer_SetLoadMapState(1) #通知GameServer切换地图停止
|
| | | curPlayer.SetMapLoadOK(True)
|
| | | curPlayer.SetInitOK(True)
|
| | | curPlayer.EndLoadMap()
|
| | |
|
| | | GameServer
|
| | | ChPlayer:def PlayerLoadMapState(index, tick) pack.GetLoadState()=1 此时的 LoadState 为1
|
| | | PlayerLoginLoadMapOK
|
| | | curPlayer.SetInitOK(True)
|
| | | curPlayer.MapServer_GameServerRefreshOK() #通知地图服务器玩家初始化成功
|
| | | curPlayer.SetIsLoadMap(False)
|
| | | |
| | | MapServer
|
| | | GameServerRefresh:GameSever_PlayerInitOK curPlayer.GetGameServerInitOK()=0
|
| | | curPlayer.SetGameServerInitOK(True)
|
| | | |
| | | 后续补充流程
|
| | | MapServer
|
| | | ChPlayer:def DoPlayerRealLoginOK(curPlayer, tick)
|
| | | 玩家真正登录成功处理,用于替换 __DoPlayerLoginServer 中的功能登录逻辑
|
| | | 通知GameServer地图最终登录成功了
|
| | | |
| | | GameServer
|
| | | ChPlayer:def DoPlayerRealLoginOK(curPlayer, tick)
|
| | | 玩家真正登录成功处理,用于替换 __DoPlayerLoginServer 中的功能登录逻辑
|
| | | '''
|
| | |
|
| | | ##玩家登陆游戏逻辑处理
|
| | | #@param curPlayer 玩家实例
|
| | | #@param tick 时间戳
|
| | |
| | | def DoPlayerLogin(curPlayer, tick):
|
| | | #这里只做初始化逻辑
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_LoadMapIsLogin, 1)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_RealLoginOK, 0) # 每次登录重置
|
| | | |
| | | #通知时间
|
| | | Sync_PyServerDataTimeToClient(curPlayer)
|
| | | Sync_OpenServerDay(curPlayer)
|
| | |
| | | curPlayer.SetForbiddenSyncClientState(False)
|
| | | PlayerControl.SetCrossMapID(curPlayer, curPlayer.GetMapID()) # 因为主服上传数据之前该值为0,所以登录跨服后在跨服服务器要设置为对应地图
|
| | |
|
| | | #通知运行成功
|
| | | curPlayer.BalanceServer_PlayerLoginInitOK()
|
| | | return
|
| | |
|
| | | def __DoPlayerLoginServer(curPlayer, tick):
|
| | |
| | | PlayerFamily.FamilyPlayerOnLoginCross(curPlayer)
|
| | |
|
| | | PlayerTeam.OnPlayerLoginCrossServer(curPlayer)
|
| | | |
| | | #通知运行成功
|
| | | curPlayer.BalanceServer_PlayerLoginInitOK()
|
| | | return
|
| | |
|
| | | leaveServerSecond = PlayerControl.GetPlayerLeaveServerSecond(curPlayer)
|
| | |
| | |
|
| | | #角色改名次数
|
| | | UpdatePlayerName.Sync_UpdatePlayerNameCount(curPlayer)
|
| | |
|
| | | #通知运行成功
|
| | | curPlayer.BalanceServer_PlayerLoginInitOK()
|
| | |
|
| | | # 坐骑相关通知
|
| | | PlayerHorse.PlayerHorseLogin(curPlayer)
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def DoPlayerRealLoginOK(curPlayer, tick):
|
| | | ''' 玩家最终登录成功处理, 由 GameServerRefresh GameSever_PlayerInitOK 调用
|
| | | 该函数为地图最终登录成功才会执行到,以后一些功能类的登录处理建议均写到这里
|
| | | 旧的功能先不动( __DoPlayerLoginServer 函数中的功能),如果有登录相关的bug再考虑是否移动到此函数
|
| | | '''
|
| | | |
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RealLoginOK):
|
| | | #切地图的不处理,切地图的也会触发该函数
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_RealLoginOK, 1)
|
| | | GameWorld.Log("MapServer->DoPlayerRealLoginOK", curPlayer.GetPlayerID())
|
| | | |
| | | # 通知GameServer地图最终登录成功了
|
| | | msg = ""
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, "PlayerRealLoginOK", msg, len(msg))
|
| | | return
|
| | |
|
| | | ## 玩家扩展信息同步
|
| | | # @param curPlayer
|