fix:混服支持,影响限购活动,充值,后台事件记录,在线人数
| | |
| | | # @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")
|
| | |
| | | # "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"%(\
|
| | | ReportUrl, ProductID, OperatorID, RegionName, eventActionID, playerInfo,
|
| | |
| | | ## =================================================================================================
|
| | |
|
| | | ## 在线
|
| | | 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
|
| | |
|
| | |
|
| | |
| | | return
|
| | |
|
| | | # 全服在线人数平台明细
|
| | | #platformOLDict = {} # 平台在线人数 {平台:人数, ...}
|
| | | platformOLDict = {} # 平台在线人数 {平台:人数, ...}
|
| | | #mapPlatformOLDict = {} # 地图平台在线人数 {mapID:{平台:人数, ...}, ...}
|
| | | tjgOnlineCnt = 0 # 脱机挂在线玩家
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | |
| | | tjgOnlineCnt += 1
|
| | | continue
|
| | |
|
| | | #platform = GameWorld.GetPlayerPlatform(player.GetAccID())
|
| | | #platformOLDict[platform] = platformOLDict.get(platform, 0) + 1 # 累计平台在线人数
|
| | | platform = GameWorld.GetPlayerPlatform(player.GetAccID())
|
| | | platformOLDict[platform] = platformOLDict.get(platform, 0) + 1 # 累计平台在线人数
|
| | |
|
| | | # mapID = player.GetMapID()
|
| | | # mapOLDict = mapPlatformOLDict.get(mapID, {})
|
| | |
| | | #activePlayerCount = GameWorld.GetPlayerManager().GetActivePlayerCount()
|
| | | #DataRecordPack.DR_OnLinePlayerCount(activePlayerCount, platformOLDict, tjgOnlineCnt)
|
| | | #===========================================================================
|
| | | # for platform, playerCnt in platformOLDict.items():
|
| | | # concurrency = EventReport.concurrency()
|
| | | # concurrency.SetEventAgentInfo(platform)
|
| | | # concurrency.concurrency = playerCnt
|
| | | # EventReport.WriteEvent(concurrency)
|
| | | for platform, playerCnt in platformOLDict.items():
|
| | | DataRecordPack.DR_OnLinePlayerCount(playerCnt, platform, tjgOnlineCnt) # 单平台
|
| | | EventReport.WriteEvent_concurrency(playerCnt, 0, platform) # 单平台 此处不能传脱机挂玩家总数
|
| | | |
| | |
|
| | | #===========================================================================
|
| | |
|
| | | DataRecordPack.DR_OnLinePlayerCount(activePlayerCount, {}, tjgOnlineCnt)
|
| | | EventReport.WriteEvent_concurrency(activePlayerCount, tjgOnlineCnt)
|
| | | DataRecordPack.DR_OnLinePlayerCount(activePlayerCount, {}, tjgOnlineCnt) # 总在线
|
| | | #EventReport.WriteEvent_concurrency(activePlayerCount, tjgOnlineCnt)
|
| | | #刷新当前地图服务器
|
| | | #===========================================================================
|
| | | # custom_concurrencyMapList = ReadChConfig.GetEvalChConfig("EventReportMapID")
|
| | |
| | | #GameWorldBoss.CheckResetBossKilledCntOnServerInit()
|
| | | #GameWorldActionTeHui.OnGameServerInitOK() # 特惠活动初始化
|
| | | #子服启动成功告知跨服主服
|
| | | serverGroupID = GameWorld.GetServerGroupID()
|
| | | if GameWorld.IsMergeOpen() and not GameWorld.IsMergeServer():
|
| | | GameWorld.Log("通知跨服主服务器启动成功, 可接收最新跨服活动状态及数据...")
|
| | | dataMsg = {"Platform":GameWorld.GetPlatform(), "ServerID":GameWorld.GetServerSID(), "ServerGroupID":serverGroupID}
|
| | | MergeChildMsg.SendMergerChildToCenterStringData(ChConfig.Def_ClientServerInitOK, dataMsg)
|
| | | |
| | | GameWorld.Log("服务器启动成功: ServerGroupID=%s" % serverGroupID)
|
| | | #===========================================================================
|
| | | # serverGroupID = GameWorld.GetServerGroupID()
|
| | | # if GameWorld.IsMergeOpen() and not GameWorld.IsMergeServer():
|
| | | # GameWorld.Log("通知跨服主服务器启动成功, 可接收最新跨服活动状态及数据...")
|
| | | # dataMsg = {"Platform":GameWorld.GetPlatform(), "ServerID":GameWorld.GetServerSID(), "ServerGroupID":serverGroupID}
|
| | | # MergeChildMsg.SendMergerChildToCenterStringData(ChConfig.Def_ClientServerInitOK, dataMsg)
|
| | | # |
| | | # GameWorld.Log("服务器启动成功: ServerGroupID=%s" % serverGroupID)
|
| | | #===========================================================================
|
| | | return
|
| | |
|
| | | def DoCheckNewServerOpen(tick):
|
| | |
| | | # @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")
|
| | |
| | | "AccountID": GameWorld.GetPlatformAccID(curPlayer.GetAccID()),
|
| | | "IP": curPlayer.GetIP(),
|
| | | "Level": curPlayer.GetLV()})
|
| | | |
| | | OperatorID = GameWorld.GetPlayerPlatform(curPlayer.GetAccID())
|
| | |
|
| | | if eventParam:
|
| | | eventParam = "&%s"%eventParam
|
| | |
| | | isAddBourseMoney = chargeInfo.GetIsAddBourseMoney()
|
| | | appID = chargeInfo.GetAppID()
|
| | | if not appID:
|
| | | appID = GameWorld.GetPlatform()
|
| | | appID = GameWorld.GetPlayerPlatform(curPlayer.GetAccID())
|
| | | addDRDict = {"orderCoin":orderCoin, "orderInfo":orderInfo, "orderID":orderID,
|
| | | "isAddBourseMoney":isAddBourseMoney, "eventName":eventName, "appID":appID}
|
| | |
|
| | |
| | | for itemID, itemCount, isBind in giftItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem],
|
| | | event=[ChConfig.ItemGive_CTG, True, addDRDict])
|
| | | |
| | | |
| | | # 取玩家APPID,混服使用
|
| | | appID = GameWorld.GetPlayerPlatform(curPlayer.GetAccID())
|
| | | notifyKey = giftbagIpyData.GetNotifyKey()
|
| | | if notifyKey:
|
| | | orderIpyData = GetFlashGiftbagIDOrderInfoIpyData(giftbagID)
|
| | | orderIpyData = GetFlashGiftbagIDOrderInfoIpyData(giftbagID, appID)
|
| | | rmb = 0 if not orderIpyData else int(orderIpyData.GetPayRMBNum())
|
| | | PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), rmb, giftbagIpyData.GetMainItemID()])
|
| | |
|
| | |
| | | GameWorld.ErrLog("限时礼包开关时间时分配置错误!cfgID=%s" % cfgID)
|
| | | return
|
| | |
|
| | | # 取玩家APPID,混服使用
|
| | | appID = GameWorld.GetPlayerPlatform(curPlayer.GetAccID())
|
| | | |
| | | packInfo = ChPyNetSendPack.tagMCFlashGiftbagInfo()
|
| | | packInfo.StartDate = flashGiftbagIpyData.GetStartDate()
|
| | | packInfo.EndtDate = flashGiftbagIpyData.GetEndDate()
|
| | |
| | |
|
| | | for giftIpyData in giftbagIpyDataList:
|
| | | giftbagID = giftIpyData.GetGiftbagID()
|
| | | orderIpyData = GetFlashGiftbagIDOrderInfoIpyData(giftbagID)
|
| | | orderIpyData = GetFlashGiftbagIDOrderInfoIpyData(giftbagID, appID)
|
| | | giftBag = ChPyNetSendPack.tagMCFlashGiftbag()
|
| | | giftBag.GiftID = giftbagID
|
| | | giftBag.OrderInfo = "" if not orderIpyData else orderIpyData.GetOrderInfo()
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, packInfo)
|
| | | return
|
| | |
|
| | | def GetFlashGiftbagIDOrderInfoIpyData(giftbagID):
|
| | | def GetFlashGiftbagIDOrderInfoIpyData(giftbagID, appID):
|
| | | ## 获取礼包ID对应实际售价
|
| | | key = "FlashGiftbagIDRMB"
|
| | | FlashGiftbagIDRMBDict = IpyGameDataPY.GetConfigEx(key)
|
| | | if not FlashGiftbagIDRMBDict:
|
| | | FlashGiftbagIDRMBDict = {}
|
| | | appID = GameWorld.GetPlatform()
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetOrderInfoCount()):
|
| | | ipyData = ipyDataMgr.GetOrderInfoByIndex(i)
|
| | |
| | | continue
|
| | | if not ipyData.GetGiftbagID():
|
| | | continue
|
| | | FlashGiftbagIDRMBDict[ipyData.GetGiftbagID()] = ipyData
|
| | | FlashGiftbagIDRMBDict[(ipyData.GetGiftbagID(), appID)] = ipyData
|
| | | IpyGameDataPY.SetConfigEx(key, FlashGiftbagIDRMBDict)
|
| | | return FlashGiftbagIDRMBDict.get(giftbagID)
|
| | | return FlashGiftbagIDRMBDict.get((giftbagID, appID))
|
| | |
|