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

Fix another shine sync crash

This commit is contained in:
Sanae 2022-03-01 19:42:14 -06:00
parent 00626ab12f
commit 412607c0c9

View file

@ -32,14 +32,17 @@ async Task ClientSyncShineBag(Client client) {
await client.Send(new ShinePacket { await client.Send(new ShinePacket {
ShineId = shine ShineId = shine
}); });
} } catch {
catch {
// errors that can happen when sending will crash the server :) // errors that can happen when sending will crash the server :)
} }
} }
async void SyncShineBag() { async void SyncShineBag() {
try {
await Parallel.ForEachAsync(server.Clients, async (client, _) => { await ClientSyncShineBag(client); }); await Parallel.ForEachAsync(server.Clients, async (client, _) => { await ClientSyncShineBag(client); });
} catch {
// errors that can happen shines change will crash the server :)
}
} }
Timer timer = new Timer(120000); Timer timer = new Timer(120000);