From 8c4813b40cff97893a73d07105d950425ea98e9f Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 21 六月 2024 19:31:23 +0800 Subject: [PATCH] 10185 【越南】【港台】【主干】BOSS凭证修改(增加仙盟充值互助活动;) --- ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/FamilyCTGAssiat.py | 90 ++++ ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py | 3 ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 39 + ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActFamilyCTGAssist.py | 257 +++++++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py | 8 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py | 11 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 267 ++++++++++++ ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 267 ++++++++++++ ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerActFamilyCTGAssist.py | 166 +++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 60 ++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 6 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py | 2 PySysDB/PySysDBPY.h | 22 + ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py | 8 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FamilyCTGAssist.py | 49 ++ PySysDB/PySysDBG.h | 16 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 9 18 files changed, 1,276 insertions(+), 8 deletions(-) diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h index 52d3e7a..91f5e18 100644 --- a/PySysDB/PySysDBG.h +++ b/PySysDB/PySysDBG.h @@ -508,6 +508,22 @@ BYTE IsDayReset; //是否每天重置 }; +//仙盟充值协助活动表 + +struct tagActFamilyCTGAssist +{ + DWORD _CfgID; //配置ID + list PlatformList; //活动平台列表["平台A", "平台A", ...],配[]代表所有 + list ServerGroupIDList; //服务器ID列表 + BYTE ActNum; //活动分组编号, 活动类型 * 10 + 不同界面编号 + char StartDate; //开启日期 + char EndDate; //结束日期 + dict NotifyInfoStart; //全服提示信息 - 相对开始时间 + dict NotifyInfoEnd; //全服提示信息 - 相对结束时间 + list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key] + BYTE IsDayReset; //是否每天重置 +}; + //集字活动时间表 struct tagActCollectWords diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h index fcb7f78..9735ee0 100644 --- a/PySysDB/PySysDBPY.h +++ b/PySysDB/PySysDBPY.h @@ -1722,6 +1722,28 @@ dict FreeItemInfo; //免费领取的物品信息列表{领取记录索引:[[物品ID,个数,是否拍品]], ...} }; +//仙盟充值协助活动表 + +struct tagActFamilyCTGAssist +{ + DWORD _CfgID; //配置ID + char StartDate; //开启日期 + char EndDate; //结束日期 + WORD LVLimit; //限制等级 + BYTE IsDayReset; //是否每天重置 + list TemplateIDList; //模板ID列表 +}; + +//仙盟充值协助活动模板表 + +struct tagActFamilyCTGAssistTemp +{ + DWORD _TemplateID; //模板ID + BYTE NeedCTGPlayers; //需要充值人数 + BYTE RecordIndex; //记录索引 + list AwardItemList; //奖励物品信息,[[物品ID,个数,是否拍品], ...] +}; + //集字活动时间表 struct tagActCollectWords diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py index f53ab2e..0bc4cf4 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py @@ -32764,6 +32764,273 @@ #------------------------------------------------------ +# AA 77 仙盟充值互助活动信息 #tagMCActFamilyCTGAssistInfo + +class tagMCActFamilyCTGAssistItem(Structure): + _pack_ = 1 + _fields_ = [ + ("ItemID", c_int), + ("ItemCount", c_ushort), + ("IsBind", c_ubyte), + ] + + def __init__(self): + self.Clear() + return + + def ReadData(self, stringData, _pos=0, _len=0): + self.Clear() + memmove(addressof(self), stringData[_pos:], self.GetLength()) + return _pos + self.GetLength() + + def Clear(self): + self.ItemID = 0 + self.ItemCount = 0 + self.IsBind = 0 + return + + def GetLength(self): + return sizeof(tagMCActFamilyCTGAssistItem) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 77 仙盟充值互助活动信息 //tagMCActFamilyCTGAssistInfo: + ItemID:%d, + ItemCount:%d, + IsBind:%d + '''\ + %( + self.ItemID, + self.ItemCount, + self.IsBind + ) + return DumpString + + +class tagMCActFamilyCTGAssistAward(Structure): + NeedCTGPlayers = 0 #(BYTE NeedCTGPlayers)//所需充值人数 + RecordIndex = 0 #(BYTE RecordIndex)//对应领奖记录索引 + Count = 0 #(BYTE Count) + AwardItemList = list() #(vector<tagMCActFamilyCTGAssistItem> AwardItemList)// 奖励物品列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.NeedCTGPlayers,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.RecordIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temAwardItemList = tagMCActFamilyCTGAssistItem() + _pos = temAwardItemList.ReadData(_lpData, _pos) + self.AwardItemList.append(temAwardItemList) + return _pos + + def Clear(self): + self.NeedCTGPlayers = 0 + self.RecordIndex = 0 + self.Count = 0 + self.AwardItemList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 1 + length += 1 + for i in range(self.Count): + length += self.AwardItemList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.NeedCTGPlayers) + data = CommFunc.WriteBYTE(data, self.RecordIndex) + data = CommFunc.WriteBYTE(data, self.Count) + for i in range(self.Count): + data = CommFunc.WriteString(data, self.AwardItemList[i].GetLength(), self.AwardItemList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + NeedCTGPlayers:%d, + RecordIndex:%d, + Count:%d, + AwardItemList:%s + '''\ + %( + self.NeedCTGPlayers, + self.RecordIndex, + self.Count, + "..." + ) + return DumpString + + +class tagMCActFamilyCTGAssistInfo(Structure): + Head = tagHead() + ActNum = 0 #(BYTE ActNum)//活动编号 + StartDate = "" #(char StartDate[10])// 开始日期 y-m-d + EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置 + LimitLV = 0 #(WORD LimitLV)// 限制等级 + AwardCount = 0 #(BYTE AwardCount) + AwardInfoList = list() #(vector<tagMCActFamilyCTGAssistAward> AwardInfoList)// 互助奖励列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x77 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10) + self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10) + self.IsDayReset,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.AwardCount): + temAwardInfoList = tagMCActFamilyCTGAssistAward() + _pos = temAwardInfoList.ReadData(_lpData, _pos) + self.AwardInfoList.append(temAwardInfoList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x77 + self.ActNum = 0 + self.StartDate = "" + self.EndtDate = "" + self.IsDayReset = 0 + self.LimitLV = 0 + self.AwardCount = 0 + self.AwardInfoList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + length += 10 + length += 10 + length += 1 + length += 2 + length += 1 + for i in range(self.AwardCount): + length += self.AwardInfoList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.ActNum) + data = CommFunc.WriteString(data, 10, self.StartDate) + data = CommFunc.WriteString(data, 10, self.EndtDate) + data = CommFunc.WriteBYTE(data, self.IsDayReset) + data = CommFunc.WriteWORD(data, self.LimitLV) + data = CommFunc.WriteBYTE(data, self.AwardCount) + for i in range(self.AwardCount): + data = CommFunc.WriteString(data, self.AwardInfoList[i].GetLength(), self.AwardInfoList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + ActNum:%d, + StartDate:%s, + EndtDate:%s, + IsDayReset:%d, + LimitLV:%d, + AwardCount:%d, + AwardInfoList:%s + '''\ + %( + self.Head.OutputString(), + self.ActNum, + self.StartDate, + self.EndtDate, + self.IsDayReset, + self.LimitLV, + self.AwardCount, + "..." + ) + return DumpString + + +m_NAtagMCActFamilyCTGAssistInfo=tagMCActFamilyCTGAssistInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActFamilyCTGAssistInfo.Head.Cmd,m_NAtagMCActFamilyCTGAssistInfo.Head.SubCmd))] = m_NAtagMCActFamilyCTGAssistInfo + + +#------------------------------------------------------ +# AA 78 仙盟充值互助活动玩家信息 #tagMCActFamilyCTGAssistPlayerInfo + +class tagMCActFamilyCTGAssistPlayerInfo(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ActNum", c_ubyte), # 活动编号 + ("AwardRecord", c_int), # 奖励记录,按奖励记录索引位运算判断是否已领取 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xAA + self.SubCmd = 0x78 + return + + def ReadData(self, stringData, _pos=0, _len=0): + self.Clear() + memmove(addressof(self), stringData[_pos:], self.GetLength()) + return _pos + self.GetLength() + + def Clear(self): + self.Cmd = 0xAA + self.SubCmd = 0x78 + self.ActNum = 0 + self.AwardRecord = 0 + return + + def GetLength(self): + return sizeof(tagMCActFamilyCTGAssistPlayerInfo) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 78 仙盟充值互助活动玩家信息 //tagMCActFamilyCTGAssistPlayerInfo: + Cmd:%s, + SubCmd:%s, + ActNum:%d, + AwardRecord:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ActNum, + self.AwardRecord + ) + return DumpString + + +m_NAtagMCActFamilyCTGAssistPlayerInfo=tagMCActFamilyCTGAssistPlayerInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActFamilyCTGAssistPlayerInfo.Cmd,m_NAtagMCActFamilyCTGAssistPlayerInfo.SubCmd))] = m_NAtagMCActFamilyCTGAssistPlayerInfo + + +#------------------------------------------------------ # AA 55 垃圾收集活动信息 #tagMCActGarbageSortingInfo class tagMCActGarbageSortingInfo(Structure): diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/FamilyCTGAssiat.py b/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/FamilyCTGAssiat.py new file mode 100644 index 0000000..1466988 --- /dev/null +++ b/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/FamilyCTGAssiat.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +#------------------------------------------------------------------------------- +# +##@package GM.Commands.FamilyCTGAssiat +# +# @todo:仙盟充值互助 +# @author hxp +# @date 2024-06-21 +# @version 1.0 +# +# 详细描述: 仙盟充值互助 +# +#------------------------------------------------------------------------------- +#"""Version = 2024-06-21 19:30""" +#------------------------------------------------------------------------------- + +import GameWorld +import PlayerActFamilyCTGAssist +import PlayerFamilyAction + +# 导入 +#------------------------------------------------------------------------------ + +## 执行逻辑 +# @param curPlayer 当前玩家 +# @param cmdList 参数列表 +# @return None +# @remarks 函数详细说明. +def OnExec(curPlayer, cmdList): + if not cmdList: + GameWorld.DebugAnswer(curPlayer, "重置充值互助: FamilyCTGAssiat 0 actNum") + GameWorld.DebugAnswer(curPlayer, "增加充值互助: FamilyCTGAssiat 1 actNum 人数") + GameWorld.DebugAnswer(curPlayer, "设置领奖人数: FamilyCTGAssiat 2 actNum 档位 人数") + return + + familyID = curPlayer.GetFamilyID() + if not familyID: + GameWorld.DebugAnswer(curPlayer, "没有仙盟") + return + + value1 = cmdList[0] + actNum = cmdList[1] if len(cmdList) > 1 else 0 + if not actNum: + GameWorld.DebugAnswer(curPlayer, "没有指定actNum") + return + + ActionType = PlayerActFamilyCTGAssist.ActionType + actionData = PlayerActFamilyCTGAssist.GetFamilyCTGAssistActionData(familyID, actNum) + + if value1 == 0: + PlayerActFamilyCTGAssist.ClearFAActPlayerIDInfo(actionData) + PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType) + GameWorld.DebugAnswer(curPlayer, "重置充值互助OK!actNum=%s" % actNum) + return + + if value1 == 1: + addCTGPlayers = cmdList[2] if len(cmdList) > 2 else 0 + ctgPlayerIDList, getAwardPlayerCountDict = PlayerActFamilyCTGAssist.GetFAActPlayerIDInfo(actionData) + + maxRotID = 0 + for pID in ctgPlayerIDList: + if pID < 10000 and pID > maxRotID: + maxRotID = pID + + for _ in range(addCTGPlayers): + maxRotID += 1 + ctgPlayerIDList.append(maxRotID) + + PlayerActFamilyCTGAssist.SetFAActPlayerIDInfo(actionData, ctgPlayerIDList, getAwardPlayerCountDict) + PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType) + GameWorld.DebugAnswer(curPlayer, "增加互助人数!actNum=%s,增加:%s,总人数:%s" % (actNum, addCTGPlayers, len(ctgPlayerIDList))) + return + + if value1 == 2: + needCTGPlayers = cmdList[2] if len(cmdList) > 2 else 0 + setGetCount = cmdList[3] if len(cmdList) > 3 else 0 + ctgPlayerIDList, getAwardPlayerCountDict = PlayerActFamilyCTGAssist.GetFAActPlayerIDInfo(actionData) + getAwardPlayerCountDict[str(needCTGPlayers)] = setGetCount + PlayerActFamilyCTGAssist.SetFAActPlayerIDInfo(actionData, ctgPlayerIDList, getAwardPlayerCountDict) + + PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType) + GameWorld.DebugAnswer(curPlayer, "设置领奖人数!actNum=%s,档位:%s,总人数:%s" % (actNum, needCTGPlayers, setGetCount)) + + return + + + + + diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py index 046d843..d8ae9bd 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py @@ -33,6 +33,7 @@ import PlayerFamilyRedPacket import PlayerFairyCeremony import PlayerNewFairyCeremony +import PlayerActFamilyCTGAssist import PlayerActGarbageSorting import PlayerActBossTrial import PlayerUniversalGameRec @@ -847,6 +848,8 @@ PlayerActGarbageSorting.OnActStart(actNum) elif actName == ShareDefine.OperationActionName_BossTrial: PlayerActBossTrial.OnActStart(actNum) + elif actName == ShareDefine.OperationActionName_FamilyCTGAssist: + PlayerActFamilyCTGAssist.OnActStart(actNum) else: if actName == ShareDefine.OperationActionName_GarbageSorting: PlayerActGarbageSorting.OnActEnd(actNum) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py index 965a101..64ebbcf 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py @@ -425,6 +425,19 @@ ("BYTE", "IsDayReset", 0), ), + "ActFamilyCTGAssist":( + ("DWORD", "CfgID", 1), + ("list", "PlatformList", 0), + ("list", "ServerGroupIDList", 0), + ("BYTE", "ActNum", 0), + ("char", "StartDate", 0), + ("char", "EndDate", 0), + ("dict", "NotifyInfoStart", 0), + ("dict", "NotifyInfoEnd", 0), + ("list", "NotifyInfoLoop", 0), + ("BYTE", "IsDayReset", 0), + ), + "ActCollectWords":( ("DWORD", "CfgID", 1), ("list", "PlatformList", 0), @@ -1612,6 +1625,24 @@ def GetNotifyInfoLoop(self): return self.attrTuple[8] # 全服提示信息 - 循环广播[间隔分钟, 广播key] list def GetIsDayReset(self): return self.attrTuple[9] # 是否每天重置 BYTE +# 仙盟充值协助活动表 +class IPY_ActFamilyCTGAssist(): + + def __init__(self): + self.attrTuple = None + return + + def GetCfgID(self): return self.attrTuple[0] # 配置ID DWORD + def GetPlatformList(self): return self.attrTuple[1] # 活动平台列表["平台A", "平台A", ...],配[]代表所有 list + def GetServerGroupIDList(self): return self.attrTuple[2] # 服务器ID列表 list + def GetActNum(self): return self.attrTuple[3] # 活动分组编号, 活动类型 * 10 + 不同界面编号 BYTE + def GetStartDate(self): return self.attrTuple[4] # 开启日期 char + def GetEndDate(self): return self.attrTuple[5] # 结束日期 char + def GetNotifyInfoStart(self): return self.attrTuple[6] # 全服提示信息 - 相对开始时间 dict + def GetNotifyInfoEnd(self): return self.attrTuple[7] # 全服提示信息 - 相对结束时间 dict + def GetNotifyInfoLoop(self): return self.attrTuple[8] # 全服提示信息 - 循环广播[间隔分钟, 广播key] list + def GetIsDayReset(self): return self.attrTuple[9] # 是否每天重置 BYTE + # 集字活动时间表 class IPY_ActCollectWords(): @@ -2574,6 +2605,7 @@ self.__LoadFileData("ActExpRate", onlyCheck) self.__LoadFileData("ActCostRebate", onlyCheck) self.__LoadFileData("ActBuyOne", onlyCheck) + self.__LoadFileData("ActFamilyCTGAssist", onlyCheck) self.__LoadFileData("ActCollectWords", onlyCheck) self.__LoadFileData("ActGarbageSorting", onlyCheck) self.__LoadFileData("ActBossTrial", onlyCheck) @@ -3106,6 +3138,13 @@ self.CheckLoadData("ActBuyOne") return self.ipyActBuyOneCache[index] + def GetActFamilyCTGAssistCount(self): + self.CheckLoadData("ActFamilyCTGAssist") + return self.ipyActFamilyCTGAssistLen + def GetActFamilyCTGAssistByIndex(self, index): + self.CheckLoadData("ActFamilyCTGAssist") + return self.ipyActFamilyCTGAssistCache[index] + def GetActCollectWordsCount(self): self.CheckLoadData("ActCollectWords") return self.ipyActCollectWordsLen diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerActFamilyCTGAssist.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerActFamilyCTGAssist.py new file mode 100644 index 0000000..28d8113 --- /dev/null +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerActFamilyCTGAssist.py @@ -0,0 +1,166 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +#------------------------------------------------------------------------------- +# +##@package PlayerActFamilyCTGAssist +# +# @todo:仙盟充值互助 +# @author hxp +# @date 2024-06-21 +# @version 1.0 +# +# 详细描述: 仙盟充值互助 +# +#------------------------------------------------------------------------------- +#"""Version = 2024-06-21 19:30""" +#------------------------------------------------------------------------------- + +import GameWorld +import PlayerFamilyAction +import ShareDefine +import PlayerFamily +import ChConfig + +ActionType = ShareDefine.Def_ActionType_FamilyCTGAssist + +def GetFAActNum(actionData): return actionData.GetValue1() +def SetFAActNum(actionData, actNum): return actionData.SetValue1(actNum) + +def GetFAActPlayerIDInfo(actionData): + playerIDInfo = [[], {}] + useData = actionData.GetUseData() + if useData: + try: + playerIDInfo = eval(useData) + except: + playerIDInfo = [[], {}] + return playerIDInfo +def SetFAActPlayerIDInfo(actionData, ctgPlayerIDList, getAwardPlayerCountDict): + useData = str([ctgPlayerIDList, getAwardPlayerCountDict]).replace(" ", "") + actionData.SetUseData(useData, len(useData)) + return +def ClearFAActPlayerIDInfo(actionData): + SetFAActPlayerIDInfo(actionData, [], {}) + return + +def GetFamilyCTGAssistActionData(familyID, actNum): + ## 获取Action + findActionData = None + familyAction = GameWorld.GetFamilyActionManager().GetFamilyAction(familyID, ActionType) + for index in range(0, familyAction.Count()): + actionData = familyAction.At(index) + if GetFAActNum(actionData) == actNum: + findActionData = actionData + break + + if not findActionData: + findActionData = familyAction.AddAction() + findActionData.SetFamilyId(familyID) + findActionData.SetActionType(ActionType) + SetFAActNum(findActionData, actNum) + ClearFAActPlayerIDInfo(findActionData) + + return findActionData + +def OnActStart(actNum): + ## 活动开启 + + familyManager = GameWorld.GetFamilyManager() + for i in range(0, familyManager.GetCount()): + family = familyManager.GetAt(i) + familyID = family.GetID() + actionData = GetFamilyCTGAssistActionData(familyID, actNum) + ClearFAActPlayerIDInfo(actionData) # 重置充值即领取人员ID记录 + + PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType) + + return + +def MapServer_FamilyCTGAssist(curPlayer, msgList): + mapID = curPlayer.GetRealMapID() + playerID = curPlayer.GetPlayerID() + GameWorld.DebugLog("MapServer_FamilyCTGAssist mapID=%s,msgList=%s" % (mapID, msgList), playerID) + if not msgList: + return + + msgType, dataMsg = msgList + ret = None + + if msgType == "PlayerCTG": + ret = __OnPlayerCTG(curPlayer, dataMsg) + + elif msgType == "FamilyCTGAssistAward": + ret = __OnFamilyCTGAssistAward(curPlayer, dataMsg) + + if ret == None: + return + return msgList + (ret if isinstance(ret, list) else [ret]) + +def __OnPlayerCTG(curPlayer, dataMsg): + ## 有玩家充值 + actNumList = dataMsg[0] + familyID = curPlayer.GetFamilyID() + if not familyID: + return + + isChange = False + playerID = curPlayer.GetPlayerID() + for actNum in actNumList: + actionData = GetFamilyCTGAssistActionData(familyID, actNum) + + ctgPlayerIDList, getAwardPlayerCountDict = GetFAActPlayerIDInfo(actionData) + if playerID in ctgPlayerIDList: + continue + + isChange = True + ctgPlayerIDList.append(playerID) + SetFAActPlayerIDInfo(actionData, ctgPlayerIDList, getAwardPlayerCountDict) + GameWorld.Log("仙盟充值互助人数变更: actNum=%s,familyID=%s,新互助玩家=%s,更新互助人数=%s, %s" + % (actNum, familyID, playerID, len(ctgPlayerIDList), ctgPlayerIDList)) + + if not isChange: + return + + PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType) + return + +def __OnFamilyCTGAssistAward(curPlayer, dataMsg): + ## 玩家领奖 + + actNum, ctgPlayers, _, _ = dataMsg + familyID = curPlayer.GetFamilyID() + if not familyID: + return + + playerID = curPlayer.GetPlayerID() + + actionData = GetFamilyCTGAssistActionData(familyID, actNum) + + ctgPlayerIDList, getAwardPlayerCountDict = GetFAActPlayerIDInfo(actionData) + + if len(ctgPlayerIDList) < ctgPlayers: + GameWorld.DebugLog("仙盟充值互助所需充值人数不足: actNum=%s,familyID=%s,已互助人数=%s < %s, %s" + % (actNum, familyID, len(ctgPlayerIDList), ctgPlayers, ctgPlayerIDList), playerID) + return + + curFamily = GameWorld.GetFamilyManager().FindFamily(familyID) + if not curFamily: + return + maxMemberCnt = PlayerFamily.GetFamilySetting(curFamily, ChConfig.Def_FamilySetting_MaxMemberCnt) + + getAwardPlayerCount = getAwardPlayerCountDict.get(str(ctgPlayers), 0) + if getAwardPlayerCount >= maxMemberCnt: + GameWorld.DebugLog("仙盟充值互助领奖人数已达上限: actNum=%s,familyID=%s,ctgPlayers=%s,getAwardPlayerCount=%s >= %s" + % (actNum, familyID, ctgPlayers, getAwardPlayerCount, maxMemberCnt), playerID) + return + + getAwardPlayerCount += 1 + getAwardPlayerCountDict[str(ctgPlayers)] = getAwardPlayerCount + + SetFAActPlayerIDInfo(actionData, ctgPlayerIDList, getAwardPlayerCountDict) + GameWorld.Log("仙盟充值互助领奖人数更新: actNum=%s,familyID=%s,ctgPlayers=%s,getAwardPlayerCount=%s, %s" + % (actNum, familyID, ctgPlayers, getAwardPlayerCount, getAwardPlayerCountDict), playerID) + + PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType) + return True + diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py index cb7b7c8..1de01c2 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py @@ -77,6 +77,7 @@ import CrossFamilyFlagwar import CrossActAllRecharge import PlayerActBossTrial +import PlayerActFamilyCTGAssist import ChPyNetSendPack import NetPackCommon import AuctionHouse @@ -1019,6 +1020,16 @@ ret = GameWorldArena.MapServer_Arena(curPlayer, eval(resultName)) resultName = '%s' % ret if ret != None else '' # 需要重置间隔,每次都回复 + # 仙盟充值互助 + if callName == "FamilyCTGAssist": + curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID) + if not curPlayer: + return + ret = PlayerActFamilyCTGAssist.MapServer_FamilyCTGAssist(curPlayer, eval(resultName)) + if ret == None: + return + resultName = '%s' % ret + # 仙盟boss if callName == "FamilyBoss": ret = PlayerFamilyBoss.MapServer_FamilyBoss(eval(resultName), tick) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py index 3e638d3..7c7fc54 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py @@ -290,6 +290,7 @@ OperationActionName_ActLoginNew = "ActLoginNew" # 登录活动-新 OperationActionName_ActTask = "ActTask" # 活动任务 OperationActionName_BuyCountGift = "ActBuyCountGift" # 购买次数礼包活动 +OperationActionName_FamilyCTGAssist = "ActFamilyCTGAssist" # 仙盟充值协助 #节日活动类型列表 - 该类型无视开服天,日期到了就开启 FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket, OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy, @@ -311,7 +312,7 @@ OperationActionName_XianXiaMJ, OperationActionName_GodGift, OperationActionName_BuyOne, OperationActionName_BossTrial, OperationActionName_ActLoginNew, OperationActionName_ActTask, - OperationActionName_BuyCountGift, + OperationActionName_BuyCountGift, OperationActionName_FamilyCTGAssist, ] + FeastOperationActionNameList #需要记录开启活动时的世界等级的运营活动 NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell, @@ -337,7 +338,7 @@ OperationActionName_XianXiaMJ, OperationActionName_GodGift, OperationActionName_BuyOne, OperationActionName_BossTrial, OperationActionName_ActLoginNew, OperationActionName_ActTask, - OperationActionName_BuyCountGift, + OperationActionName_BuyCountGift, OperationActionName_FamilyCTGAssist, ] #跨服运营活动表名定义 @@ -1392,7 +1393,8 @@ Def_ActionType_OfficerModelEquip, #记录家族有职位的成员模型装备信息11 Def_ActionType_FamilyEvent, #记录家族事件12 Def_ActionType_BossTrialSubmit, #boss凭证提交 13 - ) = range(0, 14) + Def_ActionType_FamilyCTGAssist, #仙盟充值协助活动 14 + ) = range(0, 15) # 家族行为事件类型定义; Def_ActionType_FamilyEvent; 存与事件记录Value1 # 通用:time-时间;name-玩家;value1-事件类型 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py index 44f57df..c797b9e 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py @@ -2325,6 +2325,7 @@ 1000 * 10, # 跨服排位 1000 * 10, # 跨服妖魔boss 1000 * 10, # 仙盟阵法 + 1000 * 20, # 仙盟充值互助 ] TYPE_Player_Tick_Count = len(TYPE_Player_Tick_Time) @@ -2406,6 +2407,7 @@ TYPE_Player_Tick_Championship, #跨服排位 TYPE_Player_Tick_CrossYaomoBoss, #跨服妖魔boss TYPE_Player_Tick_FamilyZhenfa, #仙盟阵法 +TYPE_Player_Tick_FamilyCTGAssist, #仙盟充值互助 ) = range(0, TYPE_Player_Tick_Count) #--------------------------------------------------------------------- @@ -3907,6 +3909,10 @@ #买一送多 Def_PDict_BuyOneID = "BuyOneID_%s" # 玩家身上的活动ID,唯一标识,取活动开始日期time,参数(活动编号) Def_PDict_BuyOneFreeItemState = "BuyOneFreeItemState_%s_%s" # 玩家免费礼包领取记录,参数(活动编号,记录索引) + +#仙盟充值互助活动 +Def_PDict_FamilyCTGAssistID = "FamilyCTGAssistID_%s" # 玩家身上的活动ID,唯一标识,取活动开始日期time,参数(活动编号) +Def_PDict_FamilyCTGAssistAward = "FamilyCTGAssistAward_%s" # 玩家领取记录,参数(活动编号) #限时特惠活动 Def_PDict_SpringSaleID = "SpringSaleID_%s" # 玩家身上的限时特惠活动ID,唯一标识,取活动开始日期time,参数(活动编号) @@ -5914,7 +5920,8 @@ Def_RewardType_ActTask, # 领取任务活动奖励71 Def_RewardType_ActBuyCountGift, # 领取购买次数礼包活动 72 Def_RewardType_Guaji, # 领取挂机收益 73 -)= range(74) +Def_RewardType_FamilyCTGAssist, # 仙盟充值互助奖励 74 +)= range(75) #boss复活相关活动定义 BossRebornActIDList = ( diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index f53ab2e..0bc4cf4 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -32764,6 +32764,273 @@ #------------------------------------------------------ +# AA 77 仙盟充值互助活动信息 #tagMCActFamilyCTGAssistInfo + +class tagMCActFamilyCTGAssistItem(Structure): + _pack_ = 1 + _fields_ = [ + ("ItemID", c_int), + ("ItemCount", c_ushort), + ("IsBind", c_ubyte), + ] + + def __init__(self): + self.Clear() + return + + def ReadData(self, stringData, _pos=0, _len=0): + self.Clear() + memmove(addressof(self), stringData[_pos:], self.GetLength()) + return _pos + self.GetLength() + + def Clear(self): + self.ItemID = 0 + self.ItemCount = 0 + self.IsBind = 0 + return + + def GetLength(self): + return sizeof(tagMCActFamilyCTGAssistItem) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 77 仙盟充值互助活动信息 //tagMCActFamilyCTGAssistInfo: + ItemID:%d, + ItemCount:%d, + IsBind:%d + '''\ + %( + self.ItemID, + self.ItemCount, + self.IsBind + ) + return DumpString + + +class tagMCActFamilyCTGAssistAward(Structure): + NeedCTGPlayers = 0 #(BYTE NeedCTGPlayers)//所需充值人数 + RecordIndex = 0 #(BYTE RecordIndex)//对应领奖记录索引 + Count = 0 #(BYTE Count) + AwardItemList = list() #(vector<tagMCActFamilyCTGAssistItem> AwardItemList)// 奖励物品列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.NeedCTGPlayers,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.RecordIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temAwardItemList = tagMCActFamilyCTGAssistItem() + _pos = temAwardItemList.ReadData(_lpData, _pos) + self.AwardItemList.append(temAwardItemList) + return _pos + + def Clear(self): + self.NeedCTGPlayers = 0 + self.RecordIndex = 0 + self.Count = 0 + self.AwardItemList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 1 + length += 1 + for i in range(self.Count): + length += self.AwardItemList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.NeedCTGPlayers) + data = CommFunc.WriteBYTE(data, self.RecordIndex) + data = CommFunc.WriteBYTE(data, self.Count) + for i in range(self.Count): + data = CommFunc.WriteString(data, self.AwardItemList[i].GetLength(), self.AwardItemList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + NeedCTGPlayers:%d, + RecordIndex:%d, + Count:%d, + AwardItemList:%s + '''\ + %( + self.NeedCTGPlayers, + self.RecordIndex, + self.Count, + "..." + ) + return DumpString + + +class tagMCActFamilyCTGAssistInfo(Structure): + Head = tagHead() + ActNum = 0 #(BYTE ActNum)//活动编号 + StartDate = "" #(char StartDate[10])// 开始日期 y-m-d + EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置 + LimitLV = 0 #(WORD LimitLV)// 限制等级 + AwardCount = 0 #(BYTE AwardCount) + AwardInfoList = list() #(vector<tagMCActFamilyCTGAssistAward> AwardInfoList)// 互助奖励列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x77 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10) + self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10) + self.IsDayReset,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.AwardCount): + temAwardInfoList = tagMCActFamilyCTGAssistAward() + _pos = temAwardInfoList.ReadData(_lpData, _pos) + self.AwardInfoList.append(temAwardInfoList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x77 + self.ActNum = 0 + self.StartDate = "" + self.EndtDate = "" + self.IsDayReset = 0 + self.LimitLV = 0 + self.AwardCount = 0 + self.AwardInfoList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + length += 10 + length += 10 + length += 1 + length += 2 + length += 1 + for i in range(self.AwardCount): + length += self.AwardInfoList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.ActNum) + data = CommFunc.WriteString(data, 10, self.StartDate) + data = CommFunc.WriteString(data, 10, self.EndtDate) + data = CommFunc.WriteBYTE(data, self.IsDayReset) + data = CommFunc.WriteWORD(data, self.LimitLV) + data = CommFunc.WriteBYTE(data, self.AwardCount) + for i in range(self.AwardCount): + data = CommFunc.WriteString(data, self.AwardInfoList[i].GetLength(), self.AwardInfoList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + ActNum:%d, + StartDate:%s, + EndtDate:%s, + IsDayReset:%d, + LimitLV:%d, + AwardCount:%d, + AwardInfoList:%s + '''\ + %( + self.Head.OutputString(), + self.ActNum, + self.StartDate, + self.EndtDate, + self.IsDayReset, + self.LimitLV, + self.AwardCount, + "..." + ) + return DumpString + + +m_NAtagMCActFamilyCTGAssistInfo=tagMCActFamilyCTGAssistInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActFamilyCTGAssistInfo.Head.Cmd,m_NAtagMCActFamilyCTGAssistInfo.Head.SubCmd))] = m_NAtagMCActFamilyCTGAssistInfo + + +#------------------------------------------------------ +# AA 78 仙盟充值互助活动玩家信息 #tagMCActFamilyCTGAssistPlayerInfo + +class tagMCActFamilyCTGAssistPlayerInfo(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ActNum", c_ubyte), # 活动编号 + ("AwardRecord", c_int), # 奖励记录,按奖励记录索引位运算判断是否已领取 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xAA + self.SubCmd = 0x78 + return + + def ReadData(self, stringData, _pos=0, _len=0): + self.Clear() + memmove(addressof(self), stringData[_pos:], self.GetLength()) + return _pos + self.GetLength() + + def Clear(self): + self.Cmd = 0xAA + self.SubCmd = 0x78 + self.ActNum = 0 + self.AwardRecord = 0 + return + + def GetLength(self): + return sizeof(tagMCActFamilyCTGAssistPlayerInfo) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 78 仙盟充值互助活动玩家信息 //tagMCActFamilyCTGAssistPlayerInfo: + Cmd:%s, + SubCmd:%s, + ActNum:%d, + AwardRecord:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ActNum, + self.AwardRecord + ) + return DumpString + + +m_NAtagMCActFamilyCTGAssistPlayerInfo=tagMCActFamilyCTGAssistPlayerInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActFamilyCTGAssistPlayerInfo.Cmd,m_NAtagMCActFamilyCTGAssistPlayerInfo.SubCmd))] = m_NAtagMCActFamilyCTGAssistPlayerInfo + + +#------------------------------------------------------ # AA 55 垃圾收集活动信息 #tagMCActGarbageSortingInfo class tagMCActGarbageSortingInfo(Structure): diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py index 02b3e4f..f2b1e46 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py @@ -1369,6 +1369,22 @@ ("dict", "FreeItemInfo", 0), ), + "ActFamilyCTGAssist":( + ("DWORD", "CfgID", 1), + ("char", "StartDate", 0), + ("char", "EndDate", 0), + ("WORD", "LVLimit", 0), + ("BYTE", "IsDayReset", 0), + ("list", "TemplateIDList", 0), + ), + + "ActFamilyCTGAssistTemp":( + ("DWORD", "TemplateID", 1), + ("BYTE", "NeedCTGPlayers", 0), + ("BYTE", "RecordIndex", 0), + ("list", "AwardItemList", 0), + ), + "ActCollectWords":( ("DWORD", "CfgID", 1), ("char", "StartDate", 0), @@ -4239,6 +4255,32 @@ def GetRecordIndex(self): return self.attrTuple[2] # 记录索引 BYTE def GetFreeItemInfo(self): return self.attrTuple[3] # 免费领取的物品信息列表{领取记录索引:[[物品ID,个数,是否拍品]], ...} dict +# 仙盟充值协助活动表 +class IPY_ActFamilyCTGAssist(): + + def __init__(self): + self.attrTuple = None + return + + def GetCfgID(self): return self.attrTuple[0] # 配置ID DWORD + def GetStartDate(self): return self.attrTuple[1] # 开启日期 char + def GetEndDate(self): return self.attrTuple[2] # 结束日期 char + def GetLVLimit(self): return self.attrTuple[3] # 限制等级 WORD + def GetIsDayReset(self): return self.attrTuple[4] # 是否每天重置 BYTE + def GetTemplateIDList(self): return self.attrTuple[5] # 模板ID列表 list + +# 仙盟充值协助活动模板表 +class IPY_ActFamilyCTGAssistTemp(): + + def __init__(self): + self.attrTuple = None + return + + def GetTemplateID(self): return self.attrTuple[0] # 模板ID DWORD + def GetNeedCTGPlayers(self): return self.attrTuple[1] # 需要充值人数 BYTE + def GetRecordIndex(self): return self.attrTuple[2] # 记录索引 BYTE + def GetAwardItemList(self): return self.attrTuple[3] # 奖励物品信息,[[物品ID,个数,是否拍品], ...] list + # 集字活动时间表 class IPY_ActCollectWords(): @@ -4315,7 +4357,7 @@ def GetResetType(self): return self.attrTuple[7] # 重置类型,0-0点重置;1-5点重置 BYTE def GetSubmitItemAwardInfo(self): return self.attrTuple[8] # 提交凭证个数对应奖励 dict def GetSubmitAwardResetType(self): return self.attrTuple[9] # 提交凭证每日重置类型,0-跟随活动; 1-0点重置;2-5点重置 BYTE - def GetActShopType(self): return self.attrTuple[10] # 开放商店 WORD + def GetActShopType(self): return self.attrTuple[10] # 开放商店类型,为0时不开放 WORD def GetTemplateIDList(self): return self.attrTuple[11] # 榜单模板编号列表 list def GetFamilyTemplateIDList(self): return self.attrTuple[12] # 仙盟榜单模板编号列表 list @@ -5861,6 +5903,8 @@ self.__LoadFileData("CostRebateTemplate", onlyCheck) self.__LoadFileData("ActBuyOne", onlyCheck) self.__LoadFileData("ActBuyOneTemplate", onlyCheck) + self.__LoadFileData("ActFamilyCTGAssist", onlyCheck) + self.__LoadFileData("ActFamilyCTGAssistTemp", onlyCheck) self.__LoadFileData("ActCollectWords", onlyCheck) self.__LoadFileData("CollectWordsExchange", onlyCheck) self.__LoadFileData("ActGarbageSorting", onlyCheck) @@ -7048,6 +7092,20 @@ self.CheckLoadData("ActBuyOneTemplate") return self.ipyActBuyOneTemplateCache[index] + def GetActFamilyCTGAssistCount(self): + self.CheckLoadData("ActFamilyCTGAssist") + return self.ipyActFamilyCTGAssistLen + def GetActFamilyCTGAssistByIndex(self, index): + self.CheckLoadData("ActFamilyCTGAssist") + return self.ipyActFamilyCTGAssistCache[index] + + def GetActFamilyCTGAssistTempCount(self): + self.CheckLoadData("ActFamilyCTGAssistTemp") + return self.ipyActFamilyCTGAssistTempLen + def GetActFamilyCTGAssistTempByIndex(self, index): + self.CheckLoadData("ActFamilyCTGAssistTemp") + return self.ipyActFamilyCTGAssistTempCache[index] + def GetActCollectWordsCount(self): self.CheckLoadData("ActCollectWords") return self.ipyActCollectWordsLen diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py index faf0cd3..ab07a77 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py @@ -113,6 +113,7 @@ import PlayerActGarbageSorting import PlayerActXianXiaMJ import PlayerActGodGift +import PlayerActFamilyCTGAssist import PlayerActRechargeRebateGold import PlayerActManyDayRecharge import PlayerActSingleRecharge @@ -821,6 +822,8 @@ PlayerFlashSale.OnPlayerLogin(curPlayer) #买一送多活动 PlayerActBuyOne.OnPlayerLogin(curPlayer) + #仙盟充值互助 + PlayerActFamilyCTGAssist.OnPlayerLogin(curPlayer) #集字活动 PlayerActCollectWords.OnPlayerLogin(curPlayer) # 世界boss @@ -5703,6 +5706,9 @@ # 买一送多活动免费奖励 elif rewardType == ChConfig.Def_RewardType_BuyOne: PlayerActBuyOne.GetBuyOneFreeAward(curPlayer, dataEx, dataExStr) + # 仙盟充值互助活动奖励 + elif rewardType == ChConfig.Def_RewardType_FamilyCTGAssist: + PlayerActFamilyCTGAssist.GetFamilyCTGAssistAward(curPlayer, dataEx, dataExStr) #缥缈奇遇领取 elif rewardType == ChConfig.Def_RewardType_FairyAdventuresAward: PlayerFairyDomain.GetFairyAdventuresAward(curPlayer, dataEx, dataExStr) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActFamilyCTGAssist.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActFamilyCTGAssist.py new file mode 100644 index 0000000..a4520db --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActFamilyCTGAssist.py @@ -0,0 +1,257 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +#------------------------------------------------------------------------------- +# +##@package Player.PlayerActFamilyCTGAssist +# +# @todo:仙盟充值协助 +# @author hxp +# @date 2024-06-21 +# @version 1.0 +# +# 详细描述: 仙盟充值协助 +# +#------------------------------------------------------------------------------- +#"""Version = 2024-06-21 19:30""" +#------------------------------------------------------------------------------- + +import PyGameData +import ShareDefine +import PlayerControl +import IpyGameDataPY +import ChPyNetSendPack +import DataRecordPack +import NetPackCommon +import ItemControler +import IPY_GameWorld +import GameWorld +import ChConfig + +def OnPlayerLogin(curPlayer): + + for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FamilyCTGAssist, {}).values(): + actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) + isReset = __CheckPlayerFamilyCTGAssistAction(curPlayer, actNum) + # 活动中同步活动信息 + if not isReset and actInfo.get(ShareDefine.ActKey_State): + Sync_FamilyCTGAssistActionInfo(curPlayer, actNum) + Sync_FamilyCTGAssistPlayerInfo(curPlayer, actNum) + + return + +def RefreshFamilyCTGAssistActionInfo(actNum): + ## 收到GameServer同步的活动信息,刷新活动信息 + playerManager = GameWorld.GetPlayerManager() + for index in xrange(playerManager.GetPlayerCount()): + curPlayer = playerManager.GetPlayerByIndex(index) + if curPlayer.GetID() == 0: + continue + __CheckPlayerFamilyCTGAssistAction(curPlayer, actNum) + return + + +def __CheckPlayerFamilyCTGAssistAction(curPlayer, actNum): + ## 检查玩活动数据信息 + + playerID = curPlayer.GetPlayerID() + + actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_FamilyCTGAssist, actNum) + actID = actInfo.get(ShareDefine.ActKey_ID, 0) + state = actInfo.get(ShareDefine.ActKey_State, 0) + #cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0) + #dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) + + playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FamilyCTGAssistID % actNum) # 玩家身上的活动ID + + # 活动ID 相同的话不处理 + if actID == playerActID: + GameWorld.DebugLog("仙盟充值协助活动ID不变,不处理! actNum=%s,actID=%s" % (actNum, actID), curPlayer.GetPlayerID()) + return + GameWorld.DebugLog("仙盟充值协助活动重置! actNum=%s,actID=%s,playerActID=%s,state=%s" % (actNum, actID, playerActID, state), playerID) + + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FamilyCTGAssistID % actNum, actID) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FamilyCTGAssistAward % actNum, 0) + + if state: + Sync_FamilyCTGAssistActionInfo(curPlayer, actNum) + Sync_FamilyCTGAssistPlayerInfo(curPlayer, actNum) + + return True + +def OnPlayerCTG(curPlayer): + if not curPlayer.GetFamilyID(): + return + + actNumList = [] + for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FamilyCTGAssist, {}).values(): + actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) + if actInfo.get(ShareDefine.ActKey_State): + actNumList.append(actNum) + + if not actNumList: + return + + SendToGameServer_FamilyCTGAssist(curPlayer, "PlayerCTG", [actNumList]) + return + +def GetFamilyCTGAssistAward(curPlayer, ctgPlayers, actNum): + '''活动免费奖励 + @param ctgPlayers: 要领取的充值人数奖励 + @param actNum: 活动编号,如11 或 12 代表不同的活动 + ''' + playerID = curPlayer.GetPlayerID() + + actNum = GameWorld.ToIntDef(actNum, 0) + if actNum <= 0: + GameWorld.Log("没有指定领取的活动编号! actNum=%s" % actNum, playerID) + return + + actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_FamilyCTGAssist, actNum) + if not actInfo.get(ShareDefine.ActKey_State): + GameWorld.Log("仙盟充值协助非活动中无法领取奖励! actNum=%s" % actNum, playerID) + return + + cfgID = actInfo.get(ShareDefine.ActKey_CfgID) + dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) + ipyData = IpyGameDataPY.GetIpyGameData("ActFamilyCTGAssist", cfgID) + if not ipyData: + return + templateID = GameWorld.GetTemplateID(ipyData, cfgID, dayIndex) + if not templateID: + return + + tempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFamilyCTGAssistTemp", templateID) + if not tempIpyDataList: + return + + recordIndex = None + awardItemList = [] + + for tempIpyData in tempIpyDataList: + if ctgPlayers != tempIpyData.GetNeedCTGPlayers(): + continue + recordIndex = tempIpyData.GetRecordIndex() + awardItemList = tempIpyData.GetAwardItemList() + break + + if recordIndex == None: + GameWorld.ErrLog("仙盟充值协助活动没有该奖励信息! actNum=%s,cfgID=%s,templateID=%s,ctgPlayers=%s" + % (actNum, cfgID, templateID, ctgPlayers), playerID) + return + + awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FamilyCTGAssistAward % actNum) + if awardRecord & pow(2, recordIndex): + GameWorld.Log("仙盟充值协助活动已经领取过该免费奖励! actNum=%s,cfgID=%s,templateID=%s,ctgPlayers=%s,recordIndex=%s" + % (actNum, cfgID, templateID, ctgPlayers, recordIndex), playerID) + return + + # 检查背包 + if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList): + return + + tick = GameWorld.GetGameWorld().GetTick() + if not GameWorld.SetPlayerTickTime(curPlayer, ChConfig.TYPE_Player_Tick_FamilyCTGAssist, tick): + GameWorld.DebugLog("请求CD中...", playerID) + return + + SendToGameServer_FamilyCTGAssist(curPlayer, "FamilyCTGAssistAward", [actNum, ctgPlayers, recordIndex, awardItemList]) + return + +def __DoGiveFamilyCTGAssistAward(curPlayer, dataMsg): + actNum, ctgPlayers, recordIndex, awardItemList = dataMsg + + playerID = curPlayer.GetPlayerID() + awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FamilyCTGAssistAward % actNum) + if awardRecord & pow(2, recordIndex): + GameWorld.DebugLog("返回时仙盟充值协助活动已经领取过该免费奖励! actNum=%s,ctgPlayers=%s,recordIndex=%s" + % (actNum, ctgPlayers, recordIndex), playerID) + return + + awardRecord |= pow(2, recordIndex) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FamilyCTGAssistAward % actNum, awardRecord) + Sync_FamilyCTGAssistPlayerInfo(curPlayer, actNum) + + for itemID, itemCount, isAuctionItem in awardItemList: + ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem]) + + addDataDict = {"actNum":actNum, "ctgPlayers":ctgPlayers, "recordIndex":recordIndex, "awardItemList":awardItemList} + DataRecordPack.DR_FuncGiveItem(curPlayer, "ActFamilyCTGAssist", addDataDict) + GameWorld.Log("仙盟充值协助活动领取奖励! actNum=%s,ctgPlayers=%s,recordIndex=%s,updAwardRecord=%s,awardItemList=%s" + % (actNum, ctgPlayers, recordIndex, awardRecord, awardItemList), playerID) + return + +def SendToGameServer_FamilyCTGAssist(curPlayer, msgType, dataMsg=""): + playerID = curPlayer.GetPlayerID() + msgList = str([msgType, dataMsg]) + GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(playerID, 0, 0, "FamilyCTGAssist", msgList, len(msgList)) + GameWorld.Log("仙盟充值互助发送GameServer: %s, %s" % (msgType, dataMsg), playerID) + return + +def GameServer_FamilyCTGAssist(curPlayer, msgData, tick): + + msgType, dataMsg, ret = msgData + + if not ret: + return + + if msgType == "FamilyCTGAssistAward": + __DoGiveFamilyCTGAssistAward(curPlayer, dataMsg) + + return + +def Sync_FamilyCTGAssistPlayerInfo(curPlayer, actNum): + ## 通知玩家数据信息 + clientPack = ChPyNetSendPack.tagMCActFamilyCTGAssistPlayerInfo() + clientPack.ActNum = actNum + clientPack.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FamilyCTGAssistAward % actNum) + NetPackCommon.SendFakePack(curPlayer, clientPack) + return + +def Sync_FamilyCTGAssistActionInfo(curPlayer, actNum): + ## 通知活动信息 + + actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_FamilyCTGAssist, actNum) + if not actInfo.get(ShareDefine.ActKey_State): + return + + cfgID = actInfo.get(ShareDefine.ActKey_CfgID) + dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) + ipyData = IpyGameDataPY.GetIpyGameData("ActFamilyCTGAssist", cfgID) + if not ipyData: + return + templateID = GameWorld.GetTemplateID(ipyData, cfgID, dayIndex) + if not templateID: + return + tempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFamilyCTGAssistTemp", templateID) + if not tempIpyDataList: + return + + startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData) + startDateSync = actInfo.get(ShareDefine.ActKey_StartDateSync, startDateStr) + actInfo = ChPyNetSendPack.tagMCActFamilyCTGAssistInfo() + actInfo.ActNum = actNum + actInfo.StartDate = startDateSync + actInfo.EndtDate = endDateStr + actInfo.LimitLV = ipyData.GetLVLimit() + actInfo.IsDayReset = ipyData.GetIsDayReset() + actInfo.AwardInfoList = [] + + for tempIpyData in tempIpyDataList: + award = ChPyNetSendPack.tagMCActFamilyCTGAssistAward() + award.NeedCTGPlayers = tempIpyData.GetNeedCTGPlayers() + award.RecordIndex = tempIpyData.GetRecordIndex() + award.AwardItemList = [] + + for itemID, itemCount, isAuctionItem in tempIpyData.GetAwardItemList(): + item = ChPyNetSendPack.tagMCActFamilyCTGAssistItem() + item.ItemID = itemID + item.ItemCount = itemCount + item.IsBind = isAuctionItem + award.AwardItemList.append(item) + award.Count = len(award.AwardItemList) + + actInfo.AwardInfoList.append(award) + + actInfo.AwardCount = len(actInfo.AwardInfoList) + NetPackCommon.SendFakePack(curPlayer, actInfo) + return diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py index 17e28ac..138af15 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py @@ -50,6 +50,7 @@ import PlayerActTotalRecharge import PlayerActGarbageSorting import PlayerActRechargeRebateGold +import PlayerActFamilyCTGAssist import PlayerActManyDayRecharge import PlayerActSingleRecharge import PlayerActRechargePrize @@ -683,6 +684,7 @@ PlayerActTurntable.OnPlayerRecharge(curPlayer, orderCoin, coinType) # 转盘 PlayerFairyCeremony.AddFCCTGRMB(curPlayer, orderCoin) PlayerNewFairyCeremony.AddFCCostGold(curPlayer, orderCoin) + PlayerActFamilyCTGAssist.OnPlayerCTG(curPlayer) #开服活动 #OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin) PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Recharge, addVIPExp) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py index c3a687a..68372d8 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py @@ -83,6 +83,7 @@ import PlayerActGarbageSorting import PlayerActXianXiaMJ import PlayerActGodGift +import PlayerActFamilyCTGAssist import PlayerActRechargeRebateGold import PlayerActManyDayRecharge import PlayerActSingleRecharge @@ -1448,6 +1449,9 @@ elif actionName == ShareDefine.OperationActionName_BuyOne: PlayerActBuyOne.RefreshBuyOneActionInfo(actNum) + elif actionName == ShareDefine.OperationActionName_FamilyCTGAssist: + PlayerActFamilyCTGAssist.RefreshFamilyCTGAssistActionInfo(actNum) + elif actionName == ShareDefine.OperationActionName_FairyCeremony: PlayerFairyCeremony.RefreshOperationAction_FairyCeremony() diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FamilyCTGAssist.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FamilyCTGAssist.py new file mode 100644 index 0000000..a6f419a --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FamilyCTGAssist.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +#------------------------------------------------------------------------------- +# +##@package Player.RemoteQuery.GY_Query_FamilyCTGAssist +# +# @todo:仙盟充值互助 +# @author hxp +# @date 2024-06-21 +# @version 1.0 +# +# 详细描述: 仙盟充值互助 +# +#------------------------------------------------------------------------------- +#"""Version = 2024-06-21 19:30""" +#------------------------------------------------------------------------------- + +import GameWorld +import PlayerActFamilyCTGAssist +import ChConfig + +#--------------------------------------------------------------------- +#逻辑实现 +## 请求逻辑 +# @param query_Type 请求类型 +# @param query_ID 请求的玩家ID +# @param packCMDList 发包命令 [ ] +# @param tick 当前时间 +# @return "True" or "False" or "" +# @remarks 函数详细说明. +def DoLogic(query_Type, query_ID, packCMDList, tick): + return "" + +#--------------------------------------------------------------------- +#执行结果 +## 执行结果 +# @param curPlayer 发出请求的玩家 +# @param callFunName 功能名称 +# @param funResult 查询的结果 +# @param tick 当前时间 +# @return None +# @remarks 函数详细说明. +def DoResult(curPlayer, callFunName, funResult, tick): + curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_FamilyCTGAssist, 0) + GameWorld.DebugLog("GY_Query_FamilyCTGAssist DoResult %s" % str(funResult), curPlayer.GetPlayerID()) + if funResult != "": + PlayerActFamilyCTGAssist.GameServer_FamilyCTGAssist(curPlayer, eval(funResult), tick) + return + diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py index 3e638d3..7c7fc54 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py @@ -290,6 +290,7 @@ OperationActionName_ActLoginNew = "ActLoginNew" # 登录活动-新 OperationActionName_ActTask = "ActTask" # 活动任务 OperationActionName_BuyCountGift = "ActBuyCountGift" # 购买次数礼包活动 +OperationActionName_FamilyCTGAssist = "ActFamilyCTGAssist" # 仙盟充值协助 #节日活动类型列表 - 该类型无视开服天,日期到了就开启 FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket, OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy, @@ -311,7 +312,7 @@ OperationActionName_XianXiaMJ, OperationActionName_GodGift, OperationActionName_BuyOne, OperationActionName_BossTrial, OperationActionName_ActLoginNew, OperationActionName_ActTask, - OperationActionName_BuyCountGift, + OperationActionName_BuyCountGift, OperationActionName_FamilyCTGAssist, ] + FeastOperationActionNameList #需要记录开启活动时的世界等级的运营活动 NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell, @@ -337,7 +338,7 @@ OperationActionName_XianXiaMJ, OperationActionName_GodGift, OperationActionName_BuyOne, OperationActionName_BossTrial, OperationActionName_ActLoginNew, OperationActionName_ActTask, - OperationActionName_BuyCountGift, + OperationActionName_BuyCountGift, OperationActionName_FamilyCTGAssist, ] #跨服运营活动表名定义 @@ -1392,7 +1393,8 @@ Def_ActionType_OfficerModelEquip, #记录家族有职位的成员模型装备信息11 Def_ActionType_FamilyEvent, #记录家族事件12 Def_ActionType_BossTrialSubmit, #boss凭证提交 13 - ) = range(0, 14) + Def_ActionType_FamilyCTGAssist, #仙盟充值协助活动 14 + ) = range(0, 15) # 家族行为事件类型定义; Def_ActionType_FamilyEvent; 存与事件记录Value1 # 通用:time-时间;name-玩家;value1-事件类型 -- Gitblit v1.8.0