#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package Player.PlayerFuncTeam # # @todo:¹¦ÄܶÓÎé±í # @author hxp # @date 2024-08-02 # @version 1.0 # # ÏêϸÃèÊö: ¹¦ÄܶÓÎé±í # #------------------------------------------------------------------------------- #"""Version = 2024-08-02 16:30""" #------------------------------------------------------------------------------- import PyGameData def OnFuncTeamMemIDRefresh(msgList): ## ¹¦ÄܶÓÎé³ÉÔ±IDˢРteamIDList, delTeamIDList, teamMemIDInfoDict = msgList # ûÓÐÖ¸¶¨Ê±£¬È«²¿Ë¢Ð if not teamIDList: PyGameData.g_funcTeamPlayerDict = {} for key, refreshDict in teamMemIDInfoDict.items(): if key not in PyGameData.g_funcTeamPlayerDict: PyGameData.g_funcTeamPlayerDict[key] = {} infoDict = PyGameData.g_funcTeamPlayerDict[key] infoDict.update(refreshDict) for teamInfoDict in PyGameData.g_funcTeamPlayerDict.values(): for delTeamID in delTeamIDList[::-1]: if delTeamID not in teamInfoDict: continue teamInfoDict.pop(delTeamID, None) delTeamIDList.remove(delTeamID) return def GetPlayerTeamID(playerID, funcMapID): for key, infoDict in PyGameData.g_funcTeamPlayerDict.items(): if funcMapID != key[1]: continue for teamID, memIDList in infoDict.items(): if playerID in memIDList: return teamID return 0 def GetMemberIDList(teamID): for infoDict in PyGameData.g_funcTeamPlayerDict.values(): if teamID in infoDict: return infoDict[teamID] return []