Пример #1
0
 private void OnPeerComponentAdded(PeerComponent component)
 {
     if (component.IsMine && component is MissionRepresentativeBase)
     {
         this._myRepresentative = (component as PeaceGameMissionRepresentative);
     }
 }
Пример #2
0
 private void OnPeerComponentAdded(PeerComponent component)
 {
     if (!component.IsMine || !(component is MissionRepresentativeBase))
     {
         return;
     }
     this._myRepresentative = component as FlagDominationMissionRepresentative;
 }
 private void OnPeerComponentAdded(PeerComponent component)
 {
     if (!(component is MissionRepresentativeBase) || !component.IsMine)
     {
         return;
     }
     this.LateInitializeHeaders();
 }
Пример #4
0
 private void OnPeerComponentAdded(PeerComponent component)
 {
     if (!component.IsMine || !(component is MissionRepresentativeBase))
     {
         return;
     }
     this._myRepresentative = component as TeamDeathmatchMissionRepresentative;
 }
        private void OnPeerComponentPreRemoved(VirtualPlayer peer, PeerComponent component)
        {
            if (!(component is MissionPeer missionPeer))
            {
                return;
            }
            MissionPeer lobbyComponent = missionPeer.GetComponent <MissionPeer>();
            int         num            = this._spectators.Contains(lobbyComponent) ? 1 : 0;
            bool        flag           = ((IEnumerable <MissionScoreboardComponent.MissionScoreboardSide>) this._sides).Any <MissionScoreboardComponent.MissionScoreboardSide>((Func <MissionScoreboardComponent.MissionScoreboardSide, bool>)(x => x != null && x.Players.Contains <MissionPeer>(lobbyComponent)));

            if (num != 0)
            {
                this._spectators.Remove(lobbyComponent);
            }
            else
            {
                if (!flag)
                {
                    return;
                }
                this._sides[(int)lobbyComponent.Team.Side].RemovePlayer(lobbyComponent);
                Formation controlledFormation = missionPeer.ControlledFormation;
                if (controlledFormation != null)
                {
                    Team team = missionPeer.Team;
                    this.Sides[(int)team.Side].BotScores.AliveCount += controlledFormation.GetCountOfUnitsWithCondition((Func <Agent, bool>)(agent => agent.IsActive()));
                    this.BotPropertiesChanged(team.Side);
                }
                Action <Team, Team, MissionPeer> playerSideChanged = this.OnPlayerSideChanged;
                if (playerSideChanged == null)
                {
                    return;
                }
                playerSideChanged(lobbyComponent.Team, (Team)null, lobbyComponent);
            }
        }
 public static void RemoveComponent(
     this NetworkCommunicator networkPeer,
     PeerComponent component)
 {
     networkPeer.VirtualPlayer.RemoveComponent(component);
 }
 public static NetworkCommunicator GetNetworkPeer(
     this PeerComponent peerComponent)
 {
     return(peerComponent.Peer.Communicator as NetworkCommunicator);
 }
 public static VirtualPlayer GetPeer(this PeerComponent peerComponent) => peerComponent.Peer;
 public void OnRemoveComponent(PeerComponent component)
 {
 }
 public void OnAddComponent(PeerComponent component)
 {
 }
 public void OnSynchronizeComponentTo(VirtualPlayer peer, PeerComponent component)
 {
 }