|  |  |  | 
|---|
|  |  |  | #"""Version = 2015-07-17 13:50""" | 
|---|
|  |  |  | #--------------------------------------------------------------------- | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import PlayerAssist | 
|---|
|  |  |  | #import PlayerRequest | 
|---|
|  |  |  | import GameWorldBoss | 
|---|
|  |  |  | import IpyGameDataPY | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #邀请组队的时候,双方都有队伍不处理 | 
|---|
|  |  |  | if curPlayerTeam != None and tagPlayerTeam != None: | 
|---|
|  |  |  | #InviteEnterLost02  <n color="255,255,0">`o很抱歉,目标玩家已在他人队伍中,邀请入队失败!</n>  25  -   - | 
|---|
|  |  |  | #PlayerControl.NotifyCode(curPlayer, "InviteEnterLost02") | 
|---|
|  |  |  | InvitePlayerJoinTeamReq(curPlayer, tagPlayer, curPlayerTeam, tick) | 
|---|
|  |  |  | #该玩家已在他人队伍中,邀请入队失败! | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "InviteEnterLost02") | 
|---|
|  |  |  | #InvitePlayerJoinTeamReq(curPlayer, tagPlayer, curPlayerTeam, tick) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if tagPlayerTeam == None: | 
|---|
|  |  |  | 
|---|
|  |  |  | else: | 
|---|
|  |  |  | GameWorld.Log("OnInvitePlayerJoinTeam ->组队系统异常" , curPlayer.GetPlayerID()) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #获得双方的队伍 | 
|---|
|  |  |  | #curPlayerTeam = curPlayer.GetTeam() | 
|---|
|  |  |  | curPlayerTeam = curPlayer.GetTeam() | 
|---|
|  |  |  | tagPlayerTeam = tagPlayer.GetTeam() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #请求加入的时候,双方都有队伍也可请求加入,支持退出队伍请求加入 | 
|---|
|  |  |  | #    if curPlayerTeam != None and tagPlayerTeam != None: | 
|---|
|  |  |  | #        #InviteEnterLost02  <n color="255,255,0">`o很抱歉,目标玩家已在他人队伍中,邀请入队失败!</n>  25  -   - | 
|---|
|  |  |  | #        PlayerControl.NotifyCode(curPlayer, "InviteEnterLost02") | 
|---|
|  |  |  | #        return | 
|---|
|  |  |  | if curPlayerTeam != None and tagPlayerTeam != None: | 
|---|
|  |  |  | #您已有队伍,请先退出再申请 | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "Friend_HaveTeam") | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | 
|---|
|  |  |  | invitePack.NameLen = len(invitePack.Name) | 
|---|
|  |  |  | invitePack.LV = curPlayer.GetLV() | 
|---|
|  |  |  | invitePack.Job = curPlayer.GetJob() | 
|---|
|  |  |  | invitePack.JobLevel = PlayerControl.GetJobRank(curPlayer) | 
|---|
|  |  |  | invitePack.RealmLV = curPlayer.GetOfficialRank() | 
|---|
|  |  |  | invitePack.TagMapID = tagMapID | 
|---|
|  |  |  | invitePack.TagMapEx = tagMapEx | 
|---|
|  |  |  | 
|---|
|  |  |  | requestPack.NameLen = len(requestPack.Name) | 
|---|
|  |  |  | requestPack.LV = curPlayer.GetLV() | 
|---|
|  |  |  | requestPack.Job = curPlayer.GetJob() | 
|---|
|  |  |  | requestPack.JobLevel = PlayerControl.GetJobRank(curPlayer) | 
|---|
|  |  |  | requestPack.RealmLV = curPlayer.GetOfficialRank() | 
|---|
|  |  |  | NetPackCommon.SendFakePack(tagPlayer, requestPack) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "TeamEnterForbid") | 
|---|
|  |  |  | return False | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if PlayerControl.GetAssistTagPlayerID(curPlayer): | 
|---|
|  |  |  | #协助中无法执行此操作 | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "InAssistForbid") | 
|---|
|  |  |  | return False | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if tagPlayer: | 
|---|
|  |  |  | tagPlayerID = tagPlayer.GetPlayerID() | 
|---|
|  |  |  | #检查ID | 
|---|
|  |  |  | 
|---|
|  |  |  | return False | 
|---|
|  |  |  | if IsInEnterFBTeamPrepare(tagTeamID): | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "TeamEnterForbid") | 
|---|
|  |  |  | return False | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if PlayerControl.GetAssistTagPlayerID(tagPlayer): | 
|---|
|  |  |  | #对方协助中,无法执行此操作 | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "TagInAssistForbid") | 
|---|
|  |  |  | return False | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return True | 
|---|
|  |  |  | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #双方的队伍 | 
|---|
|  |  |  | #curPlayerTeam = curPlayer.GetTeam() | 
|---|
|  |  |  | curPlayerTeam = curPlayer.GetTeam() | 
|---|
|  |  |  | tagPlayerTeam = tagPlayer.GetTeam() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if tagPlayerTeam == None: | 
|---|
|  |  |  | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "TeamNoExist") | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #=============================================================================================== | 
|---|
|  |  |  | # if curPlayerTeam != None: | 
|---|
|  |  |  | #    #InviteEnterLost02  组队失败,双方都有队伍! | 
|---|
|  |  |  | #    PlayerControl.NotifyCode(curPlayer, "InviteEnterLost02") | 
|---|
|  |  |  | #    return | 
|---|
|  |  |  | #=============================================================================================== | 
|---|
|  |  |  | if curPlayerTeam != None: | 
|---|
|  |  |  | #您已有队伍,请先退出再申请 | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "Friend_HaveTeam") | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #组队类型 | 
|---|
|  |  |  | #teamType = sendPack.GetTeamType() | 
|---|
|  |  |  | 
|---|
|  |  |  | #被邀请的玩家队伍 | 
|---|
|  |  |  | curPlayerTeam = curPlayer.GetTeam() | 
|---|
|  |  |  | if curPlayerTeam == None: | 
|---|
|  |  |  | GameWorld.DebugLog("玩家无队伍,无法审核加入队伍请求!" , playerID) | 
|---|
|  |  |  | PlayerControl.NotifyCode(tagPlayer, "TeamNoExist") | 
|---|
|  |  |  | return | 
|---|
|  |  |  | pass | 
|---|
|  |  |  | #屏蔽,修改为支持无队伍被请求加入 | 
|---|
|  |  |  | #GameWorld.DebugLog("玩家无队伍,无法审核加入队伍请求!" , playerID) | 
|---|
|  |  |  | #PlayerControl.NotifyCode(tagPlayer, "TeamNoExist") | 
|---|
|  |  |  | #return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #申请入队的允许双方都有队伍 | 
|---|
|  |  |  | #    #发出申请的玩家的队伍 | 
|---|
|  |  |  | #    tagPlayerTeam = tagPlayer.GetTeam() | 
|---|
|  |  |  | #    if tagPlayerTeam != None: | 
|---|
|  |  |  | #        #InviteEnterLost02  组队失败,双方都有队伍! | 
|---|
|  |  |  | #        PlayerControl.NotifyCode(tagPlayer, "InviteEnterLost02") | 
|---|
|  |  |  | #        return | 
|---|
|  |  |  | #发出申请的玩家的队伍 | 
|---|
|  |  |  | tagPlayerTeam = tagPlayer.GetTeam() | 
|---|
|  |  |  | if tagPlayerTeam != None: | 
|---|
|  |  |  | #该玩家已有队伍,同意时才提示对方有队伍 | 
|---|
|  |  |  | if isAgree == 1: | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "AcceptTeamLost") | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #=============================================================================================== | 
|---|
|  |  |  | # #请求检查,是否有这个请求 | 
|---|
|  |  |  | 
|---|
|  |  |  | ''' | 
|---|
|  |  |  | #GameWorld.DebugLog("玩家队伍变更通用处理,curTeamID=%s" % curPlayer.GetTeamID()) | 
|---|
|  |  |  | GameWorldBoss.OnPlayerTeamChange(curPlayer) | 
|---|
|  |  |  | PlayerAssist.OnPlayerTeamChange(curPlayer) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #--------------------------------------------------------------------- | 
|---|
|  |  |  | 
|---|
|  |  |  | return (teamLV == IPY_GameServer.tmlMemberCanCall or | 
|---|
|  |  |  | teamLV == IPY_GameServer.tmlLeader) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def CheckTeamOnLineCount(curTeam): | 
|---|
|  |  |  | def CheckTeamOnLineCount(curTeam, includeTJG=True): | 
|---|
|  |  |  | ##获得队伍剩余在线人数 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if not curTeam: | 
|---|
|  |  |  | return 0 | 
|---|
|  |  |  | count = 0 | 
|---|
|  |  |  | for i in xrange(curTeam.GetMemberCount()): | 
|---|
|  |  |  | curPlayer = curTeam.GetMemberPlayer(i) | 
|---|
|  |  |  | if curPlayer == None: | 
|---|
|  |  |  | continue | 
|---|
|  |  |  | if not includeTJG and PlayerControl.GetIsTJG(curPlayer): | 
|---|
|  |  |  | continue | 
|---|
|  |  |  | count += 1 | 
|---|
|  |  |  | return count | 
|---|
|  |  |  | 
|---|
|  |  |  | nearbyPlayer.NameLen = len(nearbyPlayer.Name) | 
|---|
|  |  |  | nearbyPlayer.LV = player.GetLV() | 
|---|
|  |  |  | nearbyPlayer.Job = player.GetJob() | 
|---|
|  |  |  | nearbyPlayer.JobLevel = PlayerControl.GetJobRank(player) | 
|---|
|  |  |  | nearbyPlayer.RealmLV = player.GetOfficialRank() | 
|---|
|  |  |  | nearbyPlayerInfo.PlayerList.append(nearbyPlayer) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | sceneTeam.NameLen = len(sceneTeam.PlayerName) | 
|---|
|  |  |  | sceneTeam.LV = leader.GetLV() | 
|---|
|  |  |  | sceneTeam.Job = leader.GetJob() | 
|---|
|  |  |  | sceneTeam.JobLevel = PlayerControl.GetJobRank(leader) | 
|---|
|  |  |  | sceneTeam.RealmLV = leader.GetOfficialRank() | 
|---|
|  |  |  | sceneTeam.MemberCount = team.GetTeamPlayerCount() | 
|---|
|  |  |  | sceneTeam.TagMapID = team.GetTagMapID() | 
|---|
|  |  |  | 
|---|
|  |  |  | tagMapTeam.NameLen = len(tagMapTeam.PlayerName) | 
|---|
|  |  |  | tagMapTeam.LV = leader.GetLV() | 
|---|
|  |  |  | tagMapTeam.Job = leader.GetJob() | 
|---|
|  |  |  | tagMapTeam.JobLevel = PlayerControl.GetJobRank(leader) | 
|---|
|  |  |  | tagMapTeam.RealmLV = leader.GetOfficialRank() | 
|---|
|  |  |  | tagMapTeam.MemberCount = team.GetTeamPlayerCount() | 
|---|
|  |  |  | tagMapTeam.ReqMinLV = team.GetReqMinLV() | 
|---|
|  |  |  | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | playerLV = curPlayer.GetLV() | 
|---|
|  |  |  | matchMapIDList = [ChConfig.Def_FBMapID_DuJie, ChConfig.Def_FBMapID_MunekadoTrial, ChConfig.Def_FBMapID_QueenRelics, ChConfig.Def_FBMapID_ChaosDemon] | 
|---|
|  |  |  | matchMapIDList = [ChConfig.Def_FBMapID_DuJie, ChConfig.Def_FBMapID_MunekadoTrial, ChConfig.Def_FBMapID_QueenRelics, ChConfig.Def_FBMapID_ChaosDemon, | 
|---|
|  |  |  | ChConfig.Def_FBMapID_KillDevil] | 
|---|
|  |  |  |  | 
|---|
|  |  |  | teamMgr = GameWorld.GetTeamManager() | 
|---|
|  |  |  | for matchMapID in matchMapIDList: | 
|---|
|  |  |  | 
|---|
|  |  |  | ["TeamEnterCDMe", "TeamEnterCDAll"], "SingleEnterCD"], | 
|---|
|  |  |  | ShareDefine.EntFBAskRet_LVLimit:[["TeamMatchingLVMe", "TeamMatchingLVAll"], | 
|---|
|  |  |  | ["TeamEnterLVMe", "TeamEnterLVAll"], "FbLV"], | 
|---|
|  |  |  | ShareDefine.EntFBAskRet_JobRankLimit:[["TeamMatchingJobMe", "TeamMatchingJobAll"], | 
|---|
|  |  |  | ["TeamEnterJobMe", "TeamEnterJobAll"], "SingleEnterJob"], | 
|---|
|  |  |  | ShareDefine.EntFBAskRet_NoTicket:[["TeamMatchingTicketMe", "TeamMatchingTicketAll"], | 
|---|
|  |  |  | ["TeamEnterTicketMe", "TeamEnterTicketAll"], "GeRen_chenxin_157069"], | 
|---|
|  |  |  | ShareDefine.EntFBAskRet_Dead:[["TeamMatchingDeadMe", "TeamMatchingDeadAll"], | 
|---|
|  |  |  | 
|---|
|  |  |  | ["TeamEnterSITMe", "TeamEnterSITAll"], "Carry_lhs_697674"], | 
|---|
|  |  |  | ShareDefine.EntFBAskRet_CrossPKMatching:[["CrossMatching9", "CrossMatching10"], | 
|---|
|  |  |  | ["CrossMatching11", "CrossMatching12"], "CrossMatching8"], | 
|---|
|  |  |  | ShareDefine.EntFBAskRet_InCrossMap:[["CrossMap6", "CrossMap7"], | 
|---|
|  |  |  | ["CrossMap8", "CrossMap9"], "CrossMap5"], | 
|---|
|  |  |  | ShareDefine.EntFBAskRet_Other:[["TeamMatchingDefaultMe", "TeamMatchingDefaultAll"], | 
|---|
|  |  |  | ["TeamEnterDefaultMe", "TeamEnterDefaultAll"], "SingleEnterDefaul"], | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def DR_Team(eventName, teamID, dataDict): | 
|---|
|  |  |  | drDict = {"EventName":eventName, "TeamID":teamID} | 
|---|
|  |  |  | drDict.update(dataDict) | 
|---|
|  |  |  | DataRecordPack.SendEventPack("Team_GameServer", drDict) | 
|---|
|  |  |  | #drDict = {"EventName":eventName, "TeamID":teamID} | 
|---|
|  |  |  | #drDict.update(dataDict) | 
|---|
|  |  |  | #DataRecordPack.SendEventPack("Team_GameServer", drDict) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|