| | |
| | | import PlayerGeTui
|
| | | import PlayerStore
|
| | | import GameWorldActionControl
|
| | | import GameWorldFamilyWar
|
| | | import PlayerFBHelpBattle
|
| | | import GMT_CTG
|
| | | import PyGameData
|
| | |
| | | #玩家队伍初始化
|
| | | PlayerTeam.OnPlayerLoginRefreshTeam(curPlayer, tick)
|
| | | PlayerCompensation.NotifyPlayerCompensation(curPlayer)
|
| | | __UpdOnedayJobPlayerLoginoffTime(curPlayer)
|
| | |
|
| | | if not PlayerControl.GetIsTJG(curPlayer):
|
| | | # 只有通知逻辑的应该放此处减少IO,如有逻辑处理存储等不可放在此处
|
| | |
| | | #守卫人皇
|
| | | PlayerFamilySWRH.OnLogin(curPlayer)
|
| | | PlayerTalk.LoginChatMi(curPlayer)
|
| | | PlayerTalk.NotifyTalkCache(curPlayer)
|
| | | PlayerGeTui.CleanNewGuyCallBackGeTui(curPlayer.GetID())
|
| | | #活动
|
| | | GameWorldActionControl.OnPlayerLogin(curPlayer)
|
| | |
| | | #骑宠boss状态通知
|
| | | PlayerHorsePetBoss.OnLogin(curPlayer)
|
| | | GMT_CTG.OnPlayerLogin(curPlayer)
|
| | | return
|
| | |
|
| | | def __UpdOnedayJobPlayerLoginoffTime(curPlayer):
|
| | | ## 更新一天内职业对应玩家登录、离线时间
|
| | | job = curPlayer.GetJob()
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if job not in PyGameData.g_onedayJobPlayerLoginoffTimeDict:
|
| | | PyGameData.g_onedayJobPlayerLoginoffTimeDict[job] = {}
|
| | | playerLoginoffTimeDict = PyGameData.g_onedayJobPlayerLoginoffTimeDict[job]
|
| | | playerLoginoffTimeDict[playerID] = int(time.time())
|
| | | #GameWorld.DebugLog("更新职业对应玩家登录离线时间: %s" % PyGameData.g_onedayJobPlayerLoginoffTimeDict)
|
| | | return
|
| | |
|
| | | def CheckOnedayJobPlayerLoginoffTimeout():
|
| | | ## 检查一天内职业对应玩家登录、离线时间超时玩家,每小时检查一次
|
| | | |
| | | maxTime = 24 * 3600 # 暂定24小时
|
| | | curTime = int(time.time())
|
| | | #GameWorld.DebugLog("处理24小时内在线的角色职业玩家: curTime=%s,maxTime=%s, %s" % (curTime, maxTime, PyGameData.g_onedayJobPlayerLoginoffTimeDict))
|
| | | |
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for playerDict in PyGameData.g_onedayJobPlayerLoginoffTimeDict.values():
|
| | | for playerID, loginoffTime in playerDict.items():
|
| | | if playerManager.FindPlayerByID(playerID):
|
| | | #GameWorld.DebugLog(" 在线不处理, playerID=%s" % playerID)
|
| | | continue
|
| | | if curTime - loginoffTime > maxTime:
|
| | | playerDict.pop(playerID)
|
| | | #GameWorld.DebugLog(" 超时玩家,移除! playerID=%s,loginoffTime=%s" % (playerID, loginoffTime))
|
| | | #GameWorld.DebugLog(" 处理完毕,剩余玩家! %s" % PyGameData.g_onedayJobPlayerLoginoffTimeDict)
|
| | | return
|
| | |
|
| | | ## 增加高手玩家上线广播
|
| | |
| | | PlayerFamily.PlayerLogoffRefreshFamily(curPlayer, tick)
|
| | | PlayerFriend.OnPlayerDisconnect(curPlayer, tick)
|
| | |
|
| | | __UpdOnedayJobPlayerLoginoffTime(curPlayer)
|
| | | PlayerGeTui.NewGuyCallBackGeTui(curPlayer, tick)
|
| | | # 设置家族成员离线时间
|
| | | SetPlayerOfflineTime(curPlayer)
|
| | |
| | | AuctionHouse.OnPlayerLeaveServer(curPlayer)
|
| | | #------------镖车逻辑
|
| | | #TruckPlayerDisconnectProcess(curPlayer, tick)
|
| | | |
| | | if not PlayerControl.GetIsTJG(curPlayer):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | PyGameData.g_unTJLogoffTime[playerID] = int(time.time())
|
| | | |
| | | return
|
| | |
|
| | | ## 设置玩家离线时间
|
| | |
| | | GameWorldBoss.OnPlayerChangeMap(curPlayer)
|
| | | PlayerFamily.OnPlayerChangeMap(curPlayer, tick)
|
| | | PlayerFamilyParty.OnPlayerChangeMap(curPlayer, tick)
|
| | | GameWorldFamilyWar.OnPlayerChangeMap(curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家切换真实地图
|