From bff02e0f7729e3137a86ab1e7e1fba860a9103b6 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 12 三月 2021 15:05:33 +0800
Subject: [PATCH] 8835 【BT2】【主干】【后端】Part3-2 5)新增多日连充
---
ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 41 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 292 ++++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 61 +++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 6
PySysDB/PySysDBPY.h | 23 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 292 ++++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py | 310 +++++++++++++++++
PySysDB/PySysDBG.h | 15
9 files changed, 1,044 insertions(+), 0 deletions(-)
diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h
index ff1623b..1a64a15 100644
--- a/PySysDB/PySysDBG.h
+++ b/PySysDB/PySysDBG.h
@@ -621,6 +621,21 @@
list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key]
};
+//多日连充活动表
+
+struct tagActManyDayRecharge
+{
+ 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 tagActTotalRecharge
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 9b42e90..a28d88b 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1656,6 +1656,29 @@
list CTGIDGroupList; //充值编号组列表 [[ctgID, ...], ...]
};
+//多日连充活动表
+
+struct tagActManyDayRecharge
+{
+ DWORD _CfgID; //配置ID
+ char StartDate; //开启日期
+ char EndDate; //结束日期
+ WORD LVLimit; //限制等级
+ WORD TemplateID; //模板编号
+};
+
+//多日连充模板表
+
+struct tagActManyDayRechargeAward
+{
+ DWORD _TemplateID; //模板ID
+ DWORD NeedRecharge; //所需充值额度
+ BYTE NeedDays; //所需充值天数
+ BYTE AwardIndex; //奖励索引
+ dict AwardItemInfo; //奖励物品信息 {世界等级范围:[[物品ID,个数,是否拍品], ...]}
+ char NotifyKey; //广播
+};
+
//法宝副本表
struct tagMagicWeaponFB
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 0e668e5..a3c5b7a 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -25244,6 +25244,298 @@
#------------------------------------------------------
+# AA 48 多日连充活动信息 #tagMCActManyDayRechargeInfo
+
+class tagMCActManyDayRechargeItem(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(tagMCActManyDayRechargeItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 48 多日连充活动信息 //tagMCActManyDayRechargeInfo:
+ ItemID:%d,
+ ItemCount:%d,
+ IsBind:%d
+ '''\
+ %(
+ self.ItemID,
+ self.ItemCount,
+ self.IsBind
+ )
+ return DumpString
+
+
+class tagMCActManyDayRechargeAward(Structure):
+ AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引 0~31
+ NeedRecharge = 0 #(DWORD NeedRecharge)// 单天所需充值额度
+ NeedDays = 0 #(BYTE NeedDays)// 所需充值天数
+ AwardItemCount = 0 #(BYTE AwardItemCount)
+ AwardItemList = list() #(vector<tagMCActManyDayRechargeItem> 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.NeedRecharge,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.NeedDays,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.AwardItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardItemCount):
+ temAwardItemList = tagMCActManyDayRechargeItem()
+ _pos = temAwardItemList.ReadData(_lpData, _pos)
+ self.AwardItemList.append(temAwardItemList)
+ return _pos
+
+ def Clear(self):
+ self.AwardIndex = 0
+ self.NeedRecharge = 0
+ self.NeedDays = 0
+ self.AwardItemCount = 0
+ self.AwardItemList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += 1
+ length += 4
+ length += 1
+ length += 1
+ for i in range(self.AwardItemCount):
+ length += self.AwardItemList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteBYTE(data, self.AwardIndex)
+ data = CommFunc.WriteDWORD(data, self.NeedRecharge)
+ data = CommFunc.WriteBYTE(data, self.NeedDays)
+ data = CommFunc.WriteBYTE(data, self.AwardItemCount)
+ for i in range(self.AwardItemCount):
+ data = CommFunc.WriteString(data, self.AwardItemList[i].GetLength(), self.AwardItemList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ AwardIndex:%d,
+ NeedRecharge:%d,
+ NeedDays:%d,
+ AwardItemCount:%d,
+ AwardItemList:%s
+ '''\
+ %(
+ self.AwardIndex,
+ self.NeedRecharge,
+ self.NeedDays,
+ self.AwardItemCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCActManyDayRechargeInfo(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)// 限制等级
+ AwardCount = 0 #(BYTE AwardCount)
+ AwardList = list() #(vector<tagMCActManyDayRechargeAward> AwardList)// 奖励信息列表
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x48
+ 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.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardCount):
+ temAwardList = tagMCActManyDayRechargeAward()
+ _pos = temAwardList.ReadData(_lpData, _pos)
+ self.AwardList.append(temAwardList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x48
+ self.ActNum = 0
+ self.StartDate = ""
+ self.EndtDate = ""
+ self.LimitLV = 0
+ self.AwardCount = 0
+ self.AwardList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 10
+ length += 10
+ length += 2
+ length += 1
+ for i in range(self.AwardCount):
+ length += self.AwardList[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)
+ 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 = '''
+ Head:%s,
+ ActNum:%d,
+ StartDate:%s,
+ EndtDate:%s,
+ LimitLV:%d,
+ AwardCount:%d,
+ AwardList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ActNum,
+ self.StartDate,
+ self.EndtDate,
+ self.LimitLV,
+ self.AwardCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCActManyDayRechargeInfo=tagMCActManyDayRechargeInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActManyDayRechargeInfo.Head.Cmd,m_NAtagMCActManyDayRechargeInfo.Head.SubCmd))] = m_NAtagMCActManyDayRechargeInfo
+
+
+#------------------------------------------------------
+# AA 49 多日连充活动玩家信息 #tagMCActManyDayRechargePlayerInfo
+
+class tagMCActManyDayRechargePlayerInfo(Structure):
+ Head = tagHead()
+ ActNum = 0 #(BYTE ActNum)//活动编号
+ Days = 0 #(BYTE Days)
+ DayRechargeValues = list() #(vector<DWORD> DayRechargeValues)//活动每天充值列表
+ AwardRecord = 0 #(DWORD AwardRecord)//奖励领奖记录,按奖励索引二进制位存储是否已领取
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x49
+ 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.Days,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.Days):
+ value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+ self.DayRechargeValues.append(value)
+ self.AwardRecord,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x49
+ self.ActNum = 0
+ self.Days = 0
+ self.DayRechargeValues = list()
+ self.AwardRecord = 0
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 1
+ length += 4 * self.Days
+ length += 4
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.ActNum)
+ data = CommFunc.WriteBYTE(data, self.Days)
+ for i in range(self.Days):
+ data = CommFunc.WriteDWORD(data, self.DayRechargeValues[i])
+ data = CommFunc.WriteDWORD(data, self.AwardRecord)
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ActNum:%d,
+ Days:%d,
+ DayRechargeValues:%s,
+ AwardRecord:%d
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ActNum,
+ self.Days,
+ "...",
+ self.AwardRecord
+ )
+ return DumpString
+
+
+m_NAtagMCActManyDayRechargePlayerInfo=tagMCActManyDayRechargePlayerInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActManyDayRechargePlayerInfo.Head.Cmd,m_NAtagMCActManyDayRechargePlayerInfo.Head.SubCmd))] = m_NAtagMCActManyDayRechargePlayerInfo
+
+
+#------------------------------------------------------
# AA 27 充值返利活动信息 #tagMCActRechargePrizeInfo
class tagMCActRechargePrize(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
index dae834d..fb6a050 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
@@ -518,6 +518,18 @@
("list", "NotifyInfoLoop", 0),
),
+ "ActManyDayRecharge":(
+ ("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),
+ ),
+
"ActTotalRecharge":(
("DWORD", "CfgID", 1),
("list", "PlatformList", 0),
@@ -1714,6 +1726,31 @@
def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # 全服提示信息 - 循环广播[间隔分钟, 广播key]
+# 多日连充活动表
+class IPY_ActManyDayRecharge():
+
+ def __init__(self):
+ self.CfgID = 0
+ self.PlatformList = []
+ self.ServerGroupIDList = []
+ self.ActNum = 0
+ self.StartDate = ""
+ self.EndDate = ""
+ self.NotifyInfoStart = {}
+ self.NotifyInfoEnd = {}
+ self.NotifyInfoLoop = []
+ return
+
+ def GetCfgID(self): return self.CfgID # 配置ID
+ def GetPlatformList(self): return self.PlatformList # 活动平台列表["平台A", "平台A", ...],配[]代表所有
+ def GetServerGroupIDList(self): return self.ServerGroupIDList # 服务器ID列表
+ def GetActNum(self): return self.ActNum # 活动分组编号, 活动类型 * 10 + 不同界面编号
+ def GetStartDate(self): return self.StartDate # 开启日期
+ def GetEndDate(self): return self.EndDate # 结束日期
+ def GetNotifyInfoStart(self): return self.NotifyInfoStart # 全服提示信息 - 相对开始时间
+ def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
+ def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # 全服提示信息 - 循环广播[间隔分钟, 广播key]
+
# 累计充值活动表
class IPY_ActTotalRecharge():
@@ -2200,6 +2237,8 @@
self.ipyActRechargeRebateGoldLen = len(self.ipyActRechargeRebateGoldCache)
self.ipyActGrowupBuyCache = self.__LoadFileData("ActGrowupBuy", IPY_ActGrowupBuy)
self.ipyActGrowupBuyLen = len(self.ipyActGrowupBuyCache)
+ self.ipyActManyDayRechargeCache = self.__LoadFileData("ActManyDayRecharge", IPY_ActManyDayRecharge)
+ self.ipyActManyDayRechargeLen = len(self.ipyActManyDayRechargeCache)
self.ipyActTotalRechargeCache = self.__LoadFileData("ActTotalRecharge", IPY_ActTotalRecharge)
self.ipyActTotalRechargeLen = len(self.ipyActTotalRechargeCache)
self.ipyCrossZoneCommCache = self.__LoadFileData("CrossZoneComm", IPY_CrossZoneComm)
@@ -2492,6 +2531,8 @@
def GetActRechargeRebateGoldByIndex(self, index): return self.ipyActRechargeRebateGoldCache[index]
def GetActGrowupBuyCount(self): return self.ipyActGrowupBuyLen
def GetActGrowupBuyByIndex(self, index): return self.ipyActGrowupBuyCache[index]
+ def GetActManyDayRechargeCount(self): return self.ipyActManyDayRechargeLen
+ def GetActManyDayRechargeByIndex(self, index): return self.ipyActManyDayRechargeCache[index]
def GetActTotalRechargeCount(self): return self.ipyActTotalRechargeLen
def GetActTotalRechargeByIndex(self, index): return self.ipyActTotalRechargeCache[index]
def GetCrossZoneCommCount(self): return self.ipyCrossZoneCommLen
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 0e668e5..a3c5b7a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -25244,6 +25244,298 @@
#------------------------------------------------------
+# AA 48 多日连充活动信息 #tagMCActManyDayRechargeInfo
+
+class tagMCActManyDayRechargeItem(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(tagMCActManyDayRechargeItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 48 多日连充活动信息 //tagMCActManyDayRechargeInfo:
+ ItemID:%d,
+ ItemCount:%d,
+ IsBind:%d
+ '''\
+ %(
+ self.ItemID,
+ self.ItemCount,
+ self.IsBind
+ )
+ return DumpString
+
+
+class tagMCActManyDayRechargeAward(Structure):
+ AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引 0~31
+ NeedRecharge = 0 #(DWORD NeedRecharge)// 单天所需充值额度
+ NeedDays = 0 #(BYTE NeedDays)// 所需充值天数
+ AwardItemCount = 0 #(BYTE AwardItemCount)
+ AwardItemList = list() #(vector<tagMCActManyDayRechargeItem> 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.NeedRecharge,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.NeedDays,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.AwardItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardItemCount):
+ temAwardItemList = tagMCActManyDayRechargeItem()
+ _pos = temAwardItemList.ReadData(_lpData, _pos)
+ self.AwardItemList.append(temAwardItemList)
+ return _pos
+
+ def Clear(self):
+ self.AwardIndex = 0
+ self.NeedRecharge = 0
+ self.NeedDays = 0
+ self.AwardItemCount = 0
+ self.AwardItemList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += 1
+ length += 4
+ length += 1
+ length += 1
+ for i in range(self.AwardItemCount):
+ length += self.AwardItemList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteBYTE(data, self.AwardIndex)
+ data = CommFunc.WriteDWORD(data, self.NeedRecharge)
+ data = CommFunc.WriteBYTE(data, self.NeedDays)
+ data = CommFunc.WriteBYTE(data, self.AwardItemCount)
+ for i in range(self.AwardItemCount):
+ data = CommFunc.WriteString(data, self.AwardItemList[i].GetLength(), self.AwardItemList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ AwardIndex:%d,
+ NeedRecharge:%d,
+ NeedDays:%d,
+ AwardItemCount:%d,
+ AwardItemList:%s
+ '''\
+ %(
+ self.AwardIndex,
+ self.NeedRecharge,
+ self.NeedDays,
+ self.AwardItemCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCActManyDayRechargeInfo(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)// 限制等级
+ AwardCount = 0 #(BYTE AwardCount)
+ AwardList = list() #(vector<tagMCActManyDayRechargeAward> AwardList)// 奖励信息列表
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x48
+ 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.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardCount):
+ temAwardList = tagMCActManyDayRechargeAward()
+ _pos = temAwardList.ReadData(_lpData, _pos)
+ self.AwardList.append(temAwardList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x48
+ self.ActNum = 0
+ self.StartDate = ""
+ self.EndtDate = ""
+ self.LimitLV = 0
+ self.AwardCount = 0
+ self.AwardList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 10
+ length += 10
+ length += 2
+ length += 1
+ for i in range(self.AwardCount):
+ length += self.AwardList[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)
+ 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 = '''
+ Head:%s,
+ ActNum:%d,
+ StartDate:%s,
+ EndtDate:%s,
+ LimitLV:%d,
+ AwardCount:%d,
+ AwardList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ActNum,
+ self.StartDate,
+ self.EndtDate,
+ self.LimitLV,
+ self.AwardCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCActManyDayRechargeInfo=tagMCActManyDayRechargeInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActManyDayRechargeInfo.Head.Cmd,m_NAtagMCActManyDayRechargeInfo.Head.SubCmd))] = m_NAtagMCActManyDayRechargeInfo
+
+
+#------------------------------------------------------
+# AA 49 多日连充活动玩家信息 #tagMCActManyDayRechargePlayerInfo
+
+class tagMCActManyDayRechargePlayerInfo(Structure):
+ Head = tagHead()
+ ActNum = 0 #(BYTE ActNum)//活动编号
+ Days = 0 #(BYTE Days)
+ DayRechargeValues = list() #(vector<DWORD> DayRechargeValues)//活动每天充值列表
+ AwardRecord = 0 #(DWORD AwardRecord)//奖励领奖记录,按奖励索引二进制位存储是否已领取
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x49
+ 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.Days,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.Days):
+ value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+ self.DayRechargeValues.append(value)
+ self.AwardRecord,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x49
+ self.ActNum = 0
+ self.Days = 0
+ self.DayRechargeValues = list()
+ self.AwardRecord = 0
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 1
+ length += 4 * self.Days
+ length += 4
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.ActNum)
+ data = CommFunc.WriteBYTE(data, self.Days)
+ for i in range(self.Days):
+ data = CommFunc.WriteDWORD(data, self.DayRechargeValues[i])
+ data = CommFunc.WriteDWORD(data, self.AwardRecord)
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ActNum:%d,
+ Days:%d,
+ DayRechargeValues:%s,
+ AwardRecord:%d
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ActNum,
+ self.Days,
+ "...",
+ self.AwardRecord
+ )
+ return DumpString
+
+
+m_NAtagMCActManyDayRechargePlayerInfo=tagMCActManyDayRechargePlayerInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActManyDayRechargePlayerInfo.Head.Cmd,m_NAtagMCActManyDayRechargePlayerInfo.Head.SubCmd))] = m_NAtagMCActManyDayRechargePlayerInfo
+
+
+#------------------------------------------------------
# AA 27 充值返利活动信息 #tagMCActRechargePrizeInfo
class tagMCActRechargePrize(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 57f547e..ca8636b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1307,6 +1307,23 @@
("list", "CTGIDGroupList", 0),
),
+ "ActManyDayRecharge":(
+ ("DWORD", "CfgID", 1),
+ ("char", "StartDate", 0),
+ ("char", "EndDate", 0),
+ ("WORD", "LVLimit", 0),
+ ("WORD", "TemplateID", 0),
+ ),
+
+ "ActManyDayRechargeAward":(
+ ("DWORD", "TemplateID", 1),
+ ("DWORD", "NeedRecharge", 0),
+ ("BYTE", "NeedDays", 0),
+ ("BYTE", "AwardIndex", 0),
+ ("dict", "AwardItemInfo", 0),
+ ("char", "NotifyKey", 0),
+ ),
+
"MagicWeaponFB":(
("DWORD", "MWID", 1),
("BYTE", "LineID", 0),
@@ -4424,6 +4441,42 @@
def GetLVLimit(self): return self.LVLimit # 限制等级
def GetCTGIDGroupList(self): return self.CTGIDGroupList # 充值编号组列表 [[ctgID, ...], ...]
+# 多日连充活动表
+class IPY_ActManyDayRecharge():
+
+ def __init__(self):
+ self.CfgID = 0
+ self.StartDate = ""
+ self.EndDate = ""
+ self.LVLimit = 0
+ self.TemplateID = 0
+ return
+
+ def GetCfgID(self): return self.CfgID # 配置ID
+ def GetStartDate(self): return self.StartDate # 开启日期
+ def GetEndDate(self): return self.EndDate # 结束日期
+ def GetLVLimit(self): return self.LVLimit # 限制等级
+ def GetTemplateID(self): return self.TemplateID # 模板编号
+
+# 多日连充模板表
+class IPY_ActManyDayRechargeAward():
+
+ def __init__(self):
+ self.TemplateID = 0
+ self.NeedRecharge = 0
+ self.NeedDays = 0
+ self.AwardIndex = 0
+ self.AwardItemInfo = {}
+ self.NotifyKey = ""
+ return
+
+ def GetTemplateID(self): return self.TemplateID # 模板ID
+ def GetNeedRecharge(self): return self.NeedRecharge # 所需充值额度
+ def GetNeedDays(self): return self.NeedDays # 所需充值天数
+ def GetAwardIndex(self): return self.AwardIndex # 奖励索引
+ def GetAwardItemInfo(self): return self.AwardItemInfo # 奖励物品信息 {世界等级范围:[[物品ID,个数,是否拍品], ...]}
+ def GetNotifyKey(self): return self.NotifyKey # 广播
+
# 法宝副本表
class IPY_MagicWeaponFB():
@@ -5633,6 +5686,10 @@
self.ipyRechargeRebateGoldTemplateLen = len(self.ipyRechargeRebateGoldTemplateCache)
self.ipyActGrowupBuyCache = self.__LoadFileData("ActGrowupBuy", IPY_ActGrowupBuy)
self.ipyActGrowupBuyLen = len(self.ipyActGrowupBuyCache)
+ self.ipyActManyDayRechargeCache = self.__LoadFileData("ActManyDayRecharge", IPY_ActManyDayRecharge)
+ self.ipyActManyDayRechargeLen = len(self.ipyActManyDayRechargeCache)
+ self.ipyActManyDayRechargeAwardCache = self.__LoadFileData("ActManyDayRechargeAward", IPY_ActManyDayRechargeAward)
+ self.ipyActManyDayRechargeAwardLen = len(self.ipyActManyDayRechargeAwardCache)
self.ipyMagicWeaponFBCache = self.__LoadFileData("MagicWeaponFB", IPY_MagicWeaponFB)
self.ipyMagicWeaponFBLen = len(self.ipyMagicWeaponFBCache)
self.ipyIceLodeStarAwardCache = self.__LoadFileData("IceLodeStarAward", IPY_IceLodeStarAward)
@@ -6155,6 +6212,10 @@
def GetRechargeRebateGoldTemplateByIndex(self, index): return self.ipyRechargeRebateGoldTemplateCache[index]
def GetActGrowupBuyCount(self): return self.ipyActGrowupBuyLen
def GetActGrowupBuyByIndex(self, index): return self.ipyActGrowupBuyCache[index]
+ def GetActManyDayRechargeCount(self): return self.ipyActManyDayRechargeLen
+ def GetActManyDayRechargeByIndex(self, index): return self.ipyActManyDayRechargeCache[index]
+ def GetActManyDayRechargeAwardCount(self): return self.ipyActManyDayRechargeAwardLen
+ def GetActManyDayRechargeAwardByIndex(self, index): return self.ipyActManyDayRechargeAwardCache[index]
def GetMagicWeaponFBCount(self): return self.ipyMagicWeaponFBLen
def GetMagicWeaponFBByIndex(self, index): return self.ipyMagicWeaponFBCache[index]
def GetIceLodeStarAwardCount(self): return self.ipyIceLodeStarAwardLen
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 abc2233..0cbe1d1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -107,6 +107,7 @@
import PlayerActTotalRecharge
import PlayerActRechargePrize
import PlayerActRechargeRebateGold
+import PlayerActManyDayRecharge
import PlayerSpringSale
import PlayerFairyCeremony
import PlayerNewFairyCeremony
@@ -711,6 +712,8 @@
PlayerFeastTravel.OnPlayerLogin(curPlayer)
# 登录奖励活动
PlayerActLogin.OnLogin(curPlayer)
+ # 多日连充活动
+ PlayerActManyDayRecharge.OnPlayerLogin(curPlayer)
# 仙界盛典活动
PlayerFairyCeremony.OnLogin(curPlayer)
# 新仙界盛典活动
@@ -5367,6 +5370,9 @@
# 领取累计充值奖励
elif rewardType == ChConfig.Def_RewardType_TotalRecharge:
PlayerActTotalRecharge.OnGetTotalRechargeAward(curPlayer, dataEx, dataExStr)
+ # 领取多日连充领取
+ elif rewardType == ChConfig.Def_RewardType_ManyDayRecharge:
+ PlayerActManyDayRecharge.OnGetManyDayRechargeAward(curPlayer, dataEx, dataExStr)
# 领取boss复活活动奖励
elif rewardType == ChConfig.Def_RewardType_BossReborn:
PlayerBossReborn.GetBossRebornActionAward(curPlayer, dataEx)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py
new file mode 100644
index 0000000..ad66ef8
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py
@@ -0,0 +1,310 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Player.PlayerActManyDayRecharge
+#
+# @todo:多日连充
+# @author hxp
+# @date 2021-03-12
+# @version 1.0
+#
+# 详细描述: 多日连充
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2021-03-12 15:00"""
+#-------------------------------------------------------------------------------
+
+import PyGameData
+import ShareDefine
+import PlayerControl
+import IpyGameDataPY
+import ItemControler
+import ChPyNetSendPack
+import DataRecordPack
+import IPY_GameWorld
+import NetPackCommon
+import GameWorld
+import ChConfig
+
+Max_ActDays = 7 # 支持最大活动持续天
+
+def GetTemplateID(cfgID):
+ if not cfgID:
+ return 0
+ ipyData = IpyGameDataPY.GetIpyGameData("ActManyDayRecharge", cfgID)
+ if not ipyData:
+ return 0
+ return ipyData.GetTemplateID()
+
+def OnPlayerLogin(curPlayer):
+
+ for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_ManyDayRecharge, {}).values():
+ actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0)
+ isReset = __CheckPlayerManyDayRechargeAction(curPlayer, actNum)
+ if not isReset:
+ # 活动中同步活动信息
+ if actInfo.get(ShareDefine.ActKey_State):
+ Sync_ManyDayRechargeActionInfo(curPlayer, actNum)
+ Sync_ManyDayRechargePlayerInfo(curPlayer, actNum)
+
+ return
+
+def RefreshManyDayRechargeActionInfo(actNum):
+ ## 收到GameServer同步的活动信息,刷新活动信息
+ playerManager = GameWorld.GetPlayerManager()
+ for index in xrange(playerManager.GetPlayerCount()):
+ curPlayer = playerManager.GetPlayerByIndex(index)
+ if curPlayer.GetID() == 0:
+ continue
+ __CheckPlayerManyDayRechargeAction(curPlayer, actNum)
+ return
+
+def __CheckPlayerManyDayRechargeAction(curPlayer, actNum):
+ ## 检查玩家活动数据信息
+
+ playerID = curPlayer.GetPlayerID()
+ actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_ManyDayRecharge, actNum)
+ actID = actInfo.get(ShareDefine.ActKey_ID, 0)
+ state = actInfo.get(ShareDefine.ActKey_State, 0)
+ templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0))
+
+ playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeID % actNum) # 玩家身上的活动ID
+ playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeTempID % actNum)
+
+ # 活动ID 相同的话不处理
+ if actID == playerActID:
+ GameWorld.DebugLog("多日连充活动ID不变,不处理!actNum=%s,actID=%s" % (actNum, actID), playerID)
+ if state and templateID and templateID != playerTemplateID:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeTempID % actNum, templateID)
+ Sync_ManyDayRechargePlayerInfo(curPlayer, actNum)
+ GameWorld.DebugLog(" 活动中更新模板ID: templateID=%s" % templateID, playerID)
+
+ return
+
+ actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
+ playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeWorldLV % actNum)
+
+ GameWorld.DebugLog("多日连充重置! actNum=%s,actID=%s,playerActID=%s,state=%s,templateID=%s,playerTemplateID=%s"
+ % (actNum, actID, playerActID, state, templateID, playerTemplateID), playerID)
+
+ # 未领取的奖励邮件发放
+ __SendManyDayRechargeMail(curPlayer, playerTemplateID, playerWorldLV, actNum)
+
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeID % actNum, actID)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeTempID % actNum, templateID)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeWorldLV % actNum, actWorldLV)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward % actNum, 0)
+ for dayIndex in xrange(Max_ActDays):
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex), 0)
+
+ Sync_ManyDayRechargeActionInfo(curPlayer, actNum)
+ Sync_ManyDayRechargePlayerInfo(curPlayer, actNum)
+ return True
+
+def __SendManyDayRechargeMail(curPlayer, playerTemplateID, playerWorldLV, actNum):
+ # 未领取的奖励邮件发放
+
+ if not playerTemplateID:
+ return
+
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActManyDayRechargeAward", playerTemplateID)
+ if not ipyDataList:
+ return
+
+ playerID = curPlayer.GetPlayerID()
+ batchPlayerIDList, batchAddItemList, batchParamList = [], [], []
+ awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeAward % actNum)
+
+ for ipyData in ipyDataList:
+ awardIndex = ipyData.GetAwardIndex()
+ if awardRecord & pow(2, awardIndex):
+ continue
+
+ needRechargeValue = ipyData.GetNeedRecharge()
+ needDays = ipyData.GetNeedDays()
+ finishDays = 0
+ for dayIndex in xrange(Max_ActDays):
+ rechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex))
+ if rechargeValue >= needRechargeValue:
+ finishDays += 1
+
+ if finishDays < needDays:
+ continue
+
+ awardRecord |= pow(2, awardIndex)
+ awardItemList = GameWorld.GetDictValueByRangeKey(ipyData.GetAwardItemInfo(), playerWorldLV, [])
+
+ batchPlayerIDList.append([playerID])
+ batchAddItemList.append(awardItemList)
+ batchParamList.append([needDays, needRechargeValue])
+ GameWorld.Log("多日连充活动补发奖励! actNum=%s,playerTemplateID=%s,awardIndex=%s" % (actNum, playerTemplateID, awardIndex))
+
+ if batchPlayerIDList:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward % actNum, awardRecord)
+ actType = actNum / 10
+ PlayerControl.SendMailBatch("ManyDayRechargeMail%s" % actType, batchPlayerIDList, batchAddItemList, batchParamList)
+
+ return
+
+def AddManyDayRechargeValue(curPlayer, addValue):
+ if addValue <= 0:
+ return
+
+ for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_ManyDayRecharge, {}).values():
+ actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0)
+ dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0)
+ if not actInfo.get(ShareDefine.ActKey_State):
+ GameWorld.DebugLog("多日连充活动当前未开启! actNum=%s" % actNum)
+ continue
+
+ curRechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex))
+ updRechargeValue = curRechargeValue + addValue
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex), updRechargeValue)
+ Sync_ManyDayRechargePlayerInfo(curPlayer, actNum)
+ GameWorld.DebugLog("多日连充充值活动增加充值额度: actNum=%s,dayIndex=%s,curRechargeValue=%s,addValue=%s,updRechargeValue=%s"
+ % (actNum, dayIndex, curRechargeValue, addValue, updRechargeValue), curPlayer.GetPlayerID())
+
+ return
+
+def OnGetManyDayRechargeAward(curPlayer, awardIndex, actNum):
+ '''OnGetManyDayRechargeAward
+ @param awardIndex: 奖励索引
+ @param actNum: 活动编号,如11 或 12 代表不同的活动
+ '''
+ actNum = GameWorld.ToIntDef(actNum, 0)
+ if actNum <= 0:
+ GameWorld.DebugLog("没有指定领取的活动编号! actNum=%s" % actNum)
+ return
+
+ playerID = curPlayer.GetPlayerID()
+ actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_ManyDayRecharge, actNum)
+
+ state = actInfo.get(ShareDefine.ActKey_State, 0)
+ templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0))
+ if not state or not templateID:
+ GameWorld.DebugLog("该多日连充活动非活动中,无法领奖!actNum=%s,state=%s,templateID=%s" % (actNum, state, templateID), playerID)
+ return
+
+ awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeAward % actNum)
+ if awardRecord & pow(2, awardIndex):
+ GameWorld.DebugLog("已经领取过该多日连充活动奖励! actNum=%s,awardIndex=%s" % (actNum, awardIndex), playerID)
+ return
+
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActManyDayRechargeAward", templateID)
+ if not ipyDataList:
+ return
+
+ awardIpyData = None
+ for ipyData in ipyDataList:
+ if ipyData.GetAwardIndex() == awardIndex:
+ awardIpyData = ipyData
+ break
+
+ if not awardIpyData:
+ GameWorld.DebugLog("找不到该多日连充活动档位索引奖励!actNum=%s,templateID=%s,awardIndex=%s" % (actNum, templateID, awardIndex), playerID)
+ return
+
+ needRechargeValue = awardIpyData.GetNeedRecharge()
+ needDays = awardIpyData.GetNeedDays()
+
+ dayRechargeValueDict = {}
+ finishDays = 0
+ for dayIndex in xrange(Max_ActDays):
+ rechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex))
+ if rechargeValue >= needRechargeValue:
+ finishDays += 1
+
+ if rechargeValue:
+ dayRechargeValueDict[dayIndex] = rechargeValue
+
+ if finishDays < needDays:
+ GameWorld.DebugLog("未满足多日连充档次连充天数! templateID=%s,needRechargeValue=%s,needDays(%s) > finishDays(%s), %s"
+ % (templateID, needRechargeValue, needDays, finishDays, dayRechargeValueDict), playerID)
+ return
+
+ actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
+ awardItemList = GameWorld.GetDictValueByRangeKey(ipyData.GetAwardItemInfo(), actWorldLV, [])
+
+ if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList):
+ return
+
+ awardRecord |= pow(2, awardIndex)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward % actNum, awardRecord)
+ Sync_ManyDayRechargePlayerInfo(curPlayer, actNum)
+
+ notifyKey = awardIpyData.GetNotifyKey()
+ GameWorld.DebugLog(" 领取成功! actNum=%s,templateID=%s,awardIndex=%s,needRechargeValue=%s,needDays=%s %s"
+ % (actNum, templateID, awardIndex, needRechargeValue, needDays, dayRechargeValueDict))
+ if notifyKey:
+ PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), needDays, needRechargeValue])
+
+ for itemID, itemCount, isAuctionItem in awardItemList:
+ ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem])
+
+ addDataDict = {"TemplateID":templateID, "AwardIndex":awardIndex, "ItemList":str(awardItemList), "ActNum":actNum}
+ DataRecordPack.DR_FuncGiveItem(curPlayer, "ManyDayRechargeAward", addDataDict)
+ return
+
+def Sync_ManyDayRechargePlayerInfo(curPlayer, actNum):
+ ## 通知玩家数据信息
+ playerActInfo = ChPyNetSendPack.tagMCActManyDayRechargePlayerInfo()
+ playerActInfo.ActNum = actNum
+ playerActInfo.DayRechargeValues = []
+ for dayIndex in xrange(Max_ActDays):
+ rechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex))
+ playerActInfo.DayRechargeValues.append(rechargeValue)
+ playerActInfo.Days = len(playerActInfo.DayRechargeValues)
+ playerActInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeAward % actNum)
+ NetPackCommon.SendFakePack(curPlayer, playerActInfo)
+ return
+
+def Sync_ManyDayRechargeActionInfo(curPlayer, actNum):
+ ## 通知活动信息
+
+ actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_ManyDayRecharge, actNum)
+ if not actInfo.get(ShareDefine.ActKey_State):
+ return
+
+ cfgID = actInfo.get(ShareDefine.ActKey_CfgID)
+ ipyData = IpyGameDataPY.GetIpyGameData("ActManyDayRecharge", cfgID)
+ if not ipyData:
+ return
+
+ templateID = ipyData.GetTemplateID()
+ if not templateID:
+ return
+
+ actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
+ openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+
+ clientPack = ChPyNetSendPack.tagMCActManyDayRechargeInfo()
+ clientPack.ActNum = actNum
+ clientPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
+ clientPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ clientPack.LimitLV = ipyData.GetLVLimit()
+ clientPack.AwardList = []
+
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActManyDayRechargeAward", templateID)
+ if ipyDataList:
+ for awardIpyData in ipyDataList:
+ awardInfo = ChPyNetSendPack.tagMCActManyDayRechargeAward()
+ awardInfo.AwardIndex = awardIpyData.GetAwardIndex()
+ awardInfo.NeedRecharge = awardIpyData.GetNeedRecharge()
+ awardInfo.NeedDays = awardIpyData.GetNeedDays()
+ awardInfo.AwardItemList = []
+ awardItemList = GameWorld.GetDictValueByRangeKey(awardIpyData.GetAwardItemInfo(), actWorldLV, [])
+ for itemID, itemCount, isBind in awardItemList:
+ awardItem = ChPyNetSendPack.tagMCActManyDayRechargeItem()
+ awardItem.ItemID = itemID
+ awardItem.ItemCount = itemCount
+ awardItem.IsBind = isBind
+ awardInfo.AwardItemList.append(awardItem)
+ awardInfo.AwardItemCount = len(awardInfo.AwardItemList)
+
+ clientPack.AwardList.append(awardInfo)
+
+ clientPack.AwardCount = len(clientPack.AwardList)
+ NetPackCommon.SendFakePack(curPlayer, clientPack)
+ 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 5ce8c2d..ba67337 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -78,6 +78,7 @@
import PlayerActCollectWords
import PlayerActTotalRecharge
import PlayerActRechargeRebateGold
+import PlayerActManyDayRecharge
import PlayerActRechargePrize
import PlayerActGrowupBuy
import PlayerSpringSale
@@ -1358,6 +1359,9 @@
elif actionName == ShareDefine.OperationActionName_TotalRecharge:
PlayerActTotalRecharge.RefreshTotalRechargeActionInfo(actNum)
+ elif actionName == ShareDefine.OperationActionName_ManyDayRecharge:
+ PlayerActManyDayRecharge.RefreshManyDayRechargeActionInfo(actNum)
+
elif actionName == ShareDefine.OperationActionName_SpringSale:
PlayerSpringSale.RefreshSpringSaleActionInfo(actNum)
--
Gitblit v1.8.0