Skip to content

Commit 6e667cc

Browse files
committed
Fixed return type checks for RPC
1 parent 984229f commit 6e667cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ private void CacheAttributes()
571571
}
572572
else
573573
{
574-
if (methods[i].ReturnType != typeof(void) && methods[i].ReturnType.GetGenericTypeDefinition() != typeof(RpcResponse<>))
574+
if (methods[i].ReturnType != typeof(void) && !SerializationHelper.IsTypeSupported(methods[i].ReturnType))
575575
{
576576
if (LogHelper.CurrentLogLevel <= LogLevel.Error) LogHelper.LogWarning("Invalid return type of RPC. Has to be either void or RpcResponse<T> with a serializable type");
577577
}
@@ -608,7 +608,7 @@ private void CacheAttributes()
608608
}
609609
else
610610
{
611-
if (methods[i].ReturnType != typeof(void) && methods[i].ReturnType.GetGenericTypeDefinition() != typeof(RpcResponse<>))
611+
if (methods[i].ReturnType != typeof(void) && !SerializationHelper.IsTypeSupported(methods[i].ReturnType))
612612
{
613613
if (LogHelper.CurrentLogLevel <= LogLevel.Error) LogHelper.LogWarning("Invalid return type of RPC. Has to be either void or RpcResponse<T> with a serializable type");
614614
}

0 commit comments

Comments
 (0)