public static string GetName(BinaryReader br) { var s = new AlbionReader(br, br.BaseStream.Length); ushort nameLength = s.UInt16("NameLength", 0); if (nameLength > 1024) { return("Invalid"); } s.UInt16(nameof(Unk0), 0); return(s.FixedLengthString(nameof(Name), null, nameLength)); }
public static string GetName(BinaryReader br) { if (br == null) { throw new ArgumentNullException(nameof(br)); } using var s = new AlbionReader(br, br.BaseStream.Length); ushort nameLength = s.UInt16("NameLength", 0); if (nameLength > 1024) { return("Invalid"); } s.UInt16(nameof(Unk0), 0); return(s.FixedLengthString(nameof(Name), null, nameLength)); }