From 6e37afff58dc8e9c297d6834cbe0062fdb602b77 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 06 十一月 2018 11:18:31 +0800
Subject: [PATCH] 4556 【1.2】【后端】累计充值活动开发
---
ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 41 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 310 ++++++++++++++++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 310 ++++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py | 9
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py | 289 +++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 61 +++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py | 2
PySysDB/PySysDBPY.h | 24 +
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4
PySysDB/PySysDBG.h | 15
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 9
14 files changed, 1,084 insertions(+), 8 deletions(-)
diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h
index c456097..a592bb2 100644
--- a/PySysDB/PySysDBG.h
+++ b/PySysDB/PySysDBG.h
@@ -370,4 +370,19 @@
dict NotifyInfoEnd; //全服提示信息 - 相对结束时间
list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key]
WORD LVLimit; //限制等级
+};
+
+//累计充值活动表
+
+struct tagActTotalRecharge
+{
+ DWORD _CfgID; //配置ID
+ char ActMark; //活动组标记
+ list ServerIDList; //服务器ID列表
+ char StartDate; //开启日期
+ char EndDate; //结束日期
+ dict NotifyInfoStart; //全服提示信息 - 相对开始时间
+ dict NotifyInfoEnd; //全服提示信息 - 相对结束时间
+ list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key]
+ BYTE IsDayReset; //是否每天重置
};
\ No newline at end of file
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index bb66ee7..94e1f51 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1350,3 +1350,27 @@
WORD NeedLV; //所需等级
BYTE NeedVIPLVGift; //所需购买VIP等级礼包
};
+
+
+//累计充值活动表
+
+struct tagActTotalRecharge
+{
+ DWORD _CfgID; //配置ID
+ char StartDate; //开启日期
+ char EndDate; //结束日期
+ WORD LVLimit; //限制等级
+ BYTE IsDayReset; //是否每天重置
+ list TemplateIDList; //模板ID列表
+};
+
+//累计充值模板表
+
+struct tagTotalRechargeTemplate
+{
+ DWORD _TemplateID; //模板ID
+ DWORD NeedGold; //需要充值仙玉数
+ BYTE AwardIndex; //返利奖励索引0~31,同个模板中不重复
+ dict AwardItem; //返利物品信息列表 {职业:[(物品ID,个数,是否绑定),...]}
+ char NotifyKey; //全服广播key,默认两个参数(玩家名, 档位额度)
+};
\ No newline at end of file
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index ddf5afc..bc2648f 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -19290,6 +19290,260 @@
#------------------------------------------------------
+# AA 1D 累计充值活动信息 #tagMCActTotalRechargeInfo
+
+class tagMCTotalRechargeAwardItem(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(tagMCTotalRechargeAwardItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 1D 累计充值活动信息 //tagMCActTotalRechargeInfo:
+ ItemID:%d,
+ ItemCount:%d,
+ IsBind:%d
+ '''\
+ %(
+ self.ItemID,
+ self.ItemCount,
+ self.IsBind
+ )
+ return DumpString
+
+
+class tagMCTotalRechargeAward(Structure):
+ AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引 0~31
+ NeedGold = 0 #(DWORD NeedGold)// 所需仙玉数
+ AwardItemCount = 0 #(BYTE AwardItemCount)// 奖励物品数
+ AwardItem = list() #(vector<tagMCTotalRechargeAwardItem> 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.NeedGold,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.AwardItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardItemCount):
+ temAwardItem = tagMCTotalRechargeAwardItem()
+ _pos = temAwardItem.ReadData(_lpData, _pos)
+ self.AwardItem.append(temAwardItem)
+ return _pos
+
+ def Clear(self):
+ self.AwardIndex = 0
+ self.NeedGold = 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.NeedGold)
+ 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,
+ NeedGold:%d,
+ AwardItemCount:%d,
+ AwardItem:%s
+ '''\
+ %(
+ self.AwardIndex,
+ self.NeedGold,
+ self.AwardItemCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCTotalRechargeAwardDay(Structure):
+ AwardCount = 0 #(BYTE AwardCount)// 奖励档数
+ AwardInfo = list() #(vector<tagMCTotalRechargeAward> AwardInfo)// 奖励档信息
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardCount):
+ temAwardInfo = tagMCTotalRechargeAward()
+ _pos = temAwardInfo.ReadData(_lpData, _pos)
+ self.AwardInfo.append(temAwardInfo)
+ return _pos
+
+ def Clear(self):
+ self.AwardCount = 0
+ self.AwardInfo = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += 1
+ for i in range(self.AwardCount):
+ length += self.AwardInfo[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ 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 = '''
+ AwardCount:%d,
+ AwardInfo:%s
+ '''\
+ %(
+ self.AwardCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCActTotalRechargeInfo(Structure):
+ Head = tagHead()
+ StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
+ EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
+ IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置
+ LimitLV = 0 #(WORD LimitLV)// 限制等级
+ AwardDays = 0 #(BYTE AwardDays)
+ AwardDayInfo = list() #(vector<tagMCTotalRechargeAwardDay> AwardDayInfo)//每天对应信息; 如果只有一天,但是活动有多天,则代表每天奖励都一样
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x1D
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_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.AwardDays,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardDays):
+ temAwardDayInfo = tagMCTotalRechargeAwardDay()
+ _pos = temAwardDayInfo.ReadData(_lpData, _pos)
+ self.AwardDayInfo.append(temAwardDayInfo)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x1D
+ self.StartDate = ""
+ self.EndtDate = ""
+ self.IsDayReset = 0
+ self.LimitLV = 0
+ self.AwardDays = 0
+ self.AwardDayInfo = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 10
+ length += 10
+ length += 1
+ length += 2
+ length += 1
+ for i in range(self.AwardDays):
+ length += self.AwardDayInfo[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ 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.AwardDays)
+ for i in range(self.AwardDays):
+ data = CommFunc.WriteString(data, self.AwardDayInfo[i].GetLength(), self.AwardDayInfo[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ StartDate:%s,
+ EndtDate:%s,
+ IsDayReset:%d,
+ LimitLV:%d,
+ AwardDays:%d,
+ AwardDayInfo:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.StartDate,
+ self.EndtDate,
+ self.IsDayReset,
+ self.LimitLV,
+ self.AwardDays,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCActTotalRechargeInfo=tagMCActTotalRechargeInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActTotalRechargeInfo.Head.Cmd,m_NAtagMCActTotalRechargeInfo.Head.SubCmd))] = m_NAtagMCActTotalRechargeInfo
+
+
+#------------------------------------------------------
# AA 1B 许愿池拖动结果 #tagMCActWishingDragResult
class tagMCPlayerWishingDragInfo(Structure):
@@ -22036,6 +22290,62 @@
#------------------------------------------------------
+# AA 1C 累计充值玩家活动信息 #tagMCTotalRechargePlayerInfo
+
+class tagMCTotalRechargePlayerInfo(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("GoldTotal", c_int), #本次活动已累计充值仙玉数
+ ("AwardRecord", c_int), #奖励领奖记录,按奖励索引二进制位存储是否已领取
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xAA
+ self.SubCmd = 0x1C
+ 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 = 0x1C
+ self.GoldTotal = 0
+ self.AwardRecord = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCTotalRechargePlayerInfo)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 1C 累计充值玩家活动信息 //tagMCTotalRechargePlayerInfo:
+ Cmd:%s,
+ SubCmd:%s,
+ GoldTotal:%d,
+ AwardRecord:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.GoldTotal,
+ self.AwardRecord
+ )
+ return DumpString
+
+
+m_NAtagMCTotalRechargePlayerInfo=tagMCTotalRechargePlayerInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTotalRechargePlayerInfo.Cmd,m_NAtagMCTotalRechargePlayerInfo.SubCmd))] = m_NAtagMCTotalRechargePlayerInfo
+
+
+#------------------------------------------------------
# AA 14 仙界盛典充值大礼 #tagMCXJSDRecharge
class tagMCXJSDRecharge(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
index e6d44fc..8410daf 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
@@ -319,6 +319,18 @@
("list", "NotifyInfoLoop", 0),
("WORD", "LVLimit", 0),
),
+
+ "ActTotalRecharge":(
+ ("DWORD", "CfgID", 1),
+ ("char", "ActMark", 0),
+ ("list", "ServerIDList", 0),
+ ("char", "StartDate", 0),
+ ("char", "EndDate", 0),
+ ("dict", "NotifyInfoStart", 0),
+ ("dict", "NotifyInfoEnd", 0),
+ ("list", "NotifyInfoLoop", 0),
+ ("BYTE", "IsDayReset", 0),
+ ),
}
@@ -925,6 +937,31 @@
def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # 全服提示信息 - 循环广播[间隔分钟, 广播key]
def GetLVLimit(self): return self.LVLimit # 限制等级
+
+# 累计充值活动表
+class IPY_ActTotalRecharge():
+
+ def __init__(self):
+ self.CfgID = 0
+ self.ActMark = ""
+ self.ServerIDList = []
+ self.StartDate = ""
+ self.EndDate = ""
+ self.NotifyInfoStart = {}
+ self.NotifyInfoEnd = {}
+ self.NotifyInfoLoop = []
+ self.IsDayReset = 0
+ return
+
+ def GetCfgID(self): return self.CfgID # 配置ID
+ def GetActMark(self): return self.ActMark # 活动组标记
+ def GetServerIDList(self): return self.ServerIDList # 服务器ID列表
+ 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 # 是否每天重置
def Log(msg, playerID=0, par=0):
@@ -1006,6 +1043,8 @@
self.ipyStoreLen = len(self.ipyStoreCache)
self.ipyActWishingWellCache = self.__LoadFileData("ActWishingWell", IPY_ActWishingWell)
self.ipyActWishingWellLen = len(self.ipyActWishingWellCache)
+ self.ipyActTotalRechargeCache = self.__LoadFileData("ActTotalRecharge", IPY_ActTotalRecharge)
+ self.ipyActTotalRechargeLen = len(self.ipyActTotalRechargeCache)
Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
Log("IPY_DataMgr InitOK!")
return
@@ -1228,6 +1267,8 @@
def GetStoreByIndex(self, index): return self.ipyStoreCache[index]
def GetActWishingWellCount(self): return self.ipyActWishingWellLen
def GetActWishingWellByIndex(self, index): return self.ipyActWishingWellCache[index]
+ def GetActTotalRechargeCount(self): return self.ipyActTotalRechargeLen
+ def GetActTotalRechargeByIndex(self, index): return self.ipyActTotalRechargeCache[index]
IPYData = IPY_DataMgr()
def IPY_Data(): return IPYData
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index 75a5f7b..77cd258 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -234,11 +234,12 @@
OperationActionName_RealmPoint = "ActRealmPoint" # 多倍修行点活动
OperationActionName_FlashSale = "ActFlashSale" # 限时抢购活动
OperationActionName_WishingWell = "ActWishingWell" # 许愿池活动
+OperationActionName_TotalRecharge = "ActTotalRecharge" # 累计充值活动
OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
OperationActionName_BossReborn,OperationActionName_SpringSale,
OperationActionName_FlashGiftbag, OperationActionName_FairyCeremony,
OperationActionName_RealmPoint, OperationActionName_FlashSale,
- OperationActionName_WishingWell]
+ OperationActionName_WishingWell, OperationActionName_TotalRecharge]
#需要记录开启活动时的世界等级的运营活动
NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell]
@@ -774,7 +775,8 @@
CDBPlayerRefresh_NPCHurtAddPer, # 对怪物伤害加成
CDBPlayerRefresh_FinalHurtPer, # 最终输出伤害百分比
CDBPlayerRefresh_TalentPoint, # 天赋点数 190
-) = range(146, 191)
+CDBPlayerRefresh_FBHelpPoint, # 副本助战点数 191
+) = range(146, 192)
TYPE_Price_Gold_Paper_Money = 5 # 金钱类型,(先用礼券,再用金子)
TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index e5f5364..216727c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3596,6 +3596,12 @@
Def_PDict_CostRebateGold = "CostRebateGold" # 消费返利总累计消费仙玉
Def_PDict_CostRebateAwardRecord = "CostRebateAwardRecord" # 消费返利领奖记录
+#累计充值活动
+Def_PDict_TotalRechargeID = "TotalRechargeID" # 玩家身上的累计充值活动ID,唯一标识,取活动开始日期time值
+Def_PDict_TotalRechargeTemplateID = "TotalRechargeTemplateID" # 玩家身上的累计充值模板ID
+Def_PDict_TotalRechargeGold = "TotalRechargeGold" # 消费返利总累计充值仙玉
+Def_PDict_TotalRechargeAwardRecord = "TotalRechargeAwardRecord" # 累计充值领奖记录
+
#限时特惠活动
Def_PDict_SpringSaleID = "SpringSaleID" # 玩家身上的限时特惠活动ID,唯一标识,取活动开始日期time
Def_PDict_SpringSaleMailState = "SpringSaleMailState" # 玩家身上的活动更新提醒邮件状态
@@ -5040,7 +5046,8 @@
Def_RewardType_DownLoad, # 分包下载奖励15
Def_RewardType_WishingWell, # 许愿池奖励16
Def_RewardType_OpenFunc, # 功能开启奖励17
-)= range(18)
+Def_RewardType_TotalRecharge, # 累计充值奖励18
+)= range(19)
#boss复活相关活动定义
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index ddf5afc..bc2648f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -19290,6 +19290,260 @@
#------------------------------------------------------
+# AA 1D 累计充值活动信息 #tagMCActTotalRechargeInfo
+
+class tagMCTotalRechargeAwardItem(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(tagMCTotalRechargeAwardItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 1D 累计充值活动信息 //tagMCActTotalRechargeInfo:
+ ItemID:%d,
+ ItemCount:%d,
+ IsBind:%d
+ '''\
+ %(
+ self.ItemID,
+ self.ItemCount,
+ self.IsBind
+ )
+ return DumpString
+
+
+class tagMCTotalRechargeAward(Structure):
+ AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引 0~31
+ NeedGold = 0 #(DWORD NeedGold)// 所需仙玉数
+ AwardItemCount = 0 #(BYTE AwardItemCount)// 奖励物品数
+ AwardItem = list() #(vector<tagMCTotalRechargeAwardItem> 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.NeedGold,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.AwardItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardItemCount):
+ temAwardItem = tagMCTotalRechargeAwardItem()
+ _pos = temAwardItem.ReadData(_lpData, _pos)
+ self.AwardItem.append(temAwardItem)
+ return _pos
+
+ def Clear(self):
+ self.AwardIndex = 0
+ self.NeedGold = 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.NeedGold)
+ 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,
+ NeedGold:%d,
+ AwardItemCount:%d,
+ AwardItem:%s
+ '''\
+ %(
+ self.AwardIndex,
+ self.NeedGold,
+ self.AwardItemCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCTotalRechargeAwardDay(Structure):
+ AwardCount = 0 #(BYTE AwardCount)// 奖励档数
+ AwardInfo = list() #(vector<tagMCTotalRechargeAward> AwardInfo)// 奖励档信息
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardCount):
+ temAwardInfo = tagMCTotalRechargeAward()
+ _pos = temAwardInfo.ReadData(_lpData, _pos)
+ self.AwardInfo.append(temAwardInfo)
+ return _pos
+
+ def Clear(self):
+ self.AwardCount = 0
+ self.AwardInfo = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += 1
+ for i in range(self.AwardCount):
+ length += self.AwardInfo[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ 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 = '''
+ AwardCount:%d,
+ AwardInfo:%s
+ '''\
+ %(
+ self.AwardCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCActTotalRechargeInfo(Structure):
+ Head = tagHead()
+ StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
+ EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
+ IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置
+ LimitLV = 0 #(WORD LimitLV)// 限制等级
+ AwardDays = 0 #(BYTE AwardDays)
+ AwardDayInfo = list() #(vector<tagMCTotalRechargeAwardDay> AwardDayInfo)//每天对应信息; 如果只有一天,但是活动有多天,则代表每天奖励都一样
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x1D
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_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.AwardDays,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.AwardDays):
+ temAwardDayInfo = tagMCTotalRechargeAwardDay()
+ _pos = temAwardDayInfo.ReadData(_lpData, _pos)
+ self.AwardDayInfo.append(temAwardDayInfo)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x1D
+ self.StartDate = ""
+ self.EndtDate = ""
+ self.IsDayReset = 0
+ self.LimitLV = 0
+ self.AwardDays = 0
+ self.AwardDayInfo = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 10
+ length += 10
+ length += 1
+ length += 2
+ length += 1
+ for i in range(self.AwardDays):
+ length += self.AwardDayInfo[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ 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.AwardDays)
+ for i in range(self.AwardDays):
+ data = CommFunc.WriteString(data, self.AwardDayInfo[i].GetLength(), self.AwardDayInfo[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ StartDate:%s,
+ EndtDate:%s,
+ IsDayReset:%d,
+ LimitLV:%d,
+ AwardDays:%d,
+ AwardDayInfo:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.StartDate,
+ self.EndtDate,
+ self.IsDayReset,
+ self.LimitLV,
+ self.AwardDays,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCActTotalRechargeInfo=tagMCActTotalRechargeInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActTotalRechargeInfo.Head.Cmd,m_NAtagMCActTotalRechargeInfo.Head.SubCmd))] = m_NAtagMCActTotalRechargeInfo
+
+
+#------------------------------------------------------
# AA 1B 许愿池拖动结果 #tagMCActWishingDragResult
class tagMCPlayerWishingDragInfo(Structure):
@@ -22036,6 +22290,62 @@
#------------------------------------------------------
+# AA 1C 累计充值玩家活动信息 #tagMCTotalRechargePlayerInfo
+
+class tagMCTotalRechargePlayerInfo(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("GoldTotal", c_int), #本次活动已累计充值仙玉数
+ ("AwardRecord", c_int), #奖励领奖记录,按奖励索引二进制位存储是否已领取
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xAA
+ self.SubCmd = 0x1C
+ 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 = 0x1C
+ self.GoldTotal = 0
+ self.AwardRecord = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCTotalRechargePlayerInfo)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 1C 累计充值玩家活动信息 //tagMCTotalRechargePlayerInfo:
+ Cmd:%s,
+ SubCmd:%s,
+ GoldTotal:%d,
+ AwardRecord:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.GoldTotal,
+ self.AwardRecord
+ )
+ return DumpString
+
+
+m_NAtagMCTotalRechargePlayerInfo=tagMCTotalRechargePlayerInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTotalRechargePlayerInfo.Cmd,m_NAtagMCTotalRechargePlayerInfo.SubCmd))] = m_NAtagMCTotalRechargePlayerInfo
+
+
+#------------------------------------------------------
# AA 14 仙界盛典充值大礼 #tagMCXJSDRecharge
class tagMCXJSDRecharge(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
index 5689461..01ef0a4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
@@ -1567,7 +1567,10 @@
PlayerControl.NotifyCode(curPlayer, 'AssistantIntegralFull')
return 0
addHelpPoint = min(addHelpPoint, dayMaxPoint-curDayPoint)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, curDayPoint+addHelpPoint)
+ updHelpPoint = curDayPoint+addHelpPoint
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, updHelpPoint)
+ curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FBHelpPoint, updHelpPoint, False)
+
PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_FBHelpPoint, addHelpPoint, isSysHint=False)
PlayerControl.NotifyCode(curPlayer, 'AssistantIntegral', [addHelpPoint])
GameWorld.DebugLog(" 增加副本助战积分!mapID=%s, addHelpPoint=%s"%(mapID, addHelpPoint), curPlayer.GetID())
@@ -1662,7 +1665,7 @@
#重置每日获得的助战积分
if onDayType ==ShareDefine.Def_OnEventTypeEx:
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, 0)
-
+ curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FBHelpPoint, 0, False)
return
## 玩家通用副本登录处理
@@ -1677,6 +1680,8 @@
NotifyFBCntRegainInfo(curPlayer)
#判断副本里离线超过一定时间则退出副本
CheckFBPlayerOffine(curPlayer)
+ #通知助战点数
+ curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FBHelpPoint, 0, False)
return
def CheckFBPlayerOffine(curPlayer):
mapid = curPlayer.GetMapID()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 20f13c3..fc6cd29 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1070,6 +1070,23 @@
("WORD", "NeedLV", 0),
("BYTE", "NeedVIPLVGift", 0),
),
+
+ "ActTotalRecharge":(
+ ("DWORD", "CfgID", 1),
+ ("char", "StartDate", 0),
+ ("char", "EndDate", 0),
+ ("WORD", "LVLimit", 0),
+ ("BYTE", "IsDayReset", 0),
+ ("list", "TemplateIDList", 0),
+ ),
+
+ "TotalRechargeTemplate":(
+ ("DWORD", "TemplateID", 1),
+ ("DWORD", "NeedGold", 0),
+ ("BYTE", "AwardIndex", 0),
+ ("dict", "AwardItem", 0),
+ ("char", "NotifyKey", 0),
+ ),
}
@@ -3249,6 +3266,42 @@
def GetBoxID(self): return self.BoxID # 气泡框ID
def GetNeedLV(self): return self.NeedLV # 所需等级
def GetNeedVIPLVGift(self): return self.NeedVIPLVGift # 所需购买VIP等级礼包
+
+# 累计充值活动表
+class IPY_ActTotalRecharge():
+
+ def __init__(self):
+ self.CfgID = 0
+ self.StartDate = ""
+ self.EndDate = ""
+ self.LVLimit = 0
+ self.IsDayReset = 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 GetTemplateIDList(self): return self.TemplateIDList # 模板ID列表
+
+# 累计充值模板表
+class IPY_TotalRechargeTemplate():
+
+ def __init__(self):
+ self.TemplateID = 0
+ self.NeedGold = 0
+ self.AwardIndex = 0
+ self.AwardItem = {}
+ self.NotifyKey = ""
+ return
+
+ def GetTemplateID(self): return self.TemplateID # 模板ID
+ def GetNeedGold(self): return self.NeedGold # 需要充值仙玉数
+ def GetAwardIndex(self): return self.AwardIndex # 返利奖励索引0~31,同个模板中不重复
+ def GetAwardItem(self): return self.AwardItem # 返利物品信息列表 {职业:[(物品ID,个数,是否绑定),...]}
+ def GetNotifyKey(self): return self.NotifyKey # 全服广播key,默认两个参数(玩家名, 档位额度)
def Log(msg, playerID=0, par=0):
@@ -3472,6 +3525,10 @@
self.ipyFunctionForecastLen = len(self.ipyFunctionForecastCache)
self.ipyChatBubbleBoxCache = self.__LoadFileData("ChatBubbleBox", IPY_ChatBubbleBox)
self.ipyChatBubbleBoxLen = len(self.ipyChatBubbleBoxCache)
+ self.ipyActTotalRechargeCache = self.__LoadFileData("ActTotalRecharge", IPY_ActTotalRecharge)
+ self.ipyActTotalRechargeLen = len(self.ipyActTotalRechargeCache)
+ self.ipyTotalRechargeTemplateCache = self.__LoadFileData("TotalRechargeTemplate", IPY_TotalRechargeTemplate)
+ self.ipyTotalRechargeTemplateLen = len(self.ipyTotalRechargeTemplateCache)
Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
Log("IPY_DataMgr InitOK!")
return
@@ -3836,6 +3893,10 @@
def GetFunctionForecastByIndex(self, index): return self.ipyFunctionForecastCache[index]
def GetChatBubbleBoxCount(self): return self.ipyChatBubbleBoxLen
def GetChatBubbleBoxByIndex(self, index): return self.ipyChatBubbleBoxCache[index]
+ def GetActTotalRechargeCount(self): return self.ipyActTotalRechargeLen
+ def GetActTotalRechargeByIndex(self, index): return self.ipyActTotalRechargeCache[index]
+ def GetTotalRechargeTemplateCount(self): return self.ipyTotalRechargeTemplateLen
+ def GetTotalRechargeTemplateByIndex(self, index): return self.ipyTotalRechargeTemplateCache[index]
IPYData = IPY_DataMgr()
def IPY_Data(): return IPYData
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 1fc2d40..8cd64f1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -105,6 +105,7 @@
import PlayerFlashSale
import PlayerFlashGiftbag
import PlayerCostRebate
+import PlayerActTotalRecharge
import PlayerSpringSale
import PlayerFairyCeremony
import ChNetSendPack
@@ -487,6 +488,8 @@
#消费返利
PlayerCostRebate.OnPlayerLogin(curPlayer)
+ #累计充值
+ PlayerActTotalRecharge.OnPlayerLogin(curPlayer)
#限时特惠
PlayerSpringSale.OnPlayerLogin(curPlayer)
#限时礼包
@@ -5090,6 +5093,9 @@
# 领取消费返利奖励
elif rewardType == ChConfig.Def_RewardType_CostRebate:
PlayerCostRebate.OnGetCostRebateAward(curPlayer, dataEx)
+ # 领取累计充值奖励
+ elif rewardType == ChConfig.Def_RewardType_TotalRecharge:
+ PlayerActTotalRecharge.OnGetTotalRechargeAward(curPlayer, dataEx)
# 领取boss复活活动奖励
elif rewardType == ChConfig.Def_RewardType_BossReborn:
PlayerBossReborn.GetBossRebornActionAward(curPlayer, dataEx)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
new file mode 100644
index 0000000..2a550bd
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
@@ -0,0 +1,289 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Player.PlayerActTotalRecharge
+#
+# @todo:累计充值活动
+# @author hxp
+# @date 2018-7-16
+# @version 1.0
+#
+# 详细描述: 累计充值活动
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2018-7-16 12:00"""
+#-------------------------------------------------------------------------------
+
+import PyGameData
+import ShareDefine
+import PlayerControl
+import IpyGameDataPY
+import ItemControler
+import ChPyNetSendPack
+import DataRecordPack
+import IPY_GameWorld
+import NetPackCommon
+import ItemCommon
+import GameWorld
+import ChConfig
+
+def GetTemplateID(cfgID, dayIndex):
+ if cfgID == None or dayIndex == None:
+ return 0
+ ipyData = IpyGameDataPY.GetIpyGameData("ActTotalRecharge", cfgID)
+ if not ipyData:
+ return 0
+ templateIDList = ipyData.GetTemplateIDList()
+ templateID = templateIDList[-1] if dayIndex >= len(templateIDList) else templateIDList[dayIndex]
+ return templateID
+
+def OnPlayerLogin(curPlayer):
+ isReset = __CheckPlayerTotalRechargeAction(curPlayer)
+ if not isReset:
+ actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
+ # 活动中同步活动信息
+ if actTotalRechargeInfo.get(ShareDefine.ActKey_State):
+ Sync_TotalRechargeActionInfo(curPlayer)
+ Sync_TotalRechargeInfo(curPlayer)
+ return
+
+def RefreshTotalRechargeActionInfo():
+ ## 收到GameServer同步的活动信息,刷新活动信息
+ playerManager = GameWorld.GetPlayerManager()
+ for index in xrange(playerManager.GetPlayerCount()):
+ curPlayer = playerManager.GetPlayerByIndex(index)
+ if curPlayer.GetID() == 0:
+ continue
+ __CheckPlayerTotalRechargeAction(curPlayer)
+ return
+
+def __CheckPlayerTotalRechargeAction(curPlayer):
+ ## 检查玩家累计充值活动数据信息
+
+ playerID = curPlayer.GetPlayerID()
+
+ actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
+ TotalRechargeID = actTotalRechargeInfo.get(ShareDefine.ActKey_ID, 0)
+ state = actTotalRechargeInfo.get(ShareDefine.ActKey_State, 0)
+
+ playerTotalRechargeID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeID) # 玩家身上的活动ID
+
+ # 活动ID 相同的话不处理
+ if TotalRechargeID == playerTotalRechargeID:
+ #GameWorld.DebugLog("累计充值活动ID不变,不处理!", curPlayer.GetPlayerID())
+ return
+
+ templateID = GetTemplateID(actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID, 0), actTotalRechargeInfo.get(ShareDefine.ActKey_DayIndex, 0))
+ playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeTemplateID)
+
+ GameWorld.DebugLog("累计充值重置! TotalRechargeID=%s,playerTotalRechargeID=%s,state=%s,templateID=%s,playerTemplateID=%s"
+ % (TotalRechargeID, playerTotalRechargeID, state, templateID, playerTemplateID), playerID)
+
+ # 未领取的奖励邮件发放
+ __SendTotalRechargeMail(curPlayer, playerTemplateID)
+
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID, TotalRechargeID)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID, templateID)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord, 0)
+
+ Sync_TotalRechargeActionInfo(curPlayer)
+ Sync_TotalRechargeInfo(curPlayer)
+ return True
+
+def __SendTotalRechargeMail(curPlayer, playerTemplateID):
+ # 未领取的奖励邮件发放
+
+ if not playerTemplateID:
+ return
+
+ curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
+ if not curRechargeGold:
+ return
+
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("TotalRechargeTemplate", playerTemplateID)
+ if not ipyDataList:
+ return
+
+ playerID = curPlayer.GetPlayerID()
+ batchPlayerIDList, batchAddItemList, batchParamList = [], [], []
+ awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord)
+ job = curPlayer.GetJob()
+ for ipyData in ipyDataList:
+ awardIndex = ipyData.GetAwardIndex()
+ if awardRecord & pow(2, awardIndex):
+ continue
+
+ needGold = ipyData.GetNeedGold()
+ if curRechargeGold < needGold:
+ continue
+ awardRecord |= pow(2, awardIndex)
+
+ awardItemList = ipyData.GetAwardItem().get(str(job), [])
+ batchPlayerIDList.append([playerID])
+ batchAddItemList.append(awardItemList)
+ batchParamList.append([needGold])
+
+ if batchPlayerIDList:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord, awardRecord)
+ PlayerControl.SendMailBatch("TotalRechargeMail", batchPlayerIDList, batchAddItemList, batchParamList)
+
+ return
+
+def AddTotalRechargeGold(curPlayer, addGold):
+ if addGold <= 0:
+ return
+
+
+ actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
+ if not actTotalRechargeInfo.get(ShareDefine.ActKey_State):
+ GameWorld.DebugLog("累计充值活动当前未开启!")
+ return
+
+ actID = actTotalRechargeInfo.get(ShareDefine.ActKey_ID)
+ templateID = GetTemplateID(actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID, 0), actTotalRechargeInfo.get(ShareDefine.ActKey_DayIndex, 0))
+ if not actID or not templateID:
+ GameWorld.ErrLog("累计充值活动数据异常!actID=%s,templateID=%s" % (actID, templateID), curPlayer.GetPlayerID())
+ return
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID, actID)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID, templateID)
+
+ curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
+ updRechargeGold = curRechargeGold + addGold
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold, updRechargeGold)
+ Sync_TotalRechargeInfo(curPlayer)
+ GameWorld.DebugLog("玩家累计充值活动: actID=%s,templateID=%s,curRechargeGold=%s,addGold=%s,updRechargeGold=%s"
+ % (actID, templateID, curRechargeGold, addGold, updRechargeGold), curPlayer.GetPlayerID())
+ return
+
+def OnGetTotalRechargeAward(curPlayer, awardIndex):
+ ## 领取累计充值奖励
+
+ playerID = curPlayer.GetPlayerID()
+
+ actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
+ TotalRechargeID = actTotalRechargeInfo.get(ShareDefine.ActKey_ID, 0)
+ state = actTotalRechargeInfo.get(ShareDefine.ActKey_State, 0)
+ templateID = GetTemplateID(actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID, 0), actTotalRechargeInfo.get(ShareDefine.ActKey_DayIndex, 0))
+ if not state or not templateID:
+ GameWorld.DebugLog("没有累计充值活动,无法领奖!state=%s,templateID=%s" % (state, templateID), playerID)
+ return
+
+ playerTotalRechargeID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeID) # 玩家身上的活动ID
+ if TotalRechargeID != playerTotalRechargeID:
+ return
+
+ awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord)
+ if awardRecord & pow(2, awardIndex):
+ GameWorld.DebugLog("已经领取过该累计充值活动奖励!awardIndex=%s" % awardIndex, playerID)
+ return
+
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("TotalRechargeTemplate", templateID)
+ if not ipyDataList:
+ return
+
+ awardIpyData = None
+ for ipyData in ipyDataList:
+ if ipyData.GetAwardIndex() == awardIndex:
+ awardIpyData = ipyData
+ break
+
+ if not awardIpyData:
+ GameWorld.DebugLog("找不到该返利活动档位索引奖励!templateID=%s,awardIndex=%s" % (templateID, awardIndex), playerID)
+ return
+
+ needGold = awardIpyData.GetNeedGold()
+ awardItemList = awardIpyData.GetAwardItem().get(str(curPlayer.GetJob()), [])
+
+ curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
+ if curRechargeGold < needGold:
+ GameWorld.DebugLog("所需充值仙玉数不足,无法领取!templateID=%s,awardIndex=%s,needGold=%s,curRechargeGold=%s"
+ % (templateID, awardIndex, needGold, curRechargeGold), playerID)
+ return
+
+ needSpace = len(awardItemList)
+ packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
+ if packSpace < needSpace:
+ return
+
+ awardRecord |= pow(2, awardIndex)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord, awardRecord)
+ Sync_TotalRechargeInfo(curPlayer)
+
+ notifyKey = awardIpyData.GetNotifyKey()
+ if notifyKey:
+ PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), needGold])
+
+ for itemID, itemCount, isBind in awardItemList:
+ ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem])
+
+ addDataDict = {"TemplateID":templateID, "NeedGold":needGold, "AwardIndex":awardIndex,
+ "ItemList":str(awardItemList)}
+ DataRecordPack.DR_FuncGiveItem(curPlayer, "TotalRechargeAward", addDataDict)
+ return
+
+def Sync_TotalRechargeInfo(curPlayer):
+ ## 通知累计充值玩家数据信息
+ playerActInfo = ChPyNetSendPack.tagMCTotalRechargePlayerInfo()
+ playerActInfo.GoldTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
+ playerActInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord)
+ NetPackCommon.SendFakePack(curPlayer, playerActInfo)
+ return
+
+def Sync_TotalRechargeActionInfo(curPlayer):
+ ## 通知累计充值活动信息
+ actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
+ if not actTotalRechargeInfo:
+ return
+
+ if not actTotalRechargeInfo.get(ShareDefine.ActKey_State):
+ return
+
+ cfgID = actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID)
+ ipyData = IpyGameDataPY.GetIpyGameData("ActTotalRecharge", cfgID)
+ if not ipyData:
+ return
+
+ templateIDList = ipyData.GetTemplateIDList()
+ if not templateIDList:
+ return
+ job = curPlayer.GetJob()
+ openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ actInfo = ChPyNetSendPack.tagMCActTotalRechargeInfo()
+ actInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
+ actInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actInfo.LimitLV = ipyData.GetLVLimit()
+ actInfo.IsDayReset = ipyData.GetIsDayReset()
+ actInfo.AwardDayInfo = []
+ for templateID in templateIDList:
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("TotalRechargeTemplate", templateID)
+ if not ipyDataList:
+ continue
+
+ dayInfo = ChPyNetSendPack.tagMCTotalRechargeAwardDay()
+ dayInfo.AwardInfo = []
+ for ipyData in ipyDataList:
+ awardInfo = ChPyNetSendPack.tagMCTotalRechargeAward()
+ awardInfo.AwardIndex = ipyData.GetAwardIndex()
+ awardInfo.NeedGold = ipyData.GetNeedGold()
+ awardInfo.AwardItem = []
+ awardItemDict = ipyData.GetAwardItem()
+ for itemID, itemCount, isBind in awardItemDict.get(str(job), []):
+ awardItem = ChPyNetSendPack.tagMCTotalRechargeAwardItem()
+ awardItem.ItemID = itemID
+ awardItem.ItemCount = itemCount
+ awardItem.IsBind = isBind
+ awardInfo.AwardItem.append(awardItem)
+ awardInfo.AwardItemCount = len(awardInfo.AwardItem)
+
+ dayInfo.AwardInfo.append(awardInfo)
+
+ dayInfo.AwardCount = len(dayInfo.AwardInfo)
+ actInfo.AwardDayInfo.append(dayInfo)
+
+ actInfo.AwardDays = len(actInfo.AwardDayInfo)
+ NetPackCommon.SendFakePack(curPlayer, actInfo)
+ return
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
index 33c2a86..d193fba 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -45,6 +45,7 @@
import PlayerFlashGiftbag
import PlayerFairyCeremony
import PlayerGoldGift
+import PlayerActTotalRecharge
import ItemCommon
#---------------------------------------------------------------------
@@ -239,6 +240,7 @@
#仙界盛典-充值大礼
PlayerFairyCeremony.OnFCRecharge(curPlayer)
PlayerGoldGift.DayChargeRedPackAward(curPlayer)
+ PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, addGold)
GameWorld.Log("Billing: eventName=%s, %s" % (eventName, addDRDict), curPlayer.GetPlayerID())
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 d479a12..2d465c4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -86,6 +86,7 @@
import GameLogic_Dogz
import OpenServerCampaign
import PlayerCostRebate
+import PlayerActTotalRecharge
import PlayerSpringSale
import PlayerBossReborn
import PlayerFlashGiftbag
@@ -1280,7 +1281,8 @@
elif actionName == ShareDefine.OperationActionName_CostRebate:
PlayerCostRebate.RefreshCostRebateActionInfo()
-
+ elif actionName == ShareDefine.OperationActionName_TotalRecharge:
+ PlayerActTotalRecharge.RefreshTotalRechargeActionInfo()
elif actionName == ShareDefine.OperationActionName_SpringSale:
PlayerSpringSale.RefreshSpringSaleActionInfo()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index 75a5f7b..77cd258 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -234,11 +234,12 @@
OperationActionName_RealmPoint = "ActRealmPoint" # 多倍修行点活动
OperationActionName_FlashSale = "ActFlashSale" # 限时抢购活动
OperationActionName_WishingWell = "ActWishingWell" # 许愿池活动
+OperationActionName_TotalRecharge = "ActTotalRecharge" # 累计充值活动
OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
OperationActionName_BossReborn,OperationActionName_SpringSale,
OperationActionName_FlashGiftbag, OperationActionName_FairyCeremony,
OperationActionName_RealmPoint, OperationActionName_FlashSale,
- OperationActionName_WishingWell]
+ OperationActionName_WishingWell, OperationActionName_TotalRecharge]
#需要记录开启活动时的世界等级的运营活动
NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell]
@@ -774,7 +775,8 @@
CDBPlayerRefresh_NPCHurtAddPer, # 对怪物伤害加成
CDBPlayerRefresh_FinalHurtPer, # 最终输出伤害百分比
CDBPlayerRefresh_TalentPoint, # 天赋点数 190
-) = range(146, 191)
+CDBPlayerRefresh_FBHelpPoint, # 副本助战点数 191
+) = range(146, 192)
TYPE_Price_Gold_Paper_Money = 5 # 金钱类型,(先用礼券,再用金子)
TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
--
Gitblit v1.8.0