Esempio n. 1
0
        private void ProcessLeaderBoardUpdate(NetHookItem item)
        {
            var msg = item.ReadAsProtobufMsg <CMsgClientLBSSetScore>();

            if (msg.Body.leaderboard_id == 180533)
            {
                LobbyUtils.StartLobby(Variables.Lobby);
            }
        }
Esempio n. 2
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);
            }
        }