le async has arrived

This commit is contained in:
flash 2025-04-26 22:28:41 +00:00
commit 7bdf41a047
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E
27 changed files with 282 additions and 309 deletions

View file

@ -10,10 +10,10 @@ namespace SharpChat.ClientCommands {
|| ctx.NameEquals("restart");
}
public void Dispatch(ClientCommandContext ctx) {
public async Task Dispatch(ClientCommandContext ctx) {
if(!ctx.User.UserId.Equals("1")) {
long msgId = ctx.Chat.RandomSnowflake.Next();
ctx.Chat.SendTo(ctx.User, new CommandResponseS2CPacket(msgId, LCR.COMMAND_NOT_ALLOWED, true, $"/{ctx.Name}"));
await ctx.Chat.SendTo(ctx.User, new CommandResponseS2CPacket(msgId, LCR.COMMAND_NOT_ALLOWED, true, $"/{ctx.Name}"));
return;
}
@ -24,7 +24,7 @@ namespace SharpChat.ClientCommands {
foreach(Connection conn in ctx.Chat.Connections)
conn.PrepareForRestart();
ctx.Chat.Update();
await ctx.Chat.Update();
WaitHandle?.Set();
}
}