Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 29 设置小助手 #tagCMSetLittleHelper
|
| | |
|
| | | class tagCMSetLittleHelper(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("SetNum", c_ubyte), # 托管功能设置编号1~20,每个编号对应的托管功能前端自定义
|
| | | ("Value1", c_int), # 自定义值1
|
| | | ("Value2", c_int), # 自定义值2
|
| | | ("Value3", c_int), # 自定义值3
|
| | | ("Value4", c_int), # 自定义值4
|
| | | ("Value5", c_int), # 自定义值5
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x29
|
| | | 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 = 0xA2
|
| | | self.SubCmd = 0x29
|
| | | self.SetNum = 0
|
| | | self.Value1 = 0
|
| | | self.Value2 = 0
|
| | | self.Value3 = 0
|
| | | self.Value4 = 0
|
| | | self.Value5 = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMSetLittleHelper)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A2 29 设置小助手 //tagCMSetLittleHelper:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | SetNum:%d,
|
| | | Value1:%d,
|
| | | Value2:%d,
|
| | | Value3:%d,
|
| | | Value4:%d,
|
| | | Value5:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.SetNum,
|
| | | self.Value1,
|
| | | self.Value2,
|
| | | self.Value3,
|
| | | self.Value4,
|
| | | self.Value5
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMSetLittleHelper=tagCMSetLittleHelper()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSetLittleHelper.Cmd,m_NAtagCMSetLittleHelper.SubCmd))] = m_NAtagCMSetLittleHelper
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 09 设置环任务星级#tagCMSetRunMissionStar
|
| | |
|
| | | class tagCMSetRunMissionStar(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 16 小助手设置 #tagMCLittleHelperSet
|
| | |
|
| | | class tagMCLittleHelperFuncSet(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("SetNum", c_ubyte), # 托管功能设置编号1~20,每个编号对应的托管功能前端自定义
|
| | | ("Value1", c_int), # 自定义值1,如果存储的是勾选信息, 按二进制位存储代表是否勾选,支持31位,每位代表的含义前端自定义
|
| | | ("Value2", c_int), # 自定义值2
|
| | | ("Value3", c_int), # 自定义值3
|
| | | ("Value4", c_int), # 自定义值4
|
| | | ("Value5", c_int), # 自定义值5
|
| | | ]
|
| | |
|
| | | 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.SetNum = 0
|
| | | self.Value1 = 0
|
| | | self.Value2 = 0
|
| | | self.Value3 = 0
|
| | | self.Value4 = 0
|
| | | self.Value5 = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCLittleHelperFuncSet)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A7 16 小助手设置 //tagMCLittleHelperSet:
|
| | | SetNum:%d,
|
| | | Value1:%d,
|
| | | Value2:%d,
|
| | | Value3:%d,
|
| | | Value4:%d,
|
| | | Value5:%d
|
| | | '''\
|
| | | %(
|
| | | self.SetNum,
|
| | | self.Value1,
|
| | | self.Value2,
|
| | | self.Value3,
|
| | | self.Value4,
|
| | | self.Value5
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCLittleHelperSet(Structure):
|
| | | Head = tagHead()
|
| | | FuncSetCount = 0 #(BYTE FuncSetCount)// 托管功能设置数,暂支持20个
|
| | | FuncSetList = list() #(vector<tagMCLittleHelperFuncSet> FuncSetList)// 托管功能设置列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x16
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.FuncSetCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.FuncSetCount):
|
| | | temFuncSetList = tagMCLittleHelperFuncSet()
|
| | | _pos = temFuncSetList.ReadData(_lpData, _pos)
|
| | | self.FuncSetList.append(temFuncSetList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x16
|
| | | self.FuncSetCount = 0
|
| | | self.FuncSetList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.FuncSetCount):
|
| | | length += self.FuncSetList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.FuncSetCount)
|
| | | for i in range(self.FuncSetCount):
|
| | | data = CommFunc.WriteString(data, self.FuncSetList[i].GetLength(), self.FuncSetList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | FuncSetCount:%d,
|
| | | FuncSetList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.FuncSetCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCLittleHelperSet=tagMCLittleHelperSet()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLittleHelperSet.Head.Cmd,m_NAtagMCLittleHelperSet.Head.SubCmd))] = m_NAtagMCLittleHelperSet
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 14 通知查询的NPC数量 #tagMCNPCCntList
|
| | |
|
| | | class tagMCNPCCntInfo(Structure):
|
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 16
|
| | | RegisterPackCount = 17
|
| | |
|
| | | PacketCMD_1 = 0xA5
|
| | | PacketSubCMD_1 = 0x04
|
| | |
| | | PacketSubCMD_16=0x27
|
| | | PacketCallFunc_16=OnQueryMapNPCCntInfo
|
| | |
|
| | | PacketCMD_17=0xA2
|
| | | PacketSubCMD_17=0x29
|
| | | PacketCallFunc_17=OnSetLittleHelper
|
| | |
|
| | | ;购买相关的
|
| | | [BuySomething]
|
| | | ScriptName = Event\EventSrc\Operate_PlayerBuyZhenQi.py
|
| | |
| | | Def_Player_Dict_StoryMissionState = "StoryMissionState_%s" # 剧情任务编号完成状态, 参数(key编号), 按编号位记录
|
| | | Def_Player_Dict_TaskLastKillNPCID = "TaskLastKillNPCID" #任务上次随机击杀NPCID
|
| | | Def_Player_Dict_TaskLastVisitNPCID = "TaskLastVisitNPCID" #任务上次随机访问NPCID
|
| | | LittleHelperSetNumCount = 20 # 小助手设置编号个数
|
| | | LittleHelperValueCount = 5 # 小助手设置值个数
|
| | | Def_Player_Dict_LittleHelperValue = "LittleHelperValue%s_%s" # 小助手设置值存储, 参数(设置编号, value编号)
|
| | |
|
| | |
|
| | | Def_Player_Dict_FamilyTechLV = "FamilyTechLV_%s" #家族科技等级, 参数(科技ID)
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 29 设置小助手 #tagCMSetLittleHelper
|
| | |
|
| | | class tagCMSetLittleHelper(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("SetNum", c_ubyte), # 托管功能设置编号1~20,每个编号对应的托管功能前端自定义
|
| | | ("Value1", c_int), # 自定义值1
|
| | | ("Value2", c_int), # 自定义值2
|
| | | ("Value3", c_int), # 自定义值3
|
| | | ("Value4", c_int), # 自定义值4
|
| | | ("Value5", c_int), # 自定义值5
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x29
|
| | | 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 = 0xA2
|
| | | self.SubCmd = 0x29
|
| | | self.SetNum = 0
|
| | | self.Value1 = 0
|
| | | self.Value2 = 0
|
| | | self.Value3 = 0
|
| | | self.Value4 = 0
|
| | | self.Value5 = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMSetLittleHelper)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A2 29 设置小助手 //tagCMSetLittleHelper:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | SetNum:%d,
|
| | | Value1:%d,
|
| | | Value2:%d,
|
| | | Value3:%d,
|
| | | Value4:%d,
|
| | | Value5:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.SetNum,
|
| | | self.Value1,
|
| | | self.Value2,
|
| | | self.Value3,
|
| | | self.Value4,
|
| | | self.Value5
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMSetLittleHelper=tagCMSetLittleHelper()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSetLittleHelper.Cmd,m_NAtagCMSetLittleHelper.SubCmd))] = m_NAtagCMSetLittleHelper
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 09 设置环任务星级#tagCMSetRunMissionStar
|
| | |
|
| | | class tagCMSetRunMissionStar(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 16 小助手设置 #tagMCLittleHelperSet
|
| | |
|
| | | class tagMCLittleHelperFuncSet(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("SetNum", c_ubyte), # 托管功能设置编号1~20,每个编号对应的托管功能前端自定义
|
| | | ("Value1", c_int), # 自定义值1,如果存储的是勾选信息, 按二进制位存储代表是否勾选,支持31位,每位代表的含义前端自定义
|
| | | ("Value2", c_int), # 自定义值2
|
| | | ("Value3", c_int), # 自定义值3
|
| | | ("Value4", c_int), # 自定义值4
|
| | | ("Value5", c_int), # 自定义值5
|
| | | ]
|
| | |
|
| | | 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.SetNum = 0
|
| | | self.Value1 = 0
|
| | | self.Value2 = 0
|
| | | self.Value3 = 0
|
| | | self.Value4 = 0
|
| | | self.Value5 = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCLittleHelperFuncSet)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A7 16 小助手设置 //tagMCLittleHelperSet:
|
| | | SetNum:%d,
|
| | | Value1:%d,
|
| | | Value2:%d,
|
| | | Value3:%d,
|
| | | Value4:%d,
|
| | | Value5:%d
|
| | | '''\
|
| | | %(
|
| | | self.SetNum,
|
| | | self.Value1,
|
| | | self.Value2,
|
| | | self.Value3,
|
| | | self.Value4,
|
| | | self.Value5
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCLittleHelperSet(Structure):
|
| | | Head = tagHead()
|
| | | FuncSetCount = 0 #(BYTE FuncSetCount)// 托管功能设置数,暂支持20个
|
| | | FuncSetList = list() #(vector<tagMCLittleHelperFuncSet> FuncSetList)// 托管功能设置列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x16
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.FuncSetCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.FuncSetCount):
|
| | | temFuncSetList = tagMCLittleHelperFuncSet()
|
| | | _pos = temFuncSetList.ReadData(_lpData, _pos)
|
| | | self.FuncSetList.append(temFuncSetList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x16
|
| | | self.FuncSetCount = 0
|
| | | self.FuncSetList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.FuncSetCount):
|
| | | length += self.FuncSetList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.FuncSetCount)
|
| | | for i in range(self.FuncSetCount):
|
| | | data = CommFunc.WriteString(data, self.FuncSetList[i].GetLength(), self.FuncSetList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | FuncSetCount:%d,
|
| | | FuncSetList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.FuncSetCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCLittleHelperSet=tagMCLittleHelperSet()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLittleHelperSet.Head.Cmd,m_NAtagMCLittleHelperSet.Head.SubCmd))] = m_NAtagMCLittleHelperSet
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 14 通知查询的NPC数量 #tagMCNPCCntList
|
| | |
|
| | | class tagMCNPCCntInfo(Structure):
|
| | |
| | | PlayerWishingWell.OnLogin(curPlayer)
|
| | | # 上线查询一次充值订单
|
| | | curPlayer.SendDBQueryRecharge()
|
| | | # 小助手
|
| | | SyncLittleHelper(curPlayer)
|
| | |
|
| | | curPlayer.SetState(0) # 脱机挂恢复为正常上线
|
| | | curPlayer.SetFacePic(0) # 通知数据库是否保存还是下线,做一次恢复,1为保存 0为正常下线
|
| | |
| | | curPlayer.SetSetting(setting)
|
| | | return
|
| | |
|
| | | #// A2 29 设置小助手 #tagCMSetLittleHelper
|
| | | #
|
| | | #struct tagCMSetLittleHelper
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE SetNum; // 托管功能设置编号1~20,每个编号对应的托管功能前端自定义
|
| | | # DWORD Value1; // 自定义值1
|
| | | # DWORD Value2; // 自定义值2
|
| | | # DWORD Value3; // 自定义值3
|
| | | # DWORD Value4; // 自定义值4
|
| | | # DWORD Value5; // 自定义值5
|
| | | #};
|
| | | def OnSetLittleHelper(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | setNum = clientData.SetNum
|
| | | if setNum > ChConfig.LittleHelperSetNumCount:
|
| | | GameWorld.ErrLog("小助手不支持该设置编号! setNum=%s" % setNum, curPlayer.GetPlayerID())
|
| | | return
|
| | | for i in xrange(1, ChConfig.LittleHelperValueCount + 1):
|
| | | if not hasattr(clientData, "Value%s" % i):
|
| | | GameWorld.ErrLog("小助手不支持该值编号设置! setNum=%s,value%s" % (setNum, i), curPlayer.GetPlayerID())
|
| | | continue
|
| | | value = getattr(clientData, "Value%s" % i)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_LittleHelperValue % (setNum, i), value)
|
| | | GameWorld.DebugLog("小助手值设置: setNum=%s,value%s=%s" % (setNum, i, value), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | def SyncLittleHelper(curPlayer):
|
| | | ## 同步小助手设置,仅有值的同步
|
| | | funcSetList = []
|
| | | for setNum in xrange(ChConfig.LittleHelperSetNumCount + 1):
|
| | | funcSet = None
|
| | | for i in xrange(1, ChConfig.LittleHelperValueCount + 1):
|
| | | value = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_LittleHelperValue % (setNum, i))
|
| | | if not value:
|
| | | continue
|
| | | if not funcSet:
|
| | | funcSet = ChPyNetSendPack.tagMCLittleHelperFuncSet()
|
| | | funcSet.SetNum = setNum
|
| | | if hasattr(funcSet, "Value%s" % i):
|
| | | setattr(funcSet, "Value%s" % i, value)
|
| | | if funcSet:
|
| | | funcSetList.append(funcSet)
|
| | | |
| | | if not funcSetList:
|
| | | return
|
| | | |
| | | setPack = ChPyNetSendPack.tagMCLittleHelperSet()
|
| | | setPack.FuncSetList = funcSetList
|
| | | setPack.FuncSetCount = len(setPack.FuncSetList)
|
| | | NetPackCommon.SendFakePack(curPlayer, setPack)
|
| | | return
|
| | |
|
| | | #// A2 22 设置引导成功 #tagCMSetGuideOK
|
| | | #
|
| | | #struct tagCMSetGuideOK
|