17 lines
441 B
Kotlin
17 lines
441 B
Kotlin
package com.terraocean.plugin.bridge
|
|
|
|
import com.terraocean.plugin.instance
|
|
import hazae41.minecraft.kutils.bukkit.schedule
|
|
|
|
fun queryUserJoin(username: String) {
|
|
sendToSocket("query $username")
|
|
}
|
|
|
|
fun reportPlayerActivity(username: String, activity: Long) {
|
|
sendToSocket("active $username $activity")
|
|
}
|
|
|
|
private fun sendToSocket(msg: String) {
|
|
if (!socketActive) return
|
|
instance.schedule(async = true) { socket.send(msg) }
|
|
} |