From 9f30bc4785beb84ff4ab1504a2279b4a82f9ebd1 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 11 十一月 2024 17:56:03 +0800 Subject: [PATCH] 10297 【越南】【英语】【砍树】【tqxbqy】轮回殿-服务端 --- ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 33 + ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLunhuidian.py | 269 ++++++++++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 357 ++++++++++++++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py | 3 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 357 ++++++++++++++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 58 +++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 6 PySysDB/PySysDBPY.h | 22 + ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4 PySysDB/PySysDBG.h | 13 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 9 14 files changed, 1,139 insertions(+), 1 deletions(-) diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h index 23311ec..0d0fe41 100644 --- a/PySysDB/PySysDBG.h +++ b/PySysDB/PySysDBG.h @@ -1192,6 +1192,19 @@ BYTE ResetType; //重置类型,0-0点重置;1-5点重置 }; +//轮回殿活动时间表 + +struct tagActLunhuidian +{ + DWORD _CfgID; //配置ID + list PlatformList; //活动平台列表["平台A", "平台A", ...],配[]代表所有 + list ServerGroupIDList; //服务器ID列表 + BYTE ActNum; //活动分组编号, 活动类型 * 10 + 不同界面编号 + char StartDate; //开启日期 + char EndDate; //结束日期 + BYTE ResetType; //重置类型,0-0点重置;1-5点重置 +}; + //购买次数礼包活动时间表 struct tagActBuyCountGift diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h index 823074e..eff47cc 100644 --- a/PySysDB/PySysDBPY.h +++ b/PySysDB/PySysDBPY.h @@ -2674,6 +2674,28 @@ DWORD TreasureType; //商城类型 }; +//轮回殿活动时间表 + +struct tagActLunhuidian +{ + DWORD _CfgID; //配置ID + char StartDate; //开启日期 + char EndDate; //结束日期 + WORD LVLimit; //限制等级 + BYTE ResetType; //重置类型,0-0点重置;1-5点重置 + dict RoundSetInfo; //开放轮回设定 +}; + +//轮回殿活动奖励表 + +struct tagActLunhuidianAward +{ + BYTE _RoundType; //轮回类型 + DWORD NeedValue; //奖励所需值 + BYTE AwardIndex; //奖励记录索引 0~30 + list AwardItemList; //奖励物品信息列表 [[物品ID,个数,是否拍品],...] +}; + //购买次数礼包活动时间表 struct tagActBuyCountGift diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py index 5709403..2c3f608 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py @@ -38322,6 +38322,363 @@ #------------------------------------------------------ +# AA 88 轮回殿活动信息 #tagMCActLunhuidianInfo + +class tagMCActLunhuidianItem(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(tagMCActLunhuidianItem) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 88 轮回殿活动信息 //tagMCActLunhuidianInfo: + ItemID:%d, + ItemCount:%d, + IsBind:%d + '''\ + %( + self.ItemID, + self.ItemCount, + self.IsBind + ) + return DumpString + + +class tagMCActLunhuidianAward(Structure): + AwardIndex = 0 #(BYTE AwardIndex)// 奖励记录索引 0~30 + NeedValue = 0 #(DWORD NeedValue)// 奖励所需值 + Count = 0 #(BYTE Count)// 奖励物品数 + AwardItemList = list() #(vector<tagMCActLunhuidianItem> AwardItemList)// 奖励物品列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.AwardIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.NeedValue,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temAwardItemList = tagMCActLunhuidianItem() + _pos = temAwardItemList.ReadData(_lpData, _pos) + self.AwardItemList.append(temAwardItemList) + return _pos + + def Clear(self): + self.AwardIndex = 0 + self.NeedValue = 0 + self.Count = 0 + self.AwardItemList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 4 + length += 1 + for i in range(self.Count): + length += self.AwardItemList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.AwardIndex) + data = CommFunc.WriteDWORD(data, self.NeedValue) + 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 = ''' + AwardIndex:%d, + NeedValue:%d, + Count:%d, + AwardItemList:%s + '''\ + %( + self.AwardIndex, + self.NeedValue, + self.Count, + "..." + ) + return DumpString + + +class tagMCActLunhuidianRound(Structure): + RoundType = 0 #(BYTE RoundType)// 轮回类型 + AwardType = 0 #(BYTE AwardType)// 奖励类型 1-消耗货币;2-寻宝次数 + AwardTypeValue = 0 #(DWORD AwardTypeValue)// 奖励类型对应值,消耗货币时为对应的货币类型,寻宝时为对应的寻宝类型 + RoundMax = 0 #(BYTE RoundMax)// 最大可循环轮次 + AwardCount = 0 #(BYTE AwardCount) + AwardList = list() #(vector<tagMCActLunhuidianAward> AwardList)// 每轮奖励列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.RoundType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.AwardType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.AwardTypeValue,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.RoundMax,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.AwardCount): + temAwardList = tagMCActLunhuidianAward() + _pos = temAwardList.ReadData(_lpData, _pos) + self.AwardList.append(temAwardList) + return _pos + + def Clear(self): + self.RoundType = 0 + self.AwardType = 0 + self.AwardTypeValue = 0 + self.RoundMax = 0 + self.AwardCount = 0 + self.AwardList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 1 + length += 4 + length += 1 + length += 1 + for i in range(self.AwardCount): + length += self.AwardList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.RoundType) + data = CommFunc.WriteBYTE(data, self.AwardType) + data = CommFunc.WriteDWORD(data, self.AwardTypeValue) + data = CommFunc.WriteBYTE(data, self.RoundMax) + data = CommFunc.WriteBYTE(data, self.AwardCount) + for i in range(self.AwardCount): + data = CommFunc.WriteString(data, self.AwardList[i].GetLength(), self.AwardList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + RoundType:%d, + AwardType:%d, + AwardTypeValue:%d, + RoundMax:%d, + AwardCount:%d, + AwardList:%s + '''\ + %( + self.RoundType, + self.AwardType, + self.AwardTypeValue, + self.RoundMax, + self.AwardCount, + "..." + ) + return DumpString + + +class tagMCActLunhuidianInfo(Structure): + Head = tagHead() + ActNum = 0 #(BYTE ActNum)// 活动编号 + StartDate = "" #(char StartDate[10])// 开始日期 y-m-d + EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置 + LimitLV = 0 #(WORD LimitLV)// 限制等级 + RoundCount = 0 #(BYTE RoundCount) + RoundList = list() #(vector<tagMCActLunhuidianRound> RoundList)// 轮回列表,支持多个不同类型轮回同时开启 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x88 + 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.ResetType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.RoundCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.RoundCount): + temRoundList = tagMCActLunhuidianRound() + _pos = temRoundList.ReadData(_lpData, _pos) + self.RoundList.append(temRoundList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x88 + self.ActNum = 0 + self.StartDate = "" + self.EndtDate = "" + self.ResetType = 0 + self.LimitLV = 0 + self.RoundCount = 0 + self.RoundList = 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.RoundCount): + length += self.RoundList[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.ResetType) + data = CommFunc.WriteWORD(data, self.LimitLV) + data = CommFunc.WriteBYTE(data, self.RoundCount) + for i in range(self.RoundCount): + data = CommFunc.WriteString(data, self.RoundList[i].GetLength(), self.RoundList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + ActNum:%d, + StartDate:%s, + EndtDate:%s, + ResetType:%d, + LimitLV:%d, + RoundCount:%d, + RoundList:%s + '''\ + %( + self.Head.OutputString(), + self.ActNum, + self.StartDate, + self.EndtDate, + self.ResetType, + self.LimitLV, + self.RoundCount, + "..." + ) + return DumpString + + +m_NAtagMCActLunhuidianInfo=tagMCActLunhuidianInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLunhuidianInfo.Head.Cmd,m_NAtagMCActLunhuidianInfo.Head.SubCmd))] = m_NAtagMCActLunhuidianInfo + + +#------------------------------------------------------ +# AA 89 轮回殿活动玩家信息 #tagMCActLunhuidianPlayerInfo + +class tagMCActLunhuidianPlayerInfo(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ActNum", c_ubyte), # 活动编号 + ("RoundType", c_ubyte), # 轮回类型 + ("CurRound", c_ubyte), # 当前轮次 + ("CurValue", c_int), # 累计值 + ("AwardRecord", c_int), # 当前轮次奖励领奖记录,按奖励索引二进制位存储是否已领取,所有奖励已领取后自动进入下一轮,且重置该奖励状态 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xAA + self.SubCmd = 0x89 + 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 = 0x89 + self.ActNum = 0 + self.RoundType = 0 + self.CurRound = 0 + self.CurValue = 0 + self.AwardRecord = 0 + return + + def GetLength(self): + return sizeof(tagMCActLunhuidianPlayerInfo) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 89 轮回殿活动玩家信息 //tagMCActLunhuidianPlayerInfo: + Cmd:%s, + SubCmd:%s, + ActNum:%d, + RoundType:%d, + CurRound:%d, + CurValue:%d, + AwardRecord:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ActNum, + self.RoundType, + self.CurRound, + self.CurValue, + self.AwardRecord + ) + return DumpString + + +m_NAtagMCActLunhuidianPlayerInfo=tagMCActLunhuidianPlayerInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLunhuidianPlayerInfo.Cmd,m_NAtagMCActLunhuidianPlayerInfo.SubCmd))] = m_NAtagMCActLunhuidianPlayerInfo + + +#------------------------------------------------------ # AA 48 多日连充活动信息 #tagMCActManyDayRechargeInfo class tagMCActManyDayRechargeItem(Structure): diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py index 7e446ed..1eb464e 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py @@ -958,6 +958,16 @@ ("BYTE", "ResetType", 0), ), + "ActLunhuidian":( + ("DWORD", "CfgID", 1), + ("list", "PlatformList", 0), + ("list", "ServerGroupIDList", 0), + ("BYTE", "ActNum", 0), + ("char", "StartDate", 0), + ("char", "EndDate", 0), + ("BYTE", "ResetType", 0), + ), + "ActBuyCountGift":( ("DWORD", "CfgID", 1), ("list", "PlatformList", 0), @@ -2575,6 +2585,21 @@ def GetEndDate(self): return self.attrTuple[5] # 结束日期 char def GetResetType(self): return self.attrTuple[6] # 重置类型,0-0点重置;1-5点重置 BYTE +# 轮回殿活动时间表 +class IPY_ActLunhuidian(): + + 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 GetResetType(self): return self.attrTuple[6] # 重置类型,0-0点重置;1-5点重置 BYTE + # 购买次数礼包活动时间表 class IPY_ActBuyCountGift(): @@ -3079,6 +3104,7 @@ self.__LoadFileData("CrossFamilyFlagwarZoneMap", onlyCheck) self.__LoadFileData("ActWeekParty", onlyCheck) self.__LoadFileData("ActYunshi", onlyCheck) + self.__LoadFileData("ActLunhuidian", onlyCheck) self.__LoadFileData("ActBuyCountGift", onlyCheck) self.__LoadFileData("ActTask", onlyCheck) self.__LoadFileData("ActLoginNew", onlyCheck) @@ -3930,6 +3956,13 @@ self.CheckLoadData("ActYunshi") return self.ipyActYunshiCache[index] + def GetActLunhuidianCount(self): + self.CheckLoadData("ActLunhuidian") + return self.ipyActLunhuidianLen + def GetActLunhuidianByIndex(self, index): + self.CheckLoadData("ActLunhuidian") + return self.ipyActLunhuidianCache[index] + def GetActBuyCountGiftCount(self): self.CheckLoadData("ActBuyCountGift") return self.ipyActBuyCountGiftLen diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py index 2cc0d68..0fca079 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py @@ -297,6 +297,7 @@ OperationActionName_Gubao = "ActGubao" # 古宝养成活动 OperationActionName_HorsePetTrain = "ActHorsePetTrain" # 骑宠养成活动 OperationActionName_Yunshi = "ActYunshi" # 运势活动 +OperationActionName_Lunhuidian = "ActLunhuidian" # 轮回殿活动 #节日活动类型列表 - 该类型无视开服天,日期到了就开启 FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket, OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy, @@ -320,6 +321,7 @@ OperationActionName_ActLoginNew, OperationActionName_ActTask, OperationActionName_BuyCountGift, OperationActionName_FamilyCTGAssist, OperationActionName_Gubao, OperationActionName_HorsePetTrain, OperationActionName_Yunshi, + OperationActionName_Lunhuidian, ] + FeastOperationActionNameList #需要记录开启活动时的世界等级的运营活动 NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell, @@ -347,6 +349,7 @@ OperationActionName_ActLoginNew, OperationActionName_ActTask, OperationActionName_BuyCountGift, OperationActionName_FamilyCTGAssist, OperationActionName_Gubao, OperationActionName_HorsePetTrain, OperationActionName_Yunshi, + OperationActionName_Lunhuidian, ] #跨服运营活动表名定义 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py index 9105b74..432d841 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py @@ -4201,6 +4201,12 @@ Def_PDict_ActYunshiID = "ActYunshiID_%s" # 玩家身上的活动ID,唯一标识,取活动开始日期time值,参数:(活动编号) Def_PDict_ActYunshiTreasureType = "ActYunshiTreasureType_%s" # 活动寻宝类型,参数:(活动编号) +#轮回殿活动 +Def_PDict_ActLunhuidianID = "ActLunhuidianID_%s" # 玩家身上的活动ID,唯一标识,取活动开始日期time值,参数:(活动编号) +Def_PDict_ActLunhuidianValue = "ActLunhuidianValue_%s_%s" # 活动当前累计值,参数:(活动编号, 轮回类型) +Def_PDict_ActLunhuidianRound = "ActLunhuidianRound_%s_%s" # 活动当前轮次,参数:(活动编号, 轮回类型) +Def_PDict_ActLunhuidianAward = "ActLunhuidianAward_%s_%s" # 领奖记录,按奖励索引二进制记录是否已领取,参数:(活动编号, 轮回类型) + #购买次数礼包活动 Def_PDict_BuyCountGiftID = "BuyCountGiftID_%s" # 玩家身上的活动ID,唯一标识,取活动开始日期time,参数(活动编号) Def_PDict_BuyCountGiftAward = "BuyCountGiftAward_%s" # 礼包奖励记录,按位记录是否已领取,参数(活动编号) @@ -6040,7 +6046,8 @@ Def_RewardType_TiandaoTree, # 仙宫天道树奖励 75 Def_RewardType_OpenServerDailyAward, # 开服每日奖励 76 Def_RewardType_TreasureCntAward, # 寻宝累计次数奖励 77 -)= range(78) +Def_RewardType_LunhuidianAward, # 轮回殿奖励 78 +)= range(79) #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 5709403..2c3f608 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -38322,6 +38322,363 @@ #------------------------------------------------------ +# AA 88 轮回殿活动信息 #tagMCActLunhuidianInfo + +class tagMCActLunhuidianItem(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(tagMCActLunhuidianItem) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 88 轮回殿活动信息 //tagMCActLunhuidianInfo: + ItemID:%d, + ItemCount:%d, + IsBind:%d + '''\ + %( + self.ItemID, + self.ItemCount, + self.IsBind + ) + return DumpString + + +class tagMCActLunhuidianAward(Structure): + AwardIndex = 0 #(BYTE AwardIndex)// 奖励记录索引 0~30 + NeedValue = 0 #(DWORD NeedValue)// 奖励所需值 + Count = 0 #(BYTE Count)// 奖励物品数 + AwardItemList = list() #(vector<tagMCActLunhuidianItem> AwardItemList)// 奖励物品列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.AwardIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.NeedValue,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temAwardItemList = tagMCActLunhuidianItem() + _pos = temAwardItemList.ReadData(_lpData, _pos) + self.AwardItemList.append(temAwardItemList) + return _pos + + def Clear(self): + self.AwardIndex = 0 + self.NeedValue = 0 + self.Count = 0 + self.AwardItemList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 4 + length += 1 + for i in range(self.Count): + length += self.AwardItemList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.AwardIndex) + data = CommFunc.WriteDWORD(data, self.NeedValue) + 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 = ''' + AwardIndex:%d, + NeedValue:%d, + Count:%d, + AwardItemList:%s + '''\ + %( + self.AwardIndex, + self.NeedValue, + self.Count, + "..." + ) + return DumpString + + +class tagMCActLunhuidianRound(Structure): + RoundType = 0 #(BYTE RoundType)// 轮回类型 + AwardType = 0 #(BYTE AwardType)// 奖励类型 1-消耗货币;2-寻宝次数 + AwardTypeValue = 0 #(DWORD AwardTypeValue)// 奖励类型对应值,消耗货币时为对应的货币类型,寻宝时为对应的寻宝类型 + RoundMax = 0 #(BYTE RoundMax)// 最大可循环轮次 + AwardCount = 0 #(BYTE AwardCount) + AwardList = list() #(vector<tagMCActLunhuidianAward> AwardList)// 每轮奖励列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.RoundType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.AwardType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.AwardTypeValue,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.RoundMax,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.AwardCount): + temAwardList = tagMCActLunhuidianAward() + _pos = temAwardList.ReadData(_lpData, _pos) + self.AwardList.append(temAwardList) + return _pos + + def Clear(self): + self.RoundType = 0 + self.AwardType = 0 + self.AwardTypeValue = 0 + self.RoundMax = 0 + self.AwardCount = 0 + self.AwardList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 1 + length += 4 + length += 1 + length += 1 + for i in range(self.AwardCount): + length += self.AwardList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.RoundType) + data = CommFunc.WriteBYTE(data, self.AwardType) + data = CommFunc.WriteDWORD(data, self.AwardTypeValue) + data = CommFunc.WriteBYTE(data, self.RoundMax) + data = CommFunc.WriteBYTE(data, self.AwardCount) + for i in range(self.AwardCount): + data = CommFunc.WriteString(data, self.AwardList[i].GetLength(), self.AwardList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + RoundType:%d, + AwardType:%d, + AwardTypeValue:%d, + RoundMax:%d, + AwardCount:%d, + AwardList:%s + '''\ + %( + self.RoundType, + self.AwardType, + self.AwardTypeValue, + self.RoundMax, + self.AwardCount, + "..." + ) + return DumpString + + +class tagMCActLunhuidianInfo(Structure): + Head = tagHead() + ActNum = 0 #(BYTE ActNum)// 活动编号 + StartDate = "" #(char StartDate[10])// 开始日期 y-m-d + EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置 + LimitLV = 0 #(WORD LimitLV)// 限制等级 + RoundCount = 0 #(BYTE RoundCount) + RoundList = list() #(vector<tagMCActLunhuidianRound> RoundList)// 轮回列表,支持多个不同类型轮回同时开启 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x88 + 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.ResetType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.RoundCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.RoundCount): + temRoundList = tagMCActLunhuidianRound() + _pos = temRoundList.ReadData(_lpData, _pos) + self.RoundList.append(temRoundList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x88 + self.ActNum = 0 + self.StartDate = "" + self.EndtDate = "" + self.ResetType = 0 + self.LimitLV = 0 + self.RoundCount = 0 + self.RoundList = 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.RoundCount): + length += self.RoundList[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.ResetType) + data = CommFunc.WriteWORD(data, self.LimitLV) + data = CommFunc.WriteBYTE(data, self.RoundCount) + for i in range(self.RoundCount): + data = CommFunc.WriteString(data, self.RoundList[i].GetLength(), self.RoundList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + ActNum:%d, + StartDate:%s, + EndtDate:%s, + ResetType:%d, + LimitLV:%d, + RoundCount:%d, + RoundList:%s + '''\ + %( + self.Head.OutputString(), + self.ActNum, + self.StartDate, + self.EndtDate, + self.ResetType, + self.LimitLV, + self.RoundCount, + "..." + ) + return DumpString + + +m_NAtagMCActLunhuidianInfo=tagMCActLunhuidianInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLunhuidianInfo.Head.Cmd,m_NAtagMCActLunhuidianInfo.Head.SubCmd))] = m_NAtagMCActLunhuidianInfo + + +#------------------------------------------------------ +# AA 89 轮回殿活动玩家信息 #tagMCActLunhuidianPlayerInfo + +class tagMCActLunhuidianPlayerInfo(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ActNum", c_ubyte), # 活动编号 + ("RoundType", c_ubyte), # 轮回类型 + ("CurRound", c_ubyte), # 当前轮次 + ("CurValue", c_int), # 累计值 + ("AwardRecord", c_int), # 当前轮次奖励领奖记录,按奖励索引二进制位存储是否已领取,所有奖励已领取后自动进入下一轮,且重置该奖励状态 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xAA + self.SubCmd = 0x89 + 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 = 0x89 + self.ActNum = 0 + self.RoundType = 0 + self.CurRound = 0 + self.CurValue = 0 + self.AwardRecord = 0 + return + + def GetLength(self): + return sizeof(tagMCActLunhuidianPlayerInfo) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 89 轮回殿活动玩家信息 //tagMCActLunhuidianPlayerInfo: + Cmd:%s, + SubCmd:%s, + ActNum:%d, + RoundType:%d, + CurRound:%d, + CurValue:%d, + AwardRecord:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ActNum, + self.RoundType, + self.CurRound, + self.CurValue, + self.AwardRecord + ) + return DumpString + + +m_NAtagMCActLunhuidianPlayerInfo=tagMCActLunhuidianPlayerInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLunhuidianPlayerInfo.Cmd,m_NAtagMCActLunhuidianPlayerInfo.SubCmd))] = m_NAtagMCActLunhuidianPlayerInfo + + +#------------------------------------------------------ # AA 48 多日连充活动信息 #tagMCActManyDayRechargeInfo class tagMCActManyDayRechargeItem(Structure): diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py index 6352007..b096221 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py @@ -2083,6 +2083,22 @@ ("DWORD", "TreasureType", 0), ), + "ActLunhuidian":( + ("DWORD", "CfgID", 1), + ("char", "StartDate", 0), + ("char", "EndDate", 0), + ("WORD", "LVLimit", 0), + ("BYTE", "ResetType", 0), + ("dict", "RoundSetInfo", 0), + ), + + "ActLunhuidianAward":( + ("BYTE", "RoundType", 1), + ("DWORD", "NeedValue", 0), + ("BYTE", "AwardIndex", 0), + ("list", "AwardItemList", 0), + ), + "ActBuyCountGift":( ("DWORD", "CfgID", 1), ("char", "StartDate", 0), @@ -5599,6 +5615,32 @@ def GetResetType(self): return self.attrTuple[4] # 重置类型,0-0点重置;1-5点重置 BYTE def GetTreasureType(self): return self.attrTuple[5] # 商城类型 DWORD +# 轮回殿活动时间表 +class IPY_ActLunhuidian(): + + 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 GetResetType(self): return self.attrTuple[4] # 重置类型,0-0点重置;1-5点重置 BYTE + def GetRoundSetInfo(self): return self.attrTuple[5] # 开放轮回设定 dict + +# 轮回殿活动奖励表 +class IPY_ActLunhuidianAward(): + + def __init__(self): + self.attrTuple = None + return + + def GetRoundType(self): return self.attrTuple[0] # 轮回类型 BYTE + def GetNeedValue(self): return self.attrTuple[1] # 奖励所需值 DWORD + def GetAwardIndex(self): return self.attrTuple[2] # 奖励记录索引 0~30 BYTE + def GetAwardItemList(self): return self.attrTuple[3] # 奖励物品信息列表 [[物品ID,个数,是否拍品],...] list + # 购买次数礼包活动时间表 class IPY_ActBuyCountGift(): @@ -6577,6 +6619,8 @@ self.__LoadFileData("ActWeekParty", onlyCheck) self.__LoadFileData("WeekParty", onlyCheck) self.__LoadFileData("ActYunshi", onlyCheck) + self.__LoadFileData("ActLunhuidian", onlyCheck) + self.__LoadFileData("ActLunhuidianAward", onlyCheck) self.__LoadFileData("ActBuyCountGift", onlyCheck) self.__LoadFileData("ActTask", onlyCheck) self.__LoadFileData("ActTaskTemp", onlyCheck) @@ -8265,6 +8309,20 @@ self.CheckLoadData("ActYunshi") return self.ipyActYunshiCache[index] + def GetActLunhuidianCount(self): + self.CheckLoadData("ActLunhuidian") + return self.ipyActLunhuidianLen + def GetActLunhuidianByIndex(self, index): + self.CheckLoadData("ActLunhuidian") + return self.ipyActLunhuidianCache[index] + + def GetActLunhuidianAwardCount(self): + self.CheckLoadData("ActLunhuidianAward") + return self.ipyActLunhuidianAwardLen + def GetActLunhuidianAwardByIndex(self, index): + self.CheckLoadData("ActLunhuidianAward") + return self.ipyActLunhuidianAwardCache[index] + def GetActBuyCountGiftCount(self): self.CheckLoadData("ActBuyCountGift") return self.ipyActBuyCountGiftLen 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 3cad6b4..4ab45e1 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py @@ -167,6 +167,7 @@ import PlayerMineArea import PlayerActLoginNew import PlayerActBuyCountGift +import PlayerActLunhuidian import PlayerActYunshi import PlayerActTask @@ -885,6 +886,8 @@ PlayerActTask.OnPlayerLogin(curPlayer) # 运势活动 PlayerActYunshi.OnPlayerLogin(curPlayer) + # 轮回殿活动 + PlayerActLunhuidian.OnPlayerLogin(curPlayer) # 登录活动 PlayerActLoginNew.OnPlayerLogin(curPlayer) # 节日巡礼活动 @@ -5696,6 +5699,9 @@ # 寻宝累计次数奖励 elif rewardType == ChConfig.Def_RewardType_TreasureCntAward: PlayerTreasure.GetTreasureCntAward(curPlayer, dataEx, dataExStr) + # 轮回殿奖励 + elif rewardType == ChConfig.Def_RewardType_LunhuidianAward: + PlayerActLunhuidian.GetLunhuidianAward(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/PlayerActLunhuidian.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLunhuidian.py new file mode 100644 index 0000000..4ae3247 --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLunhuidian.py @@ -0,0 +1,269 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +#------------------------------------------------------------------------------- +# +##@package Player.PlayerActLunhuidian +# +# @todo:轮回殿 +# @author hxp +# @date 2024-11-11 +# @version 1.0 +# +# 详细描述: 轮回殿 +# +#------------------------------------------------------------------------------- +#"""Version = 2024-11-11 18:00""" +#------------------------------------------------------------------------------- + +import PyGameData +import ShareDefine +import PlayerControl +import IpyGameDataPY +import ChPyNetSendPack +import NetPackCommon +import ItemControler +import GameWorld +import ChConfig + +# 轮回设定配置索引 +RoundSetIndex = ( +RoundSetIndex_AwardType, # 0 奖励类型 +RoundSetIndex_AwardTypeValue, # 1 奖励类型对应值 +RoundSetIndex_RoundMax, # 2 最大轮回次数 +) = range(3) + +# 轮回奖励类型 +AwardType_PayMoney = 1 +AwardType_Treasure = 2 + +def OnPlayerLogin(curPlayer): + + for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_Lunhuidian, {}).values(): + actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) + isReset = __CheckPlayerActLunhuidianAction(curPlayer, actNum) + # 活动中同步活动信息 + if not isReset and actInfo.get(ShareDefine.ActKey_State): + Sync_ActLunhuidianActionInfo(curPlayer, actNum) + cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0) + ipyData = IpyGameDataPY.GetIpyGameData("ActLunhuidian", cfgID) + if ipyData: + roundSetDict = ipyData.GetRoundSetInfo() + for roundType in roundSetDict.keys(): + Sync_ActLunhuidianPlayerInfo(curPlayer, actNum, roundType) + return + +def RefreshActLunhuidianActionInfo(actNum): + ## 收到GameServer同步的活动信息,刷新活动信息 + playerManager = GameWorld.GetPlayerManager() + for index in xrange(playerManager.GetPlayerCount()): + curPlayer = playerManager.GetPlayerByIndex(index) + if not GameWorld.IsNormalPlayer(curPlayer): + continue + __CheckPlayerActLunhuidianAction(curPlayer, actNum) + return + +def __CheckPlayerActLunhuidianAction(curPlayer, actNum): + ## 检查玩活动数据信息 + + playerID = curPlayer.GetPlayerID() + + actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_Lunhuidian, actNum) + actID = actInfo.get(ShareDefine.ActKey_ID, 0) + state = actInfo.get(ShareDefine.ActKey_State, 0) + cfgID = actInfo.get(ShareDefine.ActKey_CfgID) + + playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianID % actNum) # 玩家身上的活动ID + + # 活动ID 相同的话不处理 + if actID == playerActID: + GameWorld.DebugLog("轮回殿活动ID不变,不处理! actNum=%s,cfgID=%s,actID=%s" % (actNum, cfgID, actID), playerID) + return + GameWorld.DebugLog("轮回殿活动重置! actNum=%s,cfgID=%s,actID=%s,playerActID=%s,state=%s" + % (actNum, cfgID, actID, playerActID, state), playerID) + + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianID % actNum, actID) + + if state: + Sync_ActLunhuidianActionInfo(curPlayer, actNum) + ipyData = IpyGameDataPY.GetIpyGameData("ActLunhuidian", cfgID) + if ipyData: + roundSetDict = ipyData.GetRoundSetInfo() + for roundType in roundSetDict.keys(): + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianValue % (actNum, roundType), 0) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianRound % (actNum, roundType), 1) # 从第1轮开始 + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianAward % (actNum, roundType), 0) + Sync_ActLunhuidianPlayerInfo(curPlayer, actNum, roundType) + return True + +def GetRoundSetValue(roundSet, setIndex): return roundSet[setIndex] if len(roundSet) > setIndex else 0 + +def AddLunhuidianValue(curPlayer, awardType, awardTypeValue, addValue): + ## 增加轮回殿进度值 + playerID = curPlayer.GetPlayerID() + for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_Lunhuidian, {}).values(): + if not actInfo.get(ShareDefine.ActKey_State): + continue + cfgID = actInfo.get(ShareDefine.ActKey_CfgID) + actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) + ipyData = IpyGameDataPY.GetIpyGameData("ActLunhuidian", cfgID) + if not ipyData: + continue + roundSetDict = ipyData.GetRoundSetInfo() + for roundType, roundSet in roundSetDict.items(): + if awardType != GetRoundSetValue(roundSet, RoundSetIndex_AwardType): + continue + if awardTypeValue != GetRoundSetValue(roundSet, RoundSetIndex_AwardTypeValue): + continue + + curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianValue % (actNum, roundType)) + updValue = min(curValue + addValue, ChConfig.Def_UpperLimit_DWord) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianValue % (actNum, roundType), updValue) + GameWorld.DebugLog("更新轮回殿累计值: actNum=%s,cfgID=%s,roundType=%s,awardType=%s,awardTypeValue=%s,addValue=%s,curValue=%s,updValue=%s" + % (actNum, cfgID, roundType, awardType, awardTypeValue, addValue, curValue, updValue), playerID) + Sync_ActLunhuidianPlayerInfo(curPlayer, actNum, roundType) + + return + +def GetLunhuidianAward(curPlayer, dataEx, dataExStr): + ## 领取奖励 + # @param awardInfo: 要领取的奖励信息 roundType|needValue + actNum = dataEx + awardSplitList = dataExStr.split("|") + if len(awardSplitList) != 2: + GameWorld.DebugLog("发送领取格式错误: dataExStr=%s" % dataExStr) + return + roundType = GameWorld.ToIntDef(awardSplitList[0], 0) + needValue = GameWorld.ToIntDef(awardSplitList[1], 0) + + playerID = curPlayer.GetPlayerID() + actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_Lunhuidian, actNum) + if not actInfo or not actInfo.get(ShareDefine.ActKey_State): + GameWorld.DebugLog("该轮回殿非活动中: actNum=%s" % actNum) + return + cfgID = actInfo.get(ShareDefine.ActKey_CfgID) + ipyData = IpyGameDataPY.GetIpyGameData("ActLunhuidian", cfgID) + if not ipyData: + return + roundSetDict = ipyData.GetRoundSetInfo() + if roundType not in roundSetDict: + GameWorld.DebugLog("该轮回殿类型不在本次活动中: actNum=%s,roundType=%s not in %s" % (actNum, roundType, roundSetDict)) + return + roundSet = roundSetDict[roundType] + roundMax = GetRoundSetValue(roundSet, RoundSetIndex_RoundMax) + + awardIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActLunhuidianAward", roundType) + if not awardIpyDataList: + return + + curRound = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianRound % (actNum, roundType)) + curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianValue % (actNum, roundType)) + awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianAward % (actNum, roundType)) + + roundValueMax = 0 + unGetIndexList = [] + awardIndex, awardItemList = None, [] + for awardIpyData in awardIpyDataList: + needV = awardIpyData.GetNeedValue() + roundValueMax = max(roundValueMax, needV) + aIndex = awardIpyData.GetAwardIndex() + if needValue == needV: + awardIndex = aIndex + awardItemList = awardIpyData.GetAwardItemList() + else: + if not awardState&pow(2, aIndex): + unGetIndexList.append(aIndex) + + if awardIndex == None: + GameWorld.DebugLog("轮回殿没有该奖励! actNum=%s,roundType=%s,needValue=%s" % (actNum, roundType, needValue), playerID) + return + + if awardState&pow(2, awardIndex): + GameWorld.DebugLog("轮回殿奖励已领奖! actNum=%s,roundType=%s,needValue=%s,awardIndex=%s" + % (actNum, roundType, needValue, awardIndex), playerID) + return + + if curValue < needValue: + GameWorld.DebugLog("轮回殿当前值不足,无法领奖! actNum=%s,roundType=%s,curRound=%s,curValue=%s < %s" + % (actNum, roundType, curRound, curValue, needValue), playerID) + return + + updState = awardState|pow(2, awardIndex) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianAward % (actNum, roundType), updState) + GameWorld.DebugLog("领取轮回殿奖励! actNum=%s,roundType=%s,needValue=%s,awardIndex=%s,awardState=%s,updState=%s,curRound=%s" + % (actNum, roundType, needValue, awardIndex, awardState, updState, curRound), playerID) + ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList) + + GameWorld.DebugLog(" curRound=%s/%s,unGetIndexList=%s,curValue=%s,roundValueMax=%s" + % (curRound, roundMax, unGetIndexList, curValue, roundValueMax), playerID) + if not unGetIndexList and curRound < roundMax: + updRound = curRound + 1 + updValue = max(0, curValue - roundValueMax) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianRound % (actNum, roundType), updRound) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianValue % (actNum, roundType), updValue) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianAward % (actNum, roundType), 0) + GameWorld.DebugLog(" 本轮次所有奖励已经领取完毕,进入下一轮! updRound=%s,updValue=%s" % (updRound, updValue), playerID) + + Sync_ActLunhuidianPlayerInfo(curPlayer, actNum, roundType) + return + +def Sync_ActLunhuidianPlayerInfo(curPlayer, actNum, roundType): + clientPack = ChPyNetSendPack.tagMCActLunhuidianPlayerInfo() + clientPack.ActNum = actNum + clientPack.RoundType = roundType + clientPack.CurRound = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianRound % (actNum, roundType)) + clientPack.CurValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianValue % (actNum, roundType)) + clientPack.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianAward % (actNum, roundType)) + NetPackCommon.SendFakePack(curPlayer, clientPack) + return + +def Sync_ActLunhuidianActionInfo(curPlayer, actNum, roundType=0): + ## 通知活动信息 + actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_Lunhuidian, actNum) + if not actInfo: + return + if not actInfo.get(ShareDefine.ActKey_State): + return + cfgID = actInfo.get(ShareDefine.ActKey_CfgID) + ipyData = IpyGameDataPY.GetIpyGameData("ActLunhuidian", cfgID) + if not ipyData: + return + + startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData) + clientPack = ChPyNetSendPack.tagMCActLunhuidianInfo() + clientPack.Clear() + clientPack.ActNum = actNum + clientPack.StartDate = startDateStr + clientPack.EndtDate = endDateStr + clientPack.ResetType = ipyData.GetResetType() + clientPack.LimitLV = ipyData.GetLVLimit() + + roundSetDict = ipyData.GetRoundSetInfo() + for roundType, roundSet in roundSetDict.items(): + roundInfo = ChPyNetSendPack.tagMCActLunhuidianRound() + roundInfo.RoundType = roundType + roundInfo.AwardType = GetRoundSetValue(roundSet, RoundSetIndex_AwardType) + roundInfo.AwardTypeValue = GetRoundSetValue(roundSet, RoundSetIndex_AwardTypeValue) + roundInfo.RoundMax = GetRoundSetValue(roundSet, RoundSetIndex_RoundMax) + roundInfo.AwardList = [] + + awardIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActLunhuidianAward", roundType) + if awardIpyDataList: + for awardIpyData in awardIpyDataList: + award = ChPyNetSendPack.tagMCActLunhuidianAward() + award.AwardIndex = awardIpyData.GetAwardIndex() + award.NeedValue = awardIpyData.GetNeedValue() + for itemID, itemCount, isAuctionItem in awardIpyData.GetAwardItemList(): + item = ChPyNetSendPack.tagMCActLunhuidianItem() + item.ItemID = itemID + item.ItemCount = itemCount + item.IsBind = isAuctionItem + award.AwardItemList.append(item) + award.Count = len(award.AwardItemList) + + roundInfo.AwardList.append(award) + roundInfo.AwardCount = len(roundInfo.AwardList) + + clientPack.RoundList.append(roundInfo) + clientPack.RoundCount = len(clientPack.RoundList) + NetPackCommon.SendFakePack(curPlayer, clientPack) + return diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py index c9b4cb6..f868563 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py @@ -83,6 +83,7 @@ import PlayerFamilyTech import PlayerFamilyZhenfa import PlayerCostRebate +import PlayerActLunhuidian import PlayerActGarbageSorting import GY_Query_CrossRealmReg import PlayerTongTianLing @@ -3333,6 +3334,8 @@ PlayerActivity.OnPayMoneyActivity(curPlayer, type_Price, price) #转盘活动 PlayerActTurntable.OnPlayerUseGold(curPlayer, type_Price, price) + #轮回殿 + PlayerActLunhuidian.AddLunhuidianValue(curPlayer, PlayerActLunhuidian.AwardType_PayMoney, type_Price, price) unitPrice = price if quantity == 1 else int(math.ceil(price * 1.0 / quantity)) # 单价 #reason_name = "Unknown" if not costType else costType 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 caa8ccc..71ab13f 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py @@ -103,6 +103,7 @@ import PlayerFeastWish import PlayerActTask import PlayerActYunshi +import PlayerActLunhuidian import PlayerActBuyCountGift import PlayerActLoginNew import PlayerActLogin @@ -1501,6 +1502,9 @@ elif actionName == ShareDefine.OperationActionName_Yunshi: PlayerActYunshi.RefreshActYunshiActionInfo(actNum) + elif actionName == ShareDefine.OperationActionName_Lunhuidian: + PlayerActLunhuidian.RefreshActLunhuidianActionInfo(actNum) + elif actionName == ShareDefine.OperationActionName_LoginAward: PlayerActLogin.RefreshOperationAction_LoginAward() diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py index 4220e01..d5326fc 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py @@ -30,6 +30,7 @@ import PlayerFeastTravel import PlayerFairyCeremony import PlayerNewFairyCeremony +import PlayerActLunhuidian import PlayerActYunshi import PlayerActTask import ItemCommon @@ -400,6 +401,8 @@ elif treasureType == TreasureType_Gubao: PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_TreasureGubao, treasureCount) + PlayerActLunhuidian.AddLunhuidianValue(curPlayer, PlayerActLunhuidian.AwardType_Treasure, treasureType, treasureCount) + # 给物品 mailItemList = [] itemControl = ItemControler.PlayerItemControler(curPlayer) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py index 2cc0d68..0fca079 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py @@ -297,6 +297,7 @@ OperationActionName_Gubao = "ActGubao" # 古宝养成活动 OperationActionName_HorsePetTrain = "ActHorsePetTrain" # 骑宠养成活动 OperationActionName_Yunshi = "ActYunshi" # 运势活动 +OperationActionName_Lunhuidian = "ActLunhuidian" # 轮回殿活动 #节日活动类型列表 - 该类型无视开服天,日期到了就开启 FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket, OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy, @@ -320,6 +321,7 @@ OperationActionName_ActLoginNew, OperationActionName_ActTask, OperationActionName_BuyCountGift, OperationActionName_FamilyCTGAssist, OperationActionName_Gubao, OperationActionName_HorsePetTrain, OperationActionName_Yunshi, + OperationActionName_Lunhuidian, ] + FeastOperationActionNameList #需要记录开启活动时的世界等级的运营活动 NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell, @@ -347,6 +349,7 @@ OperationActionName_ActLoginNew, OperationActionName_ActTask, OperationActionName_BuyCountGift, OperationActionName_FamilyCTGAssist, OperationActionName_Gubao, OperationActionName_HorsePetTrain, OperationActionName_Yunshi, + OperationActionName_Lunhuidian, ] #跨服运营活动表名定义 -- Gitblit v1.8.0