Revert "Default Shardok server status to WAITING_FOR_AI when no faction is qu…"

This reverts commit ebc29a75d4.
This commit is contained in:
2026-05-08 07:13:59 -07:00
committed by GitHub
parent ebc29a75d4
commit e1686b6ee5
@@ -125,29 +125,7 @@ object GameController {
status = ShardokServerStatus.Status.WAITING_FOR_HUMAN_PLAYER,
waitingForFactionIds = humansToAct
)
else {
// No faction has currentCommand populated right now, which usually means the server is
// between steps (e.g., the AI consumed its currentCommand and is computing its move).
// Infer the most useful status by looking at which other factions exist in the battle:
// assume the battle is waiting on AI if any AI faction is present, otherwise on a human.
// PROCESSING is reserved for the rare case where no other faction is in the battle at all.
val otherFactionIds = allFactionIds.filter(_ != myFactionId).toVector
val otherAiFactionIds = otherFactionIds.filter(aiFactionIds.contains)
val otherHumanFactionIds = otherFactionIds.filterNot(aiFactionIds.contains)
if otherAiFactionIds.nonEmpty then
ShardokServerStatus(
status = ShardokServerStatus.Status.WAITING_FOR_AI,
waitingForFactionIds = otherAiFactionIds
)
else if otherHumanFactionIds.nonEmpty then
ShardokServerStatus(
status = ShardokServerStatus.Status.WAITING_FOR_HUMAN_PLAYER,
waitingForFactionIds = otherHumanFactionIds
)
else ShardokServerStatus(status = ShardokServerStatus.Status.PROCESSING)
}
end if
else ShardokServerStatus(status = ShardokServerStatus.Status.PROCESSING)
}
end if
}