private void init() { if (initialized) { return; } Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"Starting {nameof(PluginLoader)} v{Versions.PluginLoaderVersion}"); Console.ResetColor(); Serialization.GlobalSerializer.AddTypes(NetSerializable.GetTypesWithAttribute(Assembly.GetExecutingAssembly())); initialized = true; }
private void initialize() { if (initialized) { return; } initialized = true; Log.Info($"Starting {nameof(PluginLoader)} v{Versions.PLVersion}"); Serialization.GlobalSerializer.AddTypes(NetSerializable.GetTypesWithAttribute(Assembly.GetExecutingAssembly())); resetGameStates(); }
public static void InitializeSerializer() { var types = NetSerializable.GetTypesWithAttribute(System.Reflection.Assembly.GetExecutingAssembly()).ToList(); if (System.Reflection.Assembly.GetCallingAssembly() != System.Reflection.Assembly.GetExecutingAssembly()) { types.AddRange(NetSerializable.GetTypesWithAttribute(System.Reflection.Assembly.GetCallingAssembly()).ToList()); } var serializerSettings = new Settings(); //serializerSettings.CustomTypeSerializers = new ITypeSerializer[] { new SortedDictionarySerializer() }; serializerSettings.SupportIDeserializationCallback = true; serializerSettings.SupportSerializationCallbacks = true; Serialization.s_globalSerializer = new NetSerializer.Serializer(types.ToArray(), serializerSettings); }