From 2f0b528212b205b3ea462cba86ec3a36e40ef11e Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 03 六月 2024 17:54:14 +0800 Subject: [PATCH] 10173 【主干】【香港】【越南】BOSS凭证(新增新版登录活动) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLoginNew.py | 194 ++++++++++++ ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 37 ++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 257 +++++++++++++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 56 +++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 6 PySysDB/PySysDBPY.h | 21 + ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 257 +++++++++++++++++ PySysDB/PySysDBG.h | 15 + ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 10 12 files changed, 861 insertions(+), 2 deletions(-) diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h index 76663f5..69166de 100644 --- a/PySysDB/PySysDBG.h +++ b/PySysDB/PySysDBG.h @@ -953,6 +953,21 @@ WORD LVLimit; //限制等级 }; +//登录活动奖励时间表新 + +struct tagActLoginNew +{ + DWORD _CfgID; //配置ID + list PlatformList; //活动平台列表["平台A", "平台A", ...],配[]代表所有 + list ServerGroupIDList; //服务器ID列表 + BYTE ActNum; //活动分组编号, 活动类型 * 10 + 不同界面编号 + char StartDate; //开启日期 + char EndDate; //结束日期 + dict NotifyInfoStart; //全服提示信息 - 相对开始时间 + dict NotifyInfoEnd; //全服提示信息 - 相对结束时间 + list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key] +}; + //登录奖励时间表 struct tagActLoginAward diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h index b64e99a..1b46736 100644 --- a/PySysDB/PySysDBPY.h +++ b/PySysDB/PySysDBPY.h @@ -2354,6 +2354,27 @@ WORD Point; //积分 }; +//登录活动奖励时间表新 + +struct tagActLoginNew +{ + DWORD _CfgID; //配置ID + char StartDate; //开启日期 + char EndDate; //结束日期 + WORD LVLimit; //限制等级 + list RepSignCostMoneyInfo; //补签消耗货币类型数量 + BYTE TemplateID; //登录奖励模板编号 +}; + +//登录活动奖励模板表新 + +struct tagActLoginNewAward +{ + BYTE _TemplateID; //模板ID + BYTE DayNum; //第X天从1开始 + list LoginAwardItemList; //奖励列表[[物品ID,个数,是否拍品], ...] +}; + //登录奖励时间表 struct tagActLoginAward diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py index ee509f8..75209c9 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py @@ -33210,6 +33210,263 @@ #------------------------------------------------------ +# AA 69 登录活动信息新 #tagMCActLoginNew + +class tagMCActLoginNewItem(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(tagMCActLoginNewItem) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 69 登录活动信息新 //tagMCActLoginNew: + ItemID:%d, + ItemCount:%d, + IsBind:%d + '''\ + %( + self.ItemID, + self.ItemCount, + self.IsBind + ) + return DumpString + + +class tagMCActLoginNewDay(Structure): + DayNum = 0 #(BYTE DayNum)//天编号,从1开始,过期未签到领取的天可消耗货币补签领取 + Count = 0 #(BYTE Count)// 奖励物品数 + AwardItemList = list() #(vector<tagMCActLoginNewItem> AwardItemList)// 奖励物品列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.DayNum,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temAwardItemList = tagMCActLoginNewItem() + _pos = temAwardItemList.ReadData(_lpData, _pos) + self.AwardItemList.append(temAwardItemList) + return _pos + + def Clear(self): + self.DayNum = 0 + self.Count = 0 + self.AwardItemList = list() + return + + def GetLength(self): + length = 0 + 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.DayNum) + 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 = ''' + DayNum:%d, + Count:%d, + AwardItemList:%s + '''\ + %( + self.DayNum, + self.Count, + "..." + ) + return DumpString + + +class tagMCActLoginNew(Structure): + Head = tagHead() + ActNum = 0 #(BYTE ActNum)// 活动编号 + StartDate = "" #(char StartDate[10])// 开始日期 y-m-d + EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + LimitLV = 0 #(WORD LimitLV)// 限制等级 + RepSignCostMoney = list() #(DWORD RepSignCostMoney[2])// 补签消耗 [货币类型, 货币值] + DayCount = 0 #(BYTE DayCount) + AwardDayList = list() #(vector<tagMCActLoginNewDay> AwardDayList)// 奖励天列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x69 + 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.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.RepSignCostMoney, _pos = CommFunc.ReadString(_lpData, _pos, 2*17582024) + self.DayCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.DayCount): + temAwardDayList = tagMCActLoginNewDay() + _pos = temAwardDayList.ReadData(_lpData, _pos) + self.AwardDayList.append(temAwardDayList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x69 + self.ActNum = 0 + self.StartDate = "" + self.EndtDate = "" + self.LimitLV = 0 + self.RepSignCostMoney = list() + self.DayCount = 0 + self.AwardDayList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + length += 10 + length += 10 + length += 2 + length += 4*2 + length += 1 + for i in range(self.DayCount): + length += self.AwardDayList[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.WriteWORD(data, self.LimitLV) + for item in self.RepSignCostMoney: + data = CommFunc.WriteDWORD(data, item) + data = CommFunc.WriteBYTE(data, self.DayCount) + for i in range(self.DayCount): + data = CommFunc.WriteString(data, self.AwardDayList[i].GetLength(), self.AwardDayList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + ActNum:%d, + StartDate:%s, + EndtDate:%s, + LimitLV:%d, + RepSignCostMoney:%s, + DayCount:%d, + AwardDayList:%s + '''\ + %( + self.Head.OutputString(), + self.ActNum, + self.StartDate, + self.EndtDate, + self.LimitLV, + "...", + self.DayCount, + "..." + ) + return DumpString + + +m_NAtagMCActLoginNew=tagMCActLoginNew() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLoginNew.Head.Cmd,m_NAtagMCActLoginNew.Head.SubCmd))] = m_NAtagMCActLoginNew + + +#------------------------------------------------------ +# AA 70 登录活动玩家信息新 #tagMCActLoginPlayerInfoNew + +class tagMCActLoginPlayerInfoNew(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("LoginAward", c_int), # 是否已领取,按天索引0代表第1天记录当天是否已领取 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xAA + self.SubCmd = 0x70 + 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 = 0x70 + self.LoginAward = 0 + return + + def GetLength(self): + return sizeof(tagMCActLoginPlayerInfoNew) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 70 登录活动玩家信息新 //tagMCActLoginPlayerInfoNew: + Cmd:%s, + SubCmd:%s, + LoginAward:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.LoginAward + ) + return DumpString + + +m_NAtagMCActLoginPlayerInfoNew=tagMCActLoginPlayerInfoNew() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLoginPlayerInfoNew.Cmd,m_NAtagMCActLoginPlayerInfoNew.SubCmd))] = m_NAtagMCActLoginPlayerInfoNew + + +#------------------------------------------------------ # AA 48 多日连充活动信息 #tagMCActManyDayRechargeInfo class tagMCActManyDayRechargeItem(Structure): diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py index 072bd17..a536941 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py @@ -773,6 +773,18 @@ ("WORD", "LVLimit", 0), ), + "ActLoginNew":( + ("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), + ), + "ActLoginAward":( ("DWORD", "CfgID", 1), ("char", "ActMark", 0), @@ -2045,6 +2057,23 @@ def GetNotifyInfoEnd(self): return self.attrTuple[10] # 全服提示信息 - 相对结束时间 dict def GetLVLimit(self): return self.attrTuple[11] # 限制等级 WORD +# 登录活动奖励时间表新 +class IPY_ActLoginNew(): + + 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 + # 登录奖励时间表 class IPY_ActLoginAward(): @@ -2431,6 +2460,7 @@ self.__LoadFileData("CrossDemonLandZoneMap", onlyCheck) self.__LoadFileData("CrossFamilyFlagwarZoneMap", onlyCheck) self.__LoadFileData("ActWeekParty", onlyCheck) + self.__LoadFileData("ActLoginNew", onlyCheck) self.__LoadFileData("ActLoginAward", onlyCheck) self.__LoadFileData("ActFeastWeekParty", onlyCheck) self.__LoadFileData("ActNewFairyCeremony", onlyCheck) @@ -3150,6 +3180,13 @@ self.CheckLoadData("ActWeekParty") return self.ipyActWeekPartyCache[index] + def GetActLoginNewCount(self): + self.CheckLoadData("ActLoginNew") + return self.ipyActLoginNewLen + def GetActLoginNewByIndex(self, index): + self.CheckLoadData("ActLoginNew") + return self.ipyActLoginNewCache[index] + def GetActLoginAwardCount(self): self.CheckLoadData("ActLoginAward") return self.ipyActLoginAwardLen diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py index 3aa2e14..c5cca1b 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py @@ -287,6 +287,7 @@ OperationActionName_GodGift = "ActGodGift" # 天帝礼包活动 OperationActionName_BuyOne = "ActBuyOne" # 买一送多活动 OperationActionName_BossTrial = "ActBossTrial" # Boss历练 +OperationActionName_ActLoginNew = "ActLoginNew" # 登录活动-新 #节日活动类型列表 - 该类型无视开服天,日期到了就开启 FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket, OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy, @@ -307,6 +308,7 @@ OperationActionName_Turntable, OperationActionName_HorsePetFeast, OperationActionName_GarbageSorting, OperationActionName_XianXiaMJ, OperationActionName_GodGift, OperationActionName_BuyOne, OperationActionName_BossTrial, + OperationActionName_ActLoginNew, ] + FeastOperationActionNameList #需要记录开启活动时的世界等级的运营活动 NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell, @@ -331,6 +333,7 @@ OperationActionName_Turntable, OperationActionName_HorsePetFeast, OperationActionName_GarbageSorting, OperationActionName_XianXiaMJ, OperationActionName_GodGift, OperationActionName_BuyOne, OperationActionName_BossTrial, + OperationActionName_ActLoginNew, ] #跨服运营活动表名定义 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py index ec4e449..3cadf05 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py @@ -4072,6 +4072,10 @@ Def_PDict_ZhanlingState = "ZhanlingState" # 战令已激活状态,按类型二进制位运算记录是否已激活 Def_PDict_ZhanlingReward = "ZhanlingReward_%s_%s" # 战令奖励领取记录,按类型二进制位运算记录是否已领取,参数(类型,key编号) Def_PDict_ZhanlingRewardFree = "ZhanlingRewardFree_%s_%s" # 战令免费奖励领取记录,按类型二进制位运算记录是否已领取,参数(类型,key编号) + +#登录活动新 +Def_PDict_ActLoginNewID = "ActLoginNewID_%s" # 玩家身上的活动ID,唯一标识,取活动开始日期time值,参数:(活动编号) +Def_PDict_ActLoginNewAward = "ActLoginNewAward_%s" # 登录活动奖励记录,按位记录登录天是否已领取,参数:(活动编号) #------------------------------------------------------------------------------- #开服活动,Def_PDictType_OpenServerCampaign @@ -5842,8 +5846,10 @@ Def_RewardType_Zhanling, #战令奖励 65 Def_RewardType_Task, #任务奖励 66 Def_RewardType_LikeGame, #游戏点赞 67 -)= range(68) - +Def_RewardType_RealmLVUpTask, #境界渡劫任务条件奖励 68 +Def_RewardType_MineTreasure, #福地聚宝盆奖励 69 +Def_RewardType_ActLoginAwardNew, # 领取登录活动奖励70 +)= range(71) #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 ee509f8..75209c9 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -33210,6 +33210,263 @@ #------------------------------------------------------ +# AA 69 登录活动信息新 #tagMCActLoginNew + +class tagMCActLoginNewItem(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(tagMCActLoginNewItem) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 69 登录活动信息新 //tagMCActLoginNew: + ItemID:%d, + ItemCount:%d, + IsBind:%d + '''\ + %( + self.ItemID, + self.ItemCount, + self.IsBind + ) + return DumpString + + +class tagMCActLoginNewDay(Structure): + DayNum = 0 #(BYTE DayNum)//天编号,从1开始,过期未签到领取的天可消耗货币补签领取 + Count = 0 #(BYTE Count)// 奖励物品数 + AwardItemList = list() #(vector<tagMCActLoginNewItem> AwardItemList)// 奖励物品列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.DayNum,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temAwardItemList = tagMCActLoginNewItem() + _pos = temAwardItemList.ReadData(_lpData, _pos) + self.AwardItemList.append(temAwardItemList) + return _pos + + def Clear(self): + self.DayNum = 0 + self.Count = 0 + self.AwardItemList = list() + return + + def GetLength(self): + length = 0 + 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.DayNum) + 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 = ''' + DayNum:%d, + Count:%d, + AwardItemList:%s + '''\ + %( + self.DayNum, + self.Count, + "..." + ) + return DumpString + + +class tagMCActLoginNew(Structure): + Head = tagHead() + ActNum = 0 #(BYTE ActNum)// 活动编号 + StartDate = "" #(char StartDate[10])// 开始日期 y-m-d + EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + LimitLV = 0 #(WORD LimitLV)// 限制等级 + RepSignCostMoney = list() #(DWORD RepSignCostMoney[2])// 补签消耗 [货币类型, 货币值] + DayCount = 0 #(BYTE DayCount) + AwardDayList = list() #(vector<tagMCActLoginNewDay> AwardDayList)// 奖励天列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x69 + 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.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.RepSignCostMoney, _pos = CommFunc.ReadString(_lpData, _pos, 2*17582024) + self.DayCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.DayCount): + temAwardDayList = tagMCActLoginNewDay() + _pos = temAwardDayList.ReadData(_lpData, _pos) + self.AwardDayList.append(temAwardDayList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x69 + self.ActNum = 0 + self.StartDate = "" + self.EndtDate = "" + self.LimitLV = 0 + self.RepSignCostMoney = list() + self.DayCount = 0 + self.AwardDayList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + length += 10 + length += 10 + length += 2 + length += 4*2 + length += 1 + for i in range(self.DayCount): + length += self.AwardDayList[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.WriteWORD(data, self.LimitLV) + for item in self.RepSignCostMoney: + data = CommFunc.WriteDWORD(data, item) + data = CommFunc.WriteBYTE(data, self.DayCount) + for i in range(self.DayCount): + data = CommFunc.WriteString(data, self.AwardDayList[i].GetLength(), self.AwardDayList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + ActNum:%d, + StartDate:%s, + EndtDate:%s, + LimitLV:%d, + RepSignCostMoney:%s, + DayCount:%d, + AwardDayList:%s + '''\ + %( + self.Head.OutputString(), + self.ActNum, + self.StartDate, + self.EndtDate, + self.LimitLV, + "...", + self.DayCount, + "..." + ) + return DumpString + + +m_NAtagMCActLoginNew=tagMCActLoginNew() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLoginNew.Head.Cmd,m_NAtagMCActLoginNew.Head.SubCmd))] = m_NAtagMCActLoginNew + + +#------------------------------------------------------ +# AA 70 登录活动玩家信息新 #tagMCActLoginPlayerInfoNew + +class tagMCActLoginPlayerInfoNew(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("LoginAward", c_int), # 是否已领取,按天索引0代表第1天记录当天是否已领取 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xAA + self.SubCmd = 0x70 + 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 = 0x70 + self.LoginAward = 0 + return + + def GetLength(self): + return sizeof(tagMCActLoginPlayerInfoNew) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 70 登录活动玩家信息新 //tagMCActLoginPlayerInfoNew: + Cmd:%s, + SubCmd:%s, + LoginAward:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.LoginAward + ) + return DumpString + + +m_NAtagMCActLoginPlayerInfoNew=tagMCActLoginPlayerInfoNew() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLoginPlayerInfoNew.Cmd,m_NAtagMCActLoginPlayerInfoNew.SubCmd))] = m_NAtagMCActLoginPlayerInfoNew + + +#------------------------------------------------------ # 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 aab9f51..4c8f02a 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py @@ -1838,6 +1838,21 @@ ("WORD", "Point", 0), ), + "ActLoginNew":( + ("DWORD", "CfgID", 1), + ("char", "StartDate", 0), + ("char", "EndDate", 0), + ("WORD", "LVLimit", 0), + ("list", "RepSignCostMoneyInfo", 0), + ("BYTE", "TemplateID", 0), + ), + + "ActLoginNewAward":( + ("BYTE", "TemplateID", 1), + ("BYTE", "DayNum", 0), + ("list", "LoginAwardItemList", 0), + ), + "ActLoginAward":( ("DWORD", "CfgID", 1), ("char", "StartDate", 0), @@ -4926,6 +4941,31 @@ def GetReward(self): return self.attrTuple[4] # 奖励物品 list def GetPoint(self): return self.attrTuple[5] # 积分 WORD +# 登录活动奖励时间表新 +class IPY_ActLoginNew(): + + 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 GetRepSignCostMoneyInfo(self): return self.attrTuple[4] # 补签消耗货币类型数量 list + def GetTemplateID(self): return self.attrTuple[5] # 登录奖励模板编号 BYTE + +# 登录活动奖励模板表新 +class IPY_ActLoginNewAward(): + + def __init__(self): + self.attrTuple = None + return + + def GetTemplateID(self): return self.attrTuple[0] # 模板ID BYTE + def GetDayNum(self): return self.attrTuple[1] # 第X天从1开始 BYTE + def GetLoginAwardItemList(self): return self.attrTuple[2] # 奖励列表[[物品ID,个数,是否拍品], ...] list + # 登录奖励时间表 class IPY_ActLoginAward(): @@ -5786,6 +5826,8 @@ self.__LoadFileData("CoatChestUp", onlyCheck) self.__LoadFileData("ActWeekParty", onlyCheck) self.__LoadFileData("WeekParty", onlyCheck) + self.__LoadFileData("ActLoginNew", onlyCheck) + self.__LoadFileData("ActLoginNewAward", onlyCheck) self.__LoadFileData("ActLoginAward", onlyCheck) self.__LoadFileData("LoginAward", onlyCheck) self.__LoadFileData("ActFeastLogin", onlyCheck) @@ -7292,6 +7334,20 @@ self.CheckLoadData("WeekParty") return self.ipyWeekPartyCache[index] + def GetActLoginNewCount(self): + self.CheckLoadData("ActLoginNew") + return self.ipyActLoginNewLen + def GetActLoginNewByIndex(self, index): + self.CheckLoadData("ActLoginNew") + return self.ipyActLoginNewCache[index] + + def GetActLoginNewAwardCount(self): + self.CheckLoadData("ActLoginNewAward") + return self.ipyActLoginNewAwardLen + def GetActLoginNewAwardByIndex(self, index): + self.CheckLoadData("ActLoginNewAward") + return self.ipyActLoginNewAwardCache[index] + def GetActLoginAwardCount(self): self.CheckLoadData("ActLoginAward") return self.ipyActLoginAwardLen 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 3ae59fa..3f49413 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py @@ -156,6 +156,7 @@ import PlayerLove import GameObj import PlayerChangeJob +import PlayerActLoginNew import datetime import time @@ -859,6 +860,8 @@ PlayerActHorsePetFeast.OnLogin(curPlayer) # 周狂欢活动 PlayerWeekParty.OnLogin(curPlayer) + # 登录活动 + PlayerActLoginNew.OnPlayerLogin(curPlayer) # 节日巡礼活动 PlayerFeastWeekParty.OnLogin(curPlayer) # 节日登录活动 @@ -5659,6 +5662,9 @@ # 领取节日游历奖励 elif rewardType == ChConfig.Def_RewardType_FeastTravel: PlayerFeastTravel.GetFeastTravelAward(curPlayer, dataEx) + # 领取登录活动奖励 + elif rewardType == ChConfig.Def_RewardType_ActLoginAwardNew: + PlayerActLoginNew.OnGetActLoginAward(curPlayer, dataEx, dataExStr) # 领取跨服充值排行活动达标奖励 elif rewardType == ChConfig.Def_RewardType_CACTGBillboardDabiao: CrossActCTGBillboard.GetDabiaoAward(curPlayer, dataEx) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLoginNew.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLoginNew.py new file mode 100644 index 0000000..f230a77 --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLoginNew.py @@ -0,0 +1,194 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +#------------------------------------------------------------------------------- +# +##@package Player.PlayerActLoginNew +# +# @todo:登录活动-新 +# @author hxp +# @date 2024-06-03 +# @version 1.0 +# +# 详细描述: 登录活动-新 +# +#------------------------------------------------------------------------------- +#"""Version = 2024-06-03 18:00""" +#------------------------------------------------------------------------------- + +import PyGameData +import ShareDefine +import PlayerControl +import IpyGameDataPY +import ChPyNetSendPack +import ItemControler +import IPY_GameWorld +import NetPackCommon +import GameWorld +import ChConfig + +def OnPlayerLogin(curPlayer): + + for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_ActLoginNew, {}).values(): + actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) + isReset = __CheckPlayerActLoginAction(curPlayer, actNum) + # 活动中同步活动信息 + if not isReset and actInfo.get(ShareDefine.ActKey_State): + Sync_ActLoginActionInfo(curPlayer, actNum) + Sync_ActLoginPlayerInfo(curPlayer, actNum) + + return + +def RefreshActLoginActionInfo(actNum): + ## 收到GameServer同步的活动信息,刷新活动信息 + playerManager = GameWorld.GetPlayerManager() + for index in xrange(playerManager.GetPlayerCount()): + curPlayer = playerManager.GetPlayerByIndex(index) + if curPlayer.GetID() == 0: + continue + __CheckPlayerActLoginAction(curPlayer, actNum) + return + +def __CheckPlayerActLoginAction(curPlayer, actNum): + ## 检查玩活动数据信息 + + playerID = curPlayer.GetPlayerID() + + actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_ActLoginNew, actNum) + actID = actInfo.get(ShareDefine.ActKey_ID, 0) + state = actInfo.get(ShareDefine.ActKey_State, 0) + + playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLoginNewID % 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_ActLoginNewID % actNum, actID) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLoginNewAward % actNum, 0) + + if state: + Sync_ActLoginActionInfo(curPlayer, actNum) + Sync_ActLoginPlayerInfo(curPlayer, actNum) + return True + +def OnGetActLoginAward(curPlayer, dayNum, actNum): + ## 领取活动奖励 + + actNum = GameWorld.ToIntDef(actNum) + + actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_ActLoginNew, actNum) + if not actInfo: + GameWorld.DebugLog("没有该登录活动! actNum=%s" % actNum) + return + + if not actInfo.get(ShareDefine.ActKey_State): + GameWorld.DebugLog("非登录活动中! actNum=%s" % actNum) + return + + curDayNum = actInfo.get(ShareDefine.ActKey_DayIndex) + 1 + if curDayNum < dayNum: + GameWorld.DebugLog("未到可领取的登录天,无法领取! actNum=%s,curDayNum=%s < %s" % (actNum, curDayNum, dayNum)) + return + + cfgID = actInfo.get(ShareDefine.ActKey_CfgID) + ipyData = IpyGameDataPY.GetIpyGameData("ActLoginNew", cfgID) + if not ipyData: + return + templateID = ipyData.GetTemplateID() + + dayIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActLoginNewAward", templateID) + if not dayIpyDataList: + return + + findIpyData = None + for dayIpyData in dayIpyDataList: + if dayIpyData.GetDayNum() == dayNum: + findIpyData = dayIpyData + break + + if not findIpyData: + GameWorld.DebugLog("找不到对应登录天奖励! actNum=%s,cfgID=%s,templateID=%s,dayNum=%s" % (actNum, cfgID, templateID, dayNum)) + return + awardItemList = findIpyData.GetLoginAwardItemList() + + awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLoginNewAward % actNum) + if awardRecord & pow(2, dayNum): + GameWorld.DebugLog("登录活动该天已领奖! actNum=%s,dayNum=%s,awardRecord=%s" % (actNum, dayNum, awardRecord)) + return + + # 判断非当天需补签 + costMoneyType, costMoneyValue = 0, 0 + if curDayNum != dayNum and ipyData.GetRepSignCostMoneyInfo(): + costMoneyType, costMoneyValue = ipyData.GetRepSignCostMoneyInfo() + if costMoneyType and costMoneyValue and not PlayerControl.HaveMoney(curPlayer, costMoneyType, costMoneyValue): + return + + if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList): + return + + if costMoneyType and costMoneyValue: + PlayerControl.PayMoney(curPlayer, costMoneyType, costMoneyValue, "ActLoginNew", {"actNum":actNum, "dayNum":dayNum}) + + updAwardRecord = awardRecord | pow(2, dayNum) + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLoginNewAward % actNum, updAwardRecord) + Sync_ActLoginPlayerInfo(curPlayer, actNum) + + GameWorld.DebugLog("领取登录活动奖励! actNum=%s,dayNum=%s,awardItemList=%s" % (actNum, dayNum, awardItemList)) + + for itemID, itemCount, isAuctionItem in awardItemList: + ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem], event=["ActLoginNew", False, {}]) + + return + +def Sync_ActLoginPlayerInfo(curPlayer, actNum): + ## 通知活动玩家信息 + clientPack = ChPyNetSendPack.tagMCActLoginPlayerInfoNew() + clientPack.LoginAward = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLoginNewAward % actNum) + NetPackCommon.SendFakePack(curPlayer, clientPack) + return + +def Sync_ActLoginActionInfo(curPlayer, actNum): + ## 通知活动信息 + actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_ActLoginNew, actNum) + if not actInfo: + return + if not actInfo.get(ShareDefine.ActKey_State): + return + cfgID = actInfo.get(ShareDefine.ActKey_CfgID) + ipyData = IpyGameDataPY.GetIpyGameData("ActLoginNew", cfgID) + if not ipyData: + return + templateID = ipyData.GetTemplateID() + dayIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActLoginNewAward", templateID) + if not dayIpyDataList: + return + + startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData) + actPack = ChPyNetSendPack.tagMCActLoginNew() + actPack.Clear() + actPack.ActNum = actNum + actPack.StartDate = startDateStr + actPack.EndtDate = endDateStr + actPack.LimitLV = ipyData.GetLVLimit() + actPack.RepSignCostMoney = ipyData.GetRepSignCostMoneyInfo() + + actPack.AwardDayList = [] + for dayIpyData in dayIpyDataList: + dayInfo = ChPyNetSendPack.tagMCActLoginNewDay() + dayInfo.DayNum = dayIpyData.GetDayNum() + dayInfo.AwardItemList = [] + for itemID, itemCount, isAuctionItem in dayIpyData.GetLoginAwardItemList(): + itemInfo = ChPyNetSendPack.tagMCActLoginNewItem() + itemInfo.ItemID = itemID + itemInfo.ItemCount = itemCount + itemInfo.IsBind = isAuctionItem + dayInfo.AwardItemList.append(itemInfo) + dayInfo.Count = len(dayInfo.AwardItemList) + + actPack.AwardDayList.append(dayInfo) + actPack.DayCount = len(actPack.AwardDayList) + NetPackCommon.SendFakePack(curPlayer, actPack) + return + 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 5a7a9a8..a670120 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py @@ -98,6 +98,7 @@ import PlayerFeastTravel import PlayerFeastLogin import PlayerFeastWish +import PlayerActLoginNew import PlayerActLogin import PlayerFlashGiftbag import PlayerDailyGiftbag @@ -1458,6 +1459,9 @@ elif actionName == ShareDefine.OperationActionName_LoginAward: PlayerActLogin.RefreshOperationAction_LoginAward() + elif actionName == ShareDefine.OperationActionName_ActLoginNew: + PlayerActLoginNew.RefreshActLoginActionInfo(actNum) + elif actionName == ShareDefine.OperationActionName_FeastLogin: PlayerFeastLogin.RefreshFeastLoginActionInfo() diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py index 3aa2e14..c5cca1b 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py @@ -287,6 +287,7 @@ OperationActionName_GodGift = "ActGodGift" # 天帝礼包活动 OperationActionName_BuyOne = "ActBuyOne" # 买一送多活动 OperationActionName_BossTrial = "ActBossTrial" # Boss历练 +OperationActionName_ActLoginNew = "ActLoginNew" # 登录活动-新 #节日活动类型列表 - 该类型无视开服天,日期到了就开启 FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket, OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy, @@ -307,6 +308,7 @@ OperationActionName_Turntable, OperationActionName_HorsePetFeast, OperationActionName_GarbageSorting, OperationActionName_XianXiaMJ, OperationActionName_GodGift, OperationActionName_BuyOne, OperationActionName_BossTrial, + OperationActionName_ActLoginNew, ] + FeastOperationActionNameList #需要记录开启活动时的世界等级的运营活动 NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell, @@ -331,6 +333,7 @@ OperationActionName_Turntable, OperationActionName_HorsePetFeast, OperationActionName_GarbageSorting, OperationActionName_XianXiaMJ, OperationActionName_GodGift, OperationActionName_BuyOne, OperationActionName_BossTrial, + OperationActionName_ActLoginNew, ] #跨服运营活动表名定义 -- Gitblit v1.8.0