Commit Graph

16 Commits

Author SHA1 Message Date
Robin C. Ladiges f4eaf381e3
refac the "speedrun" mode
By not detecting new saves correctly before, players were sent all moons while still being in cap kingdom.
Having those moons made the game crash if the cutscenes from cap to cascade were skipped.

Changes:
- Rename: `speedrun => `disableShineSync`.
- Correctly detect new saves by scenario 1 instead of 0.
- Let all stages that are not cap in scenario 1 enable shine sync again (e.g. for switching back to an older save).
- Only disable shine sync once and not on every stage change (e.g. when entering cap overworld again and again).
- Disable shine bag clearing by default, option to enable it again via `Shines/ClearOnNewSaves` (for speedruns).
- Persist shines after clearing (otherwise a server crash/restart might load old moons from a previous run and sync them).
- Clear only once per player till reaching cascade (otherwise collected moons might be cleared mid-run).
- Reduce delay from 15s to 2s (even w/o a delay I couldn't reproduce a crash, but keeping it feels safer).
- Only enable shine sync again after the delay, the delay was circumvented before by other tasks triggering shine sync earlier.
2024-04-27 20:54:46 +02:00
Robin C. Ladiges 61e6fcf2a3 new setting: Shines/Excluded
To exclude specific shines to be synced to other clients.

Pre-initialized with shine 496 (Moon Shards in the Sand) that causes people to get stuck in front of the inverted pyramid.

This commit fixes issue #31
2024-04-27 14:46:43 -04:00
Robin C. Ladiges d6a8df448c
Refactoring ban command (#48)
* rename command: `ban ...` => `ban player ...`

To enable adding other subcommands starting with `ban`.

Moving ban list and crash related code into its own class to tidy the Program class up.

Change Id values of the crash cmds, to fit into the 16 byte max length imposed by ChangeStagePacket.IdSize.

* add command: `ban ip <ipv4-address>`

To add an IPv4 address to the ban list.

* add command: `ban profile <profile-id>`

To add a profile ID to the ban list.

* add command: `unban ip <ipv4-address>`

To remove a banned IPv4 address from the ban list.

* add command: `unban profile <profile-id>`

To remove a banned profile ID from the ban list.

* add commands: `ban enable` and `ban disable`

To set the value of `BanList.Enabled` to `true` or `false` without editing the `settings.json` file.

* add command: `ban list`

To show the current ban list settings.

* fix: actually working ban functionality

Changes:
- ignore new sockets from banned IP addresses way earlier.
- ignore all packets by banned profiles.

Intentionally keeping the connection open instead of d/c banned clients.
This is to prevent endless server logs due to automatically reconnecting clients.

Before:
Reconnecting clients aren't entering `ClientJoined` and therefore the d/c is only working on first connections.
Effectively banned clients got a d/c and then automatically reconnected again without getting a d/c again.
Therefore allowing them to play normally.

* use SortedSet instead of List for settings

To enforce unique entries and maintain a stable order inside of the `settings.json`.

* add commands: `ban stage <stage-name>` and `unban stage <stage-name>`

To kick players from the server when they enter a banned stage.

<stage-name> can also be a kingdom alias, which bans/unbans all stages in that kingdom.

Because we aren't banning the player, d/c them would be no good, because of the client auto reconnect.
Instead send them the crash and ignore all packets by them until they d/c on their own.

This is an alternative solution for issue #43.

* Update Server.cs

---------

Co-authored-by: Sanae <32604996+Sanae6@users.noreply.github.com>
2023-09-05 17:14:54 -06:00
TheUbMunster 86fb18962f Differentiated command channel and log channel 2022-08-22 18:58:42 -06:00
Sanae 9c01f30c5e Add the ability to disable shine sync 2022-08-20 23:31:31 -06:00
Jack Baron 8d90f50fa9 add moon persistence settings 2022-07-22 18:56:00 -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 74c00aa0f8 The user management update 2022-05-31 15:48:57 -06:00
Sanae 99aabeffc9 Add init packet 2022-05-08 16:04:57 -06:00
Sanae 2a8e1696ab Remove another useless log 2022-03-15 15:02:27 -06:00
Sanae 8d11623ada Various useful changes 2022-03-15 14:44:46 -06:00
Sanae f47ab01d4c Make flipping a permanent setting like the others 2022-03-06 17:32:49 -06:00
Sanae 00626ab12f Add scenario merging and run reformatting on solution 2022-03-01 15:08:53 -06:00
Sanae bf15f51eb3 Use Json.NET instead of Tomlyn for settings file
Tomlyn can't cope with Guids, so moving to Json.NET
2022-02-17 20:39:48 -06:00
Sanae 821301e756 Implement console commands and settings (flip list broken) 2022-02-17 19:56:12 -06:00