public static bool Start(String basePath) { try { InitializeDatabase(basePath); var settings = GetObject("settings") as Settings; if (settings == null) { throw new InvalidProgramException("No settings object is defined in the database!"); } ParserCommandHandler = new ParserCommandHandler(); LoginCommandHandler = new LoginCommandHandler(); ActionExecutionThread = new Thread(CommandProcessingThread); ActionExecutionThread.Start(); Console.WriteLine("Engine ready with path " + basePath + "."); } catch (Exception e) { Console.WriteLine("Failed to start mud engine."); Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); throw e; } return(true); }
public static bool Start(String basePath) { try { InitializeDatabase(basePath); var settings = GetObject("settings") as Settings; if (settings == null) throw new InvalidProgramException("No settings object is defined in the database!"); ParserCommandHandler = new ParserCommandHandler(); LoginCommandHandler = new LoginCommandHandler(); ActionExecutionThread = new Thread(CommandProcessingThread); ActionExecutionThread.Start(); Console.WriteLine("Engine ready with path " + basePath + "."); } catch (Exception e) { Console.WriteLine("Failed to start mud engine."); Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); throw e; } return true; }
public void Authenticate(MudObject Actor, String UserName, String Password) { var existingAccount = Accounts.LoadAccount(UserName); if (existingAccount == null || Accounts.VerifyAccount(existingAccount, Password) == false) { Core.SendMessage(Actor, "Could not verify account."); return; } var client = Actor.GetProperty <Client>("client"); LoginCommandHandler.LogPlayerIn(client as NetworkClient, existingAccount); }
public void Authenticate(MudObject Actor, String UserName, String Password) { var existingAccount = Accounts.LoadAccount(UserName); if (existingAccount != null) { Core.SendMessage(Actor, "Account already exists."); return; } var newAccount = Accounts.CreateAccount(UserName, Password); if (newAccount == null) { Core.SendMessage(Actor, "Could not create account."); return; } var client = Actor.GetProperty <Client>("client"); LoginCommandHandler.LogPlayerIn(client as NetworkClient, newAccount); }