Пример #1
0
        void advanceLevel()
        {
            AutoCmd autoCommand = list.getCommand <AutoCmd>("auto");

            if (autoCommand.autoMode)
            {
                autoCommand.nextLevel();
            }
            else
            {
                G.Sys.GameManager_.StartCoroutine(waitAndGoNext());
            }
        }
Пример #2
0
        public AutoCmd(CmdList list)
        {
            this.list = list;

            Events.Network.ConnectedToServer.Subscribe(data =>
            {
                autoMode = false;
            });

            Events.Network.ServerInitialized.Subscribe(data =>
            {
                autoMode = false;
            });

            Events.ServerToClient.ModeFinished.Subscribe(data =>
            {
                GeneralUtilities.logExceptions(() =>
                {
                    onModeFinish();
                });
            });

            Events.GameMode.ModeStarted.Subscribe(data =>
            {
                GeneralUtilities.logExceptions(() =>
                {
                    onModeStart();
                });
            });

            Events.GameMode.Go.Subscribe(data =>
            {
                GeneralUtilities.logExceptions(() =>
                {
                    onGo();
                });
            });

            Events.ClientToAllClients.ChatMessage.Subscribe(data =>
            {
                GeneralUtilities.logExceptions(() =>
                {
                    onChatEvent(data.message_);
                });
            });

            Events.RaceMode.FinalCountdownActivate.Subscribe(data =>
            {
                try {
                    AutoSpecCmd autoSpecCommand   = list.getCommand <AutoSpecCmd>("autospec");
                    CountdownCmd countdownCommand = list.getCommand <CountdownCmd>("countdown");
                    if (G.Sys.PlayerManager_.PlayerList_.Count == 2 && autoSpecCommand.autoSpecMode)
                    {
                        countdownCommand.stopCountdown();
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine($"Failed to stop countdown: {e}");
                }
            });
        }
Пример #3
0
        public int getMinPlayers()
        {
            AutoSpecCmd autoSpecCommand = list.getCommand <AutoSpecCmd>("autospec");

            return(minPlayers + autoSpecCommand.getAutoSpecPlayers().Count);
        }