DBRow Definition¶
Rows of the cache’s newer “database” tables - the format several UI panels (the prayer, skill
guide and other section content) migrated to. Each row belongs to a table id and holds a sparse
set of columns; a column can itself hold more than one typed value per row, and more than one
row of values (FieldCount).
This decoder is generic: it does not know what any table’s columns mean, only how to split them out. Interpreting a specific table’s columns - which one is an icon, which is display text - is up to the caller, worked out by inspecting real rows (see TItemLoader for the equivalent on items).
DBRowColumn.FieldCount¶
function TDBRowColumn.FieldCount(): Integer;
How many rows of typed values this column holds. Most columns hold exactly one.
DBRowColumn.Value¶
function TDBRowColumn.Value(field, typeIndex: Integer): TDBRowValue;
The value of typeIndex within row field of this column.
DBRowDefinition.HasColumn¶
function TDBRowDefinition.HasColumn(id: Integer): Boolean;
Whether column id was set on this row at all.
DBRowDefinition.Create¶
function TDBRowDefinition.Create(id: Integer; const data: TByteArray): TDBRowDefinition; static;
Decodes a database row: the table it belongs to and every column it sets.
A column’s own bytes start with its types - one cache “script var type” id per value a field of this column holds - followed by however many fields it has, each one holding that many typed values back to back. A string type reads as a NUL terminated string; anything else reads as a plain 32-bit int, regardless of what the type id actually means.
Example:
archive := CacheReader.Indices[ECacheIndex.CONFIGS].ReferenceTable.Archives.Value[EConfigArchive.DBROW];
row := TDBRowDefinition.Create(12230, archive.Files.Value[12230].Data);