8542 【主干】【长尾】【BT】【后端】组队逻辑优化(支持发送teamID请求加入;支持双方无队伍请求加入,被请求玩家为队长)
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 10
|
| | | RegisterPackCount = 11
|
| | |
|
| | | PacketCMD_1=0xB9
|
| | | PacketSubCMD_1=0x01
|
| | |
| | | PacketSubCMD_10=0x0A
|
| | | PacketCallFunc_10=OnInvitePlayerJoinTeamByLV
|
| | |
|
| | | PacketCMD_11=0xB9
|
| | | PacketSubCMD_11=0x11
|
| | | PacketCallFunc_11=OnRequestJoinTeam
|
| | |
|
| | | [PlayerViewCache]
|
| | | ScriptName = Player\PlayerViewCache.py
|
| | | Writer = alee
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B9 11 请求加入队伍 #tagCGRequestJoinTeam
|
| | |
|
| | | class tagCGRequestJoinTeam(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("TeamID", c_int), # 目标队伍ID
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB9
|
| | | self.SubCmd = 0x11
|
| | | 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 = 0xB9
|
| | | self.SubCmd = 0x11
|
| | | self.TeamID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCGRequestJoinTeam)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B9 11 请求加入队伍 //tagCGRequestJoinTeam:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | TeamID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.TeamID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCGRequestJoinTeam=tagCGRequestJoinTeam()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGRequestJoinTeam.Cmd,m_NAtagCGRequestJoinTeam.SubCmd))] = m_NAtagCGRequestJoinTeam
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B9 09 队员进入副本准备选择 #tagCGTeamMemberPrepare
|
| | |
|
| | | class tagCGTeamMemberPrepare(Structure):
|
| | |
| | |
|
| | | return
|
| | |
|
| | | #// B9 11 请求加入队伍 #tagCGRequestJoinTeam
|
| | | #
|
| | | #struct tagCGRequestJoinTeam
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD TeamID; // 目标队伍ID
|
| | | #};
|
| | | def OnRequestJoinTeam(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | teamID = clientData.TeamID
|
| | | tagPlayerTeam = GameWorld.GetTeamManager().FindTeam(teamID)
|
| | | if tagPlayerTeam == None:
|
| | | # TeamNoExist 队伍不存在
|
| | | PlayerControl.NotifyCode(curPlayer, "TeamNoExist")
|
| | | return
|
| | | RequestJoinTeamReq(curPlayer, tagPlayerTeam, tick)
|
| | | return
|
| | |
|
| | | #//09 09 请求加入队伍#tagCRequestJoinTeam
|
| | | #
|
| | | #struct tagCRequestJoinTeam
|
| | |
| | |
|
| | | if tagPlayerTeam == None:
|
| | | # TeamNoExist 队伍不存在
|
| | | PlayerControl.NotifyCode(curPlayer, "TeamNoExist")
|
| | | #PlayerControl.NotifyCode(curPlayer, "TeamNoExist")
|
| | | #目标玩家没有队伍, 邀请玩家加入, 支持无队伍双方无队伍邀请
|
| | | #InvitePlayerJoinTeamReq(curPlayer, tagPlayer, curPlayerTeam, tick)
|
| | | |
| | | #支持双方无队伍请求加入,直接发送给被请求方确认
|
| | | #通知客户端弹窗口(目标弹框)
|
| | | requestPack = ChPyNetSendPack.tagGCRequestJoinTeam()
|
| | | requestPack.PlayerID = playerID
|
| | | requestPack.Name = curPlayer.GetName()
|
| | | requestPack.NameLen = len(requestPack.Name)
|
| | | requestPack.LV = curPlayer.GetLV()
|
| | | requestPack.Job = curPlayer.GetJob()
|
| | | requestPack.RealmLV = curPlayer.GetOfficialRank()
|
| | | NetPackCommon.SendFakePack(tagPlayer, requestPack)
|
| | | |
| | | #TeamAskSuccess: 已成功发送入队申请
|
| | | PlayerControl.NotifyCode(curPlayer, "TeamAskSuccess")
|
| | | else:
|
| | | # 请求加入队伍(#被请求的玩家有队,请求加入其队伍)
|
| | | RequestJoinTeamReq(curPlayer, tagPlayerTeam, tick)
|
| | |
| | | #被邀请的玩家队伍
|
| | | curPlayerTeam = curPlayer.GetTeam()
|
| | | if curPlayerTeam == None:
|
| | | GameWorld.DebugLog("玩家无队伍,无法审核加入队伍请求!" , playerID)
|
| | | PlayerControl.NotifyCode(tagPlayer, "TeamNoExist")
|
| | | return
|
| | | pass
|
| | | #屏蔽,修改为支持无队伍被请求加入
|
| | | #GameWorld.DebugLog("玩家无队伍,无法审核加入队伍请求!" , playerID)
|
| | | #PlayerControl.NotifyCode(tagPlayer, "TeamNoExist")
|
| | | #return
|
| | |
|
| | | #申请入队的允许双方都有队伍
|
| | | # #发出申请的玩家的队伍
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B9 11 请求加入队伍 #tagCGRequestJoinTeam
|
| | |
|
| | | class tagCGRequestJoinTeam(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("TeamID", c_int), # 目标队伍ID
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB9
|
| | | self.SubCmd = 0x11
|
| | | 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 = 0xB9
|
| | | self.SubCmd = 0x11
|
| | | self.TeamID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCGRequestJoinTeam)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B9 11 请求加入队伍 //tagCGRequestJoinTeam:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | TeamID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.TeamID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCGRequestJoinTeam=tagCGRequestJoinTeam()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGRequestJoinTeam.Cmd,m_NAtagCGRequestJoinTeam.SubCmd))] = m_NAtagCGRequestJoinTeam
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B9 09 队员进入副本准备选择 #tagCGTeamMemberPrepare
|
| | |
|
| | | class tagCGTeamMemberPrepare(Structure):
|