From cc8d57d50173ba6fcbaeb65af0ad53c690f2f070 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 14 九月 2020 11:36:48 +0800
Subject: [PATCH] 1111 简繁体转换工具

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py |  171 +++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 129 insertions(+), 42 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
index 3e50463..89e82d4 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -27,31 +27,24 @@
 import GMCommon
 import ShareDefine
 #import PlayerFamilyTech
-import PlayerDataCollect
 import time
 import ChPyNetSendPack
 import NetPackCommon
 import GameDataRecord
-import GameConfig
-import ReadChConfig
 import UpdatePlayerName
 import GameWorldBoss
 import PlayerFamilyBoss
-#import PlayerManorWar
 import PlayerBourse
-import GameWorldActionTeHui
+import PlayerZhuXianBoss
 import PlayerXMZZ
-import GameWorldShopItem
 import PlayerTruck
-import HighLadder
-import EventReport
+import PlayerHorsePetBoss
 import PlayerCompensation
 import PlayerFamilyRedPacket
-import PlayerFamilyStore
-import PyDataManager
+#import PlayerFamilyStore
 import PlayerSocial
 import PlayerFamilyParty
-import PlayerSealDemon
+#import PlayerSealDemon
 import PlayerBillboard
 import PlayerLVAward
 import PlayerDuJie
@@ -61,15 +54,29 @@
 import PlayerGeTui
 import PlayerStore
 import GameWorldActionControl
+import GameWorldFamilyWar
 import PlayerFBHelpBattle
+import GameWorldSkyTower
 import GMT_CTG
 import PyGameData
 import GMShell
 import IPY_PlayerDefine
 import CrossRealmPK
+import AuctionHouse
+import PlayerAssist
+import PlayerFB
 #---------------------------------------------------------------------
 
 #---------------------------------------------------------------------
+
+def DoRefreshMainServerRole(curPlayer):
+    ## 刷新本服角色信息
+    
+    curTeam = curPlayer.GetTeam()
+    if curTeam:
+        PlayerTeam.Sync_TeamMemberInfo(curTeam)
+    return
+
 ## 玩家登录初始化(封包参数)
 #  @param index 玩家索引
 #  @param tick 当前时间
@@ -123,6 +130,7 @@
     #玩家队伍初始化
     PlayerTeam.OnPlayerLoginRefreshTeam(curPlayer, tick)
     PlayerCompensation.NotifyPlayerCompensation(curPlayer)
+    __UpdOnedayJobPlayerLoginoffTime(curPlayer)
     
     if not PlayerControl.GetIsTJG(curPlayer):
         # 只有通知逻辑的应该放此处减少IO,如有逻辑处理存储等不可放在此处
@@ -140,18 +148,20 @@
         PlayerTruck.SyncPlayerTruckStartTime(curPlayer)
         #通知玩家交易所挂单情况
         PlayerBourse.OnPlayerLogin(curPlayer)
-
+        #拍卖行
+        AuctionHouse.OnPlayerLogin(curPlayer)
+        
         #上线广播
         __CheckWorldNotifyOnLogin(curPlayer, tick)
         
         #仙盟红包
         PlayerFamilyRedPacket.OnPlayerLogin(curPlayer)
         #仙盟仓库
-        PlayerFamilyStore.OnPlayerLogin(curPlayer)
+        #PlayerFamilyStore.OnPlayerLogin(curPlayer)
         #仙盟宴会
         PlayerFamilyParty.OnPlayerLogin(curPlayer)
         #封魔坛
-        PlayerSealDemon.OnPlayerLogin(curPlayer)
+        #PlayerSealDemon.OnPlayerLogin(curPlayer)
         #仙魔之争
         PlayerXMZZ.OnXMZZOnLogin(curPlayer)
         #等级奖励
@@ -167,18 +177,58 @@
         #守卫人皇
         PlayerFamilySWRH.OnLogin(curPlayer)
         PlayerTalk.LoginChatMi(curPlayer)
-        PlayerGeTui.CleanNewGuyCallBackGeTui(curPlayer.GetID())
+        PlayerTalk.NotifyTalkCache(curPlayer)
+        #PlayerGeTui.CleanNewGuyCallBackGeTui(curPlayer.GetID())
         #活动
         GameWorldActionControl.OnPlayerLogin(curPlayer)
         #玩家等级记录
         PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()
-        #副本助战
-        PlayerFBHelpBattle.OnHelpPlayerLogin(curPlayer)
         #跨服PK
         CrossRealmPK.OnPlayerLogin(curPlayer)
