diff --git a/Account.cs b/Account.cs index daee635..0d2e175 100644 --- a/Account.cs +++ b/Account.cs @@ -19,8 +19,7 @@ namespace NightmareCoreWeb2 public List Characters { get; set; } public List Access { get; set; } - - public static Account AccountByID(int id) + public Account(int id) { MySqlConnection conn = new MySqlConnection(Program.connStr); @@ -33,7 +32,7 @@ namespace NightmareCoreWeb2 { try { - return new Account(rdr.GetString(0)); + new Account(rdr.GetString(0)); } catch (Exception e) @@ -41,9 +40,9 @@ namespace NightmareCoreWeb2 Console.WriteLine(e); } } - return null; } + public Account(string username) { MySqlConnection conn = new MySqlConnection(Program.connStr); @@ -115,7 +114,7 @@ namespace NightmareCoreWeb2 Console.WriteLine(e); } } - foreach (var access in this.Access) + foreach (var access in this.Access) { if (access.RealmID == -1 && access.RealmID >= 1) { diff --git a/GMTicket.cs b/GMTicket.cs index 26bf418..3c5e394 100644 --- a/GMTicket.cs +++ b/GMTicket.cs @@ -66,11 +66,11 @@ namespace NightmareCoreWeb2 this.LastModifiedTime = DateTimeOffset.FromUnixTimeSeconds(rdr.GetInt32(3)).UtcDateTime; if (rdr.GetInt32(4) != 0) { - this.ClosedBy = Account.AccountByID(rdr.GetInt32(4)); + this.ClosedBy = new Account(rdr.GetInt32(4)); } if (rdr.GetInt32(5) != 0) { - this.AssignedTo = Account.AccountByID(rdr.GetInt32(5)); + this.AssignedTo = new Account(rdr.GetInt32(5)); } this.Description = rdr.GetString(6); }