Пример #1
0
 public MatchSummaryAdvanced(long mapId,
                             long matchCreation,
                             long matchDuration,
                             long matchId,
                             string matchMode,
                             string matchType,
                             string matchVersion,
                             JArray participantIdentitiesA,
                             JArray participantsA,
                             string queueType,
                             string region,
                             string season)
 {
     this.mapId         = mapId;
     this.matchCreation = matchCreation;
     this.matchDuration = matchDuration;
     this.matchId       = matchId;
     this.matchMode     = GameConstants.SetGameMode(matchMode);
     this.matchType     = GameConstants.SetGameType(matchType);
     this.matchVersion  = matchVersion;
     if (participantIdentitiesA != null)
     {
         this.participantIdentities = LoadParticipantIdentites(participantIdentitiesA);
     }
     if (participantsA != null)
     {
         this.participants = LoadParticipants(participantsA);
     }
     this.queueType = AdvancedMatchHistoryConstants.SetQueueType(queueType);
     this.region    = region;
     this.season    = AdvancedMatchHistoryConstants.SetSeason(season);
 }
Пример #2
0
 /// <summary>
 /// CurrentGameInfo constructor
 /// </summary>
 /// <param name="bannedChampionsA"></param>
 /// <param name="gameId"></param>
 /// <param name="gameLength"></param>
 /// <param name="gameMode"></param>
 /// <param name="gameQueueConfigId"></param>
 /// <param name="gameStartTime"></param>
 /// <param name="gameType"></param>
 /// <param name="mapId"></param>
 /// <param name="observersO"></param>
 /// <param name="participantsA"></param>
 /// <param name="platformId"></param>
 public CurrentGameInfoLive(JArray bannedChampionsA,
                            long gameId,
                            long gameLength,
                            string gameMode,
                            long gameQueueConfigId,
                            long gameStartTime,
                            string gameType,
                            long mapId,
                            JObject observersO,
                            JArray participantsA,
                            string platformId)
 {
     this.bannedChampions       = HelperMethods.LoadBans(bannedChampionsA);
     this.gameId                = gameId;
     this.gameLengthLong        = gameLength;
     this.gameLength            = TimeSpan.FromSeconds(gameLength);
     this.gameModeString        = gameMode;
     this.gameMode              = GameConstants.SetGameMode(gameMode);
     this.gameQueueConfigIdLong = gameQueueConfigId;
     this.gameQueueConfigId     = AdvancedMatchHistoryConstants.SetQueueType(gameQueueConfigId);
     this.gameStartTimeLong     = gameStartTime;
     this.gameStartTime         = CreepScore.EpochToDateTime(gameStartTime);
     this.gameTypeString        = gameType;
     this.gameType              = GameConstants.SetGameType(gameType);
     this.mapIdLong             = mapId;
     this.mapId        = GameConstants.SetMap((int)mapId);
     this.observers    = LoadObservers(observersO);
     this.participants = LoadParticipants(participantsA);
     this.platformId   = platformId;
 }
Пример #3
0
 public MatchDetailAdvanced(long mapId,
                            long matchCreation,
                            long matchDuration,
                            long matchId,
                            string matchMode,
                            string matchType,
                            string matchVersion,
                            JArray participantIdentitiesA,
                            JArray participantsA,
                            string queueType,
                            string region,
                            string season,
                            JArray teamsA,
                            JObject timelineO)
 {
     this.mapId         = mapId;
     this.matchCreation = matchCreation;
     this.matchDuration = matchDuration;
     this.matchId       = matchId;
     this.matchMode     = GameConstants.SetGameMode(matchMode);
     this.matchType     = GameConstants.SetGameType(matchType);
     this.matchVersion  = matchVersion;
     if (participantIdentitiesA != null)
     {
         this.participantIdentities = LoadParticipantIdentites(participantIdentitiesA);
     }
     if (participantsA != null)
     {
         this.participants = LoadParticipants(participantsA);
     }
     this.queueType = AdvancedMatchHistoryConstants.SetQueueType(queueType);
     this.region    = region;
     this.season    = AdvancedMatchHistoryConstants.SetSeason(season);
     if (teamsA != null)
     {
         this.teams = LoadTeams(teamsA);
     }
     if (timelineO != null)
     {
         this.timeline = LoadTimeline(timelineO);
     }
 }
Пример #4
0
 public MatchReferenceAdvanced(long champion,
                               string lane,
                               long matchId,
                               string platformId,
                               string queue,
                               string role,
                               string season,
                               long timestamp)
 {
     this.champion      = champion;
     this.laneString    = lane;
     this.lane          = AdvancedMatchHistoryConstants.SetLane(lane);
     this.matchId       = matchId;
     this.platformId    = platformId;
     this.queueString   = queue;
     this.queue         = GameConstants.SetQueue(queue);
     this.roleString    = role;
     this.role          = AdvancedMatchHistoryConstants.SetRole(role);
     this.seasonString  = season;
     this.season        = AdvancedMatchHistoryConstants.SetSeason(season);
     this.timestampLong = timestamp;
     this.timestamp     = CreepScore.EpochToDateTime(timestamp);
 }
