Skip to content

fix: increases maximum message size to int.MaxValue #1384

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

Merged
merged 8 commits into from
Nov 16, 2021

Conversation

ShadauxCat
Copy link
Collaborator

MTT-1646

Changelog

com.unity.netcode.gameobjects

  • Fixed: The SDK no longer limits message size to 64k. (The transport may still impose its own limits, but the SDK no longer does.)

Testing and Documentation

  • No tests have been added.
  • No documentation changes or additions were necessary.

- Fixed incorrect reporting of message size for Named and Unnamed message, not taking packing into account
- Fixed OnBeforeMessageRecieved() and OnAfterMessageReceived() being called twice for messages that are deferred when received
@@ -11,11 +11,12 @@ internal struct MessageHeader
/// unchanged - if new messages are added or messages are removed, MessageType assignments may be
/// calculated differently.
/// </summary>
public byte MessageType;
public uint MessageType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a required change for this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required, no, but I thought it made sense. Making the other one larger meant it made sense to start packing the header. If the header's packed, then there's no reason to limit the number of messages to the byte range. It still ends up serialized as a byte due to packing.

private object m_Owner;
private IMessageSender m_MessageSender;
private bool m_Disposed;

internal Type[] MessageTypes => m_ReverseTypeMap;
internal MessageHandler[] MessageHandlers => m_MessageHandlers;
internal int MessageHandlerCount => m_HighMessageType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above not clear why these changes are needed.

};
var type = m_ReverseTypeMap[header.MessageType];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the moving of this code related to the original fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no... one iteration of the fix did require this code to be moved... when I backtracked on that direction I realized the code still needed to be moved because as it is, it's dispatching profiling/metrics events twice for some messages. I can move it into a separate PR...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes lets move that into a different PR

# Conflicts:
#	com.unity.netcode.gameobjects/Runtime/Messaging/MessagingSystem.cs
@andrews-unity andrews-unity enabled auto-merge (squash) November 16, 2021 18:26
@andrews-unity andrews-unity merged commit a39a445 into develop Nov 16, 2021
@andrews-unity andrews-unity deleted the fix/increase_max_message_size branch November 16, 2021 19:01
andrews-unity pushed a commit that referenced this pull request Nov 24, 2021
* fix: increases maximum message size to int.MaxValue

* Changelog entry

* - Fixed tools tests
- Fixed incorrect reporting of message size for Named and Unnamed message, not taking packing into account
- Fixed OnBeforeMessageRecieved() and OnAfterMessageReceived() being called twice for messages that are deferred when received

* Moved changelog entry to Unreleased

* Reverted unrelated change.

* Standards...
andrews-unity added a commit that referenced this pull request Nov 25, 2021
* fix: increases maximum message size to int.MaxValue

* Changelog entry

* - Fixed tools tests
- Fixed incorrect reporting of message size for Named and Unnamed message, not taking packing into account
- Fixed OnBeforeMessageRecieved() and OnAfterMessageReceived() being called twice for messages that are deferred when received

* Moved changelog entry to Unreleased

* Reverted unrelated change.

* Standards...

Co-authored-by: Jaedyn Draper <284434+ShadauxCat@users.noreply.github.com>
Co-authored-by: Unity Netcode CI <74025435+netcode-ci-service@users.noreply.github.com>
mollstam pushed a commit to Keepsake-Games/com.unity.netcode.gameobjects that referenced this pull request Feb 13, 2023
…es#1384)

* fix: increases maximum message size to int.MaxValue

* Changelog entry

* - Fixed tools tests
- Fixed incorrect reporting of message size for Named and Unnamed message, not taking packing into account
- Fixed OnBeforeMessageRecieved() and OnAfterMessageReceived() being called twice for messages that are deferred when received

* Moved changelog entry to Unreleased

* Reverted unrelated change.

* Standards...
mollstam pushed a commit to Keepsake-Games/com.unity.netcode.gameobjects that referenced this pull request Feb 13, 2023
…es#1384) (Unity-Technologies#1462)

* fix: increases maximum message size to int.MaxValue

* Changelog entry

* - Fixed tools tests
- Fixed incorrect reporting of message size for Named and Unnamed message, not taking packing into account
- Fixed OnBeforeMessageRecieved() and OnAfterMessageReceived() being called twice for messages that are deferred when received

* Moved changelog entry to Unreleased

* Reverted unrelated change.

* Standards...

Co-authored-by: Jaedyn Draper <284434+ShadauxCat@users.noreply.github.com>
Co-authored-by: Unity Netcode CI <74025435+netcode-ci-service@users.noreply.github.com>
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