public Player() { Licenses = new List <byte>(); Inventory = new List <Item>(); Characters = new List <Character>(); DenyList = new Dictionary <ulong, string>(); FriendList = new List <Friend>(); TDStats = new TDStatistics(); ConnectionType = 4; IsSpawned = false; RelayProxies = new List <byte>(); GameMode = EPlayerGameMode.Normal; GameScore = new GameScore(); }
public void UpdateTDStats(ulong accID, TDStatistics stats) { using (var con = GetConnection()) { using (var cmd = BuildQuery(con, "UPDATE account_tdstats SET TDs=@TD, TDAssists=@TDA, Kills=@Kills, KillAssists=@KillA, Offense=@Offense, OffenseAssists=@OffenseA, Defense=@Defense, DefenseAssists=@DefenseA, Recovery=@Recovery, Matches=@Matches, Won=@Won, Lost=@Lost WHERE ID=@ID", "@TD", stats.TotalTouchdowns, "@TDA", stats.TotalTouchdownAssists, "@Kills", stats.TotalKills, "@KillA", stats.TotalKillAssists, "@Offense", stats.TotalOffense, "@OffenseA", stats.TotalOffenseAssists, "@Defense", stats.TotalDefense, "@DefenseA", stats.TotalDefenseAssists, "@Recovery", stats.TotalRecovery, "@Matches", stats.TotalMatches, "@Won", stats.Won, "@Lost", stats.Lost, "@ID", accID)) { cmd.ExecuteNonQuery(); } } }
public TDStatistics GetTDStats(ulong accID) { var stats = new TDStatistics(); using (var con = GetConnection()) { using (var cmd = BuildQuery(con, "SELECT * FROM account_tdstats WHERE ID=@ID", "@ID", accID)) { using(var r = cmd.ExecuteReader()) { if(!r.Read()) return stats; stats.TotalTouchdowns = r.GetUInt32("TDs"); stats.TotalTouchdownAssists = r.GetUInt32("TDAssists"); stats.TotalKills = r.GetUInt32("Kills"); stats.TotalKillAssists = r.GetUInt32("KillAssists"); stats.TotalOffense = r.GetUInt32("Offense"); stats.TotalOffenseAssists = r.GetUInt32("OffenseAssists"); stats.TotalDefense = r.GetUInt32("Defense"); stats.TotalDefenseAssists = r.GetUInt32("DefenseAssists"); stats.TotalRecovery = r.GetUInt32("Recovery"); stats.TotalMatches = r.GetUInt32("Matches"); stats.Won = r.GetUInt32("Won"); stats.Lost = r.GetUInt32("Lost"); } } } return stats; }
public Player() { Licenses = new List<byte>(); Inventory = new List<Item>(); Characters = new List<Character>(); DenyList = new Dictionary<ulong, string>(); FriendList = new List<Friend>(); TDStats = new TDStatistics(); ConnectionType = 4; IsSpawned = false; RelayProxies = new List<byte>(); GameMode = EPlayerGameMode.Normal; GameScore = new GameScore(); }