fix!: MTT-1425 Resolving overflow issue with UTP Adapter#1300
Merged
JesseOlmer merged 9 commits intodevelopfrom Oct 15, 2021
Merged
fix!: MTT-1425 Resolving overflow issue with UTP Adapter#1300JesseOlmer merged 9 commits intodevelopfrom
JesseOlmer merged 9 commits intodevelopfrom
Conversation
# Conflicts: # com.unity.netcode.gameobjects/Components/NetworkTransform.cs
… not serializable.
andrews-unity
commented
Oct 14, 2021
| NetworkEndPoint.Parse(d.Address, (ushort)d.Port); | ||
|
|
||
| public static implicit operator ConnectionAddressData(NetworkEndPoint d) => | ||
| new ConnectionAddressData() { Address = d.Address.Split(':')[0], Port = d.Port }; |
Contributor
Author
There was a problem hiding this comment.
I do not like this but its the way NetworkEndpoint encodes the address. If there is no ':' then it will just return nothing or whatever is before it.
…/com.unity.netcode.gameobjects into fix/utp-adapter-fixes
mattwalsh-unity
approved these changes
Oct 15, 2021
0xFA11
reviewed
Oct 15, 2021
| Debug.Assert(sizeof(ulong) == UnsafeUtility.SizeOf<NetworkConnection>(), | ||
| "Netcode connection id size does not match UTP connection id size"); | ||
| Debug.Assert(m_MessageBufferSize > 5, "Message buffer size must be greater than 5"); | ||
| Debug.Assert(m_MaximumPacketSize > 5, "Message buffer size must be greater than 5"); |
Contributor
There was a problem hiding this comment.
where this magical 5 is coming from and should it be a k_ constant value?
0xFA11
reviewed
Oct 15, 2021
| private void Awake() | ||
| { | ||
| var maxCap = UnityTransport.MaximumMessageLength + 128; | ||
| var maxCap = UnityTransport.InitialBatchQueueSize + 128; |
Contributor
There was a problem hiding this comment.
another magic number here too...
Cosmin-B
approved these changes
Oct 15, 2021
Contributor
Cosmin-B
left a comment
There was a problem hiding this comment.
It also looks all good to me besides the little magic numbers.
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.
So this is doing some cleanup and fixing several issues the UTP Adapter was having with regards to queued packets, as well as fragmentation. Also cleaned up the public properties to make more sense since what was there before just lead to a lot of confusion. Also we report back a string for an error code now which should make it easier to understand what is going on.
MTT-1425
Changelog
com.unity.adapter.utp
SetConnectionDatafunction that takes in a NetworkEndpointm_MessageBufferas it was no longer needed and we just do a temp allocation and copy the packet when we call InvokeOnTransportEventTesting and Documentation