using System; using System.Runtime.InteropServices; using Dalamud.Game.Text.SeStringHandling; using Dalamud.Memory; namespace XivCommon.Functions.FriendList { /// /// An entry in a player's friend list. /// [StructLayout(LayoutKind.Explicit, Size = Size)] public unsafe struct FriendListEntry { internal const int Size = 104; /// /// The content ID of the friend. /// [FieldOffset(0x00)] public readonly ulong ContentId; /// /// The current world of the friend. /// [FieldOffset(0x1E)] public readonly ushort CurrentWorld; /// /// The home world of the friend. /// [FieldOffset(0x20)] public readonly ushort HomeWorld; /// /// The job the friend is currently on. /// [FieldOffset(0x29)] public readonly byte Job; /// /// The friend's raw SeString name. See . /// [FieldOffset(0x2A)] public fixed byte RawName[32]; /// /// The friend's raw SeString free company tag. See . /// [FieldOffset(0x4A)] public fixed byte RawFreeCompany[5]; /// /// The friend's name. /// public SeString Name { get { fixed (byte* ptr = this.RawName) { return MemoryHelper.ReadSeStringNullTerminated((IntPtr) ptr); } } } /// /// The friend's free company tag. /// public SeString FreeCompany { get { fixed (byte* ptr = this.RawFreeCompany) { return MemoryHelper.ReadSeStringNullTerminated((IntPtr) ptr); } } } } }