fix:3320 【后端】前3次宗门试炼1层和前2个大境界渡劫的世界喊话特殊处理(按等级随机邀请入队)
4个文件已修改
160 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/PyNetPack.ini 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTeam.py 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/PyNetPack.ini
@@ -269,7 +269,7 @@
Writer = hxp
Releaser = hxp
RegType = 0
RegisterPackCount = 9
RegisterPackCount = 10
PacketCMD_1=0xB9
PacketSubCMD_1=0x01
@@ -307,6 +307,10 @@
PacketSubCMD_9=0x10
PacketCallFunc_9=OnQueryTeamMemFuncData
PacketCMD_10=0xB9
PacketSubCMD_10=0x0A
PacketCallFunc_10=OnInvitePlayerJoinTeamByLV
[PlayerViewCache]
ScriptName = Player\PlayerViewCache.py
Writer = alee
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -2644,6 +2644,62 @@
#------------------------------------------------------
# B9 0A 按条件邀请玩家加入队伍 #tagCGInvitePlayerJoinTeamByLV
class  tagCGInvitePlayerJoinTeamByLV(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("LVLimit", c_ushort),    # 目标玩家大于等于此等级
                  ("InviteCnt", c_ubyte),    # 邀请玩家个数
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xB9
        self.SubCmd = 0x0A
        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 = 0x0A
        self.LVLimit = 0
        self.InviteCnt = 0
        return
    def GetLength(self):
        return sizeof(tagCGInvitePlayerJoinTeamByLV)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// B9 0A 按条件邀请玩家加入队伍 //tagCGInvitePlayerJoinTeamByLV:
                                Cmd:%s,
                                SubCmd:%s,
                                LVLimit:%d,
                                InviteCnt:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.LVLimit,
                                self.InviteCnt
                                )
        return DumpString
m_NAtagCGInvitePlayerJoinTeamByLV=tagCGInvitePlayerJoinTeamByLV()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGInvitePlayerJoinTeamByLV.Cmd,m_NAtagCGInvitePlayerJoinTeamByLV.SubCmd))] = m_NAtagCGInvitePlayerJoinTeamByLV
#------------------------------------------------------
# B9 05 查询推荐组队的附近玩家 #tagCGQueryRecommendNearbyPlayer
class  tagCGQueryRecommendNearbyPlayer(Structure):
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTeam.py
@@ -31,6 +31,7 @@
import copy
import time
import random
#---------------------------------------------------------------------
TeamFBAskType_Match = 0 # 组队副本进入询问类型 - 匹配
@@ -2915,3 +2916,44 @@
            SyncTeamEnterFBPrepareInfo(curTeam, askMapID, askMapEx, memStateDict, True)
    return
#// B9 0A 按条件邀请玩家加入队伍 #tagCGInvitePlayerJoinTeamByLV
#
#struct    tagCGInvitePlayerJoinTeamByLV
#{
#    tagHead        Head;
#    WORD        LVLimit;        // 目标玩家大于等于此等级
#    BYTE        InviteCnt;    // 邀请玩家个数
#};
def OnInvitePlayerJoinTeamByLV(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    lvlimit = clientData.LVLimit
    inviteCnt = clientData.InviteCnt
    curPlayerTeam = curPlayer.GetTeam()
    if not curPlayerTeam:
        return
    curInviteCnt = 0 #当前邀请数量
    playerManager = GameWorld.GetPlayerManager()
    playerCount = playerManager.GetActivePlayerCount()
    if playerCount < 2:
        return
    indexList = range(playerCount)
    random.shuffle(indexList)
    for i in indexList:
        tagPlayer = playerManager.GetActivePlayerAt(i)
        if tagPlayer == None or not tagPlayer.GetInitOK():
            continue
        if PlayerControl.GetIsTJG(tagPlayer):
            continue
        if tagPlayer.GetPlayerID() == curPlayer.GetPlayerID():
            continue
        if tagPlayer.GetLV() < lvlimit:
            continue
        if tagPlayer.GetTeam():
            continue
        if InvitePlayerJoinTeamReq(curPlayer, tagPlayer, curPlayerTeam, tick):
            curInviteCnt +=1
        if curInviteCnt >= inviteCnt:
            break
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -2644,6 +2644,62 @@
#------------------------------------------------------
# B9 0A 按条件邀请玩家加入队伍 #tagCGInvitePlayerJoinTeamByLV
class  tagCGInvitePlayerJoinTeamByLV(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("LVLimit", c_ushort),    # 目标玩家大于等于此等级
                  ("InviteCnt", c_ubyte),    # 邀请玩家个数
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xB9
        self.SubCmd = 0x0A
        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 = 0x0A
        self.LVLimit = 0
        self.InviteCnt = 0
        return
    def GetLength(self):
        return sizeof(tagCGInvitePlayerJoinTeamByLV)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// B9 0A 按条件邀请玩家加入队伍 //tagCGInvitePlayerJoinTeamByLV:
                                Cmd:%s,
                                SubCmd:%s,
                                LVLimit:%d,
                                InviteCnt:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.LVLimit,
                                self.InviteCnt
                                )
        return DumpString
m_NAtagCGInvitePlayerJoinTeamByLV=tagCGInvitePlayerJoinTeamByLV()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGInvitePlayerJoinTeamByLV.Cmd,m_NAtagCGInvitePlayerJoinTeamByLV.SubCmd))] = m_NAtagCGInvitePlayerJoinTeamByLV
#------------------------------------------------------
# B9 05 查询推荐组队的附近玩家 #tagCGQueryRecommendNearbyPlayer
class  tagCGQueryRecommendNearbyPlayer(Structure):