Skip to content

Commit

Permalink
fix: tag seeking command send new state to all players
Browse files Browse the repository at this point in the history
  • Loading branch information
Istador committed Jun 21, 2024
1 parent db553cc commit e160acc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,17 @@ await c.Send(new ChangeStagePacket {
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: {
Expand Down

0 comments on commit e160acc

Please sign in to comment.