コード例 #1
0
ファイル: ServerLobby.cs プロジェクト: Kevinsomnia/Darkraze
    private void RefreshPlayers()
    {
        allSuccess = true;

        for (int i = 0; i < playerInfoSlots.Length; i++)
        {
            PlayerLobbyGUI plg = playerInfoSlots[i].GetComponent <PlayerLobbyGUI>();
            plg.usernameLabel.text = "";
            plg.rankLabel.text     = "";
            plg.transform.parent   = transform;
        }

        if (Topan.Network.isConnected)
        {
            for (int p = 0; p < Topan.Network.connectedPlayers.Length; p++)
            {
                Topan.NetworkPlayer player = Topan.Network.connectedPlayers[p];
                byte team = (byte)player.GetPlayerData("team", (byte)0);
                AddPlayerToList(team, player, null);
            }

            if (GeneralVariables.gameModeHasTeams)
            {
                BotPlayer[] redBots = NetworkingGeneral.GetBotParticipants(0);
                for (int i = 0; i < redBots.Length; i++)
                {
                    AddPlayerToList(0, null, redBots[i]);
                }

                BotPlayer[] blueBots = NetworkingGeneral.GetBotParticipants(1);
                for (int i = 0; i < blueBots.Length; i++)
                {
                    AddPlayerToList(0, null, blueBots[i]);
                }
            }
            else if (BotManager.allBotPlayers != null)
            {
                for (int i = 0; i < BotManager.allBotPlayers.Length && i < GeneralVariables.Networking.botCount; i++)
                {
                    AddPlayerToList(2, null, BotManager.allBotPlayers[i]);
                }
            }
        }

        for (int i = 0; i < playerInfoSlots.Length; i++)
        {
            PlayerLobbyGUI plg = playerInfoSlots[i].GetComponent <PlayerLobbyGUI>();
            if (plg.usernameLabel.text == "")
            {
                plg.rankIcon.enabled = false;
            }
        }
    }
