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

Network friendly with non modded client #73

Conversation

gungun974
Copy link
Contributor

@UselessBullets on the discord discover my NetworkSystem make imposible to use halplibe on server without the client has also halplibe since my first UniversalPacket in sendToPlayerMessagesConfiguration() send a packet at id 88 which vanilla BTA will just panic :

Screenshot From 2025-03-07 20-13-47

Since UniversalPacket and BTA PacketCustomPayload are two class very similar this PR introduce a way to convert the UniversalPacket to PacketCustomPayload and proper mixin to handle wrapped UniversalPacket inside PacketCustomPayload

With this new feature we can now send an already exiting UniversalPacket as a PacketCustomPayload for the cost of some extra bytes but this as the advantage for fixing the original issue I just need to convert the sendToPlayerMessagesConfiguration() UniversalPacket to a PacketCustomPayloadand now if the client don't have halplibe, nothing will panic.

For the future may make possible from the halplibe consumer to choose if they want their message to be wrapped inside a PacketCustomPayload to prevent Bad packet ID but for now most mod that introduce extra network message should required the client to also have their mod installed.

Note: Please note this PR make old version of halplibe probably don't handle well the sendToPlayerMessagesConfiguration() if the server send the wrapped PacketCustomPayload to the client

@MartinSVK12 MartinSVK12 merged commit b6a8bf7 into Turnip-Labs:7.3 Mar 7, 2025
2 checks passed
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