0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-21 18:55:17 +00:00

move clear task

This commit is contained in:
Jack Baron 2022-07-22 17:53:31 +01:00 committed by Sanae
parent 24a34c35a1
commit e14616030c

View file

@ -127,9 +127,6 @@ server.PacketHandler = (c, p) => {
c.Metadata["speedrun"] = true;
((ConcurrentBag<int>) (c.Metadata["shineSync"] ??= new ConcurrentBag<int>())).Clear();
shineBag.Clear();
Task.Run(async () => {
await PersistShines();
});
c.Logger.Info("Entered Cap on new save, preventing moon sync until Cascade");
break;
case "WaterfallWorldHomeStage":
@ -573,6 +570,10 @@ CommandHandler.RegisterCommand("shine", args => {
return $"Shines: {string.Join(", ", shineBag)}";
case "clear" when args.Length == 1:
shineBag.Clear();
Task.Run(async () => {
await PersistShines();
});
foreach (ConcurrentBag<int> playerBag in server.Clients.Select(serverClient =>
(ConcurrentBag<int>)serverClient.Metadata["shineSync"]!)) playerBag?.Clear();