Skip to content

Add optional payload length field to extras:register & general refactors - #404

Open
OptimisticDeving wants to merge 2 commits into
kaboomserver:masterfrom
OptimisticDeving:messaging-limitations
Open

Add optional payload length field to extras:register & general refactors#404
OptimisticDeving wants to merge 2 commits into
kaboomserver:masterfrom
OptimisticDeving:messaging-limitations

Conversation

@OptimisticDeving

Copy link
Copy Markdown
Contributor

I implemented an optional short in the extras:register payload denoting the maximum length payload a subscriber wants to receive.

As the field is optional (and its presence is inferred from the length of the extras:register payload after the channel name is decoded), this PR will be backwards compatible with outdated client implementations.

Additionally, as there are no checks to see if the buffer has been fully consumed, up to date client implementations will be backwards compatible with outdated server implementations.

Also, since every function in the messaging module is called on the server thread, I've removed all of the synchronization and the WeakHashMap has been replaced with an IdentityHashMap (the identity of Player does not seem to change when they are re-created on dimension change, so there should be no weirdness there.) which should hopefully increase performance a little - we don't need a WeakHashMap since we explicitly remove the player in the quit event anyways.

@OptimisticDeving
OptimisticDeving marked this pull request as ready for review August 13, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants