feat(net): #13 read hotbar spells (SPELL_LISTS8 + legacy path)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f7a5eea8e8
commit
8cbb991d95
2 changed files with 83 additions and 0 deletions
|
|
@ -355,6 +355,29 @@ public static class PlayerDescriptionParser
|
|||
shortcuts.Add(new ShortcutEntry(idx, guid, spellId, layer));
|
||||
}
|
||||
}
|
||||
|
||||
if (optionFlags.HasFlag(CharacterOptionDataFlag.SpellLists8))
|
||||
{
|
||||
for (int b = 0; b < 8; b++)
|
||||
{
|
||||
uint count = ReadU32(payload, ref pos);
|
||||
if (count > 10_000) throw new FormatException("unreasonable hotbar count");
|
||||
var list = new List<uint>((int)count);
|
||||
for (uint i = 0; i < count; i++)
|
||||
list.Add(ReadU32(payload, ref pos));
|
||||
hotbarSpells.Add(list);
|
||||
}
|
||||
}
|
||||
else if (payload.Length - pos >= 4)
|
||||
{
|
||||
// Legacy single-list fallback (holtburger events.rs:544-556).
|
||||
uint count = ReadU32(payload, ref pos);
|
||||
if (count > 10_000) throw new FormatException("unreasonable hotbar count");
|
||||
var list = new List<uint>((int)count);
|
||||
for (uint i = 0; i < count; i++)
|
||||
list.Add(ReadU32(payload, ref pos));
|
||||
hotbarSpells.Add(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (FormatException ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue