File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
MLAPI/NetworkingManagerComponents Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 44using System . Linq ;
55using System . Reflection ;
66using System . Text ;
7+ using UnityEngine ;
78
89namespace MLAPI . NetworkingManagerComponents
910{
@@ -74,6 +75,8 @@ public static byte[] Serialize<T>(T instance)
7475 outputSize += Encoding . UTF8 . GetByteCount ( ( string ) sortedFields [ i ] . GetValue ( instance ) ) + 2 ;
7576 else if ( sortedFields [ i ] . FieldType == typeof ( byte [ ] ) )
7677 outputSize += ( ( byte [ ] ) sortedFields [ i ] . GetValue ( instance ) ) . Length + 2 ; //Two bytes to specify the size
78+ else
79+ Debug . LogWarning ( "MLAPI: The type \" " + sortedFields [ i ] . FieldType . Name + "\" is not supported by the Binary Serializer. It will be ignored" ) ;
7780 }
7881
7982 //Write data
@@ -187,6 +190,8 @@ public static byte[] Serialize<T>(T instance)
187190 ushort size = reader . ReadUInt16 ( ) ;
188191 sortedFields [ i ] . SetValue ( instance , reader . ReadBytes ( size ) ) ;
189192 }
193+ else
194+ Debug . LogWarning ( "MLAPI: The type \" " + sortedFields [ i ] . FieldType . Name + "\" is not supported by the Binary Serializer. It will be ignored" ) ;
190195 }
191196 }
192197 }
You can’t perform that action at this time.
0 commit comments