mirror of
https://github.com/GayPizzaSpecifications/foundation.git
synced 2025-08-03 13:31:32 +00:00
Gjallarhorn: Use Player Position Changelog in Player Position Export
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package cloud.kubelet.foundation.gjallarhorn.commands
|
||||
|
||||
import cloud.kubelet.foundation.gjallarhorn.state.PlayerPositionChangelog
|
||||
import cloud.kubelet.foundation.gjallarhorn.util.compose
|
||||
import cloud.kubelet.foundation.heimdall.table.PlayerPositionTable
|
||||
import com.github.ajalt.clikt.core.CliktCommand
|
||||
@ -10,7 +11,6 @@ import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.greaterEq
|
||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.lessEq
|
||||
import org.jetbrains.exposed.sql.and
|
||||
import org.jetbrains.exposed.sql.select
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import java.time.Instant
|
||||
import java.util.*
|
||||
@ -32,17 +32,10 @@ class PlayerPositionExport : CliktCommand(name = "export-player-positions", help
|
||||
|
||||
println("time,player,world,x,y,z,pitch,yaw")
|
||||
transaction(db) {
|
||||
PlayerPositionTable.select(filter).orderBy(PlayerPositionTable.time).forEach { row ->
|
||||
val time = row[PlayerPositionTable.time]
|
||||
val player = row[PlayerPositionTable.player]
|
||||
val world = row[PlayerPositionTable.world]
|
||||
val x = row[PlayerPositionTable.x]
|
||||
val y = row[PlayerPositionTable.y]
|
||||
val z = row[PlayerPositionTable.z]
|
||||
val pitch = row[PlayerPositionTable.pitch]
|
||||
val yaw = row[PlayerPositionTable.yaw]
|
||||
|
||||
println("${time},${player},${world},${x},${y},${z},${pitch},${yaw}")
|
||||
PlayerPositionChangelog.query(db, filter).changes.forEach { change ->
|
||||
change.apply {
|
||||
println("${time},${player},${world},${x},${y},${z},${pitch},${yaw}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user