Exemplo n.º 1
0
 private void CopyPlayerStats()
 {
     if (Variables.LobbySession)
     {
         var message = BalancingUtils.CopyPlayerStats();
         if (message == null)
         {
             Variables.OverlayWindow.ShowMessage("Player stats were copied to your clipboard, you can paste them to lobby chat.", true);
             SetMessageTimeout();
         }
         else
         {
             Variables.OverlayWindow.ShowMessage(message, true);
             SetMessageTimeout();
         }
     }
 }
Exemplo n.º 2
0
 private void CalculateBalancedTeamsWinRatio()
 {
     if (Variables.LobbySession)
     {
         Variables.OverlayWindow.ShowMessage("Calculating balanced teams...", true);
         var message = BalancingUtils.CalculateBalancedTeamsBasedOnWinRatio();
         if (message == null)
         {
             Variables.OverlayWindow.ShowMessage("Balanced teams were copied to your clipboard, you can paste them to lobby chat.", true);
             SetMessageTimeout();
         }
         else
         {
             Variables.OverlayWindow.ShowMessage(message, true);
             SetMessageTimeout();
         }
     }
 }
Exemplo n.º 3
0
        public object Put(int id, [FromBody] string payload = null)
        {
            switch (id)
            {
            case (int)Commands.IN.LOBBY_SESSION_START:
                ProcessLobbySessionStart();
                return(new { });

            case (int)Commands.IN.LOBBY_SESSION_STOP:
                ProcessLobbySessionStop();
                return(new { });

            case (int)Commands.IN.SET_UP:
                return(SetUp());

            case (int)Commands.IN.START_LOBBY_MANUALLY:
                LobbyUtils.StartLobby(Variables.Lobby);
                return(new { });

            case (int)Commands.IN.SEAL_LOBBY:
                SealLobby(payload);
                return(new { });

            case (int)Commands.IN.GET_UNSEALED_LOBBY:
                return(GetUnsealedLobby());

            case (int)Commands.IN.CALCULATE_BALANCED_TEAMS_BASED_ON_RANK:
                return(BalancingUtils.CalculateBalancedTeamsBasedOnRank());

            case (int)Commands.IN.CALCULATE_BALANCED_TEAMS_BASED_ON_TOTAL_GAMES:
                return(BalancingUtils.CalculateBalancedTeamsBasedOnTotalGames());

            case (int)Commands.IN.CALCULATE_BALANCED_TEAMS_BASED_ON_WIN_RATIO:
                return(BalancingUtils.CalculateBalancedTeamsBasedOnWinRatio());

            case (int)Commands.IN.COPY_PLAYER_STATS:
                return(BalancingUtils.CopyPlayerStats());

            default:
                throw new Exception("Command not recognized: " + id);
            }
        }