Skip to content
This repository was 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

@Syjgin

Description

@Syjgin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions