SortRealmCategories
function · glue · orchestration
- Address
0x46e750· 59 bytes, up to0x46e78a- 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):
| key | ascending result |
|---|---|
| 0 characters | both counts 0: tie; −1 when a has more than b; +1 otherwise, equal counts included |
| 1 load | bands: −1 when a's is lower, +1 higher, tie when equal |
| 2 name | SStrCmpI(a.name, b.name) |
| 3 mode | rp 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
- RebuildRealmList glue
- SetRealmSortKey glue
Callees 1
- _qsort crt
Calls and jumps by a bare address, from tables/calls.tsv.