diff --git a/MLAPI/Data/FieldType.cs b/MLAPI/Data/FieldType.cs index ef8c102..3c761e3 100644 --- a/MLAPI/Data/FieldType.cs +++ b/MLAPI/Data/FieldType.cs @@ -378,8 +378,8 @@ namespace MLAPI.Data object[] returnVal = new object[paramCount]; for (int i = 0; i < paramCount; i++) { - //FieldType fieldType = (FieldType)reader.ReadBits(5); - FieldType fieldType = (FieldType)reader.ReadByte(); + FieldType fieldType = (FieldType)reader.ReadBits(5); + switch (fieldType) { case FieldType.Bool: diff --git a/MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs b/MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs index f640a82..87cdc1c 100644 --- a/MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs +++ b/MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs @@ -174,28 +174,6 @@ namespace MLAPI.MonoBehaviours.Core return; } - /* This would not allow for cross projects. - MethodInfo method = null; - if (cachedMethods.ContainsKey(methodName)) - method = cachedMethods[methodName]; - else - method = GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.NonPublic); - - if (method.GetParameters().Length != methodParams.Length) - { - Debug.LogWarning("MLAPI: The parameter amounts are not matching."); - return; - } - - for (int i = 0; i < method.GetParameters().Length; i++) - { - if (method.GetParameters()[i].GetType() != methodParams[i].GetType()) - { - Debug.LogWarning("MLAPI: The " + (i + 1) + "th parameter has the wrong type"); - return; - } - } - */ ulong hash = Data.Cache.GetMessageAttributeHash(methodName); using (BitWriter writer = new BitWriter()) { @@ -210,7 +188,6 @@ namespace MLAPI.MonoBehaviours.Core FieldTypeHelper.WriteFieldType(writer, methodParams[i], fieldType); } - //SendToServerTarget("MLAPI_COMMAND", "MLAPI_INTERNAL", writer.Finalize()); InternalMessageHandler.Send(NetId.ServerNetId.GetClientId(), "MLAPI_COMMAND", "MLAPI_INTERNAL", writer.Finalize()); } }