Exemplo n.º 1
0
        Reply ApiSummonerStatistics(Request request)
        {
            Profiler profiler = new Profiler(false, "ApiSummonerStatistics", GlobalHandler);

            profiler.Start("PrivilegeCheck");
            PrivilegeCheck(request);
            profiler.Stop();
            profiler.Start("GetSummoner");
            var    arguments          = request.Arguments;
            string regionAbbreviation = (string)request.Arguments[0];
            int    accountId          = (int)request.Arguments[1];
            Worker worker             = GetWorkerByAbbreviation(regionAbbreviation);
            SummonerStatisticsResult output;
            Summoner summoner = StatisticsService.GetSummoner(worker.Region, accountId);

            profiler.Stop();
            if (summoner != null)
            {
                using (var connection = GetConnection())
                {
                    profiler.Start("GetSummonerStatistics");
                    SummonerStatistics statistics = GetSummonerStatistics(summoner, connection);
                    profiler.Stop();
                    profiler.Start("SummonerStatisticsResult");
                    output = new SummonerStatisticsResult(statistics);
                    profiler.Stop();
                }
            }
            else
            {
                output = new SummonerStatisticsResult(OperationResult.NotFound);
            }
            profiler.Start("GetJSONReply");
            Reply reply = GetJSONReply(output);

            profiler.Stop();
            return(reply);
        }
Exemplo n.º 2
0
        Reply ApiSummonerStatistics(Request request)
        {
            PrivilegeCheck(request);
            var    arguments          = request.Arguments;
            string regionAbbreviation = (string)request.Arguments[0];
            int    accountId          = (int)request.Arguments[1];
            Worker worker             = GetWorkerByAbbreviation(regionAbbreviation);
            SummonerStatisticsResult output;
            Summoner summoner = StatisticsService.GetSummoner(worker.Region, accountId);

            if (summoner != null)
            {
                using (var connection = GetConnection())
                {
                    SummonerStatistics statistics = GetSummonerStatistics(summoner, connection);
                    output = new SummonerStatisticsResult(statistics);
                }
            }
            else
            {
                output = new SummonerStatisticsResult(OperationResult.NotFound);
            }
            return(GetJSONReply(output));
        }
Exemplo n.º 3
0
 Reply ApiSummonerStatistics(Request request)
 {
     PrivilegeCheck(request);
     var arguments = request.Arguments;
     string regionAbbreviation = (string)request.Arguments[0];
     int accountId = (int)request.Arguments[1];
     Worker worker = GetWorkerByAbbreviation(regionAbbreviation);
     SummonerStatisticsResult output;
     Summoner summoner = StatisticsService.GetSummoner(worker.Region, accountId);
     if (summoner != null)
     {
         using (var connection = GetConnection())
         {
             SummonerStatistics statistics = GetSummonerStatistics(summoner, connection);
             output = new SummonerStatisticsResult(statistics);
         }
     }
     else
         output = new SummonerStatisticsResult(OperationResult.NotFound);
     return GetJSONReply(output);
 }
Exemplo n.º 4
0
 Reply ApiSummonerStatistics(Request request)
 {
     Profiler profiler = new Profiler(false, "ApiSummonerStatistics", GlobalHandler);
     profiler.Start("PrivilegeCheck");
     PrivilegeCheck(request);
     profiler.Stop();
     profiler.Start("GetSummoner");
     var arguments = request.Arguments;
     string regionAbbreviation = (string)request.Arguments[0];
     int accountId = (int)request.Arguments[1];
     Worker worker = GetWorkerByAbbreviation(regionAbbreviation);
     SummonerStatisticsResult output;
     Summoner summoner = StatisticsService.GetSummoner(worker.Region, accountId);
     profiler.Stop();
     if (summoner != null)
     {
         using (var connection = GetConnection())
         {
             profiler.Start("GetSummonerStatistics");
             SummonerStatistics statistics = GetSummonerStatistics(summoner, connection);
             profiler.Stop();
             profiler.Start("SummonerStatisticsResult");
             output = new SummonerStatisticsResult(statistics);
             profiler.Stop();
         }
     }
     else
         output = new SummonerStatisticsResult(OperationResult.NotFound);
     profiler.Start("GetJSONReply");
     Reply reply = GetJSONReply(output);
     profiler.Stop();
     return reply;
 }