|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #邀请组队的时候,双方都有队伍不处理 | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #=============================================================================================== | 
|---|
|  |  |  | # #请求检查,是否有这个请求 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  |  | 
|---|