mirror of
https://github.com/Zheneq/EvoS
synced 2026-08-23 18:23:04 -04:00
Tweak code command
This commit is contained in:
parent
ff68b0f60b
commit
a12085e277
2 changed files with 14 additions and 2 deletions
|
|
@ -139,6 +139,15 @@ namespace EvoS.DirectoryServer.Account
|
|||
|
||||
registrationCodeEntry = e;
|
||||
}
|
||||
else if (code is not null)
|
||||
{
|
||||
// consume the registration code if it exists even if it is not required
|
||||
RegistrationCodeDao.RegistrationCodeEntry e = registrationCodeDao.Find(code);
|
||||
if (e is not null && e.IsValid && e.IssuedTo.Equals(username.ToLower()))
|
||||
{
|
||||
registrationCodeEntry = e;
|
||||
}
|
||||
}
|
||||
|
||||
long accountId = GenerateAccountId(username);
|
||||
for (int i = 0; loginDao.Find(accountId) != null; ++i)
|
||||
|
|
|
|||
|
|
@ -383,9 +383,12 @@ namespace CentralServer.LobbyServer.Discord
|
|||
return;
|
||||
}
|
||||
|
||||
if (entry.IsUsed)
|
||||
LoginDao.LoginEntry loginEntry = DB.Get().LoginDao.Find(entry.IssuedTo);
|
||||
if (entry.IsUsed || loginEntry is not null)
|
||||
{
|
||||
await command.RespondAsync("You have already registered an account.", ephemeral: true);
|
||||
await command.RespondAsync(
|
||||
$"You have already registered `{loginEntry?.Username ?? entry.IssuedTo}`. Log in with your username and password.",
|
||||
ephemeral: true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue