le async has arrived
This commit is contained in:
parent
2eba089a21
commit
7bdf41a047
27 changed files with 282 additions and 309 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue