9455 【越南】【后端】通天令(改为按固定天数重置; 9621【越南】通天令修改)
| | |
| | | AwardStateCount = 0 #(BYTE AwardStateCount)//等级领奖记录值数,每个值存31个记录 0-30, 31-61, ...
|
| | | CommAwardStateList = list() #(vector<DWORD> CommAwardStateList)//常规奖励领奖记录,按等级二进制位存储是否领奖
|
| | | XianAwardStateList = list() #(vector<DWORD> XianAwardStateList)//仙品奖励领奖记录,按等级二进制位存储是否领奖
|
| | | StartTime = 0 #(DWORD StartTime)//通天令本轮开始时间戳,秒
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | for i in range(self.AwardStateCount):
|
| | | value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
|
| | | self.XianAwardStateList.append(value)
|
| | | self.StartTime,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.AwardStateCount = 0
|
| | | self.CommAwardStateList = list()
|
| | | self.XianAwardStateList = list()
|
| | | self.StartTime = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 1
|
| | | length += 4 * self.AwardStateCount
|
| | | length += 4 * self.AwardStateCount
|
| | | length += 4
|
| | |
|
| | | return length
|
| | |
|
| | |
| | | data = CommFunc.WriteDWORD(data, self.CommAwardStateList[i])
|
| | | for i in range(self.AwardStateCount):
|
| | | data = CommFunc.WriteDWORD(data, self.XianAwardStateList[i])
|
| | | data = CommFunc.WriteDWORD(data, self.StartTime)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | CurPoint:%d,
|
| | | AwardStateCount:%d,
|
| | | CommAwardStateList:%s,
|
| | | XianAwardStateList:%s
|
| | | XianAwardStateList:%s,
|
| | | StartTime:%d
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | |
| | | self.CurPoint,
|
| | | self.AwardStateCount,
|
| | | "...",
|
| | | "..."
|
| | | "...",
|
| | | self.StartTime
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | Def_PDict_Success_PassportAward = "Succ_PassportAward_%s" #成就通行证领奖状态,参数(key编号),按索引位存储0-未领,1-已领
|
| | |
|
| | | # 通天令
|
| | | Def_PDict_TTL_StartTime = "TTL_StartTime" # 本轮通天令开始时间戳
|
| | | Def_PDict_TTL_LVInfo = "TTL_LVInfo" # 当前通天令等级激活信息 = 等级*10+是否已购买通天令
|
| | | Def_PDict_TTL_LVPoint = "TTL_LVPoint" # 当前通天令等级已获得积分点
|
| | | Def_PDict_TTL_CommAwardRecord = "TTL_CommAwardRecord_%s" # 通天令等级常规领奖记录,参数(key编号),按等级索引位存储0-未领,1-已领
|
| | |
| | | AwardStateCount = 0 #(BYTE AwardStateCount)//等级领奖记录值数,每个值存31个记录 0-30, 31-61, ...
|
| | | CommAwardStateList = list() #(vector<DWORD> CommAwardStateList)//常规奖励领奖记录,按等级二进制位存储是否领奖
|
| | | XianAwardStateList = list() #(vector<DWORD> XianAwardStateList)//仙品奖励领奖记录,按等级二进制位存储是否领奖
|
| | | StartTime = 0 #(DWORD StartTime)//通天令本轮开始时间戳,秒
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | for i in range(self.AwardStateCount):
|
| | | value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
|
| | | self.XianAwardStateList.append(value)
|
| | | self.StartTime,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.AwardStateCount = 0
|
| | | self.CommAwardStateList = list()
|
| | | self.XianAwardStateList = list()
|
| | | self.StartTime = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 1
|
| | | length += 4 * self.AwardStateCount
|
| | | length += 4 * self.AwardStateCount
|
| | | length += 4
|
| | |
|
| | | return length
|
| | |
|
| | |
| | | data = CommFunc.WriteDWORD(data, self.CommAwardStateList[i])
|
| | | for i in range(self.AwardStateCount):
|
| | | data = CommFunc.WriteDWORD(data, self.XianAwardStateList[i])
|
| | | data = CommFunc.WriteDWORD(data, self.StartTime)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | CurPoint:%d,
|
| | | AwardStateCount:%d,
|
| | | CommAwardStateList:%s,
|
| | | XianAwardStateList:%s
|
| | | XianAwardStateList:%s,
|
| | | StartTime:%d
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | |
| | | self.CurPoint,
|
| | | self.AwardStateCount,
|
| | | "...",
|
| | | "..."
|
| | | "...",
|
| | | self.StartTime
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | import PlayerTongTianLing
|
| | | import IpyGameDataPY
|
| | | import ChConfig
|
| | | import time
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #逻辑实现
|
| | |
| | | resetTTTask(curPlayer)
|
| | | GameWorld.DebugAnswer(curPlayer, "重置通天任务OK!")
|
| | | else:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_StartTime, int(time.time()))
|
| | | resetTTLV(curPlayer)
|
| | | resetTTTask(curPlayer)
|
| | | GameWorld.DebugAnswer(curPlayer, "重置通天所有OK!")
|
| | |
| | |
|
| | | def resetTTTask(curPlayer):
|
| | |
|
| | | for i in xrange(10):
|
| | | for i in xrange(PlayerTongTianLing.TTL_TaskAwardKeyCount):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_TaskAwardRecord % i, 0)
|
| | |
|
| | | syncTaskInfoList = []
|
| | |
| | | return
|
| | |
|
| | | def resetTTLV(curPlayer):
|
| | | for i in xrange(10):
|
| | | for i in xrange(PlayerTongTianLing.TTL_LVAwardKeyCount):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_CommAwardRecord % i, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_XianAwardRecord % i, 0)
|
| | | PlayerTongTianLing.SetTongTianLingLVInfo(curPlayer, 0, 0)
|
| | |
| | | import NetPackCommon
|
| | | import ItemControler
|
| | | import ChConfig
|
| | | import time
|
| | |
|
| | | TTL_LVAwardKeyCount = 2
|
| | | TTL_TaskAwardKeyCount = 9
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | if CheckTongTianLingReset(curPlayer):
|
| | | return
|
| | | SyncTongTianLVInfo(curPlayer)
|
| | | SyncTongTianTaskInfo(curPlayer)
|
| | | SyncTongTianTaskAward(curPlayer)
|
| | | return
|
| | |
|
| | | def OnDay(curPlayer):
|
| | | |
| | | if CheckTongTianLingReset(curPlayer):
|
| | | return
|
| | |
|
| | | resetTaskTypeList, resetTaskIDList = [], []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | |
| | | SyncTongTianTaskAward(curPlayer)
|
| | |
|
| | | return
|
| | |
|
| | | def CheckTongTianLingReset(curPlayer):
|
| | | ## 检查通天令重置
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | resetDays = IpyGameDataPY.GetFuncCfg("TongTianLing", 4)
|
| | | if resetDays <= 0:
|
| | | return
|
| | | |
| | | curTime = int(time.time())
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TTL_StartTime)
|
| | | passDays = GameWorld.GetDiff_Day(curTime, startTime) + 1
|
| | | if passDays <= resetDays:
|
| | | GameWorld.DebugLog("通天令本轮天数未完,不重置! startTime(%s),passDays=%s <= %s" |
| | | % (GameWorld.ChangeTimeNumToStr(startTime), passDays, resetDays), playerID)
|
| | | return
|
| | | |
| | | syncTaskInfoList = []
|
| | | for ttTaskType in ChConfig.TTLTaskTypeList:
|
| | | for isDailyTask in [0, 1]:
|
| | | curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TTL_TaskValue % (ttTaskType, isDailyTask))
|
| | | if not curValue:
|
| | | continue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_TaskValue % (ttTaskType, isDailyTask), 0)
|
| | | syncTaskInfoList.append([ttTaskType, isDailyTask])
|
| | | |
| | | for i in xrange(TTL_LVAwardKeyCount):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_CommAwardRecord % i, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_XianAwardRecord % i, 0)
|
| | | |
| | | for i in xrange(TTL_TaskAwardKeyCount):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_TaskAwardRecord % i, 0)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_StartTime, curTime)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_LVInfo, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_LVPoint, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TTL_DailyTaskPointToday, 0)
|
| | | |
| | | GameWorld.Log("通天令重置! StartTime=%s" % curTime, playerID)
|
| | | SyncTongTianLVInfo(curPlayer)
|
| | | SyncTongTianTaskInfo(curPlayer, syncTaskInfoList)
|
| | | SyncTongTianTaskAward(curPlayer)
|
| | | return True
|
| | |
|
| | | def GetTongTianLingLVInfo(curPlayer):
|
| | | ## 获取通天令等级状态信息
|
| | |
| | | clientPack.CurPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TTL_LVPoint)
|
| | | clientPack.CommAwardStateList = []
|
| | | clientPack.XianAwardStateList = []
|
| | | for i in xrange(2):
|
| | | for i in xrange(TTL_LVAwardKeyCount):
|
| | | clientPack.CommAwardStateList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TTL_CommAwardRecord % i))
|
| | | clientPack.XianAwardStateList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TTL_XianAwardRecord % i))
|
| | | clientPack.AwardStateCount = len(clientPack.CommAwardStateList)
|
| | |
| | | ## 任务奖励信息
|
| | | clientPack = ChPyNetSendPack.tagMCTongTianLingTaskAwardInfo()
|
| | | clientPack.TaskAwardStateList = []
|
| | | for i in xrange(9):
|
| | | for i in xrange(TTL_TaskAwardKeyCount):
|
| | | clientPack.TaskAwardStateList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TTL_TaskAwardRecord % i))
|
| | | clientPack.AwardStateCount = len(clientPack.TaskAwardStateList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|