1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Add another custom game sync to mitigate and/or fix #113

This commit is contained in:
NG (Graham)
2026-08-09 18:31:03 -04:00
parent 3963a2b4de
commit 1f0aa22f68
2 changed files with 14 additions and 1 deletions

View File

@@ -520,7 +520,7 @@ impl QueueHandler {
} else {
log::debug!("Rejecting join queue for unknown custom game for user {}", public_id);
event_emitter.emit(crate::events::enqueue_error::QueueJoinError {
code: oj_rc_core::data::error_codes::LobbyReasonCode::NoSuitableLobbyFound as i16,
code: oj_rc_core::data::error_codes::LobbyReasonCode::GroupFailedChecks as i16,
text: "User is not in a custom game".to_owned(),
});
}

View File

@@ -28,6 +28,19 @@ impl <C: Send + 'static> SimpleOperation<C> for CustomGameRetriever {
};
if let Some(game) = game_opt {
log::debug!("User {} retrieved their custom game session {} info", my_pub_id, game.session_id);
if !is_workaround {
user_info.update_custom_game(oj_rc_core::persist::user::intercom::IntercomLobbyCustomGameDataMessage {
session_id: game.session_id.clone(),
config: game.config_core,
users: game.users.iter()
.filter(|user| !user.is_invited)
.map(|user| oj_rc_core::persist::user::intercom::IntercomLobbyCustomGameUserData {
public_id: user.public_id.clone(),
team: user.team,
})
.collect()
}).await;
}
params.insert(RESPONSE_CODE_PARAM_KEY, Typed::Int(crate::data::custom_games::SessionRetrieveResponse::SessionRetrieved as _));
let pub_ids: Vec<String> = game.users.iter()
.map(|member| member.public_id.clone())