コード例 #2
0
    void Awake()
    {
        countToNextRound        = 10;
        vignetting.intensity    = 0f;
        blackStuff.alpha        = 0f;
        Screen.lockCursor       = false;
        UICamera.selectedObject = null;

        sortedPlayers = new List <NetPlayerInfo>();

        for (int i = 0; i < Topan.Network.connectedPlayers.Length; i++)
        {
            Topan.NetworkPlayer curPlayer = Topan.Network.connectedPlayers[i];

            NetPlayerInfo npi = new NetPlayerInfo();
            npi.realPlayer = curPlayer;
            npi.myKills    = (int)((UInt16)curPlayer.GetPlayerData("k", (UInt16)0));
            npi.myDeaths   = (int)((UInt16)curPlayer.GetPlayerData("d", (UInt16)0));
            npi.myHeads    = (int)((UInt16)curPlayer.GetPlayerData("h", (UInt16)0));
            npi.myScore    = (int)curPlayer.GetPlayerData("sc", 0);
            sortedPlayers.Add(npi);
        }

        if (GeneralVariables.gameModeHasTeams)
        {
            teamBasedRoot.SetActive(true);
            Destroy(individualBasedRoot);

            int redIndex  = 0;
            int blueIndex = 0;

            sortedPlayers = new List <NetPlayerInfo>();
            for (int i = 0; i < Topan.Network.connectedPlayers.Length; i++)
            {
                Topan.NetworkPlayer curPlayer = Topan.Network.connectedPlayers[i];

                NetPlayerInfo npi = new NetPlayerInfo();
                npi.realPlayer = curPlayer;
                npi.myKills    = (int)((UInt16)curPlayer.GetPlayerData("k", (UInt16)0));
                npi.myDeaths   = (int)((UInt16)curPlayer.GetPlayerData("d", (UInt16)0));
                npi.myHeads    = (int)((UInt16)curPlayer.GetPlayerData("h", (UInt16)0));
                npi.myScore    = (int)curPlayer.GetPlayerData("sc", 0);
                sortedPlayers.Add(npi);
            }

            BotPlayer[] redBots = NetworkingGeneral.GetBotParticipants(0);
            for (int i = 0; i < redBots.Length; i++)
            {
                BotStats hisStats = BotManager.GetBotStats(redBots[i].index);

                NetPlayerInfo npi = new NetPlayerInfo();
                npi.botPlayer = redBots[i];
                npi.myKills   = hisStats.kills;
                npi.myDeaths  = hisStats.deaths;
                npi.myHeads   = hisStats.headshots;
                npi.myScore   = hisStats.score;
                sortedPlayers.Add(npi);
            }

            BotPlayer[] blueBots = NetworkingGeneral.GetBotParticipants(1);
            for (int i = 0; i < blueBots.Length; i++)
            {
                BotStats hisStats = BotManager.GetBotStats(blueBots[i].index);

                NetPlayerInfo npi = new NetPlayerInfo();
                npi.botPlayer = blueBots[i];
                npi.myKills   = hisStats.kills;
                npi.myDeaths  = hisStats.deaths;
                npi.myHeads   = hisStats.headshots;
                npi.myScore   = hisStats.score;
                sortedPlayers.Add(npi);
            }

            if (NetworkingGeneral.currentGameType.sortPlayersBy == SortPlayersBy.Kills)
            {
                sortedPlayers.Sort((p1, p2) => p2.myKills.CompareTo(p1.myKills));
            }
            else if (NetworkingGeneral.currentGameType.sortPlayersBy == SortPlayersBy.Score)
            {
                sortedPlayers.Sort((p1, p2) => p2.myScore.CompareTo(p1.myScore));
            }

            for (int i = 0; i < sortedPlayers.Count; i++)
            {
                NetPlayerInfo current = sortedPlayers[i];
                if (current.botPlayer == null && current.realPlayer == null)
                {
                    continue;
                }

                if (current.myInfo == null)
                {
                    continue;
                }

                int   kills  = current.myKills;
                int   deaths = current.myDeaths;
                int   score  = current.myScore;
                float kd     = (deaths > 0) ? ((float)kills / (float)deaths) : kills;

                UserStatsGUI usg = null;
                if (current.myTeam == 0)
                {
                    UserStatsGUI instance = (UserStatsGUI)Instantiate(scoreboardPrefab);
                    instance.transform.parent        = redStart;
                    instance.transform.localPosition = Vector3.down * (redIndex * statsSpacing);
                    instance.transform.localScale    = Vector3.one;
                    usg = instance;
                    redIndex++;
                }
                else
                {
                    UserStatsGUI instance = (UserStatsGUI)Instantiate(scoreboardPrefab);
                    instance.transform.parent        = blueStart;
                    instance.transform.localPosition = Vector3.down * (blueIndex * statsSpacing);
                    instance.transform.localScale    = Vector3.one;
                    usg = instance;
                    blueIndex++;
                }

                int thisListIndex = (current.myTeam == 0) ? redIndex : blueIndex;

                string clanNameFinal = (current.myInfo.clan != "") ? ((current.thisPlayerIsBot) ? DarkRef.ClanColor(true) + "(" + current.myInfo.clan + ")[-] " : DarkRef.ClanColor(false) + "[" + current.myInfo.clan + "][-] ") : "";
                usg.SetInfo(((current.myInfo != null) ? current.myInfo.rank : 1).ToString(),
                            clanNameFinal + current.myInfo.username,
                            kills.ToString(),
                            deaths.ToString(),
                            kd.ToString("F2"),
                            current.myHeads.ToString(),
                            score.ToString(),
                            ((current.thisPlayerIsBot) ? Topan.Network.server.GetPlayerData("ping", 0).ToString() : current.realPlayer.GetPlayerData("ping", 0)).ToString(),
                            (!current.thisPlayerIsBot && current.realPlayer == Topan.Network.player),
                            (thisListIndex % 2 == 0));
            }
        }
        else
        {
            Destroy(teamBasedRoot);
            individualBasedRoot.SetActive(true);

            int currentIndex = 0;

            for (int i = 0; i < BotManager.allBotPlayers.Length && i < GeneralVariables.Networking.botCount; i++)
            {
                BotStats hisStats = BotManager.GetBotStats(i);

                NetPlayerInfo npi = new NetPlayerInfo();
                npi.botPlayer = BotManager.allBotPlayers[i];
                npi.myKills   = hisStats.kills;
                npi.myDeaths  = hisStats.deaths;
                npi.myHeads   = hisStats.headshots;
                npi.myScore   = hisStats.score;
                sortedPlayers.Add(npi);
            }

            if (NetworkingGeneral.currentGameType.sortPlayersBy == SortPlayersBy.Kills)
            {
                sortedPlayers.Sort((p1, p2) => p2.myKills.CompareTo(p1.myKills));
            }
            else if (NetworkingGeneral.currentGameType.sortPlayersBy == SortPlayersBy.Score)
            {
                sortedPlayers.Sort((p1, p2) => p2.myScore.CompareTo(p1.myScore));
            }

            for (int i = 0; i < sortedPlayers.Count; i++)
            {
                NetPlayerInfo current = sortedPlayers[i];
                if (current.botPlayer == null && current.realPlayer == null)
                {
                    continue;
                }

                if (current.myInfo == null)
                {
                    continue;
                }

                int   kills  = current.myKills;
                int   deaths = current.myDeaths;
                int   score  = current.myScore;
                float kd     = (deaths > 0) ? ((float)kills / (float)deaths) : kills;

                if (currentIndex >= 16)
                {
                    continue;
                }

                UserStatsGUI instance = (UserStatsGUI)Instantiate(scoreboardPrefab);
                instance.transform.parent        = individualStart;
                instance.transform.localPosition = Vector3.down * (currentIndex * statsSpacing);
                instance.transform.localScale    = Vector3.one;

                currentIndex++;

                string clanNameFinal = (current.myInfo.clan != "") ? ((current.thisPlayerIsBot) ? DarkRef.ClanColor(true) + "(" + current.myInfo.clan + ")[-] " : DarkRef.ClanColor(false) + "[" + current.myInfo.clan + "][-] ") : "";
                instance.SetInfo(((current.myInfo != null) ? current.myInfo.rank : 1).ToString(),
                                 clanNameFinal + current.myInfo.username,
                                 kills.ToString(),
                                 deaths.ToString(),
                                 kd.ToString("F2"),
                                 current.myHeads.ToString(),
                                 score.ToString(),
                                 ((current.thisPlayerIsBot) ? Topan.Network.server.GetPlayerData("ping", 0).ToString() : current.realPlayer.GetPlayerData("ping", 0)).ToString(),
                                 (!current.thisPlayerIsBot && current.realPlayer == Topan.Network.player),
                                 (currentIndex % 2 == 0));
            }
        }

        if (GeneralVariables.gameModeHasTeams)
        {
            roundLabel.cachedTrans.localPosition    = new Vector3(0f, 245f, -7f);
            spectatorList.cachedTrans.localPosition = new Vector3(-395f, -316f, 0f);
            panelRoot.localPosition = Vector3.zero;
            statsBackground.SetDimensions(270, 530);
            statsOutline.SetDimensions(278, 540);
        }
        else
        {
            roundLabel.cachedTrans.localPosition    = new Vector3(0f, 225f, -7f);
            spectatorList.cachedTrans.localPosition = new Vector3(-395f, -261f, 0f);
            panelRoot.localPosition = Vector3.up * -20f;
            statsBackground.SetDimensions(270, 440);
            statsOutline.SetDimensions(278, 450);
        }

        int roundScore = (int)Topan.Network.player.GetPlayerData("sc", 0);
        int targetExp  = AccountManager.GetTargetExperienceForRank(AccountManager.profileData.rank);

        startExp             = AccountManager.profileData.curXP;
        currentExpValue      = startExp;
        earnedExp            = roundScore;
        earnedCurrency       = Mathf.RoundToInt(roundScore * UnityEngine.Random.Range(0.95f, 1.05f) * 0.237f);
        expBaseAnimationTime = Mathf.Max(0.01f, expBaseAnimationTime);
        animationSpeed       = (float)earnedExp / expBaseAnimationTime;
        expSlowdownTime      = Mathf.Clamp(expSlowdownTime, 0f, 0.99f);

        expAccumulateSound.volume = 0f;
        expProgressBar.value      = (float)startExp / (float)targetExp;
        xpLabel.text        = startExp.ToString() + " XP / " + targetExp.ToString() + " XP";
        xpLeftLabel.text    = (targetExp - startExp).ToString() + " XP REMAINING";
        currencyLabel.alpha = 0f;
        currencyLabel.text  = "+0 CREDITS";
        rankLabel.text      = "[u]" + AccountManager.profileData.username + "[/u]" + "\n" + "RANK " + AccountManager.profileData.rank.ToString() + " [ROOKIE]";
        nextRankLabel.text  = "RANK " + (AccountManager.profileData.rank + 1).ToString() + " [ROOKIE]";

        StartCoroutine(ProcessData());
    }
