Skip to content

chore: remove unitytransport debug asserts [up-port] #3226

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,13 @@ public override void DisconnectLocalClient()
/// <param name="clientId">The client to disconnect</param>
public override void DisconnectRemoteClient(ulong clientId)
{
Debug.Assert(m_State == State.Listening, "DisconnectRemoteClient should be called on a listening server");
#if DEBUG
if (m_State != State.Listening)
{
Debug.LogWarning($"{nameof(DisconnectRemoteClient)} should only be called on a listening server!");
return;
}
#endif

if (m_State == State.Listening)
{
Expand Down Expand Up @@ -1292,7 +1298,13 @@ public NetworkEndpoint GetEndpoint(ulong clientId)
/// <param name="networkManager">The NetworkManager that initialized and owns the transport</param>
public override void Initialize(NetworkManager networkManager = null)
{
Debug.Assert(sizeof(ulong) == UnsafeUtility.SizeOf<NetworkConnection>(), "Netcode connection id size does not match UTP connection id size");
#if DEBUG
if (sizeof(ulong) != UnsafeUtility.SizeOf<NetworkConnection>())
{
Debug.LogWarning($"Netcode connection id size {sizeof(ulong)} does not match UTP connection id size {UnsafeUtility.SizeOf<NetworkConnection>()}!");
return;
}
#endif

m_NetworkManager = networkManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ public IEnumerator DoesNotActAfterShutdown([Values] AfterShutdownAction afterShu
{
m_Server.DisconnectRemoteClient(m_Client1.ServerClientId);

LogAssert.Expect(LogType.Assert, "DisconnectRemoteClient should be called on a listening server");
LogAssert.Expect(LogType.Warning, $"{nameof(UnityTransport.DisconnectRemoteClient)} should only be called on a listening server!");
}
else if (afterShutdownAction == AfterShutdownAction.DisconnectLocalClient)
{
Expand Down