benilla-re systems structs docs

s_realmCompareJumpTable

global · glue

Address
0x46e998 · 16 bytes, up to 0x46e9a7
Type
void *[4]
Meaning
Holds the realm comparator's case addresses for sort keys 0 to 3
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.