Commit Graph

88 Commits

Author SHA1 Message Date
Robin C. Ladiges 86c79177fd fix: synchronization issues
- Send empty `TagPacket` and `CapturePacket` on new connections, to reset old data back that other players might still have in their puppet from an
earlier connection.
- Cache and send `CostumePacket`, `CapturePacket`, `TagPacket`, `GamePacket` and `PlayerPacket` to (re-)connecting players.
- Clear Metadata cache for existing clients that connect fresh (after a game restart).
2023-09-05 16:51:58 -06:00
Robin C. Ladiges 71bb96bf1e verify stage values for send and sendall
Changes:
- Moved alias mapping from Constants.cs to Stages.cs.
- Added `odyssey` as an alias.
- Hardcoded all known stage values.
- Verfify that the stage input is either a alias or a known stage name.
- Added an option to append `!` to a stage name to force sending even if the stage is not known (e.g. for custom kingdoms).

Before it only checked that it was a known alias or that it contained `Stage` or `Zone`.
That made it impossible to send players to`MoonWorldShopRoom` and `MoonWorldSphinxRoom`.
And a typo would have resulted in a game crash.
2023-03-22 16:50:38 -06:00
Robin C. Ladiges 47fc1527bf fix: don't process and broadcast shine packets when shine sync is disabled
The breaks make the function return true, which causes the shine packets to be broadcasted to all connected clients.
Returning false will prevent the broadcast of the current shine packet.

Note: If shines are enabled, the clients will receive every shine twice.
Once from the `SyncShineBag();` and then a second time from the default broadcast caused by the remaining breaks.
We should probably replace every `break;` with `return false;` here?
2022-12-16 13:18:07 -06:00
Robin C. Ladiges a0642e6a30 fix: only send shines to connected clients and save only after sending
otherwise it will save that the client got it to the bag and then fail sending it, therefore forever preventing the client to get the shine.
2022-12-16 13:18:07 -06:00
Robin C. Ladiges 472c8856bc move the client.CurrentCostume update to the PacketHandler and log the packet
(cherry picked from commit 47505dbdd5)
2022-10-10 11:09:39 -06:00
Robin C. Ladiges 53442b598e only start listening for clients once everything is initialized
Otherwise clients might connect to the server before everything is ready for them.
E.g. when restarting the server, the clients will immediately try to reconnect.

Clients might connect before the `PacketHandler` is initialized, which results in some packets not being processed by the server correctly.

Same goes for the commands: Discord might send in commands before all commands were added to the `CommandHandler`.

Without the `ClientJoined` action, clients might even be allowed to connect if they are on the banlist.
(Though without this initialization they or regular clients might be broken in some ways?)

