| | |
| | | import md5
|
| | | import os
|
| | | import re
|
| | | import urllib
|
| | | import IpyGameDataPY
|
| | |
|
| | |
|
| | | EventFilepath = "D:\\EventServer\\PythonScribe\\EventLog\\"
|
| | |
| | | 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
|
| | |
|
| | |
| | |
|
| | | 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(),
|
| | |
| | | return
|
| | | RegionName = 's%s'%sid
|
| | |
|
| | | getUrl = "%s?ProductID=%s&OperatorID=%s&RegionName=%s&EventID=%s%s&Time=%s&%s"%(\
|
| | | 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
|