suriyun-mmorpg/UnityMultiplayerARPG_UMA

Building with prefabs causes exception

vaughanb opened this issue · 3 comments

Building with any of the building part prefabs (foundation/wall/door, etc.) results in the following exception in MMO mode:

(Exception) ArgumentException: Object of type 'MultiplayerARPG.BuildingEntity' cannot be converted to type 'IPlayerCharacterData'. System.RuntimeType.CheckValue (System.Object value, System.Reflection.Binder binder, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <599589bf4ce248909b8a14cbe4a2034e>:0) System.Reflection.MonoMethod.ConvertValues (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <599589bf4ce248909b8a14cbe4a2034e>:0) System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <599589bf4ce248909b8a14cbe4a2034e>:0) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <599589bf4ce248909b8a14cbe4a2034e>:0) DevExtUtils.InvokeDevExtMethods (System.Type type, System.Object obj, System.String baseMethodName, System.Reflection.BindingFlags bindingFlags, System.Object[] args) (at C:/Game Design/mmorpgkit/MMORPGKit/Assets/UnityMultiplayerARPG/Core/DevExtension/Scripts/DevExtUtils.cs:69) UnityEngine.Debug:LogException(Exception) DevExtUtils:InvokeDevExtMethods(Type, Object, String, BindingFlags, Object[]) (at C:/Game Design/mmorpgkit/MMORPGKit/Assets/UnityMultiplayerARPG/Core/DevExtension/Scripts/DevExtUtils.cs:74) DevExtUtils:InvokeStaticDevExtMethods(Type, String, Object[]) (at C:/Game Design/mmorpgkit/MMORPGKit/Assets/UnityMultiplayerARPG/Core/DevExtension/Scripts/DevExtUtils.cs:46) BuildingSaveDataExtension:CloneTo(IBuildingSaveData, BuildingSaveData) (at C:/Game Design/mmorpgkit/MMORPGKit/Assets/UnityMultiplayerARPG/Core/Scripts/WorldData/BuildingSaveDataExtension.cs:24) MultiplayerARPG.MMO.<SaveBuildingsRoutine>d__92:MoveNext() (at C:/Game Design/mmorpgkit/MMORPGKit/Assets/UnityMultiplayerARPG/MMO/Scripts/MMOGame/Networking/Map/MapNetworkManager_DatabaseFunction.cs:98) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) MultiplayerARPG.MMO.MapNetworkManager:Update() (at C:/Game Design/mmorpgkit/MMORPGKit/Assets/UnityMultiplayerARPG/MMO/Scripts/MMOGame/Networking/Map/MapNetworkManager.cs:128)

The above was gathered from a fresh kit install with UMA and the UMA addon installed and nothing else. The error does not occur on a kit without the UMA addon.

Oh, thank you for the bug report, to fix it, you have to change codes in BuildingSaveDataExtension.cs
line 9
From

                classType = typeof(PlayerCharacterDataExtension);

To

                classType = typeof(BuildingSaveDataExtension);

Or wait next patch update, if you don't want to change project codes

Happy to help. Thanks for the info!

Fixed in 1.50