コード例 #3
0
    public void Refresh()
    {
        if (!Topan.Network.isConnected)
        {
            return;
        }

        sortedPlayers = new List <NetPlayerInfo>();

        for (int i = 0; i < Topan.Network.connectedPlayers.Length; i++)
        {
            Topan.NetworkPlayer curPlayer = Topan.Network.connectedPlayers[i];
            NetPlayerInfo       npi       = new NetPlayerInfo();

            npi.realPlayer = curPlayer;
            npi.myKills    = (int)((UInt16)curPlayer.GetPlayerData("k", (UInt16)0));
            npi.myDeaths   = (int)((UInt16)curPlayer.GetPlayerData("d", (UInt16)0));
            npi.myHeads    = (int)((UInt16)curPlayer.GetPlayerData("h", (UInt16)0));
            npi.myScore    = (int)curPlayer.GetPlayerData("sc", 0);
            sortedPlayers.Add(npi);

            if (curPlayer.id == Topan.Network.player.id)
            {
                yourPlayer = npi;
            }
        }

        if (GeneralVariables.gameModeHasTeams)
        {
            int redIndex       = 0;
            int blueIndex      = 0;
            int redTotalScore  = 0;
            int blueTotalScore = 0;

            waitingForRed  = true;
            waitingForBlue = true;

            BotPlayer[] redBots = NetworkingGeneral.GetBotParticipants(0);
            for (int i = 0; i < redBots.Length; i++)
            {
                BotStats hisStats = BotManager.GetBotStats(redBots[i].index);

                NetPlayerInfo npi = new NetPlayerInfo();
                npi.botPlayer = redBots[i];
                npi.myKills   = hisStats.kills;
                npi.myDeaths  = hisStats.deaths;
                npi.myHeads   = hisStats.headshots;
                npi.myScore   = hisStats.score;
                sortedPlayers.Add(npi);
            }

            BotPlayer[] blueBots = NetworkingGeneral.GetBotParticipants(1);
            for (int i = 0; i < blueBots.Length; i++)
            {
                BotStats hisStats = BotManager.GetBotStats(blueBots[i].index);

                NetPlayerInfo npi = new NetPlayerInfo();
                npi.botPlayer = blueBots[i];
                npi.myKills   = hisStats.kills;
                npi.myDeaths  = hisStats.deaths;
                npi.myHeads   = hisStats.headshots;
                npi.myScore   = hisStats.score;
                sortedPlayers.Add(npi);
            }

            if (NetworkingGeneral.currentGameType.sortPlayersBy == SortPlayersBy.Kills)
            {
                sortedPlayers.Sort((p1, p2) => p2.myKills.CompareTo(p1.myKills));
            }
            else if (NetworkingGeneral.currentGameType.sortPlayersBy == SortPlayersBy.Score)
            {
                sortedPlayers.Sort((p1, p2) => p2.myScore.CompareTo(p1.myScore));
            }

            tdmSubheader.text = NetworkingGeneral.currentGameType.typeName + " [" + Topan.Network.GameName + "]";
            for (int i = 0; i < sortedPlayers.Count; i++)
            {
                NetPlayerInfo current = sortedPlayers[i];
                if (current.botPlayer == null && current.realPlayer == null)
                {
                    continue;
                }

                if (current.myInfo == null)
                {
                    continue;
                }

                int   kills  = current.myKills;
                int   deaths = current.myDeaths;
                int   score  = current.myScore;
                float kd     = (deaths > 0) ? ((float)kills / (float)deaths) : kills;

                UserStatsGUI usg = null;
                if (current.myTeam == 0)
                {
                    if (redIndex >= 8)
                    {
                        continue;
                    }

                    waitingForRed = false;
                    usg           = redTeam[redIndex];
                    usg.gameObject.SetActive(true);
                    redTotalScore += score;
                    redIndex++;
                }
                else if (current.myTeam == 1)
                {
                    if (blueIndex >= 8)
                    {
                        continue;
                    }

                    waitingForBlue = false;
                    usg            = blueTeam[blueIndex];
                    usg.gameObject.SetActive(true);
                    blueTotalScore += score;
                    blueIndex++;
                }

                int thisListIndex = (current.myTeam == 0) ? redIndex : blueIndex;

                string clanNameFinal = (current.myInfo.clan != "") ? ((current.thisPlayerIsBot) ? DarkRef.ClanColor(true) + "(" + current.myInfo.clan + ")[-] " : DarkRef.ClanColor(false) + "[" + current.myInfo.clan + "][-] ") : "";
                usg.SetInfo(current.myInfo.rank.ToString(),
                            clanNameFinal + current.myInfo.username,
                            kills.ToString(),
                            deaths.ToString(),
                            kd.ToString("F2"),
                            current.myHeads.ToString(),
                            score.ToString(),
                            ((current.thisPlayerIsBot) ? Topan.Network.server.GetPlayerData("ping", 0).ToString() : current.realPlayer.GetPlayerData("ping", 0)).ToString(),
                            (!current.thisPlayerIsBot && current.realPlayer == Topan.Network.player),
                            (thisListIndex % 2 == 0));
            }

            if (redIndex < 7)
            {
                for (int i = redIndex; i < 8; i++)
                {
                    redTeam[i].gameObject.SetActive(false);
                }
            }

            if (blueIndex < 7)
            {
                for (int i = blueIndex; i < 8; i++)
                {
                    blueTeam[i].gameObject.SetActive(false);
                }
            }

            try
            {
                tkRed  = (UInt16)Topan.Network.GetServerInfo("rTK");
                tkBlue = (UInt16)Topan.Network.GetServerInfo("bTK");
                tdRed  = (UInt16)Topan.Network.GetServerInfo("rTD");
                tdBlue = (UInt16)Topan.Network.GetServerInfo("bTD");
            }
            catch
            {
                tkRed  = 0;
                tkBlue = 0;
                tdRed  = 0;
                tdBlue = 0;
            }

            string redTotal = "Total Kills: " + tkRed;
            redTotal += "\n" + "Total Deaths: " + tdRed;
            float redKD = (tdRed > 0) ? ((float)tkRed / (float)tdRed) : tkRed;
            redTotal += "\n" + "Total K/D: " + redKD.ToString("F2");
            redTotal += "\n" + "Team Score: " + redTotalScore.ToString();
            redTotal += "\n----------------";
            redTotal += "\n" + "Team Captures: 0"; //Placeholder, captures if capture the flag, defuses if demolition.

            string blueTotal = "Total Kills: " + tkBlue;
            blueTotal += "\n" + "Total Deaths: " + tdBlue;
            float blueKD = (tdBlue > 0) ? ((float)tkBlue / (float)tdBlue) : tkBlue;
            blueTotal += "\n" + "Total K/D: " + blueKD.ToString("F2");
            blueTotal += "\n" + "Team Score: " + blueTotalScore.ToString();
            blueTotal += "\n----------------";
            blueTotal += "\n" + "Team Captures: 0"; //Placeholder, captures if capture the flag, defuses if demolition.

            totalStatsRed.text  = redTotal;
            totalStatsBlue.text = blueTotal;

            roundVictoryStats.text = "[CE1C1C](RED)[-] " + (byte)Topan.Network.GetServerInfo("rVic") + " [A0A0A0]|[-] " + (byte)Topan.Network.GetServerInfo("bVic") + " [2546A5](BLUE)[-]";
        }
        else
        {
            int currentIndex = 0;
            int yourIndex    = 1;

            for (int i = 0; i < BotManager.allBotPlayers.Length && i < GeneralVariables.Networking.botCount; i++)
            {
                BotStats hisStats = BotManager.GetBotStats(i);

                NetPlayerInfo npi = new NetPlayerInfo();
                npi.botPlayer = BotManager.allBotPlayers[i];
                npi.myKills   = hisStats.kills;
                npi.myDeaths  = hisStats.deaths;
                npi.myHeads   = hisStats.headshots;
                npi.myScore   = hisStats.score;
                sortedPlayers.Add(npi);
            }

            if (NetworkingGeneral.currentGameType.sortPlayersBy == SortPlayersBy.Kills)
            {
                sortedPlayers.Sort((p1, p2) => p2.myKills.CompareTo(p1.myKills));
            }
            else if (NetworkingGeneral.currentGameType.sortPlayersBy == SortPlayersBy.Score)
            {
                sortedPlayers.Sort((p1, p2) => p2.myScore.CompareTo(p1.myScore));
            }

            dmSubheader.text = NetworkingGeneral.currentGameType.typeName + " [" + Topan.Network.GameName + "]";
            for (int i = 0; i < sortedPlayers.Count; i++)
            {
                NetPlayerInfo current = sortedPlayers[i];
                if (current.botPlayer == null && current.realPlayer == null)
                {
                    continue;
                }

                if (current.myInfo == null)
                {
                    continue;
                }

                int   kills  = current.myKills;
                int   deaths = current.myDeaths;
                int   score  = current.myScore;
                float kd     = (deaths > 0) ? ((float)kills / (float)deaths) : kills;

                UserStatsGUI usg = null;

                if (currentIndex >= 16)
                {
                    continue;
                }

                usg = individuals[currentIndex];
                usg.gameObject.SetActive(true);
                currentIndex++;

                if (!current.thisPlayerIsBot && current.realPlayer == Topan.Network.player)
                {
                    yourIndex = i;
                }

                string clanNameFinal = (current.myInfo.clan != "") ? ((current.thisPlayerIsBot) ? DarkRef.ClanColor(true) + "(" + current.myInfo.clan + ")[-] " : DarkRef.ClanColor(false) + "[" + current.myInfo.clan + "][-] ") : "";
                usg.SetInfo(current.myInfo.rank.ToString(),
                            clanNameFinal + current.myInfo.username,
                            kills.ToString(),
                            deaths.ToString(),
                            kd.ToString("F2"),
                            current.myHeads.ToString(),
                            score.ToString(),
                            ((current.thisPlayerIsBot) ? Topan.Network.server.GetPlayerData("ping", 0).ToString() : current.realPlayer.GetPlayerData("ping", 0)).ToString(),
                            (!current.thisPlayerIsBot && current.realPlayer == Topan.Network.player),
                            (currentIndex % 2 == 0));
            }

            if (currentIndex < 15)
            {
                for (int i = currentIndex; i < 16; i++)
                {
                    individuals[i].gameObject.SetActive(false);
                }
            }

            tkRed  = 0;
            tkBlue = 0;
            tdRed  = 0;
            tdBlue = 0;

            yourPlace.text = "You're in " + DarkRef.OrdinalIndicatorFormat(yourIndex + 1) + " place";
        }

        refreshTimer += refreshTime;
    }
