mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix: Mark weaver as failed if serializing invalid type
This commit is contained in:
parent
f310c61405
commit
03c767db6a
@ -106,7 +106,7 @@ public static MethodReference GetReadFunc(TypeReference variable, int recursionC
|
|||||||
|
|
||||||
if (newReaderFunc == null)
|
if (newReaderFunc == null)
|
||||||
{
|
{
|
||||||
Log.Error("GetReadFunc unable to generate function for:" + variable.FullName);
|
Weaver.Error("GetReadFunc unable to generate function for:" + variable.FullName);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
RegisterReadFunc(variable.FullName, newReaderFunc);
|
RegisterReadFunc(variable.FullName, newReaderFunc);
|
||||||
@ -126,7 +126,7 @@ static MethodDefinition GenerateArrayReadFunc(TypeReference variable, MethodRefe
|
|||||||
{
|
{
|
||||||
if (!variable.IsArrayType())
|
if (!variable.IsArrayType())
|
||||||
{
|
{
|
||||||
Log.Error(variable.FullName + " is an unsupported array type. Jagged and multidimensional arrays are not supported");
|
Weaver.Error(variable.FullName + " is an unsupported array type. Jagged and multidimensional arrays are not supported");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
string functionName = "_ReadArray" + variable.GetElementType().Name + "_";
|
string functionName = "_ReadArray" + variable.GetElementType().Name + "_";
|
||||||
@ -251,7 +251,7 @@ static MethodDefinition GenerateStructReadFunction(TypeReference variable, int r
|
|||||||
MethodDefinition ctor = Resolvers.ResolveDefaultPublicCtor(variable);
|
MethodDefinition ctor = Resolvers.ResolveDefaultPublicCtor(variable);
|
||||||
if (ctor == null)
|
if (ctor == null)
|
||||||
{
|
{
|
||||||
Log.Error("The class " + variable.Name + " has no default constructor or it's private, aborting.");
|
Weaver.Error("The class " + variable.Name + " has no default constructor or it's private, aborting.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user