public static void HandleAccountCreateQuery(int index, string username, string password) { bool userExists = CommonMongo.DoesUserExist(username); if (userExists) { ServerOutput.Compose(Outbound.Account_Create_Fail, index, Log.DatabaseAccountAlreadyExists); return; } CommonMongo.CreateAccount(username, password); ServerOutput.Compose(Outbound.Account_Create_Success, index, Log.DatabaseAccountCreated); }
public static void HandleDoesUserExist(int index, string username) { var result = CommonMongo.DoesUserExist(username); ServerOutput.Compose(Outbound.DoesUserExist, index, result ? false : true); }