8873 【BT2】【主干】【后端】新增在线特惠(创角后充值1000、30元档; 主干)
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 04 创角在线充值特惠信息 #tagMCOnlineRechargeTH
|
| | |
|
| | | class tagMCOnlineRechargeTH(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("AwardState", c_ubyte), #是否已领取奖励
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x04
|
| | | 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 = 0x04
|
| | | self.AwardState = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCOnlineRechargeTH)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 04 创角在线充值特惠信息 //tagMCOnlineRechargeTH:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | AwardState:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.AwardState
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCOnlineRechargeTH=tagMCOnlineRechargeTH()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCOnlineRechargeTH.Cmd,m_NAtagMCOnlineRechargeTH.SubCmd))] = m_NAtagMCOnlineRechargeTH
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 28 充值返利玩家活动信息 #tagMCRechargePrizePlayerInfo
|
| | |
|
| | | class tagMCRechargePrizeInfo(Structure):
|
| | |
| | | Def_PDict_TodayCTGCoinTotal = "TodayCTGCoinTotal" # 当日充值Coin数
|
| | | Def_PDict_TodayCTGCount = "TodayCTGCount_%s" # 当日充值次数,参数(CTG对应的商品记录ID)
|
| | | Def_PDict_CTGGoodsBuyCount = "CTGGoodsBuyCount_%s" # 对应充值商品已购买次数,参数(CTG对应的商品记录ID)
|
| | | Def_PDict_OnlineRechargeTHAward = "OnlineRechargeTHAward" # 在线特惠充值额外奖励 - 是否已领取奖励
|
| | | Def_PDict_DayFreeGoldGiftState = "DayFreeGoldGiftState" # 每日免费直购礼包领取记录
|
| | | Def_PDict_GoldGiftFirstRecord = "GoldGiftFirstRecord" # 首充领取记录,按位记录首充第x天是否已领取
|
| | | Def_PDict_FirstGoldServerDay = "FirstGoldServerDay" # 首充时的开服天
|
| | |
| | | Def_RewardType_ManyDayRecharge, #多日连充41
|
| | | Def_RewardType_InfiniteMoney, #无限货币42
|
| | | Def_RewardType_SingleRecharge, #单笔累充 43
|
| | | )= range(44)
|
| | | Def_RewardType_OnlineRechargeTH, #创角在线特惠充值额外奖励 44
|
| | | )= range(45)
|
| | |
|
| | |
|
| | | #boss复活相关活动定义
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 04 创角在线充值特惠信息 #tagMCOnlineRechargeTH
|
| | |
|
| | | class tagMCOnlineRechargeTH(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("AwardState", c_ubyte), #是否已领取奖励
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x04
|
| | | 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 = 0x04
|
| | | self.AwardState = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCOnlineRechargeTH)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 04 创角在线充值特惠信息 //tagMCOnlineRechargeTH:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | AwardState:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.AwardState
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCOnlineRechargeTH=tagMCOnlineRechargeTH()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCOnlineRechargeTH.Cmd,m_NAtagMCOnlineRechargeTH.SubCmd))] = m_NAtagMCOnlineRechargeTH
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 28 充值返利玩家活动信息 #tagMCRechargePrizePlayerInfo
|
| | |
|
| | | class tagMCRechargePrizeInfo(Structure):
|
| | |
| | | #历史累计充值领取
|
| | | elif rewardType == ChConfig.Def_RewardType_HistoryChargeAward:
|
| | | PlayerGoldGift.OnGetHistoryRechargeAward(curPlayer, dataEx)
|
| | | #在线特惠充值额外奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_OnlineRechargeTH:
|
| | | PlayerCoin.OnGetOnlineRechargeTH(curPlayer)
|
| | | #天星塔全服挑战层领奖
|
| | | elif rewardType == ChConfig.Def_RewardType_SkyTowerServerChallengeReward:
|
| | | GameLogic_SkyTower.OnGetSkyTowerServerChallengeReward(curPlayer, dataEx)
|
| | |
| | | Sync_CoinToGoldCountInfo(curPlayer)
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DayFreeGoldGiftState):
|
| | | Sync_DayFreeGoldGiftState(curPlayer)
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnlineRechargeTHAward):
|
| | | SyncOnlineRechargeTH(curPlayer)
|
| | | return
|
| | |
|
| | | def DoResetCTGCountByTime(curPlayer):
|
| | |
| | | return
|
| | |
|
| | | ## ------------------------------------------
|
| | | ## ---------- 创角在线充值特惠 ---------------
|
| | |
|
| | | def OnGetOnlineRechargeTH(curPlayer):
|
| | | ## 领取创角在线充值特惠
|
| | | awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnlineRechargeTHAward)
|
| | | if awardState:
|
| | | #GameWorld.DebugLog("已领取该奖励!")
|
| | | return
|
| | | |
| | | # 后端只验证是否有充值其中一个即可,不验证充值时间(充值同步到游戏服务器有时间差)
|
| | | canGet = False
|
| | | needCtgIDList = IpyGameDataPY.GetFuncEvalCfg("OnlineRechargeTH", 2)
|
| | | for ctgID in needCtgIDList:
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % ctgID):
|
| | | canGet = True
|
| | | break
|
| | | |
| | | if not canGet:
|
| | | return
|
| | | |
| | | awardItemList = IpyGameDataPY.GetFuncEvalCfg("OnlineRechargeTH", 3)
|
| | | if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList):
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnlineRechargeTHAward, 1)
|
| | | |
| | | for itemID, itemCount, isAuctionItem in awardItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem], |
| | | event=["OnlineRechargeTH", False, {}])
|
| | | |
| | | SyncOnlineRechargeTH(curPlayer)
|
| | | return
|
| | |
|
| | | def SyncOnlineRechargeTH(curPlayer):
|
| | | clientPack = ChPyNetSendPack.tagMCOnlineRechargeTH()
|
| | | clientPack.AwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnlineRechargeTHAward)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | ## ------------------------------------------ |