Repository navigation
fix(libsidecar-cpp): pass the real realm ID on battleground left/status-changed events - #67
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a matchmaking cleanup bug in battlegrounds by ensuring battleground leave and status-change events carry the correct realmID, so the matchmaking server can correctly index and purge battlegrounds by (instanceID, realmID).
Changes:
- Add a fallback to the sidecar’s realm ID when
TC9PlayerLeftBattlegroundreceivesrealmID == 0. - Update
TC9BattlegroundStatusChangedto send a non-placeholder realm ID instead of0.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Local players carry realm 0 in their GUID; the matchmaking looks the | ||
| // battleground up by (instanceID, realmID), so 0 would never match. | ||
| if (realmID == 0) { | ||
| realmID = g_state.realm_id; | ||
| } |
| // Note: We'd need to pass realm ID to this function or store it globally | ||
| // For now, using 0 as placeholder - this should be fixed in the API | ||
| g_state.grpc_clients->BattlegroundStatusChanged(0, instanceID, false, status); | ||
| g_state.grpc_clients->BattlegroundStatusChanged(g_state.realm_id, instanceID, false, status); |
…us-changed events TC9BattlegroundStatusChanged hardcoded realm 0 (leftover placeholder from the C++ port) and the leave path used GetGUID().GetRealmID() which is 0 for local players. The matchmaking server indexes battlegrounds by (instanceID, realmID), so realm 0 never matched: ended battlegrounds stayed active forever and every participant kept a stale link, making any later enqueue fail with 'already in queue' until the service restarted. Fall back to the sidecar's own realm ID when the player GUID carries none, and pass the real realm ID on status changes.
|
Good catch — the state field got lost when I extracted this from my integration branch. Amended: |
8a7171e to
2c3094f
Compare
| config.matchmaking_address() | ||
| ); | ||
|
|
||
| g_state.realm_id = realmID; |
There was a problem hiding this comment.
Maybe lets do that only in cases: if (isCrossRealm == 0)
There was a problem hiding this comment.
Done — the realm ID is now only pinned when isCrossRealm == 0, so cross-realm setups keep the untouched GUID realm.
…mple-map-layering * 'master' of github.com:walkline/ToCloud9: fix(authserver): store the locale reported by the game client (walkline#83) fix(matchmakingserver): make the 'already in queue' check atomic with the enqueue (walkline#71) fix(matchmakingserver): purge invited players' links when a battleground ends (walkline#70) fix(matchmakingserver): only backfill running battlegrounds up to team balance (walkline#69) fix(libsidecar-cpp): pass the real realm ID on battleground left/status-changed events (walkline#67) Fix big int alignment that causes failed auth in ~1% of cases. Fix some minor issues related to recent changes in AC and libsidecar. feat(gateway): surface battleground enqueue errors to the player (walkline#68) fix(gateway): keep party frames alive for members with partial stats (walkline#61) fix(guild): push permissions to the member after a promote/demote (walkline#60) fix(guild): surface invite business errors to the client (walkline#59) fix(group,guild): mark members of a dead gateway as offline (walkline#65) fix(libsidecar-cpp): apply only own server's diff on maps reassignment (walkline#66) feat(charserver): resolve guild names in who query results (walkline#53) fix(gateway): manage offline guild members (walkline#54) fix(group): surface invite business errors as proper party results (walkline#52) guildserver: fix nil pointer panic on officer note updates (walkline#51) fix(libsidecar-cpp): carry loot threshold and group state in group events (walkline#50) # Conflicts: # apps/groupserver/server/group.go # gen/group/pb/group.pb.go
While testing battlegrounds on my cluster I noticed that once a match ended,
every participant was stuck with "already in queue" on any later enqueue until
I restarted the matchmaking server.
Dumping the matchmaking events showed
PlayerJoinedBattlegroundcarryingrealmID: 1whilePlayerLeftBattlegroundandBattlegroundStatusChangedcarried none. Two causes in libsidecar-cpp:
TC9BattlegroundStatusChangedhardcoded realm 0 (leftover placeholder from the C++ port), and the leave path
passes
GetGUID().GetRealmID()which is 0 for local players. The matchmakingserver indexes battlegrounds by
(instanceID, realmID), so those lookupsmissed silently: ended battlegrounds stayed active forever and every
participant kept a stale link.
Fix: fall back to the sidecar's own realm ID when the player GUID carries
none, and pass the real realm ID on status changes. Running on my 4-worldserver
cluster: ended battlegrounds are purged and re-queue works again.