You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cases where the specific transport can be used to guide the user to better support, we pass this information to the error log.
If the version is Unity Transport Protocol (UTP) we also pass the specific transport protocol to determine if relay is being used
Co-authored-by: Kitty Draper <[email protected]>
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Runtime/Messaging/NetworkManagerHooks.cs
+32-5Lines changed: 32 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
usingSystem;
2
+
usingUnity.Netcode.Transports.UTP;
2
3
3
4
namespaceUnity.Netcode
4
5
{
@@ -56,7 +57,8 @@ public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReade
56
57
{
57
58
if(NetworkLog.CurrentLogLevel<=LogLevel.Normal)
58
59
{
59
-
NetworkLog.LogError($"A {nameof(ConnectionApprovedMessage)} was received from a client on the server side. This should not happen. Please report this to the Netcode for GameObjects team at https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues and include the following data: Message Size: {messageContent.Length}. Message Content: {NetworkMessageManager.ByteArrayToString(messageContent.ToArray(),0,messageContent.Length)}");
NetworkLog.LogError($"A {nameof(ConnectionApprovedMessage)} was received from a client on the server side. {transportErrorMsg}");
60
62
}
61
63
62
64
returnfalse;
@@ -66,7 +68,7 @@ public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReade
66
68
{
67
69
if(NetworkLog.CurrentLogLevel<=LogLevel.Normal)
68
70
{
69
-
NetworkLog.LogWarning($"Message received from {nameof(senderId)}={senderId} before it has been accepted");
71
+
NetworkLog.LogWarning($"Message received from {nameof(senderId)}={senderId} before it has been accepted.");
70
72
}
71
73
72
74
returnfalse;
@@ -76,7 +78,8 @@ public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReade
76
78
{
77
79
if(NetworkLog.CurrentLogLevel<=LogLevel.Normal)
78
80
{
79
-
NetworkLog.LogError($"A {nameof(ConnectionRequestMessage)} was received from a client when the connection has already been established. This should not happen. Please report this to the Netcode for GameObjects team at https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues and include the following data: Message Size: {messageContent.Length}. Message Content: {NetworkMessageManager.ByteArrayToString(messageContent.ToArray(),0,messageContent.Length)}");
NetworkLog.LogError($"A {nameof(ConnectionRequestMessage)} was received from a client when the connection has already been established. {transportErrorMsg}");
80
83
}
81
84
82
85
returnfalse;
@@ -88,7 +91,8 @@ public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReade
88
91
{
89
92
if(NetworkLog.CurrentLogLevel<=LogLevel.Normal)
90
93
{
91
-
NetworkLog.LogError($"A {nameof(ConnectionRequestMessage)} was received from the server on the client side. This should not happen. Please report this to the Netcode for GameObjects team at https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues and include the following data: Message Size: {messageContent.Length}. Message Content: {NetworkMessageManager.ByteArrayToString(messageContent.ToArray(),0,messageContent.Length)}");
NetworkLog.LogError($"A {nameof(ConnectionRequestMessage)} was received from the server on the client side. {transportErrorMsg}");
92
96
}
93
97
94
98
returnfalse;
@@ -98,7 +102,8 @@ public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReade
98
102
{
99
103
if(NetworkLog.CurrentLogLevel<=LogLevel.Normal)
100
104
{
101
-
NetworkLog.LogError($"A {nameof(ConnectionApprovedMessage)} was received from the server when the connection has already been established. This should not happen. Please report this to the Netcode for GameObjects team at https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues and include the following data: Message Size: {messageContent.Length}. Message Content: {NetworkMessageManager.ByteArrayToString(messageContent.ToArray(),0,messageContent.Length)}");
NetworkLog.LogError($"A {nameof(ConnectionApprovedMessage)} was received from the server when the connection has already been established. {transportErrorMsg}");
102
107
}
103
108
104
109
returnfalse;
@@ -108,6 +113,28 @@ public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReade
return$"{transportVersion}. This should not happen. Please report this to the Netcode for GameObjects team at https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues and include the following data: Message Size: {messageContent.Length}. Message Content: {NetworkMessageManager.ByteArrayToString(messageContent.ToArray(),0,messageContent.Length)}";
LogAssert.Expect(LogType.Error,newRegex($"A {nameof(ConnectionApprovedMessage)} was received from the server when the connection has already been established\\. This should not happen\\."));
99
+
LogAssert.Expect(LogType.Error,newRegex($"A {nameof(ConnectionApprovedMessage)} was received from the server when the connection has already been established\\. NetworkTransport: Unity.Netcode.Transports.UTP.UnityTransport UnityTransportProtocol: UnityTransport. This should not happen\\."));
LogAssert.Expect(LogType.Error,newRegex($"A {nameof(ConnectionRequestMessage)} was received from the server on the client side\\. This should not happen\\."));
121
+
LogAssert.Expect(LogType.Error,newRegex($"A {nameof(ConnectionRequestMessage)} was received from the server on the client side\\. NetworkTransport: Unity.Netcode.Transports.UTP.UnityTransport UnityTransportProtocol: UnityTransport. This should not happen\\."));
LogAssert.Expect(LogType.Error,newRegex($"A {nameof(ConnectionRequestMessage)} was received from a client when the connection has already been established\\. This should not happen\\."));
143
+
LogAssert.Expect(LogType.Error,newRegex($"A {nameof(ConnectionRequestMessage)} was received from a client when the connection has already been established\\. NetworkTransport: Unity.Netcode.Transports.UTP.UnityTransport UnityTransportProtocol: UnityTransport. This should not happen\\."));
LogAssert.Expect(LogType.Error,newRegex($"A {nameof(ConnectionApprovedMessage)} was received from a client on the server side\\. This should not happen\\."));
168
+
LogAssert.Expect(LogType.Error,newRegex($"A {nameof(ConnectionApprovedMessage)} was received from a client on the server side\\. NetworkTransport: Unity.Netcode.Transports.UTP.UnityTransport UnityTransportProtocol: UnityTransport. This should not happen\\."));
0 commit comments