AddPlayer() public method

Adds the player information at start-up.
public AddPlayer ( OpenRA runtimePlayer, Session lobbyInfo ) : void
runtimePlayer OpenRA
lobbyInfo OpenRA.Network.Session
return void
Ejemplo n.º 1
0
        public void LoadComplete(WorldRenderer wr)
        {
            // ScreenMap must be initialized before anything else
            using (new PerfTimer("ScreenMap.WorldLoaded"))
                ScreenMap.WorldLoaded(this, wr);

            foreach (var wlh in WorldActor.TraitsImplementing <IWorldLoaded>())
            {
                // These have already been initialized
                if (wlh == ScreenMap)
                {
                    continue;
                }

                using (new PerfTimer(wlh.GetType().Name + ".WorldLoaded"))
                    wlh.WorldLoaded(this, wr);
            }

            gameInfo.StartTimeUtc = DateTime.UtcNow;
            foreach (var player in Players)
            {
                gameInfo.AddPlayer(player, OrderManager.LobbyInfo);
            }

            var echo = OrderManager.Connection as EchoConnection;
            var rc   = echo != null ? echo.Recorder : null;

            if (rc != null)
            {
                rc.Metadata = new ReplayMetadata(gameInfo);
            }
        }
Ejemplo n.º 2
0
        public void LoadComplete(WorldRenderer wr)
        {
            if (IsLoadingGameSave)
            {
                wasLoadingGameSave          = true;
                Game.Sound.DisableAllSounds = true;
                foreach (var nsr in WorldActor.TraitsImplementing <INotifyGameLoading>())
                {
                    nsr.GameLoading(this);
                }
            }

            // ScreenMap must be initialized before anything else
            using (new PerfTimer("ScreenMap.WorldLoaded"))
                ScreenMap.WorldLoaded(this, wr);

            foreach (var iwl in WorldActor.TraitsImplementing <IWorldLoaded>())
            {
                // These have already been initialized
                if (iwl == ScreenMap)
                {
                    continue;
                }

                using (new PerfTimer(iwl.GetType().Name + ".WorldLoaded"))
                    iwl.WorldLoaded(this, wr);
            }

            foreach (var p in Players)
            {
                foreach (var iwl in p.PlayerActor.TraitsImplementing <IWorldLoaded>())
                {
                    using (new PerfTimer(iwl.GetType().Name + ".WorldLoaded"))
                        iwl.WorldLoaded(this, wr);
                }
            }

            gameInfo.StartTimeUtc = DateTime.UtcNow;
            foreach (var player in Players)
            {
                gameInfo.AddPlayer(player, OrderManager.LobbyInfo);
            }

            gameInfo.DisabledSpawnPoints = OrderManager.LobbyInfo.DisabledSpawnPoints;

            var echo = OrderManager.Connection as EchoConnection;
            var rc   = echo != null ? echo.Recorder : null;

            if (rc != null)
            {
                rc.Metadata = new ReplayMetadata(gameInfo);
            }
        }
Ejemplo n.º 3
0
        public void LoadComplete(WorldRenderer wr)
        {
            foreach (var wlh in WorldActor.TraitsImplementing <IWorldLoaded>())
            {
                using (new Support.PerfTimer(wlh.GetType().Name + ".WorldLoaded"))
                    wlh.WorldLoaded(this, wr);
            }

            gameInfo.StartTimeUtc = DateTime.UtcNow;
            foreach (var player in Players)
            {
                gameInfo.AddPlayer(player, orderManager.LobbyInfo);
            }

            var rc = orderManager.Connection as ReplayRecorderConnection;

            if (rc != null)
            {
                rc.Metadata = new ReplayMetadata(gameInfo);
            }
        }