Exemplo n.º 1
0
        static void PrintOfflineZSStats(Player p, PlayerData who)
        {
            ZombieStats stats = LoadStats(who.Name);

            PrintZSStats(p, stats.TotalRounds, stats.TotalInfected,
                         stats.MaxRounds, stats.MaxInfected);
        }
Exemplo n.º 2
0
        static ZombieStats LoadStats(string name)
        {
            ZombieStats stats = default(ZombieStats);

            return((ZombieStats)Database.ReadRows("ZombieStats", "*", stats,
                                                  ReadStats, "WHERE Name=@0", name));
        }
Exemplo n.º 3
0
        public ZombieStats LoadZombieStats(string name)
        {
            DataTable   table = Database.Backend.GetRows("ZombieStats", "*", "WHERE Name=@0", name);
            ZombieStats stats = default(ZombieStats);

            if (table.Rows.Count > 0)
            {
                DataRow row = table.Rows[0];
                stats.TotalRounds   = int.Parse(row["TotalRounds"].ToString());
                stats.MaxRounds     = int.Parse(row["MaxRounds"].ToString());
                stats.TotalInfected = int.Parse(row["TotalInfected"].ToString());
                stats.MaxInfected   = int.Parse(row["MaxInfected"].ToString());
            }
            table.Dispose();
            return(stats);
        }
Exemplo n.º 4
0
        public ZombieStats LoadZombieStats(string name)
        {
            ParameterisedQuery query = ParameterisedQuery.Create();

            query.AddParam("@Name", name);
            DataTable   table = Database.fillData(query, "SELECT * FROM ZombieStats WHERE Name=@Name");
            ZombieStats stats = default(ZombieStats);

            if (table.Rows.Count > 0)
            {
                DataRow row = table.Rows[0];
                stats.TotalRounds   = int.Parse(row["TotalRounds"].ToString());
                stats.MaxRounds     = int.Parse(row["MaxRounds"].ToString());
                stats.TotalInfected = int.Parse(row["TotalInfected"].ToString());
                stats.MaxInfected   = int.Parse(row["MaxInfected"].ToString());
            }
            table.Dispose();
            return(stats);
        }
Exemplo n.º 5
0
        internal static ZSData Get(Player p)
        {
            ZSData data = TryGet(p);

            if (data != null)
            {
                return(data);
            }
            data = new ZSData();

            // TODO: Is this even thread-safe
            data.InfectMessages = ZSConfig.LoadPlayerInfectMessages(p.name);
            ZombieStats s = LoadStats(p.name);

            data.MaxInfected       = s.MaxInfected;     data.TotalInfected = s.TotalInfected;
            data.MaxRoundsSurvived = s.MaxRounds; data.TotalRoundsSurvived = s.TotalRounds;

            p.Extras[zsExtrasKey] = data;
            return(data);
        }