Example #1
0
        public MatchRunner(IMatch match, string playerOneFolder, string playerTwoFolder, IRenderer renderer)
        {
            Match    = match;
            Renderer = renderer;

            _logger        = new MatchLogger();
            _consoleLogger = new ConsoleLogger();
            _replayLogger  = new ReplayLogger();

            string runFilename = Environment.OSVersion.Platform == PlatformID.Unix ? Settings.Default.BotRunFilenameLinux : Settings.Default.BotRunFilename;

            _players    = new BotRunner[2];
            _players[0] = new BotRunner(
                1,
                playerOneFolder,
                runFilename
                );
            _players[1] = new BotRunner(
                2,
                playerTwoFolder,
                runFilename
                );

            match.SetPlayerName(1, _players[0].PlayerName);
            match.SetPlayerName(2, _players[1].PlayerName);
        }
 private void Awake()
 {
     Instance = this;
 }
Example #3
0
        /// <summary>
        /// Init this game and loads all the assets needed to receive players
        /// </summary>
        public void LaunchGame()
        {
            SetGameStatus(GameStatus.Launching);
            MapLoader = new AssetLoader();
            MapLoader.LoadAssetBundle("Bundles/scenes/maps.bundle");
            MapLoader.LoadAsset($"archive:/buildplayer-robotfactory_opu_gamemode/buildplayer-{GameConfig.Map.ToLower()}");

            MapLoader.ConstructCaches();


            AssetsLoader = new AssetLoader();
            AssetsLoader.LoadAsset("resources.assets");
            AssetsLoader.ConstructCaches();

            MiscLoader = new AssetLoader();
            MiscLoader.LoadAssetBundle("Bundles/scenes/frontend.bundle");
            MiscLoader.LoadAsset("archive:/buildplayer-options_ui/buildplayer-clientenvironmentsingletons");
            MiscLoader.ConstructCaches();

            SpawnObject(MiscLoader, "ApplicationSingletonsNetId", out _);
            SpawnObject(MiscLoader, "GameSceneSingletons", out var gameSceneSingletons);
            TheatricsManager  = gameSceneSingletons.GetComponent <TheatricsManager>();
            AbilityModManager = gameSceneSingletons.GetComponent <AbilityModManager>();
            SpawnObject(MiscLoader, "SharedEffectBarrierManager", out SharedEffectBarrierManager);
            SpawnObject(MiscLoader, "SharedActionBuffer", out SharedActionBuffer);
            SharedActionBuffer.Networkm_actionPhase = ActionBufferPhase.Done;

            SpawnScene(MapLoader, 1, out var commonGameLogic);
            InterfaceManager    = commonGameLogic.GetComponent <InterfaceManager>();
            GameFlow            = commonGameLogic.GetComponent <GameFlow>();
            MatchLogger         = commonGameLogic.GetComponent <MatchLogger>();
            ServerCombatManager = commonGameLogic.GetComponent <ServerCombatManager>();
            ServerEffectManager = commonGameLogic.GetComponent <ServerEffectManager>();
            TeamStatusDisplay   = commonGameLogic.GetComponent <TeamStatusDisplay>();
            ServerActionBuffer  = commonGameLogic.GetComponent <ServerActionBuffer>();
            TeamSelectData      = commonGameLogic.GetComponent <TeamSelectData>();
            BarrierManager      = commonGameLogic.GetComponent <BarrierManager>();

            SpawnObject <Board, Board>(MapLoader, out Board);
            SpawnScene(MapLoader, 2, out BrushCoordinator);
            SpawnScene(MapLoader, 3, out var sceneGameLogic);

            GameFlowData       = sceneGameLogic.GetComponent <GameFlowData>();
            GameplayData       = sceneGameLogic.GetComponent <GameplayData>();
            SpoilsManager      = sceneGameLogic.GetComponent <SpoilsManager>();
            ObjectivePoints    = sceneGameLogic.GetComponent <ObjectivePoints>();
            SpawnPointManager  = sceneGameLogic.GetComponent <SpawnPointManager>();
            MatchObjectiveKill = sceneGameLogic.GetComponent <MatchObjectiveKill>();

            PrintAllNetworkGameObjects();

            foreach (LobbyPlayerInfo playerInfo in TeamInfo.TeamPlayerInfo)
            {
                // We use the ReadyState here to indicate wheter a player or bot finished loading the match
                if (playerInfo.IsNPCBot)
                {
                    playerInfo.ReadyState = ReadyState.Ready; // Bots are marked as ready as they don't have to load anything
                }
                else
                {
                    playerInfo.ReadyState = ReadyState.Unknown; // Unknown means it is loading
                }
            }

            SetGameStatus(GameStatus.Launched);
        }
Example #4
0
 public void HandleLevelLoadTest()
 {
     MatchLogger.HandleLevelLoad(new byte[] { 13, 13 });
     Assert.IsTrue(true);
 }