benilla-re systems structs docs

SortRealmCategories

function · glue · orchestration

Address
0x46e750 · 59 bytes, up to 0x46e78a
Signature
void __cdecl (void)
Meaning
Sorts each category's holder indices with qsort and the realm comparator
Confidence
verified, proof one
Finding
glue/realms#the-realm-comparator

Finding: The realm comparator in glue: the realm list

0x46e750 sorts each category's index array with the C runtime's qsort (0x73f727) and the comparator 0x46e790. That resolves both indices (a null either side returns 0) and walks the four records in order; the first key that does not tie returns, negated when the record's descending flag is set, and four ties return 0. Keys (jump table 0x46e998; a key above 3 is skipped):

keyascending result
0 charactersboth counts 0: tie; −1 when a has more than b; +1 otherwise, equal counts included
1 loadbands: −1 when a's is lower, +1 higher, tie when equal
2 nameSStrCmpI(a.name, b.name)
3 moderp first (non-RP before RP), then pvp (non-PvP first): Normal, PvP, RP, RP-PvP

Mode reads each realm's pvp and rp from the last Cfg_Configs row of its type; a type with no row is Normal. Key 0 is not antisymmetric: two realms with the same nonzero count each sort after the other, and the name compare inside it is discarded.

The derivation is in the doc.

Callers 2

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.