| | |
| | | #"""Version = 2015-07-17 13:50"""
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import PlayerAssist
|
| | | #import PlayerRequest
|
| | | import GameWorldBoss
|
| | | import IpyGameDataPY
|
| | |
| | | GameWorld.ErrLog("设置当前创建队伍玩家为队长, 找不到玩家!teamID=%s" % teamID, curPlayerID)
|
| | | DR_Team("CreateError", teamID, {"Leader":curPlayerID, "tagMapID":tagMapID, "tagMapEx":tagMapEx, "reqMinLV":reqMinLV, "reqMaxLV":reqMaxLV})
|
| | | return
|
| | | |
| | | curNewTeamMenber.SetFace(curPlayer.GetFace())
|
| | | curNewTeamMenber.SetFacePic(curPlayer.GetFacePic())
|
| | | __SetTeamLV(curNewTeamMenber, IPY_GameServer.tmlLeader, False)
|
| | | if isSync:
|
| | | Sync_TeamMemberInfo(curNewTeam)
|
| | |
| | |
|
| | | #邀请组队的时候,双方都有队伍不处理
|
| | | 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()
|
| | | requestPack.Face = curPlayer.GetFace()
|
| | | requestPack.FacePic = curPlayer.GetFacePic()
|
| | | NetPackCommon.SendFakePack(tagPlayer, requestPack)
|
| | | |
| | | #TeamAskSuccess: 已成功发送入队申请
|
| | | PlayerControl.NotifyCode(curPlayer, "TeamAskSuccess")
|
| | | else:
|
| | | # 请求加入队伍(#被请求的玩家有队,请求加入其队伍)
|
| | | RequestJoinTeamReq(curPlayer, tagPlayerTeam, tick)
|
| | |
| | | requestPack.LV = curPlayer.GetLV()
|
| | | requestPack.Job = curPlayer.GetJob()
|
| | | requestPack.RealmLV = curPlayer.GetOfficialRank()
|
| | | requestPack.Face = curPlayer.GetFace()
|
| | | requestPack.FacePic = curPlayer.GetFacePic()
|
| | | NetPackCommon.SendFakePack(tagPlayer, requestPack)
|
| | |
|
| | | #TeamAskSuccess: 已成功发送入队申请
|
| | |
| | | member.Job = memberInfo.GetPlayerJob()
|
| | | member.JobLevel = memberInfo.GetPlayerJobLevel()
|
| | | member.RealmLV = memberInfo.GetPlayerRealmLV()
|
| | | member.Face = memberInfo.GetFace()
|
| | | member.FacePic = memberInfo.GetFacePic()
|
| | |
|
| | | memberPlayer = curTeam.GetMemberPlayer(i)
|
| | | if memberPlayer and memberPlayer.GetPlayerID():
|
| | |
| | | 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.Log("%s(%d)加入队伍 %s(%d), teamID=%s!" % (joinPlayer.GetName(), joinPlayer.GetPlayerID(),
|
| | | teamPlayer.GetName(), teamPlayer.GetPlayerID(), teamID))
|
| | | tagTeam.AddMember(joinPlayer)
|
| | | tagMember = tagTeam.GetMemberByID(joinPlayer.GetPlayerID())
|
| | | if tagMember:
|
| | | tagMember.SetFace(joinPlayer.GetFace())
|
| | | tagMember.SetFacePic(joinPlayer.GetFacePic())
|
| | | #UpdSceneTeamVersion(teamPlayer.GetMapID(), tick)
|
| | |
|
| | | #tagTeam.Sync_TeamState()
|
| | |
| | | '''
|
| | | #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.LV = player.GetLV()
|
| | | nearbyPlayer.Job = player.GetJob()
|
| | | nearbyPlayer.RealmLV = player.GetOfficialRank()
|
| | | nearbyPlayer.Face = player.GetFace()
|
| | | nearbyPlayer.FacePic = player.GetFacePic()
|
| | | nearbyPlayerInfo.PlayerList.append(nearbyPlayer)
|
| | |
|
| | | playerCount = len(nearbyPlayerInfo.PlayerList)
|
| | |
| | | teamMember.SetPlayerJobLevel(value)
|
| | | elif refreshType == IPY_GameServer.CDBPlayerRefresh_OfficialRank:
|
| | | teamMember.SetPlayerRealmLV(value)
|
| | | elif refreshType == IPY_GameServer.CDBPlayerRefresh_Face:
|
| | | teamMember.SetFace(value)
|
| | | elif refreshType == IPY_GameServer.CDBPlayerRefresh_HairColor:
|
| | | teamMember.SetFacePic(value)
|
| | | elif refreshType in [IPY_GameServer.CDBPlayerRefresh_VIPLv, IPY_GameServer.CDBPlayerRefresh_ExAttr9]:
|
| | | SyncMapServerTeamInfo(curTeam, "Refresh", {"refreshType":refreshType, "value":value})
|
| | | else:
|
| | |
| | | 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:
|
| | |
| | | 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
|
| | |
|