[Networking] Improve handling of legacy channel format - #90
Open
SpaceWalkerRS wants to merge 1 commit into
Open
Conversation
SpaceWalkerRS
force-pushed
the
improve-legacy-packet-channel-support
branch
from
September 12, 2026 15:52
d8eb06f to
ff07e64
Compare
Yedelo
reviewed
Sep 12, 2026
Yedelo
left a comment
There was a problem hiding this comment.
allows colons to be parsed in StringChannelIdentifierParser#fromString with the proper namespace and identifer, looks good
This file contains hidden or 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
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.
resolves #89
Channel Identifiers
Currently, the way channels identifiers are converted to and from
Strings is different in 1.13-pre2 and below vs 1.13-pre4 and above.In 1.13-pre4 and above, Vanilla uses
Identifiers for custom payload channels, and OSL does as well. As such, there is no special handling forStringconversions, and the standard colon-separated format is used:<namespace>:<identifier>.In 1.13-pre2 and below, Vanilla uses
Stringsfor custom payload channels, with no validation exception for limiting the length to 20 (or 16 in older versions). However, by convention, a sort of namespaced identifier is used with a vertical bar separator (|). All channel identifiers made through OSL are serialized to this legacy format.Changes
ChannelIdentifiers.from()now ALWAYS serialize to the standard colon-separated format.ChannelIdentifiers.fromLegacy()methods are added that create channel identifiers that ALWAYS serialize to the legacy vertical-bar-separated format.Note on breaking changes and compatibility
This is a breaking change, and any mod for 1.13-pre2 and below that uses OSL for networking will behave differently with OSL 0.21 vs. this update. If keeping compatibility is important, use the new
fromLegacyfactory methods to keep compatibility for communication with OSL 0.21.