From b58392bcbca98bfa2f9fd90fad8978f1ed77d8bc Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 10 九月 2018 20:18:00 +0800
Subject: [PATCH] fix:老玩家成就处理

---
 ServerPython/CoreServerGroup/GameServer/Script/EventReport.py |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py b/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py
index 9a92af3..fcb35c6 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.GetAccID())
+        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)
@@ -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
 
 

--
Gitblit v1.8.0