Skip to content
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

fix: construct tag packet instead of caching it in memory #52

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

Istador
Copy link
Contributor

@Istador Istador commented Apr 25, 2024

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.)

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.)
@Sanae6 Sanae6 merged commit 20ee74d into Sanae6:master Apr 27, 2024
1 check passed
@Istador Istador deleted the fix-tag-packet branch April 27, 2024 18:56
@Istador Istador mentioned this pull request Apr 27, 2024
Istador added a commit to Istador/smo-multi-rs that referenced this pull request May 4, 2024
- 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`, `GamePacket` and `PlayerPacket` to (re-)connecting players.

Same change in the C# server:
- Sanae6/SmoOnlineServer#49

---

The last `TagPacket` is not cached, because it could contain an update type that isn't complete.
Instead a packet is created from `time` and `is_seeking` for (re-)connecting players.

Same change in the C# server:
- Sanae6/SmoOnlineServer#52

---

As this server deletes the player data on disconnects, the cached packets from earlier re-connected connections are no longer available.

Therefore the saved packets don't need to be cleared for fresh connections (after a restart).

---

But this can cause sync issues for new players now, if ealier re-connecting players use a mod version below 1.3.0.
Because the mod below 1.3.0 does not send all of the important game packets again after a reconnect.

I'm ignoring this for now, because version 1.4.0 of the mod is required to connect to a UDP server that has a fix for this.

But if this rust server software is used for TCP-only a client with an older mod version might connect and run into these issues.
For now I've added two TODO comments in `client.rs` and `coordninator.rs` to mark where a change is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants