Sort fights by start time in descending order and refactor saveFromStream method to use useDb block.
All checks were successful
SteamWarCI Build successful
All checks were successful
SteamWarCI Build successful
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 {
|
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")
|
||||||
|
|||||||
Reference in New Issue
Block a user