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

Make match loading forcefully advanced after a time

This commit is contained in:
NG (Graham)
2026-01-25 18:17:34 -05:00
parent a5ebe4284b
commit a346299de8
17 changed files with 391 additions and 52 deletions

View File

@@ -353,6 +353,11 @@ impl CustomGameLogic for PitLogic {
if generic.is_game_done() {
return true;
}
let game_start = generic.game_start.load(std::sync::atomic::Ordering::Relaxed);
if game_start == i64::MIN || game_start > chrono::Utc::now().timestamp() {
// game has not started yet, player probably timed out while loading (which we can ignore)
return true;
}
let read_lock = generic.users.read().await;
if read_lock.len() == 1 {
// nobody to play against, automatically end the game