From b69fe56d5ebb784c4430cb5e86f460efafa1b30a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 28 三月 2019 16:57:29 +0800
Subject: [PATCH] 6373 【后端】【2.0】删除无用功能代码、封包、配置(生产系统)
---
ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py | 125 +++++++++++++++++------------------------
1 files changed, 52 insertions(+), 73 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
index 18b0890..9ab6681 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -27,32 +27,21 @@
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 GameWorldMergePK
-import GameWorldShopItem
-import MergeChildMsg
import PlayerTruck
-import PlayerMergeEvent
-import HighLadder
-import EventReport
-import MergePlayer
+import PlayerHorsePetBoss
import PlayerCompensation
import PlayerFamilyRedPacket
-import PlayerFamilyStore
-import PyDataManager
+#import PlayerFamilyStore
import PlayerSocial
import PlayerFamilyParty
import PlayerSealDemon
@@ -70,9 +59,20 @@
import PyGameData
import GMShell
import IPY_PlayerDefine
+import CrossRealmPK
+import AuctionHouse
#---------------------------------------------------------------------
#---------------------------------------------------------------------
+
+def DoRefreshMainServerRole(curPlayer):
+ ## 刷新本服角色信息
+
+ curTeam = curPlayer.GetTeam()
+ if curTeam:
+ PlayerTeam.Sync_TeamMemberInfo(curTeam)
+ return
+
## 玩家登录初始化(封包参数)
# @param index 玩家索引
# @param tick 当前时间
@@ -106,6 +106,20 @@
InitPlayerOnLineReply(curPlayer, tick)
# 统计登入人数
GameDataRecord.PlayerLoginRecord(curPlayer, tick)
+ __DoPlayerLoginServer(curPlayer, tick)
+
+ #通知地图服务器自己初始化成功
+ curPlayer.MapServer_InitOK()
+ return
+
+def __DoPlayerLoginServer(curPlayer, tick):
+ ''' 玩家登录需要处理的内容,本服及跨服服务器分开
+ '''
+ if GameWorld.IsCrossServer():
+ #跨服PK
+ CrossRealmPK.OnPlayerLoginCrossServer(curPlayer)
+ return
+
#玩家家族刷新
#家族任务需要刷新 FamilyLV, 地图服务器需要知道FamilyLV来通知玩家家族任务次数
PlayerFamily.PlayerLoginRefreshFamily(curPlayer, tick)
@@ -126,26 +140,19 @@
# 通知广播信息
GMCommon.SendBroadCastToClient(curPlayer)
-
- # 在非跨服服务器上线时,在跨服PK赛期间如果roomID不为0则重置
- #if not GameWorld.IsMergeServer() and GameWorldMergePK.IsMergePKMatchOpen() \
- # and curPlayer.GetVsRoomId() != 0:
- # PlayerControl.SetVsRoomId(curPlayer, 0)
-
PlayerTruck.SyncPlayerTruckStartTime(curPlayer)
#通知玩家交易所挂单情况
PlayerBourse.OnPlayerLogin(curPlayer)
-
+ #拍卖行
+ AuctionHouse.OnPlayerLogin(curPlayer)
+
#上线广播
__CheckWorldNotifyOnLogin(curPlayer, tick)
- #上线奖励处理
- #PlayerMergeEvent.MergeEventOnPlayerLogin(curPlayer)
- #MergePlayer.OnPlayerLogin(curPlayer)
#仙盟红包
PlayerFamilyRedPacket.OnPlayerLogin(curPlayer)
#仙盟仓库
- PlayerFamilyStore.OnPlayerLogin(curPlayer)
+ #PlayerFamilyStore.OnPlayerLogin(curPlayer)
#仙盟宴会
PlayerFamilyParty.OnPlayerLogin(curPlayer)
#封魔坛
@@ -172,12 +179,13 @@
PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()
#副本助战
PlayerFBHelpBattle.OnHelpPlayerLogin(curPlayer)
-
- GMShell.OnPlayerLogin(curPlayer)
+ #跨服PK
+ CrossRealmPK.OnPlayerLogin(curPlayer)
+ #诛仙BOSS
+ PlayerZhuXianBoss.OnPlayerLogin(curPlayer)
+ #骑宠boss状态通知
+ PlayerHorsePetBoss.OnLogin(curPlayer)
GMT_CTG.OnPlayerLogin(curPlayer)
-
- #通知地图服务器自己初始化成功
- curPlayer.MapServer_InitOK()
return
## 增加高手玩家上线广播
@@ -185,7 +193,7 @@
# @return None
def __CheckWorldNotifyOnLogin(curPlayer, tick):
# 跨服服务器不广播
- if GameWorld.IsMergeServer():
+ if GameWorld.IsCrossServer():
return
limitLV = IpyGameDataPY.GetFuncCfg("BillBoardPlayerLoginNotify", 2) # 最低等级限制
@@ -208,9 +216,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
@@ -229,11 +234,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:
@@ -259,31 +260,6 @@
diff_Time = loginTime - logoffTime
#天数 * 24小时 * 60 分钟 + 秒
return diff_Time.days * 24 * 60 * 60 + diff_Time.seconds
-
-## 统计客户端跨服赛激活时间
-# @param index 玩家索引
-# @return None
-def SendMergeWarOpen(curPlayer):
- # 发送跨服赛服务器信息
- mapConfig = GameConfig.GetConfig()
- mergeServerIP = mapConfig.get("MergeServerIP")
- mergeServerPort = mapConfig.get("MergeServerPort")
- if not mergeServerIP:
- return
- mergeServerInfo = ChPyNetSendPack.tagMergeServerInfo()
- mergeServerInfo.ServerIPLen = len(mergeServerIP)
- mergeServerInfo.ServerIP = mergeServerIP
- mergeServerInfo.Port = mergeServerPort
- mergeServerInfo.IsMergeServer = GameWorld.IsMergeServer()
- NetPackCommon.SendFakePack(curPlayer, mergeServerInfo)
- return
-
-## 跨服赛通知奖励
-# @param curPlayer: 玩家实例
-# @return: None
-def MSGetReward(curPlayer):
- #PlayerCanGetReward.SynClient_CanGetRewardList(curPlayer)
- return
## 运营登陆信息处理
# @param curPlayer
@@ -515,7 +491,7 @@
def __Func_PlayerDisconnect(curPlayer, tick):
#跨服匹配PK
- #GameWorldMergePK.OnLeaveServer(curPlayer)
+ CrossRealmPK.OnLeaveServer(curPlayer)
#组队玩家离线
PlayerTeam.DoPlayerLogOffTeamLogic(curPlayer, tick)
@@ -526,8 +502,8 @@
PlayerGeTui.NewGuyCallBackGeTui(curPlayer, tick)
# 设置家族成员离线时间
SetPlayerOfflineTime(curPlayer)
-
- #MergePlayer.OnPlayerLeaveGotoMergeServer(curPlayer, tick)
+ #拍卖行
+ AuctionHouse.OnPlayerLeaveServer(curPlayer)
#------------镖车逻辑
#TruckPlayerDisconnectProcess(curPlayer, tick)
return
@@ -634,8 +610,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:
# #这里应该通知组队那边刷新
@@ -665,7 +639,10 @@
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);
@@ -789,7 +766,7 @@
#===============================================================================
#自己已经初始化成功
curPlayer.SetInitOK(True)
-
+ GMShell.OnPlayerLogin(curPlayer)
#发送请求至目标地图(任务需要登陆家族长触发事件)
__RefreshFamilyToMapServer(curPlayer)
return
@@ -915,11 +892,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