示例#1
0
        void SetSummaryParameters(DatabaseCommand command, MapType map, GameModeType gameMode, Summoner summoner, PlayerStatSummary summary, bool forceNullRating)
        {
            if (forceNullRating)
            {
                command.Set("current_rating", DbType.Int32, null);
                command.Set("top_rating", DbType.Int32, null);
            }
            else
            {
                //Zero rating means that the Elo is below 1200 and is not revealed by the server
                if (summary.rating == 0)
                    command.Set("current_rating", DbType.Int32, null);
                else
                    command.Set("current_rating", summary.rating);
                command.Set("top_rating", summary.maxRating);
            }

            command.Set("summoner_id", summoner.Id);
            command.Set("map", (int)map);
            command.Set("game_mode", (int)gameMode);

            command.Set("wins", summary.wins);
            command.Set("losses", summary.losses);
            command.Set("leaves", summary.leaves);
        }
        void SetSummaryParameters(DatabaseCommand command, MapType map, GameModeType gameMode, Summoner summoner, PlayerStatSummary summary, bool forceNullRating)
        {
            if (forceNullRating)
            {
                command.Set("current_rating", DbType.Int32, DBNull.Value);
                command.Set("top_rating", DbType.Int32, DBNull.Value);
            }
            else
            {
                //Zero rating means that the Elo is below 1200 and is not revealed by the server
                if (summary.rating == 0)
                    command.Set("current_rating", DbType.Int32, DBNull.Value);
                else
                    command.Set("current_rating", summary.rating);
                command.Set("top_rating", summary.maxRating);
            }

            command.Set("summoner_id", summoner.Id);
            command.Set("map", (int)map);
            command.Set("game_mode", (int)gameMode);

            command.Set("wins", summary.wins);
            command.Set("losses", summary.losses);
            command.Set("leaves", summary.leaves);

            int k = 0, d = 0, a = 0;

            var kills = summary.aggregatedStats.stats.FirstOrDefault(e => e.statType == "TOTAL_CHAMPION_KILLS");
            if (kills != null)
            {
                k = kills.value;
            }

            var deaths = summary.aggregatedStats.stats.FirstOrDefault(e => e.statType == "TOTAL_DEATHS_PER_SESSION");
            if (deaths != null)
            {
                d = deaths.value;
            }

            var assists = summary.aggregatedStats.stats.FirstOrDefault(e => e.statType == "TOTAL_ASSISTS");
            if (assists != null)
            {
                a = assists.value;
            }

            command.Set("kills", k);
            command.Set("deaths", d);
            command.Set("assists", a);
        }
示例#3
0
        void SetSummaryParameters(DatabaseCommand command, MapType map, GameModeType gameMode, Summoner summoner, PlayerStatSummary summary, bool forceNullRating)
        {
            if (forceNullRating)
            {
                command.Set("current_rating", DbType.Int32, null);
                command.Set("top_rating", DbType.Int32, null);
            }
            else
            {
                //Zero rating means that the Elo is below 1200 and is not revealed by the server
                if (summary.rating == 0)
                {
                    command.Set("current_rating", DbType.Int32, null);
                }
                else
                {
                    command.Set("current_rating", summary.rating);
                }
                command.Set("top_rating", summary.maxRating);
            }

            command.Set("summoner_id", summoner.Id);
            command.Set("map", (int)map);
            command.Set("game_mode", (int)gameMode);

            command.Set("wins", summary.wins);
            command.Set("losses", summary.losses);
            command.Set("leaves", summary.leaves);
        }
        void SetSummonerRankedStatisticsParameters(DatabaseCommand update, Summoner summoner, int season, ChampionStatistics champion)
        {
            update.SetFieldNames(SummonerRankedStatisticsFields);

            update.Set(summoner.Id);

            update.Set(season);

            update.Set(champion.ChampionId);

            update.Set(champion.Wins);
            update.Set(champion.Losses);

            update.Set(champion.Kills);
            update.Set(champion.Deaths);
            update.Set(champion.Assists);

            update.Set(champion.MinionKills);

            update.Set(champion.Gold);

            update.Set(champion.TurretsDestroyed);

            update.Set(champion.DamageDealt);
            update.Set(champion.PhysicalDamageDealt);
            update.Set(champion.MagicalDamageDealt);

            update.Set(champion.DamageTaken);

            update.Set(champion.DoubleKills);
            update.Set(champion.TripleKills);
            update.Set(champion.QuadraKills);
            update.Set(champion.PentaKills);

            update.Set(champion.TimeSpentDead);

            update.Set(champion.MaximumKills);
            update.Set(champion.MaximumDeaths);
        }
        void SetSummonerRankedStatisticsParameters(DatabaseCommand update, Summoner summoner, int season, ChampionStatistics champion)
        {
            update.SetFieldNames(SummonerRankedStatisticsFields);

            update.Set(summoner.Id);

            update.Set(season);

            update.Set(champion.ChampionId);

            update.Set(champion.Wins);
            update.Set(champion.Losses);

            update.Set(champion.Kills);
            update.Set(champion.Deaths);
            update.Set(champion.Assists);

            update.Set(champion.MinionKills);

            update.Set(champion.Gold);

            update.Set(champion.TurretsDestroyed);

            update.Set(champion.DamageDealt);
            update.Set(champion.PhysicalDamageDealt);
            update.Set(champion.MagicalDamageDealt);

            update.Set(champion.DamageTaken);

            update.Set(champion.DoubleKills);
            update.Set(champion.TripleKills);
            update.Set(champion.QuadraKills);
            update.Set(champion.PentaKills);

            update.Set(champion.TimeSpentDead);

            update.Set(champion.MaximumKills);
            update.Set(champion.MaximumDeaths);
        }