public virtual void Initialize(SpawnComponent spawnComponent)
 {
     this.SpawnComponent            = spawnComponent;
     this.AgentVisualSpawnComponent = this.Mission.GetMissionBehaviour <MultiplayerMissionAgentVisualSpawnComponent>();
     this.GameMode = this.Mission.GetMissionBehaviour <MissionMultiplayerGameModeBase>();
     this.MissionLobbyComponent = this.Mission.GetMissionBehaviour <MissionLobbyComponent>();
     this.MissionLobbyEquipmentNetworkComponent = this.Mission.GetMissionBehaviour <MissionLobbyEquipmentNetworkComponent>();
     this.MissionLobbyEquipmentNetworkComponent.OnEquipmentRefreshed += new MissionLobbyEquipmentNetworkComponent.OnRefreshEquipmentEventDelegate(this.OnPeerEquipmentUpdated);
 }
 public override void OnBehaviourInitialize()
 {
     base.OnBehaviourInitialize();
     this.MissionLobbyComponent  = this.Mission.GetMissionBehaviour <MissionLobbyComponent>();
     this.GameModeBaseClient     = this.Mission.GetMissionBehaviour <MissionMultiplayerGameModeBaseClient>();
     this.NotificationsComponent = this.Mission.GetMissionBehaviour <MultiplayerGameNotificationsComponent>();
     this.RoundController        = this.Mission.GetMissionBehaviour <MultiplayerRoundController>();
     this.WarmupComponent        = this.Mission.GetMissionBehaviour <MultiplayerWarmupComponent>();
     this.TimerComponent         = this.Mission.GetMissionBehaviour <MultiplayerTimerComponent>();
     this.SpawnComponent         = Mission.Current.GetMissionBehaviour <SpawnComponent>();
     this._lastPerkTickTime      = Mission.Current.Time;
 }
 public override void AfterStart()
 {
     this.Clear();
     this._missionLobbyComponent               = this.Mission.GetMissionBehaviour <MissionLobbyComponent>();
     this._mpGameModeBase                      = this.Mission.GetMissionBehaviour <MissionMultiplayerGameModeBaseClient>();
     this._scoreboardSides                     = this._missionLobbyComponent.MissionType == MissionLobbyComponent.MultiplayerGameType.FreeForAll || this._missionLobbyComponent.MissionType == MissionLobbyComponent.MultiplayerGameType.Duel ? MissionScoreboardComponent.ScoreboardSides.OneSide : MissionScoreboardComponent.ScoreboardSides.TwoSides;
     MissionPeer.OnTeamChanged                += new MissionPeer.OnTeamChangedDelegate(this.TeamChange);
     VirtualPlayer.OnPeerComponentPreRemoved  += new Action <VirtualPlayer, PeerComponent>(this.OnPeerComponentPreRemoved);
     NetworkCommunicator.OnPeerComponentAdded += new Action <PeerComponent>(this.OnPeerComponentAdded);
     if (GameNetwork.IsServerOrRecorder && this._mpGameModeBase.RoundComponent != null)
     {
         this._mpGameModeBase.RoundComponent.OnRoundEnding += new Action(this.OnRoundEnding);
     }
     this.LateInitScoreboard();
 }
 public static void OpenSiegeMission(string scene) => MissionState.OpenNew("MultiplayerSiege", new MissionInitializerRecord(scene)
 {
     SceneUpgradeLevel = 3,
     SceneLevels       = ""
 }, (InitializeMissionBehvaioursDelegate)(missionController => GameNetwork.IsServer ? (IEnumerable <MissionBehaviour>) new MissionBehaviour[19]
 {
     (MissionBehaviour)MissionLobbyComponent.CreateBehaviour(),
     (MissionBehaviour) new MissionMultiplayerSiege(),
     (MissionBehaviour) new MultiplayerWarmupComponent(),
     (MissionBehaviour) new MissionMultiplayerSiegeClient(),
     (MissionBehaviour) new MultiplayerTimerComponent(),
     (MissionBehaviour) new MultiplayerMissionAgentVisualSpawnComponent(),
     (MissionBehaviour) new SpawnComponent((SpawnFrameBehaviourBase) new SiegeSpawnFrameBehaviour(), (SpawningBehaviourBase) new SiegeSpawningBehaviour()),
     (MissionBehaviour) new MissionLobbyEquipmentNetworkComponent(),
     (MissionBehaviour) new MultiplayerTeamSelectComponent(),
     (MissionBehaviour) new MissionHardBorderPlacer(),
     (MissionBehaviour) new MissionBoundaryPlacer(),
     (MissionBehaviour) new MissionBoundaryCrossingHandler(),
     (MissionBehaviour) new MultiplayerPollComponent(),
     (MissionBehaviour) new MultiplayerAdminComponent(),
     (MissionBehaviour) new MultiplayerGameNotificationsComponent(),
     (MissionBehaviour) new MissionOptionsComponent(),
     (MissionBehaviour) new MissionScoreboardComponent("Siege"),
     (MissionBehaviour) new MissionAgentPanicHandler(),
     (MissionBehaviour) new AgentBattleAILogic()
 } : (IEnumerable <MissionBehaviour>) new MissionBehaviour[16]
 {
     (MissionBehaviour)MissionLobbyComponent.CreateBehaviour(),
     (MissionBehaviour) new MultiplayerWarmupComponent(),
     (MissionBehaviour) new MissionMultiplayerSiegeClient(),
     (MissionBehaviour) new MultiplayerTimerComponent(),
     (MissionBehaviour) new MultiplayerMissionAgentVisualSpawnComponent(),
     (MissionBehaviour) new MissionLobbyEquipmentNetworkComponent(),
     (MissionBehaviour) new MultiplayerTeamSelectComponent(),
     (MissionBehaviour) new MissionHardBorderPlacer(),
     (MissionBehaviour) new MissionBoundaryPlacer(),
     (MissionBehaviour) new MissionBoundaryCrossingHandler(),
     (MissionBehaviour) new MultiplayerPollComponent(),
     (MissionBehaviour) new MultiplayerGameNotificationsComponent(),
     (MissionBehaviour) new MissionOptionsComponent(),
     (MissionBehaviour) new MissionScoreboardComponent("Siege"),
     (MissionBehaviour) new MissionMatchHistoryComponent(),
     (MissionBehaviour) new MissionRecentPlayersComponent()
 }));
 public static void OpenCaptainMission(string scene) => MissionState.OpenNew("MultiplayerCaptain", new MissionInitializerRecord(scene), (InitializeMissionBehvaioursDelegate)(missionController => GameNetwork.IsServer ? (IEnumerable <MissionBehaviour>) new MissionBehaviour[21]
 {
     (MissionBehaviour)MissionLobbyComponent.CreateBehaviour(),
     (MissionBehaviour) new MultiplayerRoundController(),
     (MissionBehaviour) new MissionMultiplayerFlagDomination(false),
     (MissionBehaviour) new MultiplayerWarmupComponent(),
     (MissionBehaviour) new MissionMultiplayerGameModeFlagDominationClient(),
     (MissionBehaviour) new MultiplayerTimerComponent(),
     (MissionBehaviour) new MultiplayerMissionAgentVisualSpawnComponent(),
     (MissionBehaviour) new SpawnComponent((SpawnFrameBehaviourBase) new FlagDominationSpawnFrameBehaviour(), (SpawningBehaviourBase) new FlagDominationSpawningBehaviour()),
     (MissionBehaviour) new MissionLobbyEquipmentNetworkComponent(),
     (MissionBehaviour) new MultiplayerTeamSelectComponent(),
     (MissionBehaviour) new AgentVictoryLogic(),
     (MissionBehaviour) new AgentBattleAILogic(),
     (MissionBehaviour) new MissionAgentPanicHandler(),
     (MissionBehaviour) new MissionBoundaryPlacer(),
     (MissionBehaviour) new MissionBoundaryCrossingHandler(),
     (MissionBehaviour) new MultiplayerPollComponent(),
     (MissionBehaviour) new MultiplayerAdminComponent(),
     (MissionBehaviour) new MultiplayerGameNotificationsComponent(),
     (MissionBehaviour) new MissionOptionsComponent(),
     (MissionBehaviour) new MissionScoreboardComponent("Captain"),
     (MissionBehaviour) new AgentFadeOutLogic()
 } : (IEnumerable <MissionBehaviour>) new MissionBehaviour[17]
 {
     (MissionBehaviour)MissionLobbyComponent.CreateBehaviour(),
     (MissionBehaviour) new MultiplayerRoundComponent(),
     (MissionBehaviour) new MultiplayerWarmupComponent(),
     (MissionBehaviour) new MissionMultiplayerGameModeFlagDominationClient(),
     (MissionBehaviour) new MultiplayerTimerComponent(),
     (MissionBehaviour) new MultiplayerMissionAgentVisualSpawnComponent(),
     (MissionBehaviour) new MissionLobbyEquipmentNetworkComponent(),
     (MissionBehaviour) new MultiplayerTeamSelectComponent(),
     (MissionBehaviour) new AgentVictoryLogic(),
     (MissionBehaviour) new MissionBoundaryPlacer(),
     (MissionBehaviour) new MissionBoundaryCrossingHandler(),
     (MissionBehaviour) new MultiplayerPollComponent(),
     (MissionBehaviour) new MultiplayerGameNotificationsComponent(),
     (MissionBehaviour) new MissionOptionsComponent(),
     (MissionBehaviour) new MissionScoreboardComponent("Captain"),
     (MissionBehaviour) new MissionMatchHistoryComponent(),
     (MissionBehaviour) new MissionRecentPlayersComponent()
 }));