-        
-        GMShell.OnPlayerLogin(curPlayer)
+        #诛仙BOSS
+        PlayerZhuXianBoss.OnPlayerLogin(curPlayer)
+        #骑宠boss状态通知
+        PlayerHorsePetBoss.OnLogin(curPlayer)
+        #协助
+        PlayerAssist.OnPlayerLogin(curPlayer, False)
+        #天星塔
+        GameWorldSkyTower.OnPlayerLogin(curPlayer)
         GMT_CTG.OnPlayerLogin(curPlayer)
+        
+    else:
+        #协助
+        PlayerAssist.OnPlayerLogin(curPlayer, True)
+        
+    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
 
 ## 增加高手玩家上线广播
@@ -209,9 +259,6 @@
             if checkMark not in ShareDefine.BillboardTypeList:
                 continue
             
-            if checkMark in [ShareDefine.Def_BT_HighLadder]:
-                continue
-            
             billboard = GameWorld.GetBillboard().FindBillboard(checkMark)
             if not billboard:
                 continue
@@ -230,11 +277,7 @@
                 objBillboard = billboard.At(index)
                 if curPlayer.GetID() == objBillboard.GetID():
                     msgMark = notifyDict[order]
-                    break
-#        # 竞技场
-#        elif checkMark == "HighLadder":
-#            highLadderOrder = HighLadder.GetPlayerOrder(curPlayer.GetID()) + 1
-#            msgMark = notifyDict.get(highLadderOrder, "")             
+                    break           
         
         # 有可以广播的,马上广播,退出,不再检查
         if msgMark:
@@ -490,6 +533,9 @@
 #  @remarks 函数详细说明.
 def __Func_PlayerDisconnect(curPlayer, tick):
     
+    if GameWorld.IsCrossServer():
+        PlayerFB.OnPlayerDisconnectCrossServer(curPlayer)
+        
     #跨服匹配PK
     CrossRealmPK.OnLeaveServer(curPlayer)
     
@@ -499,12 +545,21 @@
     PlayerFamily.PlayerLogoffRefreshFamily(curPlayer, tick)
     PlayerFriend.OnPlayerDisconnect(curPlayer, tick)
     
-    PlayerGeTui.NewGuyCallBackGeTui(curPlayer, tick)
+    __UpdOnedayJobPlayerLoginoffTime(curPlayer)
+    #PlayerGeTui.NewGuyCallBackGeTui(curPlayer, tick)
     # 设置家族成员离线时间
     SetPlayerOfflineTime(curPlayer)
-    
+    #拍卖行
+    AuctionHouse.OnPlayerLeaveServer(curPlayer)
+    #协助
+    PlayerAssist.OnLeaveServer(curPlayer)
     #------------镖车逻辑
     #TruckPlayerDisconnectProcess(curPlayer, tick)
+    
+    if not PlayerControl.GetIsTJG(curPlayer):
+        playerID = curPlayer.GetPlayerID()
+        PyGameData.g_unTJLogoffTime[playerID] = int(time.time())
+        
     return
 
 ## 设置玩家离线时间
@@ -574,6 +629,10 @@
         PlayerControl.SetGMForbidenTalk(curPlayer, packValue)
         return
     
+    if packType == ShareDefine.CDBPlayerRefresh_ExAttr17:
+        PlayerControl.SetPlayerAccState(curPlayer, packValue)
+        return
+
     if packType == IPY_GameServer.CDBPlayerRefresh_State:
         # 脱机在线
         PlayerControl.SetIsTJG(curPlayer, packValue)
@@ -597,6 +656,14 @@
         PlayerTeam.SetTeamCheckState(curPlayer, packValue)
         return
     
+    #if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr1:
+    #    PlayerControl.SetAssistTagPlayerID(curPlayer, packValue)
+    #    return
+    
+    if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr3:
+        PlayerControl.SetFBFuncLineID(curPlayer, packValue)
+        return
+    
     #---常规逻辑处理---
         
     elif packType == IPY_GameServer.CDBPlayerRefresh_LV:
@@ -609,8 +676,6 @@
 
     elif packType == IPY_GameServer.CDBPlayerRefresh_Job:
         curPlayer.SetJob(packValue)
-    elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr1:
-        PlayerControl.SetJobRank(curPlayer, packValue)
         
 #    elif packType == IPY_GameServer.CDBPlayerRefresh_CurrentPlayerType:
 #        #这里应该通知组队那边刷新
@@ -632,15 +697,19 @@
     elif packType == IPY_GameServer.CDBPlayerRefresh_VIPLv:
         curPlayer.SetVIPLv(packValue);
 #        __RefreshTeamState(curPlayer)