Пример #5
0
        public async Task <MatchListAdvanced> RetrieveMatchList(List <int> championIds = null, List <GameConstants.Queue> rankedQueues = null, List <AdvancedMatchHistoryConstants.SeasonAdvanced> seasons = null, long?beginTime = null, long?endTime = null, int?beginIndex = null, int?endIndex = null)
        {
            string url = UrlConstants.GetBaseUrl(region) +
                         UrlConstants.apiLolPart + "/" +
                         UrlConstants.GetRegion(region) +
                         UrlConstants.matchListAPIVersion +
                         UrlConstants.matchListPart +
                         UrlConstants.bySummonerPart + "/" +
                         id.ToString() + "?";

            if (championIds != null)
            {
                if (championIds.Count != 0)
                {
                    url += "championIds=";

                    for (int i = 0; i < championIds.Count; i++)
                    {
                        if (i + 1 == championIds.Count)
                        {
                            url += championIds[i].ToString() + "&";
                        }
                        else
                        {
                            url += championIds[i].ToString() + ",";
                        }
                    }
                }
            }

            if (rankedQueues != null)
            {
                if (rankedQueues.Count != 0)
                {
                    string tmpRankedQueues = "";
                    for (int i = 0; i < rankedQueues.Count; i++)
                    {
                        if (rankedQueues[i] == GameConstants.Queue.None)
                        {
                            continue;
                        }
                        else
                        {
                            if (i + 1 == rankedQueues.Count)
                            {
                                tmpRankedQueues += GameConstants.GetQueue(rankedQueues[i]);
                            }
                            else
                            {
                                tmpRankedQueues += GameConstants.GetQueue(rankedQueues[i]) + ",";
                            }
                        }
                    }
                    if (tmpRankedQueues != "")
                    {
                        url += "rankedQueues=" + tmpRankedQueues + "&";
                    }
                }
            }

            if (seasons != null)
            {
                if (seasons.Count != 0)
                {
                    string tmpSeasons = "";
                    for (int i = 0; i < seasons.Count; i++)
                    {
                        if (seasons[i] == AdvancedMatchHistoryConstants.SeasonAdvanced.Other)
                        {
                            continue;
                        }
                        else
                        {
                            if (i + 1 == seasons.Count)
                            {
                                tmpSeasons += AdvancedMatchHistoryConstants.GetSeason(seasons[i]);
                            }
                            else
                            {
                                tmpSeasons += AdvancedMatchHistoryConstants.GetSeason(seasons[i]) + ",";
                            }
                        }
                    }
                    if (tmpSeasons != "")
                    {
                        url += "seasons=" + tmpSeasons + "&";
                    }
                }
            }

            if (beginTime != null)
            {
                url += "beginTime=" + beginTime.Value.ToString() + "&";
            }

            if (endTime != null)
            {
                url += "endTime=" + endTime.Value.ToString() + "&";
            }

            if (beginIndex != null)
            {
                url += "beginIndex=" + beginIndex.Value.ToString() + "&";
            }

            if (endIndex != null)
            {
                url += "endIndex=" + endIndex.Value.ToString() + "&";
            }
            url += "api_key=" +
                   CreepScore.apiKey;

            Uri uri = new Uri(url);

            await CreepScore.GetPermission(region);

            string responseString;

            try
            {
                responseString = await CreepScore.GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadMatchListAdvanced(JObject.Parse(responseString)));
        }
Пример #6
0
 public EventAdvanced(string ascendedType,
                      JArray assistingParticipantsIdsA,
                      string buildingType,
                      int?creatorId,
                      string eventType,
                      int?itemAfter,
                      int?itemBefore,
                      int?itemId,
                      int?killerId,
                      string laneType,
                      string levelUpType,
                      string monsterType,
                      int?participantId,
                      string pointCaptured,
                      JObject positionO,
                      int?skillSlot,
                      int?teamId,
                      long timestamp,
                      string towerType,
                      int?victimId,
                      string wardType)
 {
     if (ascendedType != null)
     {
         this.ascendedType = AdvancedMatchHistoryConstants.SetAscendedType(ascendedType);
     }
     if (assistingParticipantsIdsA != null)
     {
         this.assistingParticipantIds = HelperMethods.LoadInts(assistingParticipantsIdsA);
     }
     if (buildingType != null)
     {
         this.buildingType = AdvancedMatchHistoryConstants.SetBuildingType(buildingType);
     }
     this.creatorId  = creatorId;
     this.eventType  = AdvancedMatchHistoryConstants.SetEventType(eventType);
     this.itemAfter  = itemAfter;
     this.itemBefore = itemBefore;
     this.itemId     = itemId;
     this.killerId   = killerId;
     if (laneType != null)
     {
         this.laneType = AdvancedMatchHistoryConstants.SetLaneType(laneType);
     }
     if (levelUpType != null)
     {
         this.levelUpType = AdvancedMatchHistoryConstants.SetLevelUpType(levelUpType);
     }
     if (monsterType != null)
     {
         this.monsterType = AdvancedMatchHistoryConstants.SetMonsterType(monsterType);
     }
     this.participantId = participantId;
     if (pointCaptured != null)
     {
         this.pointCaptured = AdvancedMatchHistoryConstants.SetPointCaptured(pointCaptured);
     }
     if (positionO != null)
     {
         this.position = LoadPosition(positionO);
     }
     this.skillSlot = skillSlot;
     this.teamId    = teamId;
     this.timestamp = TimeSpan.FromMilliseconds(timestamp);
     if (towerType != null)
     {
         this.towerType = AdvancedMatchHistoryConstants.SetTowerType(towerType);
     }
     this.victimId = victimId;
     if (wardType != null)
     {
         this.wardType = AdvancedMatchHistoryConstants.SetWardType(wardType);
     }
 }