forked from SteamWar/SteamWar
@@ -72,9 +72,8 @@ class InternalKit(id: EntityID<CompositeID>): CompositeEntity(id) {
|
||||
) {
|
||||
this.inventory = rawInventory
|
||||
this.armor = rawArmor
|
||||
this.inUse = true
|
||||
}
|
||||
}
|
||||
}.also { it.setDefault() }
|
||||
|
||||
@JvmStatic
|
||||
fun getKitInUse(userId: Int, gamemode: String) = useDb {
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.intellij.lang.annotations.Language
|
||||
import org.jetbrains.exposed.v1.core.ColumnType
|
||||
import org.jetbrains.exposed.v1.core.Expression
|
||||
import org.jetbrains.exposed.v1.core.ResultRow
|
||||
import org.jetbrains.exposed.v1.core.StdOutSqlLogger
|
||||
import org.jetbrains.exposed.v1.core.statements.StatementType
|
||||
import org.jetbrains.exposed.v1.dao.IntEntity
|
||||
import org.jetbrains.exposed.v1.dao.IntEntityClass
|
||||
@@ -69,6 +70,7 @@ object KotlinDatabase {
|
||||
fun <T: Any?> useDb(statement: JdbcTransaction.() -> T): T {
|
||||
KotlinDatabase.ensureConnected()
|
||||
return TransactionManager.currentOrNull()?.statement() ?: transaction(KotlinDatabase.db) {
|
||||
addLogger(StdOutSqlLogger)
|
||||
statement()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user