fix: Adds CUO settings support and adds more robust 7.0.9 support (#945)
This commit is contained in:
parent
941452de4a
commit
5b7b99e0de
12 changed files with 958 additions and 773 deletions
|
|
@ -1,41 +1,42 @@
|
|||
using System;
|
||||
using Server.Accounting;
|
||||
using Server.Logging;
|
||||
|
||||
namespace Server.Misc
|
||||
namespace Server.Misc;
|
||||
|
||||
public static class AccountPrompt
|
||||
{
|
||||
public static class AccountPrompt
|
||||
private static readonly ILogger logger = LogFactory.GetLogger(typeof(AccountPrompt));
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
public static void Initialize()
|
||||
if (Accounts.Count == 0)
|
||||
{
|
||||
if (Accounts.Count == 0)
|
||||
Console.WriteLine("This server has no accounts.");
|
||||
Console.Write("Do you want to create the owner account now? (y/n): ");
|
||||
|
||||
var answer = Console.ReadLine();
|
||||
if (answer is "y" or "Y")
|
||||
{
|
||||
Console.WriteLine("This server has no accounts.");
|
||||
Console.Write("Do you want to create the owner account now? (y/n): ");
|
||||
Console.WriteLine();
|
||||
|
||||
var answer = Console.ReadLine();
|
||||
if (answer is "y" or "Y")
|
||||
Console.Write("Username: ");
|
||||
var username = Console.ReadLine();
|
||||
|
||||
Console.Write("Password: ");
|
||||
var password = Console.ReadLine();
|
||||
|
||||
var a = new Account(username, password)
|
||||
{
|
||||
Console.WriteLine();
|
||||
AccessLevel = AccessLevel.Owner
|
||||
};
|
||||
|
||||
Console.Write("Username: ");
|
||||
var username = Console.ReadLine();
|
||||
|
||||
Console.Write("Password: ");
|
||||
var password = Console.ReadLine();
|
||||
|
||||
var a = new Account(username, password);
|
||||
a.AccessLevel = AccessLevel.Owner;
|
||||
|
||||
Console.WriteLine("Account created.");
|
||||
|
||||
ServerAccess.AddProtectedAccount(a, true);
|
||||
Console.WriteLine("Added {0} to the protected accounts list.", a.Username);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Account not created.");
|
||||
}
|
||||
logger.Information("Owner account created: {0}", username);
|
||||
ServerAccess.AddProtectedAccount(a, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.Warning("No owner account created.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue