protected override void HandleRequest() { DbAccount acc; var status = Database.Verify(Query["guid"], Query["password"], out acc); if (status == LoginStatus.OK || status == LoginStatus.AccountNotExists) { if (status == LoginStatus.AccountNotExists) { acc = Database.CreateGuestAccount(Query["guid"]); } if (acc.Banned) { using (StreamWriter wtr = new StreamWriter(Context.Response.OutputStream)) wtr.WriteLine("<Error>Account under maintenance</Error>"); Context.Response.Close(); } var ca = new DbClassAvailability(acc); if (ca.IsNull) { ca.Init(GameData); } ca.Flush(); var list = CharList.FromDb(Database, acc); list.Servers = GetServerList(); WriteLine(list.ToXml(Program.GameData, acc)); } else { WriteErrorLine(status.GetInfo()); } }
protected override void HandleRequest() { DbAccount acc; var status = Database.Verify(Query["guid"], Query["password"], out acc); if (status == LoginStatus.OK || status == LoginStatus.AccountNotExists) { if (status == LoginStatus.AccountNotExists) { acc = Database.CreateGuestAccount(Query["guid"]); } var ca = new DbClassAvailability(acc); if (ca.IsNull) { ca.Init(GameData); } ca.Flush(); var list = CharList.FromDb(Database, acc); list.Servers = GetServerList(); WriteLine(list.ToXml(Program.GameData, acc)); } else { WriteErrorLine(status.GetInfo()); } }
protected override void HandleRequest() { DbAccount acc; if (Query["guid"] == null || Query["password"] == null) { WriteErrorLine("Error.incorrectEmailOrPassword"); } else { LoginStatus status = Database.Verify(Query["guid"], Query["password"], out acc); if (status == LoginStatus.OK) { if (acc.Admin) { var ca = new DbClassAvailability(acc); ca.Init(GameData); ca.Flush(); WriteLine("<Success />"); } else { WriteLine("<Failure />"); } } else { WriteErrorLine("<Failure />"); } } }