Esempio n. 6
0
        private bool HandleClientEventCreateBannerForPeer(
            NetworkCommunicator peer,
            NetworkMessages.FromClient.CreateBanner message)
        {
            MissionMultiplayerGameModeBase missionBehaviour = Mission.Current.GetMissionBehaviour <MissionMultiplayerGameModeBase>();

            if (missionBehaviour == null || !missionBehaviour.AllowCustomPlayerBanners())
            {
                return(false);
            }
            MissionPeer component = peer.GetComponent <MissionPeer>();

            if (component == null)
            {
                return(false);
            }
            component.Peer.BannerCode = message.BannerCode;
            MissionLobbyComponent.SyncBannersToAllClients(message.BannerCode, component.GetNetworkPeer());
            return(true);
        }
 public static void OpenDuelMission(string scene) => MissionState.OpenNew("MultiplayerDuel", new MissionInitializerRecord(scene), (InitializeMissionBehvaioursDelegate)(missionController => GameNetwork.IsServer ? (IEnumerable <MissionBehaviour>) new MissionBehaviour[17]
 {
     (MissionBehaviour)MissionLobbyComponent.CreateBehaviour(),
     (MissionBehaviour) new MissionMultiplayerDuel(),
     (MissionBehaviour) new MissionMultiplayerGameModeDuelClient(),
     (MissionBehaviour) new MultiplayerTimerComponent(),
     (MissionBehaviour) new MultiplayerMissionAgentVisualSpawnComponent(),
     (MissionBehaviour) new SpawnComponent((SpawnFrameBehaviourBase) new FFASpawnFrameBehaviour(), (SpawningBehaviourBase) new WarmupSpawningBehaviour()),
     (MissionBehaviour) new MissionLobbyEquipmentNetworkComponent(),
     (MissionBehaviour) new MissionHardBorderPlacer(),
     (MissionBehaviour) new MissionBoundaryPlacer(),
     (MissionBehaviour) new MissionBoundaryCrossingHandler(),
     (MissionBehaviour) new MultiplayerPollComponent(),
     (MissionBehaviour) new MultiplayerAdminComponent(),
     (MissionBehaviour) new MultiplayerGameNotificationsComponent(),
     (MissionBehaviour) new MissionOptionsComponent(),
     (MissionBehaviour) new MissionScoreboardComponent("Duel"),
     (MissionBehaviour) new MissionAgentPanicHandler(),
     (MissionBehaviour) new AgentBattleAILogic()
 } : (IEnumerable <MissionBehaviour>) new MissionBehaviour[14]
 {
     (MissionBehaviour)MissionLobbyComponent.CreateBehaviour(),
     (MissionBehaviour) new MissionMultiplayerGameModeDuelClient(),
     (MissionBehaviour) new MultiplayerTimerComponent(),
     (MissionBehaviour) new MultiplayerMissionAgentVisualSpawnComponent(),
     (MissionBehaviour) new MissionLobbyEquipmentNetworkComponent(),
     (MissionBehaviour) new MissionHardBorderPlacer(),
     (MissionBehaviour) new MissionBoundaryPlacer(),
     (MissionBehaviour) new MissionBoundaryCrossingHandler(),
     (MissionBehaviour) new MultiplayerPollComponent(),
     (MissionBehaviour) new MultiplayerGameNotificationsComponent(),
     (MissionBehaviour) new MissionOptionsComponent(),
     (MissionBehaviour) new MissionScoreboardComponent("Duel"),
     (MissionBehaviour) new MissionMatchHistoryComponent(),
     (MissionBehaviour) new MissionRecentPlayersComponent()
 }));