(cherry picked from commit 92e540aaa6)
2022-10-10 11:08:38 -06:00
Jack Baron e14616030c move clear task 2022-09-05 18:56:24 -06:00
Jack Baron 24a34c35a1 ignore file not found errors 2022-09-05 18:56:24 -06:00
Sanae 9c01f30c5e Add the ability to disable shine sync 2022-08-20 23:31:31 -06:00
raym55 c86be55717 PIPERS 2022-08-10 15:03:34 -06:00
Sanae e7a3347a37
Merge pull request #19 from TheUbMunster/restart-command 2022-07-29 13:19:04 -06:00
TheUbMunster 8baf75155e removed testing code 2022-07-29 12:55:14 -06:00
TheUbMunster fc2f9b1417 "banning the same person multiple times" should now be fixed 2022-07-29 12:55:14 -06:00
TheUbMunster 33fdd69e15 readded persisten shinies 2022-07-29 12:55:14 -06:00
TheUbMunster 5af8001398 Fixed adding quotes around Ambiguous for "user": , fixed showing correct casing of arguments. 2022-07-29 12:55:14 -06:00
TheUbMunster ba02c88b13 added !* variants for ban, crash, rejoin 2022-07-29 12:55:14 -06:00
TheUbMunster 95c918b5c4 Removed fire-and-forget warnings, null-forgave some metadata. 2022-07-29 12:55:01 -06:00
TheUbMunster 3a8e7ffb93 Changed "Running (pid)" to "Server Running on (pid)" 2022-07-28 18:00:18 -06:00
TheUbMunster d2c8c8d3cd Fixed race condition with restart to make sure it only happens after the listener closes. 2022-07-28 00:11:40 -06:00
TheUbMunster 068cc7c06d Added restart server command 2022-07-27 23:56:50 -06:00
TheUbMunster db05586dd0 Added quotable arguments, potential fix for ban * not banning anyone. 2022-07-27 12:14:56 -06:00
TheUbMunster d604c59a77 Added quotable arguments, potential fix for ban * not banning anyone. 2022-07-27 12:14:56 -06:00
TheUbMunster 5ca5b10db8 Fixed backwards ternaries in ban, crash, rejoin, 0 arguments no longer valid. 2022-07-27 12:14:56 -06:00
Jack Baron f305c3001b save/load moons from file 2022-07-22 18:56:00 -06:00
CraftyBoss 967a89a55b Merge branch 'master' of https://github.com/Sanae6/SmoOnlineServer 2022-07-08 23:13:44 +00:00
CraftyBoss 11015bd445 only send game packet on join to connected clients 2022-07-08 23:13:35 +00:00
raym55 787491456f Update Program.cs 2022-06-29 06:54:14 +01:00
Sanae 72061215ce Add wildcard to rejoin, crash, ban commands 2022-06-28 14:34:03 -06:00
Sanae f9c20e73a8 Fix accidental squashed command handler 2022-06-20 13:10:35 -06:00
Sanae b5825b537f Implements Added Bot Reconnect Command (#1)
Add dscrestart command
Update Program.cs
2022-06-20 12:55:01 -06:00
Sanae 5d78814620 Reformat Program.cs 2022-06-20 12:52:46 -06:00
Sanae e9136704c1 Fix response messages for ban and send commands 2022-06-19 19:33:08 -06:00
Sanae c4c0616fb7 Make some commands accept ids and partial names 2022-06-18 02:09:40 -06:00
Sanae 1f5ea97272 Finish ban implementation 2022-06-17 21:18:08 -06:00
Sanae 561d633e40 Add a simple discord bot to manage the server 2022-06-12 18:48:24 -06:00
Sanae 774ef20bb4 Multiple users on commands 2022-05-31 16:02:12 -06:00
Sanae 74c00aa0f8 The user management update 2022-05-31 15:48:57 -06:00
Sanae d898f4754b Add max players command and remove savesettigns 2022-05-31 14:48:48 -06:00
Sanae ab318db1b8 Clean up logging from testing 2022-04-27 21:32:52 -06:00
Sanae df2e976782 balls 2022-04-27 14:09:50 -06:00
Sanae 7a088eb314 Fix 2, electric boogaloo 2022-04-26 23:06:27 -06:00
CraftyBoss 3e462ddb64 Merge branch 'master' of https://github.com/Sanae6/SmoOnlineServer 2022-04-27 04:43:48 +00:00
CraftyBoss ff570a17c7 only show connected players in list command 2022-04-27 04:43:46 +00:00
Sanae eaadb90ee3 Probably fix scenario merging for real this time 2022-04-26 22:40:02 -06:00
CraftyBoss a89471de54 Merge branch 'master' of https://github.com/Sanae6/SmoOnlineServer 2022-04-05 19:35:15 +00:00
CraftyBoss 7eb7c97c43 fix possible typos with send/sendall cmd 2022-04-05 19:35:13 +00:00
Sanae 1a82666d93 Disconnect previous client instead of throwing on new client (rejoins) 2022-04-04 14:43:44 -06:00
Sanae 534a6c9655 Make packet transformation work in Send(Memory)
speedrun flag
2022-04-03 22:29:34 -06:00
Sanae 886b57f16a Actually broadcast instead of sending to only one person 2022-03-31 16:21:20 -06:00
Sanae 6224234272 Clear global shine bag on new speedrun 2022-03-31 15:34:08 -06:00