Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Is ZeroFomatter can be used now on other platforms, than Windows, on the development machine? #130

Open
Syjgin opened this issue Nov 18, 2021 · 0 comments

Comments

@Syjgin
Copy link

Syjgin commented Nov 18, 2021

I'm trying to migrate from Unity binary serializer on the linux host, as it's described on the quick start guide:
I replaced all [Serializable] annotations with [ZeroFormattable], and all fields with virtual properties.
But after all, when I tried to serialize class to file, there are following error:

InvalidOperationException: Type is not supported, please register SaveFilesList
ZeroFormatter.Formatters.ErrorFormatter2[TTypeResolver,T].Serialize (System.Byte[]& bytes, System.Int32 offset, T value) (at <1c2cf38bb8ea407ea801af930792b503>:0) ZeroFormatter.ZeroFormatterSerializer+CustomSerializer1[TTypeResolver].Serialize[T] (System.Byte[]& buffer, System.Int32 offset, T obj) (at <1c2cf38bb8ea407ea801af930792b503>:0)
ZeroFormatter.ZeroFormatterSerializer+CustomSerializer1[TTypeResolver].Serialize[T] (T obj) (at <1c2cf38bb8ea407ea801af930792b503>:0) ZeroFormatter.ZeroFormatterSerializer+CustomSerializer1[TTypeResolver].Serialize[T] (System.IO.Stream stream, T obj) (at <1c2cf38bb8ea407ea801af930792b503>:0)
ZeroFormatter.ZeroFormatterSerializer.Serialize[T] (System.IO.Stream stream, T obj) (at <1c2cf38bb8ea407ea801af930792b503>:0)
Data.LoadSaveSystem.WriteObjectToBinaryFormatter[T] (System.String path, T object2Write) (at Assets/Scripts/Data/LoadSaveSystem.cs:329)
UnityEngine.Debug:LogException(Exception)
DebugUtils.DebugLogger:LogException(Exception) (at Assets/Scripts/DebugUtils/DebugLogger.cs:29)
Data.LoadSaveSystem:WriteObjectToBinaryFormatter(String, SaveFilesList) (at Assets/Scripts/Data/LoadSaveSystem.cs:333)
Data.LoadSaveSystem:UpdateCurrentSavesIndex(List`1) (at Assets/Scripts/Data/LoadSaveSystem.cs:346)
Data.d__3:MoveNext() (at Assets/Scripts/Data/LoadSaveSystem.cs:77)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)

class itself is described as follows:
[ZeroFormattable] public class SaveFilesList { [Index(0)] public IList<SaveFileDescription> Saves; }

Child object:

[ZeroFormattable] public class SaveFileDescription { [Index(0)] public virtual string Name { get; set; } [Index(1)] public virtual long Date { get; set; } [Index(2)] public virtual string SaveFile { get; set; } [Index(3)] public virtual bool IsProtected { get; set; } }

For register this class in the zeroFormatter, I have to run zfc.exe, which can be run only on the Windows, for now? Or there are some misconfiguration?
In the first case, it's better to describe more cleanly in the guide, that this tool can be used on the Windows host only

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant