forked from Sanae6/SmoOnlineServer
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] master from Sanae6:master #41
Open
pull
wants to merge
16
commits into
TeamPiplup:master
Choose a base branch
from
Sanae6:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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).
* 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 <[email protected]>
Because the tag packet received from the client could have an UpdateType that isn't both State and Time. (Though currently the client always updates both together.)
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
- use brackets when possible - set client.Id and client.Name earlier - use client.Id instead of header.Id - rename firstConn to isClientNew
To make service discovery by internet scan bots harder.
Otherwise they keep sending all their packets (including positional updates) to the server which costs bandwidth and processing power.
…ayers limit Otherwise they'll enter an endless disconnect-reconnnect loop spamming the server with new TCP connections.
KeyNotFoundException: The given key 'time' was not present in the dictionary.
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.
Seconds are only one byte big and not two, so the Minutes start at byte 3 and not 4.
Broadcast() with a sender never sends the packet to the sender. Therefore only other players got informed about the new role. But never the actual player that is supposed to change to that role.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )