Skip to content

Instantly share code, notes, and snippets.

@electr0sheep
Last active March 7, 2023 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save electr0sheep/d290d30a7e9a0467b386c2bb4d8870a9 to your computer and use it in GitHub Desktop.
Save electr0sheep/d290d30a7e9a0467b386c2bb4d8870a9 to your computer and use it in GitHub Desktop.
[StructLayout(LayoutKind.Explicit, Size = 0x2D8)]
internal struct AdventureListResultPage
{
[FieldOffset(0x02)] public readonly ushort StartIndex;
[FieldOffset(0x00)] public readonly ushort EndIndex;
// TODO: 0x04 through 0x07 is unknown data
[FieldOffset(0x08)] private fixed byte Players[10 * 0x48];
public Span<AdventureListPlayer> PlayerSpan => new(Unsafe.AsPointer(ref Players[0]), 10);
public bool LastPage => EndIndex == 0;
}
[StructLayout(LayoutKind.Explicit, Size = 0x48)]
internal struct AdventureListPlayer
{
[FieldOffset(0x00)] public readonly ulong ContentId;
// TODO: 0x08 through 0x13 is unknown data
[FieldOffset(0x14)] public readonly ushort TimeLeftSeconds;
// TODO: 0x16 through 0x17 is unknown data
[FieldOffset(0x18)] public readonly ushort HomeWorldId;
[FieldOffset(0x1A)] public readonly ushort DutyLevel;
[FieldOffset(0x1C)] public readonly byte ClassJobId;
//TODO: [FieldOffset(0x1D)] public readonly byte UnknownData;
// I think this has always been 0b0001 everytime I've looked
[FieldOffset(0x1E)] public readonly byte ClientLanguage;
// ClientLanguage 0 = Japanese, 1 = English, 2 = German, 3 = French
[FieldOffset(0x1F)] public readonly ushort AvailableLanguages;
// AvailableLanguages are flags where 1 = Japanese, 2 = English, 4 = German, 8 = French
// So 0b1111 = every language is selected, 0b0001 = Japanese only selected
// This data could be stored in a single byte, but I'm pretty sure the preceeding
// byte has always been zeroed out every time I've looked, which leads me to believe
// this is a ushort, and not just a byte
[FieldOffset(0x21)] public fixed byte CharacterName[32];
// TODO: 0x42 through 0x47 is unknown data
public bool IsValid => ContentId != 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment