From 242e5a77aac262b16b20bd2ab52adb3233fe2475 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 03 六月 2024 18:01:41 +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 +++
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 +
10 files changed, 847 insertions(+), 0 deletions(-)
diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h
index 7f26e18..d30221a 100644
--- a/PySysDB/PySysDBG.h
+++ b/PySysDB/PySysDBG.h
@@ -954,6 +954,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 de4ed87..d2fab86 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -2409,6 +2409,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 77943dc..5ec3c41 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -33858,6 +33858,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 d8368bb..6324890 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
@@ -774,6 +774,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),
@@ -2059,6 +2071,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():
@@ -2462,6 +2491,7 @@
self.__LoadFileData("CrossPenglaiZoneMap", onlyCheck)
self.__LoadFileData("CrossDemonLandZoneMap", onlyCheck)
self.__LoadFileData("ActWeekParty", onlyCheck)
+ self.__LoadFileData("ActLoginNew", onlyCheck)
self.__LoadFileData("ActLoginAward", onlyCheck)
self.__LoadFileData("ActFeastWeekParty", onlyCheck)
self.__LoadFileData("ActNewFairyCeremony", onlyCheck)
@@ -3182,6 +3212,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 aa6c983..abfd3b9 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/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 77943dc..5ec3c41 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -33858,6 +33858,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 13aeb13..345e05e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1893,6 +1893,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),
@@ -5051,6 +5066,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():
@@ -5936,6 +5976,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)
@@ -7444,6 +7486,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/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 2a098d9..1b2cab3 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
@@ -1461,6 +1462,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 aa6c983..abfd3b9 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