+    
+    elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr5:
+        PlayerControl.SetCrossMapID(curPlayer, packValue, False)
+        
     elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr9:
         PlayerControl.SetVIPExpireTime(curPlayer, packValue)
         
     elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr10:
         PlayerControl.SetChatBubbleBox(curPlayer, packValue)
         
-    elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr11:
-        PlayerControl.SetTodayXianyuanCoin(curPlayer, packValue)
-
+    elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr13:
+        PlayerControl.SetPlayerServerGroupID(curPlayer, packValue)
+        
     elif packType == IPY_GameServer.CDBPlayerRefresh_OperateInfo:
         curPlayer.SetOperateInfo(packValue);
     
@@ -674,6 +743,7 @@
     GameWorldBoss.OnPlayerChangeMap(curPlayer)
     PlayerFamily.OnPlayerChangeMap(curPlayer, tick)
     PlayerFamilyParty.OnPlayerChangeMap(curPlayer, tick)
+    GameWorldFamilyWar.OnPlayerChangeMap(curPlayer)
     return 
 
 ## 玩家切换真实地图
@@ -751,6 +821,9 @@
     #改到mapServer登录成功通知
     #Sync_PyServerDataTimeToClient(curPlayer, tick)
     
+    if GameWorld.IsCrossServer():
+        PlayerFB.PlayerLoginLoadCrossMapOK(curPlayer)
+        
     PlayerTeam.OnPlayerReadMapOK(curPlayer, tick)
     
     #刷新人物日期状态
@@ -764,7 +837,7 @@
 #===============================================================================
     #自己已经初始化成功
     curPlayer.SetInitOK(True)
-    
+    GMShell.OnPlayerLogin(curPlayer)
     #发送请求至目标地图(任务需要登陆家族长触发事件)
     __RefreshFamilyToMapServer(curPlayer)
     return
@@ -864,17 +937,29 @@
 #{
 #    tagHead        Head;
 #    DWORD        MapID;
-#    BYTE        FBLineID;
-#    BYTE        IsAllLine;
+#    BYTE        LineCount;
+#    BYTE        LineIDList[LineCount];    //个数为0时代表查全部
 #};
 def ClinetQueryFBLinePlayerCnt(index, clientData, tick):
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
     queryMapID = clientData.MapID
-    fbLineID = clientData.FBLineID
-    isAllLine = clientData.IsAllLine
+    queryFBLineIDList = clientData.LineIDList
     playerManager = GameWorld.GetPlayerManager()
     
-    sendCMD = str([queryMapID, fbLineID, isAllLine])
+    if queryMapID in ChConfig.Def_CrossMapIDList:
+        fbLinePlayerInfoDict = PyGameData.g_crossFBFuncLinePlayerCountInfo.get(queryMapID, {})
+        if not queryFBLineIDList:
+            resultInfo = [queryMapID, fbLinePlayerInfoDict]
+        else:
+            defaultInfo = [0] # 与本服结构相同,默认0人
+            queryFBLineInfo = {}
+            for lineID in queryFBLineIDList:
+                queryFBLineInfo[lineID] = fbLinePlayerInfoDict.get(lineID, defaultInfo)
+            resultInfo = [queryMapID, queryFBLineInfo]
+        QueryFBLinePlayerCntResult(curPlayer, resultInfo)
+        return
+    
+    sendCMD = str([queryMapID, queryFBLineIDList])
     playerManager.MapServer_QueryPlayer(curPlayer.GetPlayerID(), 0, 0, queryMapID,
                 'FBLinePlayerCnt', sendCMD, len(sendCMD), curPlayer.GetRouteServerIndex())
     return
@@ -890,11 +975,13 @@
     fblinePack = ChPyNetSendPack.tagGCFBLinePlayerCnt()
     fblinePack.MapID = tagMapID
     fblinePack.FBLineInfoList = []
-    for lineID, playerCnt in fbLinePlayerCntDict.items():
+    for lineID, infoList in fbLinePlayerCntDict.items():
         mapLineState = ChPyNetSendPack.tagGCFBLineInfo()
         mapLineState.Clear()
         mapLineState.FBLineID = lineID
-        mapLineState.PlayerCnt = playerCnt
+        mapLineState.PlayerCnt = infoList[0] if infoList else 0
+        mapLineState.ExtraStr = infoList[1] if len(infoList) > 1 else ''
+        mapLineState.ExtraStrLen = len(mapLineState.ExtraStr)
         fblinePack.FBLineInfoList.append(mapLineState)
     
     fblinePack.Count = len(fblinePack.FBLineInfoList)

--
Gitblit v1.8.0