Example #1
0
 Reply ApiSummonerGames(Request request)
 {
     var arguments = request.Arguments;
     string regionAbbreviation = (string)request.Arguments[0];
     int accountId = (int)request.Arguments[1];
     Worker worker = GetWorkerByAbbreviation(regionAbbreviation);
     SummonerGamesResult output;
     Summoner summoner = StatisticsService.GetSummoner(worker.Region, accountId);
     if (summoner != null)
     {
         using (var connection = GetConnection())
         {
             List<ExtendedPlayer> games = GetSummonerGames(summoner, connection);
             output = new SummonerGamesResult(games);
         }
     }
     else
         output = new SummonerGamesResult(OperationResult.NotFound);
     return GetJSONReply(output);
 }
Example #2
0
        Reply ApiSummonerGames(Request request)
        {
            PrivilegeCheck(request);
            var    arguments          = request.Arguments;
            string regionAbbreviation = (string)request.Arguments[0];
            int    accountId          = (int)request.Arguments[1];
            Worker worker             = GetWorkerByAbbreviation(regionAbbreviation);
            SummonerGamesResult output;
            Summoner            summoner = StatisticsService.GetSummoner(worker.Region, accountId);

            if (summoner != null)
            {
                using (var connection = GetConnection())
                {
                    List <ExtendedPlayer> games = GetSummonerGames(summoner, connection);
                    output = new SummonerGamesResult(games);
                }
            }
            else
            {
                output = new SummonerGamesResult(OperationResult.NotFound);
            }
            return(GetJSONReply(output));
        }