Esempio n. 8
0
 public override void OnBehaviourInitialize()
 {
     base.OnBehaviourInitialize();
     this._missionLobbyComponent = this.Mission.GetMissionBehaviour <MissionLobbyComponent>();
 }
Esempio n. 9
0
 protected virtual void OnPlayerDies(MissionPeer peer, MissionPeer assistorPeer)
 {
     if (assistorPeer != null && assistorPeer.GetNetworkPeer().IsConnectionActive)
     {
         GameNetwork.BeginBroadcastModuleEvent();
         GameNetwork.WriteMessage((GameNetworkMessage) new KillDeathCountChange(assistorPeer.GetNetworkPeer(), (NetworkCommunicator)null, assistorPeer.KillCount, assistorPeer.AssistCount, assistorPeer.DeathCount, assistorPeer.Score));
         GameNetwork.EndBroadcastModuleEvent(GameNetwork.EventBroadcastFlags.None);
     }
     ++peer.DeathCount;
     peer.SpawnTimer.Reset(MBCommon.GetTime(MBCommon.TimeType.Mission), (float)MissionLobbyComponent.GetSpawnPeriodDurationForPeer(peer));
     peer.WantsToSpawnAsBot    = false;
     peer.HasSpawnTimerExpired = false;
     this._missionScoreboardComponent.PlayerPropertiesChanged(peer.GetNetworkPeer());
     GameNetwork.BeginBroadcastModuleEvent();
     GameNetwork.WriteMessage((GameNetworkMessage) new KillDeathCountChange(peer.GetNetworkPeer(), (NetworkCommunicator)null, peer.KillCount, peer.AssistCount, peer.DeathCount, peer.Score));
     GameNetwork.EndBroadcastModuleEvent(GameNetwork.EventBroadcastFlags.None);
 }
Esempio n. 10
0
 static MissionLobbyComponent()
 {
     MissionLobbyComponent.AddLobbyComponentType(typeof(MissionBattleSchedulerClientComponent), LobbyMissionType.Matchmaker, false);
     MissionLobbyComponent.AddLobbyComponentType(typeof(MissionCustomGameClientComponent), LobbyMissionType.Custom, false);
 }