mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 21:35:42 +00:00
Revert "Default Shardok server status to WAITING_FOR_AI when no faction is qu…"
This reverts commit ebc29a75d4.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user