Sort fights by start time in descending order and refactor saveFromStream method to use useDb block.
All checks were successful
SteamWarCI Build successful

Signed-off-by: Chaoscaot <max@maxsp.de>
This commit is contained in:
2025-11-10 12:27:02 +01:00
parent 7e5a13989b
commit 13c4a3ff8b

View File

@@ -122,7 +122,7 @@ class Fight(id: EntityID<Int>) : IntEntity(id) {
replayExists() && useDb { replayExists() && useDb {
exec( exec(
"SELECT (b.NodeId IS NULL OR b.Config & 2) AND (r.NodeId IS NULL OR r.Config & 2) AS ReplayAllowed FROM Fight f LEFT OUTER JOIN SchematicNode b ON f.BlueSchem = b.NodeId LEFT OUTER JOIN SchematicNode r ON f.RedSchem = r.NodeId WHERE FightId = ?", "SELECT (b.NodeId IS NULL OR b.Config & 2) AND (r.NodeId IS NULL OR r.Config & 2) AS ReplayAllowed FROM Fight f LEFT OUTER JOIN SchematicNode b ON f.BlueSchem = b.NodeId LEFT OUTER JOIN SchematicNode r ON f.RedSchem = r.NodeId WHERE FightId = ?",
args = listOf(IntegerColumnType() to this@Fight.id) args = listOf(IntegerColumnType() to this@Fight.id.value)
) { ) {
if (it.next()) { if (it.next()) {
it.getBoolean("ReplayAllowed") it.getBoolean("ReplayAllowed")