8650 【主干】【BT2】活动规则优化(限时礼包支持多活动编号同时开启);
# Conflicts:
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py
| | |
| | | struct tagActFlashGiftbag
|
| | | {
|
| | | DWORD _CfgID; //配置ID
|
| | | char ActMark; //活动组标记
|
| | | list PlatformList; //活动平台列表["平台A", "平台A", ...],配[]代表所有
|
| | | list ServerGroupIDList; //服务器ID列表
|
| | | BYTE ActNum; //活动分组编号, 活动类型 * 10 + 不同界面编号
|
| | | char StartDate; //开启日期
|
| | | char EndDate; //结束日期
|
| | | list StartTimeList; //开启时间列表, 支持多个时段
|
| | |
| | |
|
| | | class tagMCFlashGiftbagInfo(Structure):
|
| | | Head = tagHead()
|
| | | ActNum = 0 #(BYTE ActNum)//活动编号
|
| | | StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | AdvanceMinutes = 0 #(WORD AdvanceMinutes)// 提前显示分钟
|
| | |
| | | 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.AdvanceMinutes,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x12
|
| | | self.ActNum = 0
|
| | | self.StartDate = ""
|
| | | self.EndtDate = ""
|
| | | self.AdvanceMinutes = 0
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 10
|
| | | length += 10
|
| | | length += 2
|
| | |
| | | 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.AdvanceMinutes)
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ActNum:%d,
|
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | AdvanceMinutes:%d,
|
| | |
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ActNum,
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.AdvanceMinutes,
|
| | |
| | |
|
| | | class tagMCFlashGiftbagPlayerInfo(Structure):
|
| | | Head = tagHead()
|
| | | ActNum = 0 #(BYTE ActNum)//活动编号
|
| | | Count = 0 #(BYTE Count)
|
| | | BuyCountList = list() #(vector<tagMCFlashGiftbagBuyCount> BuyCountList)//礼包购买次数信息
|
| | | data = None
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temBuyCountList = tagMCFlashGiftbagBuyCount()
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x13
|
| | | self.ActNum = 0
|
| | | self.Count = 0
|
| | | self.BuyCountList = list()
|
| | | return
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.BuyCountList[i].GetLength()
|
| | |
| | | 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.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.BuyCountList[i].GetLength(), self.BuyCountList[i].GetBuffer())
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ActNum:%d,
|
| | | Count:%d,
|
| | | BuyCountList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ActNum,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | |
| | |
|
| | | "ActFlashGiftbag":(
|
| | | ("DWORD", "CfgID", 1),
|
| | | ("char", "ActMark", 0),
|
| | | ("list", "PlatformList", 0),
|
| | | ("list", "ServerGroupIDList", 0),
|
| | | ("BYTE", "ActNum", 0),
|
| | | ("char", "StartDate", 0),
|
| | | ("char", "EndDate", 0),
|
| | | ("list", "StartTimeList", 0),
|
| | |
| | | |
| | | def __init__(self): |
| | | self.CfgID = 0
|
| | | self.ActMark = ""
|
| | | self.PlatformList = []
|
| | | self.ServerGroupIDList = []
|
| | | self.ActNum = 0
|
| | | self.StartDate = ""
|
| | | self.EndDate = ""
|
| | | self.StartTimeList = []
|
| | |
| | | return |
| | | |
| | | def GetCfgID(self): return self.CfgID # 配置ID
|
| | | def GetActMark(self): return self.ActMark # 活动组标记
|
| | | 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 GetStartTimeList(self): return self.StartTimeList # 开启时间列表, 支持多个时段
|
| | |
| | | ]
|
| | |
|
| | | #支持多活动分组编号的活动名
|
| | | MultiActNumOperationActNameList = [OperationActionName_TotalRecharge, OperationActionName_CollectWords]
|
| | | MultiActNumOperationActNameList = [OperationActionName_TotalRecharge, OperationActionName_CollectWords,
|
| | | OperationActionName_FlashGiftbag,
|
| | | ]
|
| | |
|
| | | #跨服运营活动表名定义
|
| | | CrossActName_CTGBillboard = "CrossActCTGBillboard" # 充值排行榜
|
| | |
| | | Def_PDict_SpringSaleMailState = "SpringSaleMailState" # 玩家身上的活动更新提醒邮件状态
|
| | |
|
| | | #限时礼包活动
|
| | | Def_PDict_FlashGiftbagID = "FlashGiftbagID" # 玩家身上的限时礼包活动ID,唯一标识,取活动开始日期time
|
| | | Def_PDict_FlashGiftbagBuyCount = "FlashGiftbagBuyCount_%s" # 限时礼包已购买次数,参数(礼包ID)
|
| | | Def_PDict_FlashGiftbagMailState = "FlashGiftbagMailState" # 玩家身上的活动更新提醒邮件状态
|
| | | Def_PDict_FlashGiftbagID = "FlashGiftbagID_%s" # 玩家身上的限时礼包活动ID,唯一标识,取活动开始日期time,参数(活动编号)
|
| | | Def_PDict_FlashGiftbagBuyCount = "FlashGiftbagBuy_%s_%s" # 限时礼包已购买次数,参数(活动编号, 礼包ID)
|
| | | Def_PDict_FlashGiftbagMailState = "FlashGiftbagMail_%s" # 玩家身上的活动更新提醒邮件状态,参数(活动编号)
|
| | |
|
| | | #每日礼包活动
|
| | | Def_PDict_DailyGiftbagID = "DailyGiftbagID" # 玩家身上的每日礼包活动ID,唯一标识,取活动开始日期time
|
| | |
| | |
|
| | | class tagMCFlashGiftbagInfo(Structure):
|
| | | Head = tagHead()
|
| | | ActNum = 0 #(BYTE ActNum)//活动编号
|
| | | StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | AdvanceMinutes = 0 #(WORD AdvanceMinutes)// 提前显示分钟
|
| | |
| | | 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.AdvanceMinutes,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x12
|
| | | self.ActNum = 0
|
| | | self.StartDate = ""
|
| | | self.EndtDate = ""
|
| | | self.AdvanceMinutes = 0
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 10
|
| | | length += 10
|
| | | length += 2
|
| | |
| | | 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.AdvanceMinutes)
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ActNum:%d,
|
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | AdvanceMinutes:%d,
|
| | |
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ActNum,
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.AdvanceMinutes,
|
| | |
| | |
|
| | | class tagMCFlashGiftbagPlayerInfo(Structure):
|
| | | Head = tagHead()
|
| | | ActNum = 0 #(BYTE ActNum)//活动编号
|
| | | Count = 0 #(BYTE Count)
|
| | | BuyCountList = list() #(vector<tagMCFlashGiftbagBuyCount> BuyCountList)//礼包购买次数信息
|
| | | data = None
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temBuyCountList = tagMCFlashGiftbagBuyCount()
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x13
|
| | | self.ActNum = 0
|
| | | self.Count = 0
|
| | | self.BuyCountList = list()
|
| | | return
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.BuyCountList[i].GetLength()
|
| | |
| | | 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.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.BuyCountList[i].GetLength(), self.BuyCountList[i].GetBuffer())
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ActNum:%d,
|
| | | Count:%d,
|
| | | BuyCountList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ActNum,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | |
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | def GetActInfo(actName, actNum):
|
| | | if actName not in PyGameData.g_operationActionDict:
|
| | | return {}
|
| | | actNumDict = PyGameData.g_operationActionDict[actName]
|
| | | if actNum not in actNumDict:
|
| | | return {}
|
| | | return actNumDict[actNum]
|
| | |
|
| | | def GetOperationActionDateStr(dateInfo, openServerDay):
|
| | | '''获取运营活动对应日期,存数字代表开服天配置,需要转化为对应的日期
|
| | | @param dateInfo: 运营活动表配置的日期信息, 如果是纯数字代表开服天
|
| | |
| | | PlayerBossReborn.RefreshOperationAction_BossReborn()
|
| | |
|
| | | elif actionName == ShareDefine.OperationActionName_FlashGiftbag:
|
| | | PlayerFlashGiftbag.RefreshFlashGiftbagActionInfo()
|
| | | PlayerFlashGiftbag.RefreshFlashGiftbagActionInfo(actNum)
|
| | |
|
| | | elif actionName == ShareDefine.OperationActionName_DailyGiftbag:
|
| | | PlayerDailyGiftbag.RefreshDailyGiftbagActionInfo()
|
| | |
| | | ]
|
| | |
|
| | | #支持多活动分组编号的活动名
|
| | | MultiActNumOperationActNameList = [OperationActionName_TotalRecharge, OperationActionName_CollectWords]
|
| | | MultiActNumOperationActNameList = [OperationActionName_TotalRecharge, OperationActionName_CollectWords,
|
| | | OperationActionName_FlashGiftbag,
|
| | | ]
|
| | |
|
| | | #跨服运营活动表名定义
|
| | | CrossActName_CTGBillboard = "CrossActCTGBillboard" # 充值排行榜
|