Skip to content

Commit

Permalink
fix: tag time command send new time to all players
Browse files Browse the repository at this point in the history
  • Loading branch information
Istador committed Jun 21, 2024
1 parent c256b00 commit db553cc
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,18 @@ await c.Send(new ChangeStagePacket {
return $"Invalid time for seconds {args[3]} (range: 0-59)";
TagPacket tagPacket = new TagPacket {
UpdateType = TagPacket.TagUpdate.Time,
Minutes = minutes,
Seconds = seconds
Minutes = minutes,
Seconds = seconds,
};
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 time for {(args[1] == "*" ? "everyone" : args[1])} to {minutes}:{seconds}";
}
case "seeking" when args.Length == 3: {
Expand Down

0 comments on commit db553cc

Please sign in to comment.