forked from SteamWar/SteamWar
Sort fights by start time in descending order and refactor saveFromStream method to use useDb block.
Signed-off-by: Chaoscaot <max@maxsp.de>
This commit is contained in:
@@ -122,7 +122,7 @@ class Fight(id: EntityID<Int>) : IntEntity(id) {
|
||||
replayExists() && useDb {
|
||||
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 = ?",
|
||||
args = listOf(IntegerColumnType() to this@Fight.id)
|
||||
args = listOf(IntegerColumnType() to this@Fight.id.value)
|
||||
) {
|
||||
if (it.next()) {
|
||||
it.getBoolean("ReplayAllowed")
|
||||
|
||||
Reference in New Issue
Block a user