コード例 #4
0
ファイル: Server.cs プロジェクト: Kevinsomnia/Darkraze
    void Update()
    {
        if (!Topan.Network.isConnected)
        {
            return;
        }

        //Bot Management
        if (!inLobby && BotManager.allBotPlayers != null)
        {
            oldBots = BotManager.allBotPlayers;

            if (GeneralVariables.gameModeHasTeams)
            {
                for (int i = 0; i < BotManager.allBotPlayers.Length; i++)
                {
                    BotManager.allBotPlayers[i].isParticipating = false;
                }

                redParticipantBots = NetworkingGeneral.GetBotParticipants(0);
                for (int i = 0; i < redParticipantBots.Length; i++)
                {
                    redParticipantBots[i].isParticipating = true;
                }

                blueParticipantBots = NetworkingGeneral.GetBotParticipants(1);
                for (int i = 0; i < blueParticipantBots.Length; i++)
                {
                    blueParticipantBots[i].isParticipating = true;
                }
            }
            else
            {
                for (int i = 0; i < BotManager.allBotPlayers.Length; i++)
                {
                    BotManager.allBotPlayers[i].isParticipating = (i < GeneralVariables.Networking.botCount);
                }
            }

            /* Experimental stuff...
             * for(int i = 0; i < BotManager.allBotPlayers.Length; i++) {
             *  if(!BotManager.allBotPlayers[i].isParticipating) {
             *      if(GeneralVariables.Networking.botInstances[i] != null) {
             *          GeneralVariables.Networking.botInstances[i].gameObject.GetComponent<Topan.NetworkView>().Deallocate();
             *          Debug.Log("Destroying instance of bot");
             *      }
             *  }
             * }
             *
             * for(int i = 0; i < BotManager.allBotPlayers.Length; i++) {
             *  if(BotManager.allBotPlayers[i].isParticipating != oldBots[i].isParticipating) {
             *      if(BotManager.allBotPlayers[i].isParticipating) {
             *          botRespawnQueue.Add(i);
             *          Debug.Log("Re-participating bot, respawning!: " + BotManager.allBotPlayers[i].botInfo.username);
             *      }
             *  }
             * }
             */
        }

        if (Topan.Network.HasServerInfo("pl") && (byte)Topan.Network.GetServerInfo("pl") <= 0)
        {
            StartMatch();
        }

        if (!Topan.Network.HasServerInfo("sm") || startedMatch != setCheck)
        {
            Topan.Network.SetServerInfo("sm", startedMatch);
            setCheck = startedMatch;
        }

        if (nGeneral.countingDown && spawnBots)
        {
            StartCoroutine(SpawnAllBots());
            spawnBots = false;
        }

        if (startedMatch && !nGeneral.finishedGame)
        {
            countTimer += Time.deltaTime;
            if (countTimer >= 1f)
            {
                CounterReduce();
                countTimer -= 1f;
            }
        }
        else if (nGeneral.countingDown)
        {
            if (Input.GetKey(KeyCode.X) && Input.GetKeyDown(KeyCode.V))
            {
                countdown = 0;
            }
        }

        for (int i = 0; i < botRespawnQueue.Count; i++)
        {
            if (!BotManager.allBotPlayers[botRespawnQueue[i]].isParticipating)
            {
                botRespawnQueue.RemoveAt(i);
                continue;
            }

            StartCoroutine(RespawnBot(botRespawnQueue[i], 5f + UnityEngine.Random.value));
            botRespawnQueue.RemoveAt(i);
        }

        if (!inLobby)
        {
            pingCheckTimer += Time.unscaledDeltaTime;
            if (pingCheckTimer >= 1f)
            {
                CheckPing();
                pingCheckTimer -= 1f;
            }
        }
    }