From 7c1b4ff3635e266b57c47eabe68466064923db2f Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期二, 22 一月 2019 11:17:02 +0800 Subject: [PATCH] 5512 子 【开发】跨服 -- 跨服字典统一处理,部分状态不同步导致战力不对应问题 --- ServerPython/CoreServerGroup/GameServer/Script/EventReport.py | 67 ++++++++++++++++++--------------- 1 files changed, 36 insertions(+), 31 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py b/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py index 9a92af3..7ff6764 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py @@ -84,17 +84,15 @@ # @param eventParam 事件参数 # @param curPlayer # @return None -def EventReport(eventActionID, eventParam, curPlayer=None): +def EventReport(eventActionID, eventParam, curPlayer=None, OperatorID=""): # 组成例子 eventParam 的格式必须是 xx=yy&zz=cc # "http://192.168.0.249:12000/event_receiver?EventID=3099&OperatorID=test&PlayerCount=102&Time=2018-02-08 18:30:30&ProductID=snxxz&RegionName=s1" - OperatorID = GameWorld.GetPlatform() - if not OperatorID: + if not curPlayer and not OperatorID: return ProductID = ReadChConfig.GetPyMongoConfig("EventReport", "ProductID") ReportUrl = ReadChConfig.GetPyMongoConfig("EventReport", "ReportUrl") - RegionName = GameWorld.GetServerSID() # 需考虑合服情况 playerInfo = "" if curPlayer: @@ -107,8 +105,13 @@ # "IP": curPlayer.GetIP(), # "Level": curPlayer.GetLV()}) #======================================================================= - - + OperatorID = GameWorld.GetPlayerPlatform(curPlayer) + RegionName = GameWorld.GetPlayerServerSID(curPlayer) + + else: + # 合服情况,玩家取自己服发送,非玩家数据按指定平台配置发,没有则取配置主服 + RegionName = 's%s'%GameWorld.GetPlayerMainServerID(OperatorID) + getUrl = "%s?ProductID=%s&OperatorID=%s&RegionName=%s&EventID=%s%s&Time=%s&%s"%(\ ReportUrl, ProductID, OperatorID, RegionName, eventActionID, playerInfo, str(datetime.datetime.today()).split('.')[0], eventParam) @@ -124,7 +127,7 @@ # @param eventClass # @return None def WriteEvent(eventClass): - if GameWorld.IsMergeServer(): + if GameWorld.IsCrossServer(): return if eventClass.GetScribeEventName() not in ReadChConfig.GetEvalChConfig("EventReportID"): @@ -312,11 +315,11 @@ ## ================================================================================================= ## 在线 -def WriteEvent_concurrency(activePlayerCount, tjgOnlineCnt): +def WriteEvent_concurrency(activePlayerCount, tjgOnlineCnt, OperatorID): # 只传真实玩家,让后台显示真实在线玩家 realPlayer = activePlayerCount-tjgOnlineCnt EventReport(ShareDefine.Def_UserAction_KeepOnline, - "PlayerCount=%s&TotalPlayerCount=%s"%(realPlayer, realPlayer)) + "PlayerCount=%s&TotalPlayerCount=%s"%(realPlayer, realPlayer), None, OperatorID) return @@ -331,28 +334,30 @@ def WriteEvent_chat_log(curPlayer, content, cmc_name, tagName="", addinfo=""): return - ''' - @todo: 写聊天监控记录 - @param content: 聊天内容 - @param cmc_name: 聊天频道标识 - @param tagName: 私聊对象 - @param addinfo: 额外信息 - ''' - - chatlogEvent = chat_log() - chatlogEvent.SetEventAgentInfo(GameWorld.GetPlayerPlatform(curPlayer.GetAccID())) - chatlogEvent.account_id = GameWorld.GetPlatformAccID(curPlayer.GetAccID()) - chatlogEvent.chr_name = curPlayer.GetName() - chatlogEvent.content = __GetEventChatContent(content) - chatlogEvent.cmc_name = cmc_name - chatlogEvent.ip = curPlayer.GetIP() - chatlogEvent.account_name = chatlogEvent.account_id - chatlogEvent.account_type = 0 - chatlogEvent.chr_level = 0 - chatlogEvent.object = tagName - chatlogEvent.addinfo = addinfo - WriteEvent(chatlogEvent) - return + #=========================================================================== + # ''' + # @todo: 写聊天监控记录 + # @param content: 聊天内容 + # @param cmc_name: 聊天频道标识 + # @param tagName: 私聊对象 + # @param addinfo: 额外信息 + # ''' + # + # chatlogEvent = chat_log() + # chatlogEvent.SetEventAgentInfo(GameWorld.GetPlayerPlatform(curPlayer)) + # chatlogEvent.account_id = GameWorld.GetPlatformAccID(curPlayer.GetAccID()) + # chatlogEvent.chr_name = curPlayer.GetName() + # chatlogEvent.content = __GetEventChatContent(content) + # chatlogEvent.cmc_name = cmc_name + # chatlogEvent.ip = curPlayer.GetIP() + # chatlogEvent.account_name = chatlogEvent.account_id + # chatlogEvent.account_type = 0 + # chatlogEvent.chr_level = 0 + # chatlogEvent.object = tagName + # chatlogEvent.addinfo = addinfo + # WriteEvent(chatlogEvent) + # return + #=========================================================================== def __GetEventChatContent(content): ''' -- Gitblit v1.8.0