feat(world): activity lobbies join, ready and leave through the chat server

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-30 04:12:00 -05:00
parent 2ae086d933
commit 289a1acfdf
4 changed files with 99 additions and 359 deletions

View File

@@ -143,18 +143,17 @@ namespace GameMessages {
auto* comp = scriptedAct->GetComponent<ScriptedActivityComponent>();
if (!comp) continue;
if (comp->GetActivityID() == value) {
comp->PlayerJoin(&entity);
comp->PlayerJoin(&entity, playerChoices);
}
}
}
} else if (type == 1) { // ready/unready
for (Entity* scriptedAct : scriptedActs) {
auto* comp = scriptedAct->GetComponent<ScriptedActivityComponent>();
if (!comp) continue;
if (comp->PlayerIsInQueue(&entity)) {
comp->PlayerReady(&entity, value);
}
}
// Answered like a join (live), then the chat server tells the lobby (docs/Matchmaking.md)
MatchResponse response;
response.target = entity.GetObjectID();
response.response = 0;
response.SendToClient(sysAddr);
ActivityComponent::PlayerReady(&entity, value != 0);
}
}