0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-24 12:15:17 +00:00

fix: tag time command send new time to all players

This commit is contained in:
Robin C. Ladiges 2024-06-21 22:10:13 +02:00 committed by Aubrey
parent d69d9b8296
commit 7a055be9cf

View file

@ -463,13 +463,18 @@ CommandHandler.RegisterCommand("tag", args => {
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: {