From 32f92cf196d36588653093f9a27d3ce41df2b9ca Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 07 四月 2021 17:42:12 +0800
Subject: [PATCH] 8886 【BT2】【后端】线下活动支持(增加单笔累充系统)
---
ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 44 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 271 +++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 67 +++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActSingleRecharge.py | 340 ++++++++++++++++++
PySysDB/PySysDBPY.h | 25 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 271 +++++++++++++++
PySysDB/PySysDBG.h | 16
8 files changed, 1,038 insertions(+), 0 deletions(-)
diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h
index cb8252d..a018acf 100644
--- a/PySysDB/PySysDBG.h
+++ b/PySysDB/PySysDBG.h
@@ -622,6 +622,22 @@
list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key]
};
+//单笔累充活动表
+
+struct tagActSingleRecharge
+{
+ DWORD _CfgID; //配置ID
+ list PlatformList; //活动平台列表["平台A", "平台A", ...],配[]代表所有
+ list ServerGroupIDList; //服务器ID列表
+ BYTE ActNum; //活动分组编号, 活动类型 * 10 + 不同界面编号
+ char StartDate; //开启日期
+ char EndDate; //结束日期
+ dict NotifyInfoStart; //全服提示信息 - 相对开始时间
+ dict NotifyInfoEnd; //全服提示信息 - 相对结束时间
+ list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key]
+ BYTE IsDayReset; //是否每天重置
+};
+
//多日连充活动表
struct tagActManyDayRecharge
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 5ea565625..57c7409 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1679,6 +1679,31 @@
char NotifyKey; //广播
};
+//单笔累充活动表
+
+struct tagActSingleRecharge
+{
+ DWORD _CfgID; //配置ID
+ char StartDate; //开启日期
+ char EndDate; //结束日期
+ WORD LVLimit; //限制等级
+ BYTE IsDayReset; //是否每天重置
+ BYTE CTGTypeEffValue; //充值有效类型值
+ BYTE IsOfflineAct; //是否线下活动
+ list TemplateIDList; //模板ID列表
+};
+
+//单笔累充模板表
+
+struct tagActSingleRechargeAward
+{
+ DWORD _TemplateID; //模板ID
+ DWORD SingleRechargeValue; //单笔充值额度
+ BYTE AwardIndex; //返利奖励索引0~31,同个模板中不重复
+ dict AwardItem; //返利物品信息列表 {职业:[(物品ID,个数,是否绑定),...]}
+ char NotifyKey; //全服广播key,默认两个参数(玩家名, 档位额度)
+};
+
//法宝副本表
struct tagMagicWeaponFB
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index a50930a..4eea8de 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -25962,6 +25962,277 @@
#------------------------------------------------------
+# AA 50 单笔累充活动信息 #tagMCActSingleRechargeInfo
+
+class tagMCActSingleRechargeAwardItem(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(tagMCActSingleRechargeAwardItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 50 单笔累充活动信息 //tagMCActSingleRechargeInfo:
+ ItemID:%d,
+ ItemCount:%d,
+ IsBind:%d
+ '''\
+ %(
+ self.ItemID,
+ self.ItemCount,
+ self.IsBind
+ )
+ return DumpString
+
+
+class tagMCActSingleRechargeAward(Structure):
+ AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引 0~31
+ SingleRechargeValue = 0 #(DWORD SingleRechargeValue)// 单笔所需充值额度
+ AwardItemCount = 0 #(BYTE AwardItemCount)// 奖励物品数
+ AwardItem = list() #(vector<tagMCActSingleRechargeAwardItem> AwardItem)// 奖励物品信息
+ 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.SingleRechargeValue,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.AwardItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardItemCount):
+ temAwardItem = tagMCActSingleRechargeAwardItem()
+ _pos = temAwardItem.ReadData(_lpData, _pos)
+ self.AwardItem.append(temAwardItem)
+ return _pos
+
+ def Clear(self):
+ self.AwardIndex = 0
+ self.SingleRechargeValue = 0
+ self.AwardItemCount = 0
+ self.AwardItem = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += 1
+ length += 4
+ length += 1
+ for i in range(self.AwardItemCount):
+ length += self.AwardItem[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteBYTE(data, self.AwardIndex)
+ data = CommFunc.WriteDWORD(data, self.SingleRechargeValue)
+ data = CommFunc.WriteBYTE(data, self.AwardItemCount)
+ for i in range(self.AwardItemCount):
+ data = CommFunc.WriteString(data, self.AwardItem[i].GetLength(), self.AwardItem[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ AwardIndex:%d,
+ SingleRechargeValue:%d,
+ AwardItemCount:%d,
+ AwardItem:%s
+ '''\
+ %(
+ self.AwardIndex,
+ self.SingleRechargeValue,
+ self.AwardItemCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCActSingleRechargeInfo(Structure):
+ Head = tagHead()
+ ActNum = 0 #(BYTE ActNum)//活动编号
+ StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
+ EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
+ IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置
+ LimitLV = 0 #(WORD LimitLV)// 限制等级
+ AwardCount = 0 #(BYTE AwardCount)// 奖励档数
+ AwardInfo = list() #(vector<tagMCActSingleRechargeAward> AwardInfo)// 奖励档信息
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x50
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+ self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+ self.IsDayReset,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardCount):
+ temAwardInfo = tagMCActSingleRechargeAward()
+ _pos = temAwardInfo.ReadData(_lpData, _pos)
+ self.AwardInfo.append(temAwardInfo)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x50
+ self.ActNum = 0
+ self.StartDate = ""
+ self.EndtDate = ""
+ self.IsDayReset = 0
+ self.LimitLV = 0
+ self.AwardCount = 0
+ self.AwardInfo = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 10
+ length += 10
+ length += 1
+ length += 2
+ length += 1
+ for i in range(self.AwardCount):
+ length += self.AwardInfo[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.ActNum)
+ data = CommFunc.WriteString(data, 10, self.StartDate)
+ data = CommFunc.WriteString(data, 10, self.EndtDate)
+ data = CommFunc.WriteBYTE(data, self.IsDayReset)
+ data = CommFunc.WriteWORD(data, self.LimitLV)
+ data = CommFunc.WriteBYTE(data, self.AwardCount)
+ for i in range(self.AwardCount):
+ data = CommFunc.WriteString(data, self.AwardInfo[i].GetLength(), self.AwardInfo[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ActNum:%d,
+ StartDate:%s,
+ EndtDate:%s,
+ IsDayReset:%d,
+ LimitLV:%d,
+ AwardCount:%d,
+ AwardInfo:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ActNum,
+ self.StartDate,
+ self.EndtDate,
+ self.IsDayReset,
+ self.LimitLV,
+ self.AwardCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCActSingleRechargeInfo=tagMCActSingleRechargeInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargeInfo.Head.Cmd,m_NAtagMCActSingleRechargeInfo.Head.SubCmd))] = m_NAtagMCActSingleRechargeInfo
+
+
+#------------------------------------------------------
+# AA 51 单笔累充活动玩家信息 #tagMCActSingleRechargePlayerInfo
+
+class tagMCActSingleRechargePlayerInfo(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ActNum", c_ubyte), #活动编号从1开始,目前支持两个累充活动同时存在且相互独立 1或2
+ ("HightestSingleRecharge", c_int), # 最高单笔充值额度
+ ("AwardRecord", c_int), #奖励领奖记录,按奖励索引二进制位存储是否已领取
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xAA
+ self.SubCmd = 0x51
+ 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 = 0x51
+ self.ActNum = 0
+ self.HightestSingleRecharge = 0
+ self.AwardRecord = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCActSingleRechargePlayerInfo)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 51 单笔累充活动玩家信息 //tagMCActSingleRechargePlayerInfo:
+ Cmd:%s,
+ SubCmd:%s,
+ ActNum:%d,
+ HightestSingleRecharge:%d,
+ AwardRecord:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ActNum,
+ self.HightestSingleRecharge,
+ self.AwardRecord
+ )
+ return DumpString
+
+
+m_NAtagMCActSingleRechargePlayerInfo=tagMCActSingleRechargePlayerInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargePlayerInfo.Cmd,m_NAtagMCActSingleRechargePlayerInfo.SubCmd))] = m_NAtagMCActSingleRechargePlayerInfo
+
+
+#------------------------------------------------------
# AA 1D 累计充值活动信息 #tagMCActTotalRechargeInfo
class tagMCTotalRechargeAwardItem(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
index 33e1944..6c250f8 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
@@ -519,6 +519,19 @@
("list", "NotifyInfoLoop", 0),
),
+ "ActSingleRecharge":(
+ ("DWORD", "CfgID", 1),
+ ("list", "PlatformList", 0),
+ ("list", "ServerGroupIDList", 0),
+ ("BYTE", "ActNum", 0),
+ ("char", "StartDate", 0),
+ ("char", "EndDate", 0),
+ ("dict", "NotifyInfoStart", 0),
+ ("dict", "NotifyInfoEnd", 0),
+ ("list", "NotifyInfoLoop", 0),
+ ("BYTE", "IsDayReset", 0),
+ ),
+
"ActManyDayRecharge":(
("DWORD", "CfgID", 1),
("list", "PlatformList", 0),
@@ -1729,6 +1742,33 @@
def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # 全服提示信息 - 循环广播[间隔分钟, 广播key]
+# 单笔累充活动表
+class IPY_ActSingleRecharge():
+
+ def __init__(self):
+ self.CfgID = 0
+ self.PlatformList = []
+ self.ServerGroupIDList = []
+ self.ActNum = 0
+ self.StartDate = ""
+ self.EndDate = ""
+ self.NotifyInfoStart = {}
+ self.NotifyInfoEnd = {}
+ self.NotifyInfoLoop = []
+ self.IsDayReset = 0
+ 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]
+ def GetIsDayReset(self): return self.IsDayReset # 是否每天重置
+
# 多日连充活动表
class IPY_ActManyDayRecharge():
@@ -2240,6 +2280,8 @@
self.ipyActRechargeRebateGoldLen = len(self.ipyActRechargeRebateGoldCache)
self.ipyActGrowupBuyCache = self.__LoadFileData("ActGrowupBuy", IPY_ActGrowupBuy)
self.ipyActGrowupBuyLen = len(self.ipyActGrowupBuyCache)
+ self.ipyActSingleRechargeCache = self.__LoadFileData("ActSingleRecharge", IPY_ActSingleRecharge)
+ self.ipyActSingleRechargeLen = len(self.ipyActSingleRechargeCache)
self.ipyActManyDayRechargeCache = self.__LoadFileData("ActManyDayRecharge", IPY_ActManyDayRecharge)
self.ipyActManyDayRechargeLen = len(self.ipyActManyDayRechargeCache)
self.ipyActTotalRechargeCache = self.__LoadFileData("ActTotalRecharge", IPY_ActTotalRecharge)
@@ -2534,6 +2576,8 @@
def GetActRechargeRebateGoldByIndex(self, index): return self.ipyActRechargeRebateGoldCache[index]
def GetActGrowupBuyCount(self): return self.ipyActGrowupBuyLen
def GetActGrowupBuyByIndex(self, index): return self.ipyActGrowupBuyCache[index]
+ def GetActSingleRechargeCount(self): return self.ipyActSingleRechargeLen
+ def GetActSingleRechargeByIndex(self, index): return self.ipyActSingleRechargeCache[index]
def GetActManyDayRechargeCount(self): return self.ipyActManyDayRechargeLen
def GetActManyDayRechargeByIndex(self, index): return self.ipyActManyDayRechargeCache[index]
def GetActTotalRechargeCount(self): return self.ipyActTotalRechargeLen
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index a50930a..4eea8de 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -25962,6 +25962,277 @@
#------------------------------------------------------
+# AA 50 单笔累充活动信息 #tagMCActSingleRechargeInfo
+
+class tagMCActSingleRechargeAwardItem(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(tagMCActSingleRechargeAwardItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 50 单笔累充活动信息 //tagMCActSingleRechargeInfo:
+ ItemID:%d,
+ ItemCount:%d,
+ IsBind:%d
+ '''\
+ %(
+ self.ItemID,
+ self.ItemCount,
+ self.IsBind
+ )
+ return DumpString
+
+
+class tagMCActSingleRechargeAward(Structure):
+ AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引 0~31
+ SingleRechargeValue = 0 #(DWORD SingleRechargeValue)// 单笔所需充值额度
+ AwardItemCount = 0 #(BYTE AwardItemCount)// 奖励物品数
+ AwardItem = list() #(vector<tagMCActSingleRechargeAwardItem> AwardItem)// 奖励物品信息
+ 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.SingleRechargeValue,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.AwardItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardItemCount):
+ temAwardItem = tagMCActSingleRechargeAwardItem()
+ _pos = temAwardItem.ReadData(_lpData, _pos)
+ self.AwardItem.append(temAwardItem)
+ return _pos
+
+ def Clear(self):
+ self.AwardIndex = 0
+ self.SingleRechargeValue = 0
+ self.AwardItemCount = 0
+ self.AwardItem = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += 1
+ length += 4
+ length += 1
+ for i in range(self.AwardItemCount):
+ length += self.AwardItem[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteBYTE(data, self.AwardIndex)
+ data = CommFunc.WriteDWORD(data, self.SingleRechargeValue)
+ data = CommFunc.WriteBYTE(data, self.AwardItemCount)
+ for i in range(self.AwardItemCount):
+ data = CommFunc.WriteString(data, self.AwardItem[i].GetLength(), self.AwardItem[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ AwardIndex:%d,
+ SingleRechargeValue:%d,
+ AwardItemCount:%d,
+ AwardItem:%s
+ '''\
+ %(
+ self.AwardIndex,
+ self.SingleRechargeValue,
+ self.AwardItemCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCActSingleRechargeInfo(Structure):
+ Head = tagHead()
+ ActNum = 0 #(BYTE ActNum)//活动编号
+ StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
+ EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
+ IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置
+ LimitLV = 0 #(WORD LimitLV)// 限制等级
+ AwardCount = 0 #(BYTE AwardCount)// 奖励档数
+ AwardInfo = list() #(vector<tagMCActSingleRechargeAward> AwardInfo)// 奖励档信息
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x50
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+ self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+ self.IsDayReset,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardCount):
+ temAwardInfo = tagMCActSingleRechargeAward()
+ _pos = temAwardInfo.ReadData(_lpData, _pos)
+ self.AwardInfo.append(temAwardInfo)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x50
+ self.ActNum = 0
+ self.StartDate = ""
+ self.EndtDate = ""
+ self.IsDayReset = 0
+ self.LimitLV = 0
+ self.AwardCount = 0
+ self.AwardInfo = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 10
+ length += 10
+ length += 1
+ length += 2
+ length += 1
+ for i in range(self.AwardCount):
+ length += self.AwardInfo[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.ActNum)
+ data = CommFunc.WriteString(data, 10, self.StartDate)
+ data = CommFunc.WriteString(data, 10, self.EndtDate)
+ data = CommFunc.WriteBYTE(data, self.IsDayReset)
+ data = CommFunc.WriteWORD(data, self.LimitLV)
+ data = CommFunc.WriteBYTE(data, self.AwardCount)
+ for i in range(self.AwardCount):
+ data = CommFunc.WriteString(data, self.AwardInfo[i].GetLength(), self.AwardInfo[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ActNum:%d,
+ StartDate:%s,
+ EndtDate:%s,
+ IsDayReset:%d,
+ LimitLV:%d,
+ AwardCount:%d,
+ AwardInfo:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ActNum,
+ self.StartDate,
+ self.EndtDate,
+ self.IsDayReset,
+ self.LimitLV,
+ self.AwardCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCActSingleRechargeInfo=tagMCActSingleRechargeInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargeInfo.Head.Cmd,m_NAtagMCActSingleRechargeInfo.Head.SubCmd))] = m_NAtagMCActSingleRechargeInfo
+
+
+#------------------------------------------------------
+# AA 51 单笔累充活动玩家信息 #tagMCActSingleRechargePlayerInfo
+
+class tagMCActSingleRechargePlayerInfo(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ActNum", c_ubyte), #活动编号从1开始,目前支持两个累充活动同时存在且相互独立 1或2
+ ("HightestSingleRecharge", c_int), # 最高单笔充值额度
+ ("AwardRecord", c_int), #奖励领奖记录,按奖励索引二进制位存储是否已领取
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xAA
+ self.SubCmd = 0x51
+ 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 = 0x51
+ self.ActNum = 0
+ self.HightestSingleRecharge = 0
+ self.AwardRecord = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCActSingleRechargePlayerInfo)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 51 单笔累充活动玩家信息 //tagMCActSingleRechargePlayerInfo:
+ Cmd:%s,
+ SubCmd:%s,
+ ActNum:%d,
+ HightestSingleRecharge:%d,
+ AwardRecord:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ActNum,
+ self.HightestSingleRecharge,
+ self.AwardRecord
+ )
+ return DumpString
+
+
+m_NAtagMCActSingleRechargePlayerInfo=tagMCActSingleRechargePlayerInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargePlayerInfo.Cmd,m_NAtagMCActSingleRechargePlayerInfo.SubCmd))] = m_NAtagMCActSingleRechargePlayerInfo
+
+
+#------------------------------------------------------
# AA 1D 累计充值活动信息 #tagMCActTotalRechargeInfo
class tagMCTotalRechargeAwardItem(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 85c7c3e..a660f70 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1324,6 +1324,25 @@
("char", "NotifyKey", 0),
),
+ "ActSingleRecharge":(
+ ("DWORD", "CfgID", 1),
+ ("char", "StartDate", 0),
+ ("char", "EndDate", 0),
+ ("WORD", "LVLimit", 0),
+ ("BYTE", "IsDayReset", 0),
+ ("BYTE", "CTGTypeEffValue", 0),
+ ("BYTE", "IsOfflineAct", 0),
+ ("list", "TemplateIDList", 0),
+ ),
+
+ "ActSingleRechargeAward":(
+ ("DWORD", "TemplateID", 1),
+ ("DWORD", "SingleRechargeValue", 0),
+ ("BYTE", "AwardIndex", 0),
+ ("dict", "AwardItem", 0),
+ ("char", "NotifyKey", 0),
+ ),
+
"MagicWeaponFB":(
("DWORD", "MWID", 1),
("BYTE", "LineID", 0),
@@ -4477,6 +4496,46 @@
def GetAwardItemInfo(self): return self.AwardItemInfo # 奖励物品信息 {世界等级范围:[[物品ID,个数,是否拍品], ...]}
def GetNotifyKey(self): return self.NotifyKey # 广播
+# 单笔累充活动表
+class IPY_ActSingleRecharge():
+
+ def __init__(self):
+ self.CfgID = 0
+ self.StartDate = ""
+ self.EndDate = ""
+ self.LVLimit = 0
+ self.IsDayReset = 0
+ self.CTGTypeEffValue = 0
+ self.IsOfflineAct = 0
+ self.TemplateIDList = []
+ 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 GetIsDayReset(self): return self.IsDayReset # 是否每天重置
+ def GetCTGTypeEffValue(self): return self.CTGTypeEffValue # 充值有效类型值
+ def GetIsOfflineAct(self): return self.IsOfflineAct # 是否线下活动
+ def GetTemplateIDList(self): return self.TemplateIDList # 模板ID列表
+
+# 单笔累充模板表
+class IPY_ActSingleRechargeAward():
+
+ def __init__(self):
+ self.TemplateID = 0
+ self.SingleRechargeValue = 0
+ self.AwardIndex = 0
+ self.AwardItem = {}
+ self.NotifyKey = ""
+ return
+
+ def GetTemplateID(self): return self.TemplateID # 模板ID
+ def GetSingleRechargeValue(self): return self.SingleRechargeValue # 单笔充值额度
+ def GetAwardIndex(self): return self.AwardIndex # 返利奖励索引0~31,同个模板中不重复
+ def GetAwardItem(self): return self.AwardItem # 返利物品信息列表 {职业:[(物品ID,个数,是否绑定),...]}
+ def GetNotifyKey(self): return self.NotifyKey # 全服广播key,默认两个参数(玩家名, 档位额度)
+
# 法宝副本表
class IPY_MagicWeaponFB():
@@ -5690,6 +5749,10 @@
self.ipyActManyDayRechargeLen = len(self.ipyActManyDayRechargeCache)
self.ipyActManyDayRechargeAwardCache = self.__LoadFileData("ActManyDayRechargeAward", IPY_ActManyDayRechargeAward)
self.ipyActManyDayRechargeAwardLen = len(self.ipyActManyDayRechargeAwardCache)
+ self.ipyActSingleRechargeCache = self.__LoadFileData("ActSingleRecharge", IPY_ActSingleRecharge)
+ self.ipyActSingleRechargeLen = len(self.ipyActSingleRechargeCache)
+ self.ipyActSingleRechargeAwardCache = self.__LoadFileData("ActSingleRechargeAward", IPY_ActSingleRechargeAward)
+ self.ipyActSingleRechargeAwardLen = len(self.ipyActSingleRechargeAwardCache)
self.ipyMagicWeaponFBCache = self.__LoadFileData("MagicWeaponFB", IPY_MagicWeaponFB)
self.ipyMagicWeaponFBLen = len(self.ipyMagicWeaponFBCache)
self.ipyIceLodeStarAwardCache = self.__LoadFileData("IceLodeStarAward", IPY_IceLodeStarAward)
@@ -6216,6 +6279,10 @@
def GetActManyDayRechargeByIndex(self, index): return self.ipyActManyDayRechargeCache[index]
def GetActManyDayRechargeAwardCount(self): return self.ipyActManyDayRechargeAwardLen
def GetActManyDayRechargeAwardByIndex(self, index): return self.ipyActManyDayRechargeAwardCache[index]
+ def GetActSingleRechargeCount(self): return self.ipyActSingleRechargeLen
+ def GetActSingleRechargeByIndex(self, index): return self.ipyActSingleRechargeCache[index]
+ def GetActSingleRechargeAwardCount(self): return self.ipyActSingleRechargeAwardLen
+ def GetActSingleRechargeAwardByIndex(self, index): return self.ipyActSingleRechargeAwardCache[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/PlayerActSingleRecharge.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActSingleRecharge.py
new file mode 100644
index 0000000..c0de09e
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActSingleRecharge.py
@@ -0,0 +1,340 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Player.PlayerActSingleRecharge
+#
+# @todo:单笔累充活动
+# @author hxp
+# @date 2021-04-07
+# @version 1.0
+#
+# 详细描述: 单笔累充活动
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2021-04-07 17:30"""
+#-------------------------------------------------------------------------------
+
+import PyGameData
+import ShareDefine
+import PlayerControl
+import IpyGameDataPY
+import ItemControler
+import ChPyNetSendPack
+import IPY_GameWorld
+import NetPackCommon
+import GameWorld
+import ChConfig
+
+def GetTemplateID(cfgID, dayIndex):
+ if not cfgID or dayIndex == None:
+ return 0
+ ipyData = IpyGameDataPY.GetIpyGameData("ActSingleRecharge", cfgID)
+ if not ipyData:
+ return 0
+ templateIDList = ipyData.GetTemplateIDList()
+ templateID = templateIDList[-1] if dayIndex >= len(templateIDList) else templateIDList[dayIndex]
+ return templateID
+
+def OnPlayerLogin(curPlayer):
+
+ for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_SingleRecharge, {}).values():
+ actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0)
+ isReset = __CheckPlayerSingleRechargeAction(curPlayer, actNum)
+ if not isReset:
+ # 活动中同步活动信息
+ if actInfo.get(ShareDefine.ActKey_State):
+ Sync_SingleRechargeActionInfo(curPlayer, actNum)
+ Sync_SingleRechargePlayerInfo(curPlayer, actNum)
+
+ return
+
+def RefreshSingleRechargeActionInfo(actNum):
+ ## 收到GameServer同步的活动信息,刷新活动信息
+ playerManager = GameWorld.GetPlayerManager()
+ for index in xrange(playerManager.GetPlayerCount()):
+ curPlayer = playerManager.GetPlayerByIndex(index)
+ if curPlayer.GetID() == 0:
+ continue
+ __CheckPlayerSingleRechargeAction(curPlayer, actNum)
+ return
+
+def __CheckPlayerSingleRechargeAction(curPlayer, actNum):
+ ## 检查玩家活动数据信息
+
+ playerID = curPlayer.GetPlayerID()
+ actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_SingleRecharge, actNum)
+ actID = actInfo.get(ShareDefine.ActKey_ID, 0)
+ state = actInfo.get(ShareDefine.ActKey_State, 0)
+
+ playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeID % actNum) # 玩家身上的活动ID
+ playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeTemplateID % actNum)
+
+ templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
+
+ # 活动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_SingleRechargeTemplateID % actNum, templateID)
+ Sync_SingleRechargeActionInfo(curPlayer, actNum)
+ Sync_SingleRechargePlayerInfo(curPlayer, actNum)
+ GameWorld.DebugLog(" 活动中更新模板ID: templateID=%s" % templateID, playerID)
+
+ return
+
+ actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
+ playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeWorldLV % actNum)
+
+ GameWorld.DebugLog("单笔累充重置! actNum=%s,actID=%s,playerActID=%s,state=%s,templateID=%s,playerTemplateID=%s"
+ % (actNum, actID, playerActID, state, templateID, playerTemplateID), playerID)
+
+ # 未领取的奖励邮件发放
+ __SendSingleRechargeMail(curPlayer, playerTemplateID, playerWorldLV, actNum)
+
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeID % actNum, actID)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeTemplateID % actNum, templateID)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeWorldLV % actNum, actWorldLV)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeAward % actNum, 0)
+
+ Sync_SingleRechargeActionInfo(curPlayer, actNum)
+ Sync_SingleRechargePlayerInfo(curPlayer, actNum)
+ return True
+
+def __SendSingleRechargeMail(curPlayer, playerTemplateID, playerWorldLV, actNum):
+ # 未领取的奖励邮件发放
+
+ if not playerTemplateID:
+ return
+
+ curRechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
+ if not curRechargeValue:
+ return
+
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", playerTemplateID)
+ if not ipyDataList:
+ return
+
+ playerID = curPlayer.GetPlayerID()
+ batchPlayerIDList, batchAddItemList, batchParamList = [], [], []
+ awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeAward % actNum)
+
+ for ipyData in ipyDataList:
+ awardIndex = ipyData.GetAwardIndex()
+ if awardRecord & pow(2, awardIndex):
+ continue
+
+ singleValue = ipyData.GetSingleRechargeValue()
+ if curRechargeValue < singleValue:
+ continue
+ awardRecord |= pow(2, awardIndex)
+
+ awardItemList = GameWorld.GetDictValueByRangeKey(ipyData.GetAwardItem(), playerWorldLV, [])
+ batchPlayerIDList.append([playerID])
+ batchAddItemList.append(awardItemList)
+ batchParamList.append([singleValue])
+
+ if batchPlayerIDList:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeAward % actNum, awardRecord)
+ PlayerControl.SendMailBatch("SingleRechargeMail%s" % actNum, batchPlayerIDList, batchAddItemList, batchParamList)
+
+ return
+
+def UpdSingleRechargeValue(curPlayer, updRechargeValue, coinType):
+ if updRechargeValue <= 0:
+ return
+
+ for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_SingleRecharge, {}).values():
+ actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0)
+ if not actInfo.get(ShareDefine.ActKey_State):
+ GameWorld.DebugLog("单笔累充活动当前未开启! actNum=%s" % actNum)
+ continue
+
+ cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0)
+ if not cfgID:
+ continue
+
+ ipyData = IpyGameDataPY.GetIpyGameData("ActSingleRecharge", cfgID)
+ if not ipyData:
+ continue
+
+ ctgTypeEffValue = ipyData.GetCTGTypeEffValue()
+ if not ctgTypeEffValue & pow(2, coinType):
+ GameWorld.DebugLog("单笔累充充值活动,充值类型对该活动无效! actNum=%s,coinType=%s,ctgTypeEffValue=%s"
+ % (actNum, coinType, ctgTypeEffValue), curPlayer.GetPlayerID())
+ continue
+
+ templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
+ if not templateID:
+ GameWorld.ErrLog("单笔累充充值活动数据异常!cfgID=%s,templateID=%s" % (cfgID, templateID), curPlayer.GetPlayerID())
+ continue
+
+ curRechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
+ if curRechargeValue >= updRechargeValue:
+ GameWorld.DebugLog("单笔累充充值活动,未超过当前单笔累充额度,不更新! actNum=%s,curRechargeValue=%s >= updRechargeValue=%s"
+ % (actNum, curRechargeValue, updRechargeValue), curPlayer.GetPlayerID())
+ continue
+
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, updRechargeValue)
+ Sync_SingleRechargePlayerInfo(curPlayer, actNum)
+ GameWorld.DebugLog("单笔累充充值活动更新单笔充值额度: actNum=%s,curRechargeValue=%s,updRechargeValue=%s"
+ % (actNum, curRechargeValue, updRechargeValue), curPlayer.GetPlayerID())
+
+ # 线下活动,检查发放奖励
+ if ipyData.GetIsOfflineAct():
+ playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeWorldLV % actNum)
+ __SendSingleRechargeMail(curPlayer, templateID, playerWorldLV, actNum)
+
+ return
+
+def OnGetSingleRechargeAward(curPlayer, awardIndex, actNum):
+ '''领取奖励
+ @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_SingleRecharge, actNum)
+
+ state = actInfo.get(ShareDefine.ActKey_State, 0)
+ templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 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_SingleRechargeAward % actNum)
+ if awardRecord & pow(2, awardIndex):
+ GameWorld.DebugLog("已经领取过该单笔累充活动奖励! actNum=%s,awardIndex=%s" % (actNum, awardIndex), playerID)
+ return
+
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", 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
+
+ singleValue = awardIpyData.GetSingleRechargeValue()
+ curRechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
+
+ if curRechargeValue < singleValue:
+ GameWorld.DebugLog("所需单笔充值额度不足,无法领取! templateID=%s,awardIndex=%s,singleValue=(%s) > curRechargeValue(%s)"
+ % (templateID, awardIndex, singleValue, curRechargeValue), playerID)
+ return
+
+ actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
+ awardItemList = GameWorld.GetDictValueByRangeKey(ipyData.GetAwardItem(), actWorldLV, [])
+
+ if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList):
+ return
+
+ awardRecord |= pow(2, awardIndex)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeAward % actNum, awardRecord)
+ Sync_SingleRechargePlayerInfo(curPlayer, actNum)
+
+ GameWorld.DebugLog(" 领取成功! actNum=%s,templateID=%s,awardIndex=%s,singleValue=%s,awardRecord=%s"
+ % (actNum, templateID, awardIndex, singleValue, awardRecord))
+
+ notifyKey = awardIpyData.GetNotifyKey()
+ if notifyKey:
+ PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), singleValue])
+
+ for itemID, itemCount, isAuctionItem in awardItemList:
+ ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem], event=["SingleRechargeAward", False, {}])
+
+ return
+
+def Sync_SingleRechargePlayerInfo(curPlayer, actNum):
+ ## 通知玩家数据信息
+
+ actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_SingleRecharge, actNum)
+ if not actInfo.get(ShareDefine.ActKey_State):
+ return
+
+ cfgID = actInfo.get(ShareDefine.ActKey_CfgID)
+ if not cfgID:
+ return
+
+ ipyData = IpyGameDataPY.GetIpyGameData("ActSingleRecharge", cfgID)
+ if not ipyData:
+ return
+
+ if ipyData.GetIsOfflineAct():
+ #线下活动不下发
+ return
+
+ playerActInfo = ChPyNetSendPack.tagMCActSingleRechargePlayerInfo()
+ playerActInfo.ActNum = actNum
+ playerActInfo.HightestSingleRecharge = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
+ playerActInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeAward % actNum)
+ NetPackCommon.SendFakePack(curPlayer, playerActInfo)
+ return
+
+def Sync_SingleRechargeActionInfo(curPlayer, actNum):
+ ## 通知活动信息
+
+ actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_SingleRecharge, actNum)
+ if not actInfo.get(ShareDefine.ActKey_State):
+ return
+
+ cfgID = actInfo.get(ShareDefine.ActKey_CfgID)
+ if not cfgID:
+ return
+
+ ipyData = IpyGameDataPY.GetIpyGameData("ActSingleRecharge", cfgID)
+ if not ipyData:
+ return
+
+ if ipyData.GetIsOfflineAct():
+ #线下活动不下发
+ return
+
+ templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
+ if not templateID:
+ return
+
+ actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
+ openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+
+ clientPack = ChPyNetSendPack.tagMCActSingleRechargeInfo()
+ clientPack.ActNum = actNum
+ clientPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
+ clientPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ clientPack.IsDayReset = ipyData.GetIsDayReset()
+ clientPack.LimitLV = ipyData.GetLVLimit()
+ clientPack.AwardInfo = []
+
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", templateID)
+ if ipyDataList:
+ for awardIpyData in ipyDataList:
+ awardInfo = ChPyNetSendPack.tagMCActSingleRechargeAward()
+ awardInfo.AwardIndex = awardIpyData.GetAwardIndex()
+ awardInfo.SingleRechargeValue = awardIpyData.GetSingleRechargeValue()
+ awardInfo.AwardItem = []
+ awardItemList = GameWorld.GetDictValueByRangeKey(awardIpyData.GetAwardItem(), actWorldLV, [])
+ for itemID, itemCount, isBind in awardItemList:
+ awardItem = ChPyNetSendPack.tagMCActSingleRechargeAwardItem()
+ awardItem.ItemID = itemID
+ awardItem.ItemCount = itemCount
+ awardItem.IsBind = isBind
+ awardInfo.AwardItem.append(awardItem)
+ awardInfo.AwardItemCount = len(awardInfo.AwardItem)
+
+ clientPack.AwardInfo.append(awardInfo)
+
+ clientPack.AwardCount = len(clientPack.AwardInfo)
+ 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 34a5fa9..0e2c392 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -79,6 +79,7 @@
import PlayerActTotalRecharge
import PlayerActRechargeRebateGold
import PlayerActManyDayRecharge
+import PlayerActSingleRecharge
import PlayerActRechargePrize
import PlayerActGrowupBuy
import PlayerSpringSale
@@ -1365,6 +1366,9 @@
elif actionName == ShareDefine.OperationActionName_ManyDayRecharge:
PlayerActManyDayRecharge.RefreshManyDayRechargeActionInfo(actNum)
+ elif actionName == ShareDefine.OperationActionName_SingleRecharge:
+ PlayerActSingleRecharge.RefreshSingleRechargeActionInfo(actNum)
+
elif actionName == ShareDefine.OperationActionName_SpringSale:
PlayerSpringSale.RefreshSpringSaleActionInfo(actNum)
--
Gitblit v1.8.0