CompareRealms
function · glue · primitive
- Address
0x46e790· 519 bytes, up to0x46e996- Signature
int32_t __cdecl (const uint32_t *a, const uint32_t *b)- Meaning
- Compares two holder realms by the four sort records, the first key that does not tie deciding
- 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 0
None by a direct call or jump.
Callees 3
- GetRealmLoadBand glue
- GetRealmInfoByIndex net
- SStrCmpI storm
Calls and jumps by a bare address, from tables/calls.tsv.