mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 22:17:22 +01:00
try to fix some crashes
This commit is contained in:
parent
66affed8ae
commit
42f086730f
1 changed files with 3 additions and 3 deletions
|
|
@ -124,7 +124,7 @@ namespace MareSynchronosServer.Discord
|
||||||
using var db = scope.ServiceProvider.GetService<MareDbContext>();
|
using var db = scope.ServiceProvider.GetService<MareDbContext>();
|
||||||
|
|
||||||
var lodestoneAuth = db.LodeStoneAuth.SingleOrDefault(u => u.DiscordId == id);
|
var lodestoneAuth = db.LodeStoneAuth.SingleOrDefault(u => u.DiscordId == id);
|
||||||
if (lodestoneAuth != null)
|
if (lodestoneAuth != null || !DiscordLodestoneMapping.ContainsKey(id))
|
||||||
{
|
{
|
||||||
Random rand = new();
|
Random rand = new();
|
||||||
var randomServer = LodestoneServers[rand.Next(LodestoneServers.Length)];
|
var randomServer = LodestoneServers[rand.Next(LodestoneServers.Length)];
|
||||||
|
|
@ -202,7 +202,7 @@ namespace MareSynchronosServer.Discord
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
embedBuilder.WithTitle("Your auth has expired");
|
embedBuilder.WithTitle("Your auth has expired or something else went wrong");
|
||||||
embedBuilder.WithDescription("Start again with **/register**");
|
embedBuilder.WithDescription("Start again with **/register**");
|
||||||
DiscordLodestoneMapping.TryRemove(id, out _);
|
DiscordLodestoneMapping.TryRemove(id, out _);
|
||||||
}
|
}
|
||||||
|
|
@ -346,7 +346,7 @@ namespace MareSynchronosServer.Discord
|
||||||
discordClient.Disconnected += DiscordClient_Disconnected;
|
discordClient.Disconnected += DiscordClient_Disconnected;
|
||||||
|
|
||||||
_timer = new Timer(UpdateStatus, null, TimeSpan.Zero, TimeSpan.FromSeconds(15));
|
_timer = new Timer(UpdateStatus, null, TimeSpan.Zero, TimeSpan.FromSeconds(15));
|
||||||
_queueTimer = new Timer(ProcessQueue, null, TimeSpan.Zero, TimeSpan.FromSeconds(5));
|
_queueTimer = new Timer(ProcessQueue, null, TimeSpan.Zero, TimeSpan.FromSeconds(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue