0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-22 03:05:16 +00:00

Actually broadcast instead of sending to only one person

This commit is contained in:
Sanae 2022-03-31 16:21:20 -06:00
parent 6224234272
commit 886b57f16a

View file

@ -260,15 +260,15 @@ CommandHandler.RegisterCommand("tag", args => {
await Task.Delay(realTime);
await Task.WhenAll(
Parallel.ForEachAsync(seekers, async (seeker, _) =>
await seeker.Send(new TagPacket {
await server.Broadcast(new TagPacket {
UpdateType = TagPacket.TagUpdate.State,
IsIt = true
})),
}, seeker)),
Parallel.ForEachAsync(server.Clients.Except(seekers), async (hider, _) =>
await hider.Send(new TagPacket {
await server.Broadcast(new TagPacket {
UpdateType = TagPacket.TagUpdate.State,
IsIt = false
})
}, hider)
)
);
consoleLogger.Info($"Started game with seekers {string.Join(", ", seekerNames)}");