From 904df7e20029fa64f9382bc32b52f12f46e37e5d Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期五, 21 九月 2018 18:08:12 +0800 Subject: [PATCH] 1 礼包卡以权限分应用 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 150 insertions(+), 21 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index 8ced94f..a8171fe 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -11558,19 +11558,15 @@ #------------------------------------------------------ #A3 0A 副本鼓舞信息通知 #tagMCFBEncourageInfo -class tagMCFBEncourageInfo(Structure): +class tagMCFBEncourageCnt(Structure): _pack_ = 1 _fields_ = [ - ("Cmd", c_ubyte), - ("SubCmd", c_ubyte), - ("Cnt1", c_ubyte), # 当前铜钱鼓舞次数 - ("Cnt2", c_ubyte), # 当前仙玉鼓舞次数 + ("MoneyType", c_ubyte), # 金钱类型 + ("EncourageCnt", c_ubyte), # 当前鼓舞次数 ] def __init__(self): self.Clear() - self.Cmd = 0xA3 - self.SubCmd = 0x0A return def ReadData(self, stringData, _pos=0, _len=0): @@ -11579,36 +11575,92 @@ return _pos + self.GetLength() def Clear(self): - self.Cmd = 0xA3 - self.SubCmd = 0x0A - self.Cnt1 = 0 - self.Cnt2 = 0 + self.MoneyType = 0 + self.EncourageCnt = 0 return def GetLength(self): - return sizeof(tagMCFBEncourageInfo) + return sizeof(tagMCFBEncourageCnt) def GetBuffer(self): return string_at(addressof(self), self.GetLength()) def OutputString(self): DumpString = '''//A3 0A 副本鼓舞信息通知 //tagMCFBEncourageInfo: - Cmd:%s, - SubCmd:%s, - Cnt1:%d, - Cnt2:%d + MoneyType:%d, + EncourageCnt:%d '''\ %( - self.Cmd, - self.SubCmd, - self.Cnt1, - self.Cnt2 + self.MoneyType, + self.EncourageCnt + ) + return DumpString + + +class tagMCFBEncourageInfo(Structure): + Head = tagHead() + Cnt = 0 #(BYTE Cnt)// + InfoList = list() #(vector<tagMCFBEncourageCnt> InfoList)// 次数信息 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xA3 + self.Head.SubCmd = 0x0A + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Cnt): + temInfoList = tagMCFBEncourageCnt() + _pos = temInfoList.ReadData(_lpData, _pos) + self.InfoList.append(temInfoList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA3 + self.Head.SubCmd = 0x0A + self.Cnt = 0 + self.InfoList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + for i in range(self.Cnt): + length += self.InfoList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.Cnt) + for i in range(self.Cnt): + data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Cnt:%d, + InfoList:%s + '''\ + %( + self.Head.OutputString(), + self.Cnt, + "..." ) return DumpString m_NAtagMCFBEncourageInfo=tagMCFBEncourageInfo() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBEncourageInfo.Cmd,m_NAtagMCFBEncourageInfo.SubCmd))] = m_NAtagMCFBEncourageInfo +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBEncourageInfo.Head.Cmd,m_NAtagMCFBEncourageInfo.Head.SubCmd))] = m_NAtagMCFBEncourageInfo #------------------------------------------------------ @@ -13824,6 +13876,62 @@ m_NAtagMCPlayerStoveMsg=tagMCPlayerStoveMsg() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPlayerStoveMsg.Cmd,m_NAtagMCPlayerStoveMsg.SubCmd))] = m_NAtagMCPlayerStoveMsg + + +#------------------------------------------------------ +# A3 21 祈福丹药结果 #tagMCPrayElixirResult + +class tagMCPrayElixirResult(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ItemID", c_int), # 物品ID + ("PrayCnt", c_ubyte), # 今日祈福次数 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xA3 + self.SubCmd = 0x21 + 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 = 0xA3 + self.SubCmd = 0x21 + self.ItemID = 0 + self.PrayCnt = 0 + return + + def GetLength(self): + return sizeof(tagMCPrayElixirResult) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A3 21 祈福丹药结果 //tagMCPrayElixirResult: + Cmd:%s, + SubCmd:%s, + ItemID:%d, + PrayCnt:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ItemID, + self.PrayCnt + ) + return DumpString + + +m_NAtagMCPrayElixirResult=tagMCPrayElixirResult() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPrayElixirResult.Cmd,m_NAtagMCPrayElixirResult.SubCmd))] = m_NAtagMCPrayElixirResult #------------------------------------------------------ @@ -19750,6 +19858,7 @@ Head = tagHead() StartDate = "" #(char StartDate[10])// 开始日期 y-m-d EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + AdvanceMinutes = 0 #(WORD AdvanceMinutes)// 提前显示分钟 ActivityTimeCount = 0 #(BYTE ActivityTimeCount) ActivityTime = list() #(vector<tagMCFlashGiftbagTime> ActivityTime)//活动时间 IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置 @@ -19769,6 +19878,7 @@ _pos = self.Head.ReadData(_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.ActivityTimeCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) for i in range(self.ActivityTimeCount): temActivityTime = tagMCFlashGiftbagTime() @@ -19790,6 +19900,7 @@ self.Head.SubCmd = 0x12 self.StartDate = "" self.EndtDate = "" + self.AdvanceMinutes = 0 self.ActivityTimeCount = 0 self.ActivityTime = list() self.IsDayReset = 0 @@ -19803,6 +19914,7 @@ length += self.Head.GetLength() length += 10 length += 10 + length += 2 length += 1 for i in range(self.ActivityTimeCount): length += self.ActivityTime[i].GetLength() @@ -19819,6 +19931,7 @@ 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.WriteWORD(data, self.AdvanceMinutes) data = CommFunc.WriteBYTE(data, self.ActivityTimeCount) for i in range(self.ActivityTimeCount): data = CommFunc.WriteString(data, self.ActivityTime[i].GetLength(), self.ActivityTime[i].GetBuffer()) @@ -19834,6 +19947,7 @@ Head:%s, StartDate:%s, EndtDate:%s, + AdvanceMinutes:%d, ActivityTimeCount:%d, ActivityTime:%s, IsDayReset:%d, @@ -19845,6 +19959,7 @@ self.Head.OutputString(), self.StartDate, self.EndtDate, + self.AdvanceMinutes, self.ActivityTimeCount, "...", self.IsDayReset, @@ -20393,6 +20508,7 @@ Head = tagHead() StartDate = "" #(char StartDate[10])// 开始日期 y-m-d EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + AdvanceMinutes = 0 #(WORD AdvanceMinutes)// 提前显示分钟 ActivityTimeCount = 0 #(BYTE ActivityTimeCount) ActivityTime = list() #(vector<tagMCSpringSaleTime> ActivityTime)//活动时间 IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置 @@ -20412,6 +20528,7 @@ _pos = self.Head.ReadData(_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.ActivityTimeCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) for i in range(self.ActivityTimeCount): temActivityTime = tagMCSpringSaleTime() @@ -20433,6 +20550,7 @@ self.Head.SubCmd = 0x11 self.StartDate = "" self.EndtDate = "" + self.AdvanceMinutes = 0 self.ActivityTimeCount = 0 self.ActivityTime = list() self.IsDayReset = 0 @@ -20446,6 +20564,7 @@ length += self.Head.GetLength() length += 10 length += 10 + length += 2 length += 1 for i in range(self.ActivityTimeCount): length += self.ActivityTime[i].GetLength() @@ -20462,6 +20581,7 @@ 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.WriteWORD(data, self.AdvanceMinutes) data = CommFunc.WriteBYTE(data, self.ActivityTimeCount) for i in range(self.ActivityTimeCount): data = CommFunc.WriteString(data, self.ActivityTime[i].GetLength(), self.ActivityTime[i].GetBuffer()) @@ -20477,6 +20597,7 @@ Head:%s, StartDate:%s, EndtDate:%s, + AdvanceMinutes:%d, ActivityTimeCount:%d, ActivityTime:%s, IsDayReset:%d, @@ -20488,6 +20609,7 @@ self.Head.OutputString(), self.StartDate, self.EndtDate, + self.AdvanceMinutes, self.ActivityTimeCount, "...", self.IsDayReset, @@ -21211,6 +21333,7 @@ Head = tagHead() StartDate = "" #(char StartDate[10])// 开始日期 y-m-d EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置 LimitLV = 0 #(WORD LimitLV)// 限制等级 TaskCnt = 0 #(BYTE TaskCnt) TaskInfo = list() #(vector<tagMCBossRebornTaskInfo> TaskInfo) @@ -21227,6 +21350,7 @@ _pos = self.Head.ReadData(_lpData, _pos) self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10) self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10) + self.ResetType,_pos = CommFunc.ReadBYTE(_lpData, _pos) self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos) self.TaskCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) for i in range(self.TaskCnt): @@ -21242,6 +21366,7 @@ self.Head.SubCmd = 0x04 self.StartDate = "" self.EndtDate = "" + self.ResetType = 0 self.LimitLV = 0 self.TaskCnt = 0 self.TaskInfo = list() @@ -21252,6 +21377,7 @@ length += self.Head.GetLength() length += 10 length += 10 + length += 1 length += 2 length += 1 for i in range(self.TaskCnt): @@ -21264,6 +21390,7 @@ 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.ResetType) data = CommFunc.WriteWORD(data, self.LimitLV) data = CommFunc.WriteBYTE(data, self.TaskCnt) for i in range(self.TaskCnt): @@ -21275,6 +21402,7 @@ Head:%s, StartDate:%s, EndtDate:%s, + ResetType:%d, LimitLV:%d, TaskCnt:%d, TaskInfo:%s @@ -21283,6 +21411,7 @@ self.Head.OutputString(), self.StartDate, self.EndtDate, + self.ResetType, self.LimitLV, self.TaskCnt, "..." -- Gitblit v1.8.0