From 4bf976c6e6af3c7bb6bcb2798544b7f47cd7844d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 22 三月 2024 15:48:37 +0800
Subject: [PATCH] 10138 内存分析(修复读取活动配置部分属性错误bug)
---
ServerPython/CoreServerGroup/GameServer/Script/EventReport.py | 85 +++++++++++++++++++++++++++---------------
1 files changed, 54 insertions(+), 31 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py b/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py
index 2f9e7f2..2dbb565 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/EventReport.py
@@ -38,6 +38,8 @@
import md5
import os
import re
+import urllib
+import IpyGameDataPY
EventFilepath = "D:\\EventServer\\PythonScribe\\EventLog\\"
@@ -87,18 +89,25 @@
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"
-
+
+ reportActionIDList = IpyGameDataPY.GetFuncEvalCfg("EventReport", 3)
+ if reportActionIDList and eventActionID not in reportActionIDList:
+ #GameWorld.DebugLog("非需要汇报的事件ID! %s" % eventActionID)
+ return
+ if eventActionID in IpyGameDataPY.GetFuncEvalCfg("EventReport", 1):
+ #GameWorld.DebugLog("不需要汇报的事件! %s" % eventActionID)
+ return
+
if not curPlayer and not OperatorID:
return
ProductID = ReadChConfig.GetPyMongoConfig("EventReport", "ProductID")
ReportUrl = ReadChConfig.GetPyMongoConfig("EventReport", "ReportUrl")
- RegionName = GameWorld.GetServerSID() # 需考虑合服情况
playerInfo = ""
if curPlayer:
- playerInfo = "&AccountID=%s&IP=%s"%(GameWorld.GetPlatformAccID(curPlayer.GetAccID()),
- curPlayer.GetIP())
+ playerInfo = "&AccountID=%s&IP=%s&DeviceFlag=%s"%(GameWorld.GetPlatformAccID(curPlayer.GetAccID()),
+ curPlayer.GetIP(), curPlayer.GetDeviceFlag())
#=======================================================================
# #UTF8 需要转成url编码才可用
# playerInfo = urllib.urlencode({"RoleID": curPlayer.GetName(),
@@ -106,11 +115,23 @@
# "IP": curPlayer.GetIP(),
# "Level": curPlayer.GetLV()})
#=======================================================================
- OperatorID = GameWorld.GetPlayerPlatform(curPlayer.GetAccID())
-
- getUrl = "%s?ProductID=%s&OperatorID=%s&RegionName=%s&EventID=%s%s&Time=%s&%s"%(\
+ OperatorID = GameWorld.GetPlayerPlatform(curPlayer)
+ RegionName = GameWorld.GetPlayerServerSID(curPlayer)
+
+ else:
+ # 合服情况,玩家取自己服发送,非玩家数据按指定平台配置发
+ sid = GameWorld.GetPlayerMainServerID(OperatorID)
+ if not sid:
+ GameWorld.ErrLog("GetPlayerMainServerID: %s-%s"%(OperatorID, sid))
+ return
+ RegionName = 's%s'%sid
+
+ if eventParam:
+ eventParam = "&%s"%eventParam
+
+ 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)
+ urllib.quote(str(datetime.datetime.today()).split('.')[0]), eventParam)
GameWorld.DebugLog("EventReport: %s"%getUrl)
# 第五个参数0代表get发送 1代表post
@@ -123,7 +144,7 @@
# @param eventClass
# @return None
def WriteEvent(eventClass):
- if GameWorld.IsMergeServer():
+ if GameWorld.IsCrossServer():
return
if eventClass.GetScribeEventName() not in ReadChConfig.GetEvalChConfig("EventReportID"):
@@ -330,28 +351,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