mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 19:37:23 +01:00
add alias handling to server and database
This commit is contained in:
parent
66e2b3db82
commit
88cec262cd
9 changed files with 553 additions and 12 deletions
|
|
@ -166,7 +166,8 @@ public class DiscordBot : IHostedService
|
|||
while (!hasValidUid)
|
||||
{
|
||||
var uid = GenerateRandomString(10);
|
||||
if (db.Users.Any(u => u.UID == uid)) continue;
|
||||
if (await db.Users.AnyAsync(u => u.UID == uid).ConfigureAwait(false)) continue;
|
||||
if (await db.Aliases.AnyAsync(u => u.AliasUID == uid).ConfigureAwait(false)) continue;
|
||||
user.UID = uid;
|
||||
hasValidUid = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue