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:
parent
d69d9b8296
commit
7a055be9cf
1 changed files with 11 additions and 6 deletions
|
@ -464,12 +464,17 @@ CommandHandler.RegisterCommand("tag", args => {
|
|||
TagPacket tagPacket = new TagPacket {
|
||||
UpdateType = TagPacket.TagUpdate.Time,
|
||||
Minutes = minutes,
|
||||
Seconds = seconds
|
||||
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: {
|
||||
|
|
Loading…
Reference in a new issue