Network friendly with non modded client #73
Merged
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.
@UselessBullets on the discord discover my NetworkSystem make imposible to use halplibe on server without the client has also halplibe since my first
UniversalPacket
insendToPlayerMessagesConfiguration()
send a packet at id 88 which vanilla BTA will just panic :Since
UniversalPacket
and BTAPacketCustomPayload
are two class very similar this PR introduce a way to convert theUniversalPacket
toPacketCustomPayload
and proper mixin to handle wrappedUniversalPacket
insidePacketCustomPayload
With this new feature we can now send an already exiting
UniversalPacket
as aPacketCustomPayload
for the cost of some extra bytes but this as the advantage for fixing the original issue I just need to convert thesendToPlayerMessagesConfiguration()
UniversalPacket
to aPacketCustomPayload
and 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 wrappedPacketCustomPayload
to the client