private void SaveTypeDatabase(string path, List <Type> types) { var bfw = new BinaryFileWriter(path, false); bfw.Write(types.Count); foreach (var type in types) { bfw.Write(type.FullName); } bfw.Flush(); bfw.Close(); }
public static bool SubWrite(GenericWriter writer, Action <GenericWriter> serializer) { if (writer == null) { return(false); } using (MemoryStream s = new MemoryStream()) { BinaryFileWriter w = new BinaryFileWriter(s, true); try { serializer(w); } catch (Exception e) { Console.WriteLine("Quest Save Failure: {0}", Utility.FormatDelegate(serializer)); Server.Diagnostics.ExceptionLogging.LogException(e); writer.Write(0L); return(false); } finally { w.Flush(); } writer.Write(s.Length); s.Position = 0; while (s.Position < s.Length) { writer.Write((byte)s.ReadByte()); } } return(true); }
private void SaveTypeDatabase( string path, List<Type> types ) { BinaryFileWriter bfw = new BinaryFileWriter( path, false ); bfw.Write( types.Count ); foreach ( Type type in types ) { bfw.Write( type.FullName ); } bfw.Flush(); bfw.Close(); }