mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-22 03:05:16 +00:00
fix: tag seeking
command send new state to all players
This commit is contained in:
parent
7a055be9cf
commit
3affb59eb9
1 changed files with 10 additions and 5 deletions
|
@ -483,12 +483,17 @@ CommandHandler.RegisterCommand("tag", args => {
|
|||
if (!bool.TryParse(args[2], out bool seeking)) return $"Usage: tag seeking {args[1]} <true/false>";
|
||||
TagPacket tagPacket = new TagPacket {
|
||||
UpdateType = TagPacket.TagUpdate.State,
|
||||
IsIt = seeking
|
||||
IsIt = seeking,
|
||||
};
|
||||
if (args[1] == "*")
|
||||
server.Broadcast(tagPacket);
|
||||
else
|
||||
client?.Send(tagPacket);
|
||||
if (args[1] == "*") {
|
||||
Parallel.ForEachAsync(server.Clients, async (client, _) => {
|
||||
await server.Broadcast(tagPacket, client);
|
||||
await client.Send(tagPacket);
|
||||
});
|
||||
} else if (client != null) {
|
||||
server.Broadcast(tagPacket, client);
|
||||
client.Send(tagPacket);
|
||||
}
|
||||
return $"Set {(args[1] == "*" ? "everyone" : args[1])} to {(seeking ? "seeker" : "hider")}";
|
||||
}
|
||||
case "start" when args.Length > 2: {
|
||||
|
|
Loading…
Reference in a new issue