Ejemplo n.º 1
0
        public static Account Load(Hashtable row)
        {
            if (row == null)
                return null;

            var result = new Account();

            result.Id = (int)row["id"];
            result.Name = (string)row["name"];
            result.EmailAddress = (string)row["email"];
            result.IsAdmin = (string)row["admin"] == "True";
            result.SignedUp = Utility.FromUnixTimestamp((int)row["signed_up"]);

            result.Wins = (int)row["wins"];
            result.Games = (int)row["games"];
            result.Rating = (int)row["rating"];

            result.LastOn = Utility.FromUnixTimestamp((int)row["last_on"]);
            result.LoginCount = (int)row["num_logins"];
            result.LastIpAddress = (string)row["last_ip"];

            result.IsDisabled = (string)row["status"] == "Disabled";

            result.ForwardEmails = (string)row["forward_emails"];

            return result;
        }
Ejemplo n.º 2
0
 public static void PlayerInvited(Game game, Account account)
 {
     SaveGame(game);
     using (var db = CreateDB())
     {
         db.Execute("insert into player (game_id, account_id, isInvite) values ({0}, {1}, 1) ", game.Id, account.Id);
     }
 }