execute bridge commands ingame
This commit is contained in:
parent
42dcd2c543
commit
4627a60c9d
|
@ -44,10 +44,11 @@ object EventHandler {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun chatEvent(e: ServerChatEvent) {
|
fun chatEvent(e: ServerChatEvent) {
|
||||||
if(e.isCanceled) return
|
if(e.isCanceled) return
|
||||||
ChatProcessor.sendToBridge(
|
e.isCanceled = ChatProcessor.sendToBridge(
|
||||||
user = e.player.displayName.unformattedText,
|
user = e.player.displayName.unformattedText,
|
||||||
msg = e.message,
|
msg = e.message,
|
||||||
event = ""
|
event = "",
|
||||||
|
uuid = e.player.gameProfile.id.toString()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package matterlink
|
package matterlink
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile
|
import com.mojang.authlib.GameProfile
|
||||||
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
import matterlink.command.MatterLinkCommand
|
import matterlink.command.MatterLinkCommand
|
||||||
import matterlink.command.MatterLinkCommandSender
|
import matterlink.command.MatterLinkCommandSender
|
||||||
import matterlink.config.BaseConfig
|
import matterlink.config.BaseConfig
|
||||||
|
@ -107,12 +108,9 @@ object MatterLink : IMatterLink() {
|
||||||
|
|
||||||
override fun commandSenderFor(
|
override fun commandSenderFor(
|
||||||
user: String,
|
user: String,
|
||||||
userId: String,
|
env: IBridgeCommand.CommandEnvironment,
|
||||||
server: String,
|
|
||||||
uuid: String?,
|
|
||||||
username: String?,
|
|
||||||
op: Boolean
|
op: Boolean
|
||||||
) = MatterLinkCommandSender(user, userId, server, uuid, username, op)
|
) = MatterLinkCommandSender(user, env, op)
|
||||||
|
|
||||||
override val mcVersion: String = MCVERSION
|
override val mcVersion: String = MCVERSION
|
||||||
override val modVersion: String = MODVERSION
|
override val modVersion: String = MODVERSION
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package matterlink.command
|
package matterlink.command
|
||||||
|
|
||||||
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
import matterlink.bridge.command.IMinecraftCommandSender
|
import matterlink.bridge.command.IMinecraftCommandSender
|
||||||
import net.minecraft.command.CommandResultStats
|
import net.minecraft.command.CommandResultStats
|
||||||
import net.minecraft.command.ICommandSender
|
import net.minecraft.command.ICommandSender
|
||||||
|
@ -15,11 +16,8 @@ import javax.annotation.Nonnull
|
||||||
|
|
||||||
class MatterLinkCommandSender(
|
class MatterLinkCommandSender(
|
||||||
user: String,
|
user: String,
|
||||||
userId: String,
|
env: IBridgeCommand.CommandEnvironment,
|
||||||
server: String,
|
op: Boolean) : IMinecraftCommandSender(user, env, op), ICommandSender {
|
||||||
uuid: String?,
|
|
||||||
username: String?,
|
|
||||||
op: Boolean) : IMinecraftCommandSender(user, userId, server, uuid, username, op), ICommandSender {
|
|
||||||
|
|
||||||
override fun execute(cmdString: String): Boolean {
|
override fun execute(cmdString: String): Boolean {
|
||||||
return 0 < FMLCommonHandler.instance().minecraftServerInstance.commandManager.executeCommand(
|
return 0 < FMLCommonHandler.instance().minecraftServerInstance.commandManager.executeCommand(
|
||||||
|
|
|
@ -45,10 +45,11 @@ object EventHandler {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun chatEvent(e: ServerChatEvent) {
|
fun chatEvent(e: ServerChatEvent) {
|
||||||
if(e.isCanceled) return
|
if(e.isCanceled) return
|
||||||
ChatProcessor.sendToBridge(
|
e.isCanceled = ChatProcessor.sendToBridge(
|
||||||
user = e.player.displayName.unformattedText,
|
user = e.player.displayName.unformattedText,
|
||||||
msg = e.message,
|
msg = e.message,
|
||||||
event = ""
|
event = "",
|
||||||
|
uuid = e.player.gameProfile.id.toString()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package matterlink
|
package matterlink
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile
|
import com.mojang.authlib.GameProfile
|
||||||
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
import matterlink.command.MatterLinkCommand
|
import matterlink.command.MatterLinkCommand
|
||||||
import matterlink.command.MatterLinkCommandSender
|
import matterlink.command.MatterLinkCommandSender
|
||||||
import matterlink.config.BaseConfig
|
import matterlink.config.BaseConfig
|
||||||
|
@ -106,12 +107,9 @@ object MatterLink : IMatterLink() {
|
||||||
|
|
||||||
override fun commandSenderFor(
|
override fun commandSenderFor(
|
||||||
user: String,
|
user: String,
|
||||||
userId: String,
|
env: IBridgeCommand.CommandEnvironment,
|
||||||
server: String,
|
|
||||||
uuid: String?,
|
|
||||||
username: String?,
|
|
||||||
op: Boolean
|
op: Boolean
|
||||||
) = MatterLinkCommandSender(user, userId, server, uuid, username, op)
|
) = MatterLinkCommandSender(user, env, op)
|
||||||
|
|
||||||
override val mcVersion: String = MCVERSION
|
override val mcVersion: String = MCVERSION
|
||||||
override val modVersion: String = MODVERSION
|
override val modVersion: String = MODVERSION
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package matterlink.command
|
package matterlink.command
|
||||||
|
|
||||||
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
import matterlink.bridge.command.IMinecraftCommandSender
|
import matterlink.bridge.command.IMinecraftCommandSender
|
||||||
import net.minecraft.command.CommandResultStats
|
import net.minecraft.command.CommandResultStats
|
||||||
import net.minecraft.command.ICommandSender
|
import net.minecraft.command.ICommandSender
|
||||||
|
@ -15,11 +16,8 @@ import javax.annotation.Nonnull
|
||||||
|
|
||||||
class MatterLinkCommandSender(
|
class MatterLinkCommandSender(
|
||||||
user: String,
|
user: String,
|
||||||
userId: String,
|
env: IBridgeCommand.CommandEnvironment,
|
||||||
server: String,
|
op: Boolean) : IMinecraftCommandSender(user, env, op), ICommandSender {
|
||||||
uuid: String?,
|
|
||||||
username: String?,
|
|
||||||
op: Boolean) : IMinecraftCommandSender(user, userId, server, uuid, username, op), ICommandSender {
|
|
||||||
|
|
||||||
override fun execute(cmdString: String): Boolean {
|
override fun execute(cmdString: String): Boolean {
|
||||||
return 0 < FMLCommonHandler.instance().minecraftServerInstance.commandManager.executeCommand(
|
return 0 < FMLCommonHandler.instance().minecraftServerInstance.commandManager.executeCommand(
|
||||||
|
|
|
@ -37,10 +37,11 @@ object EventHandler {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun chatEvent(e: ServerChatEvent) {
|
fun chatEvent(e: ServerChatEvent) {
|
||||||
if(e.isCanceled) return
|
if(e.isCanceled) return
|
||||||
ChatProcessor.sendToBridge(
|
e.isCanceled = ChatProcessor.sendToBridge(
|
||||||
user = e.player.displayName.unformattedText,
|
user = e.player.displayName.unformattedText,
|
||||||
msg = e.message,
|
msg = e.message,
|
||||||
event = ""
|
event = "",
|
||||||
|
uuid = e.player.gameProfile.id.toString()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +66,6 @@ object EventHandler {
|
||||||
else -> return
|
else -> return
|
||||||
}
|
}
|
||||||
ChatProcessor.sendToBridge(user = sender, msg = args, event = type)
|
ChatProcessor.sendToBridge(user = sender, msg = args, event = type)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//FORGE-DEPENDENT
|
//FORGE-DEPENDENT
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package matterlink
|
package matterlink
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile
|
import com.mojang.authlib.GameProfile
|
||||||
import jline.internal.Log.warn
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
import matterlink.command.AuthCommand
|
import matterlink.command.AuthCommand
|
||||||
import matterlink.command.MatterLinkCommand
|
import matterlink.command.MatterLinkCommand
|
||||||
import matterlink.command.MatterLinkCommandSender
|
import matterlink.command.MatterLinkCommandSender
|
||||||
|
@ -111,12 +111,9 @@ object MatterLink : IMatterLink() {
|
||||||
|
|
||||||
override fun commandSenderFor(
|
override fun commandSenderFor(
|
||||||
user: String,
|
user: String,
|
||||||
userId: String,
|
env: IBridgeCommand.CommandEnvironment,
|
||||||
server: String,
|
|
||||||
uuid: String?,
|
|
||||||
username: String?,
|
|
||||||
op: Boolean
|
op: Boolean
|
||||||
) = MatterLinkCommandSender(user, userId, server, uuid, username, op)
|
) = MatterLinkCommandSender(user, env, op)
|
||||||
|
|
||||||
override val mcVersion: String = MCVERSION
|
override val mcVersion: String = MCVERSION
|
||||||
override val modVersion: String = MODVERSION
|
override val modVersion: String = MODVERSION
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package matterlink.command
|
package matterlink.command
|
||||||
|
|
||||||
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
import matterlink.bridge.command.IMinecraftCommandSender
|
import matterlink.bridge.command.IMinecraftCommandSender
|
||||||
import net.minecraft.command.ICommandSender
|
import net.minecraft.command.ICommandSender
|
||||||
import net.minecraft.server.MinecraftServer
|
import net.minecraft.server.MinecraftServer
|
||||||
|
@ -11,11 +12,8 @@ import javax.annotation.Nonnull
|
||||||
|
|
||||||
class MatterLinkCommandSender(
|
class MatterLinkCommandSender(
|
||||||
user: String,
|
user: String,
|
||||||
userId: String,
|
env: IBridgeCommand.CommandEnvironment,
|
||||||
server: String,
|
op: Boolean) : IMinecraftCommandSender(user, env, op), ICommandSender {
|
||||||
uuid: String?,
|
|
||||||
username: String?,
|
|
||||||
op: Boolean) : IMinecraftCommandSender(user, userId, server, uuid, username, op), ICommandSender {
|
|
||||||
|
|
||||||
override fun execute(cmdString: String): Boolean {
|
override fun execute(cmdString: String): Boolean {
|
||||||
return 0 < FMLCommonHandler.instance().minecraftServerInstance.commandManager.executeCommand(
|
return 0 < FMLCommonHandler.instance().minecraftServerInstance.commandManager.executeCommand(
|
||||||
|
|
|
@ -41,10 +41,11 @@ object EventHandler {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
fun chatEvent(e: ServerChatEvent) {
|
fun chatEvent(e: ServerChatEvent) {
|
||||||
if(e.isCanceled) return
|
if(e.isCanceled) return
|
||||||
ChatProcessor.sendToBridge(
|
e.isCanceled = ChatProcessor.sendToBridge(
|
||||||
user = e.player.displayName,
|
user = e.player.displayName,
|
||||||
msg = e.message,
|
msg = e.message,
|
||||||
event = ""
|
event = "",
|
||||||
|
uuid = e.player.gameProfile.id.toString()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent
|
||||||
import cpw.mods.fml.common.event.FMLServerStartingEvent
|
import cpw.mods.fml.common.event.FMLServerStartingEvent
|
||||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent
|
import cpw.mods.fml.common.event.FMLServerStoppingEvent
|
||||||
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
import matterlink.command.MatterLinkCommand
|
import matterlink.command.MatterLinkCommand
|
||||||
import matterlink.command.MatterLinkCommandSender
|
import matterlink.command.MatterLinkCommandSender
|
||||||
import matterlink.config.BaseConfig
|
import matterlink.config.BaseConfig
|
||||||
|
@ -110,12 +111,9 @@ class MatterLink : IMatterLink() {
|
||||||
|
|
||||||
override fun commandSenderFor(
|
override fun commandSenderFor(
|
||||||
user: String,
|
user: String,
|
||||||
userId: String,
|
env: IBridgeCommand.CommandEnvironment,
|
||||||
server: String,
|
|
||||||
uuid: String?,
|
|
||||||
username: String?,
|
|
||||||
op: Boolean
|
op: Boolean
|
||||||
) = MatterLinkCommandSender(user, userId, server, uuid, username, op)
|
) = MatterLinkCommandSender(user, env, op)
|
||||||
|
|
||||||
override val mcVersion: String = MCVERSION
|
override val mcVersion: String = MCVERSION
|
||||||
override val modVersion: String = MODVERSION
|
override val modVersion: String = MODVERSION
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package matterlink.command
|
package matterlink.command
|
||||||
|
|
||||||
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
import matterlink.bridge.command.IMinecraftCommandSender
|
import matterlink.bridge.command.IMinecraftCommandSender
|
||||||
import net.minecraft.command.ICommandSender
|
import net.minecraft.command.ICommandSender
|
||||||
import net.minecraft.server.MinecraftServer
|
import net.minecraft.server.MinecraftServer
|
||||||
|
@ -10,11 +11,8 @@ import net.minecraft.world.World
|
||||||
|
|
||||||
class MatterLinkCommandSender(
|
class MatterLinkCommandSender(
|
||||||
user: String,
|
user: String,
|
||||||
userId: String,
|
env: IBridgeCommand.CommandEnvironment,
|
||||||
server: String,
|
op: Boolean) : IMinecraftCommandSender(user, env, op), ICommandSender {
|
||||||
uuid: String?,
|
|
||||||
username: String?,
|
|
||||||
op: Boolean) : IMinecraftCommandSender(user, userId, server, uuid, username, op), ICommandSender {
|
|
||||||
|
|
||||||
override fun execute(cmdString: String): Boolean {
|
override fun execute(cmdString: String): Boolean {
|
||||||
return 0 < MinecraftServer.getServer().commandManager.executeCommand(
|
return 0 < MinecraftServer.getServer().commandManager.executeCommand(
|
||||||
|
|
|
@ -2,6 +2,7 @@ package matterlink
|
||||||
|
|
||||||
import matterlink.bridge.MessageHandlerInst
|
import matterlink.bridge.MessageHandlerInst
|
||||||
import matterlink.bridge.command.BridgeCommandRegistry
|
import matterlink.bridge.command.BridgeCommandRegistry
|
||||||
|
import matterlink.bridge.command.IBridgeCommand
|
||||||
import matterlink.bridge.command.IMinecraftCommandSender
|
import matterlink.bridge.command.IMinecraftCommandSender
|
||||||
import matterlink.config.cfg
|
import matterlink.config.cfg
|
||||||
import matterlink.update.UpdateChecker
|
import matterlink.update.UpdateChecker
|
||||||
|
@ -13,7 +14,7 @@ abstract class IMatterLink {
|
||||||
abstract val modVersion: String
|
abstract val modVersion: String
|
||||||
abstract val forgeVersion: String
|
abstract val forgeVersion: String
|
||||||
|
|
||||||
abstract fun commandSenderFor(user: String, userId: String, server: String, uuid: String?, username: String?, op: Boolean): IMinecraftCommandSender
|
abstract fun commandSenderFor(user: String, env: IBridgeCommand.CommandEnvironment, op: Boolean): IMinecraftCommandSender
|
||||||
|
|
||||||
abstract fun wrappedSendToPlayers(msg: String)
|
abstract fun wrappedSendToPlayers(msg: String)
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ object PasteUtil {
|
||||||
http.doOutput = true
|
http.doOutput = true
|
||||||
|
|
||||||
val out = jankson.toJson(paste)
|
val out = jankson.toJson(paste)
|
||||||
.toJson(false, false).apply { println(this) }
|
.toJson(false, false)
|
||||||
.toByteArray()
|
.toByteArray()
|
||||||
|
|
||||||
http.setFixedLengthStreamingMode(out.size)
|
http.setFixedLengthStreamingMode(out.size)
|
||||||
|
|
|
@ -30,11 +30,11 @@ fun String.mapFormat(env: Map<String, String>): String {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
fun String.lazyFormat(env: Map<String, () -> String>): String {
|
fun String.lazyFormat(env: Map<String, () -> String?>): String {
|
||||||
var result = this
|
var result = this
|
||||||
env.forEach { key, value ->
|
env.forEach { key, value ->
|
||||||
if (result.contains(key)) {
|
if (result.contains(key)) {
|
||||||
result = result.replace(key, value())
|
result = result.replace(key, value().toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package matterlink.bridge.command
|
package matterlink.bridge.command
|
||||||
|
|
||||||
import matterlink.api.ApiMessage
|
|
||||||
import matterlink.bridge.MessageHandlerInst
|
|
||||||
import matterlink.config.AuthRequest
|
import matterlink.config.AuthRequest
|
||||||
import matterlink.config.IdentitiesConfig
|
import matterlink.config.IdentitiesConfig
|
||||||
import matterlink.config.cfg
|
import matterlink.config.cfg
|
||||||
|
@ -9,21 +7,28 @@ import matterlink.instance
|
||||||
import matterlink.randomString
|
import matterlink.randomString
|
||||||
|
|
||||||
object AuthBridgeCommand : IBridgeCommand() {
|
object AuthBridgeCommand : IBridgeCommand() {
|
||||||
override val help: String = "Requests authentication on the bridge. Syntax: auth [username]"
|
val syntax = "Syntax: auth [username]"
|
||||||
|
override val help: String = "Requests authentication on the bridge. $syntax"
|
||||||
override val permLevel: Double
|
override val permLevel: Double
|
||||||
get() = cfg.command.defaultPermUnauthenticated
|
get() = cfg.command.defaultPermUnauthenticated
|
||||||
|
|
||||||
override fun execute(alias: String, user: String, userId: String, platform: String, uuid: String?, args: String): Boolean {
|
override fun execute(alias: String, user: String, env: CommandEnvironment, args: String): Boolean {
|
||||||
|
if (env !is CommandEnvironment.BridgeEnv) {
|
||||||
|
env.respond("please initiate authentication from linked external chat")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
if (uuid != null) {
|
if (env.uuid != null) {
|
||||||
val name = instance.uuidToName(uuid)
|
val name = instance.uuidToName(env.uuid)
|
||||||
respond("you are already authenticated as name: $name uuid: $uuid")
|
env.respond("you are already authenticated as name: $name uuid: ${env.uuid}")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
val argList = args.split(' ', limit = 2)
|
val argList = args.split(' ', limit = 2)
|
||||||
val target = argList.getOrNull(0) ?: run {
|
val target = argList.getOrNull(0) ?: run {
|
||||||
respond("no username/uuid provided")
|
env.respond("no username/uuid provided\n" +
|
||||||
|
syntax)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +36,7 @@ object AuthBridgeCommand : IBridgeCommand() {
|
||||||
|
|
||||||
val targetUUid: String = instance.nameToUUID(target) ?: run {
|
val targetUUid: String = instance.nameToUUID(target) ?: run {
|
||||||
targetUserName = instance.uuidToName(target) ?: run {
|
targetUserName = instance.uuidToName(target) ?: run {
|
||||||
respond("cannot find player by username/uuid $target")
|
env.respond("cannot find player by username/uuid $target")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
target
|
target
|
||||||
|
@ -39,7 +44,7 @@ object AuthBridgeCommand : IBridgeCommand() {
|
||||||
|
|
||||||
val online = instance.isOnline(targetUserName)
|
val online = instance.isOnline(targetUserName)
|
||||||
if (!online) {
|
if (!online) {
|
||||||
respond("$targetUserName is not online, please log in and try again to send instructions")
|
env.respond("$targetUserName is not online, please log in and try again to send instructions")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
val nonce = randomString(length = 3).toUpperCase()
|
val nonce = randomString(length = 3).toUpperCase()
|
||||||
|
@ -50,19 +55,9 @@ object AuthBridgeCommand : IBridgeCommand() {
|
||||||
instance.wrappedSendToPlayer(targetUserName, "otherwise you may ignore this message")
|
instance.wrappedSendToPlayer(targetUserName, "otherwise you may ignore this message")
|
||||||
|
|
||||||
|
|
||||||
IdentitiesConfig.authRequests.put(requestId, AuthRequest(username = targetUserName, uuid = targetUUid, nonce = nonce, platform = platform, userid = userId))
|
IdentitiesConfig.authRequests.put(requestId, AuthRequest(username = targetUserName, uuid = targetUUid, nonce = nonce, platform = env.platform, userid = env.userId))
|
||||||
respond("please accept the authentication request ingame, do not share the code")
|
env.respond("please accept the authentication request ingame, do not share the code")
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun respond(text: String) {
|
|
||||||
MessageHandlerInst.transmit(
|
|
||||||
ApiMessage(
|
|
||||||
text = text
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -28,6 +28,7 @@ object BridgeCommandRegistry {
|
||||||
|
|
||||||
val uuid = IdentitiesConfig.getUUID(input.account, input.userid)
|
val uuid = IdentitiesConfig.getUUID(input.account, input.userid)
|
||||||
|
|
||||||
|
val env = IBridgeCommand.CommandEnvironment.BridgeEnv(input.username, input.userid, input.account, uuid)
|
||||||
return commandMap[cmd[0]]?.let {
|
return commandMap[cmd[0]]?.let {
|
||||||
if (!it.reachedTimeout()) {
|
if (!it.reachedTimeout()) {
|
||||||
instance.debug("dropped command ${it.alias}")
|
instance.debug("dropped command ${it.alias}")
|
||||||
|
@ -35,14 +36,39 @@ object BridgeCommandRegistry {
|
||||||
}
|
}
|
||||||
it.preExecute() // resets the tickCounter
|
it.preExecute() // resets the tickCounter
|
||||||
if (!it.canExecute(uuid)) {
|
if (!it.canExecute(uuid)) {
|
||||||
MessageHandlerInst.transmit(
|
env.respond(
|
||||||
ApiMessage(
|
text = "${input.username} is not permitted to perform command: ${cmd[0]}"
|
||||||
text = "${input.username} is not permitted to perform command: ${cmd[0]}".stripColorOut
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
it.execute(cmd[0], input.username, input.userid, input.account, uuid, args)
|
it.execute(cmd[0], input.username, env, args)
|
||||||
|
} ?: false
|
||||||
|
}
|
||||||
|
|
||||||
|
fun handleCommand(text: String, username: String, uuid: String): Boolean {
|
||||||
|
if (!cfg.command.enable || text.isBlank()) return false
|
||||||
|
|
||||||
|
if (text[0] != cfg.command.prefix || text.length < 2) return false
|
||||||
|
|
||||||
|
val cmd = text.substring(1).split(' ', ignoreCase = false, limit = 2)
|
||||||
|
val args = if (cmd.size == 2) cmd[1] else ""
|
||||||
|
|
||||||
|
val env = IBridgeCommand.CommandEnvironment.GameEnv(username, uuid)
|
||||||
|
|
||||||
|
return commandMap[cmd[0]]?.let {
|
||||||
|
if (!it.reachedTimeout()) {
|
||||||
|
instance.debug("dropped command ${it.alias}")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
it.preExecute() // resets the tickCounter
|
||||||
|
if (!it.canExecute(uuid)) {
|
||||||
|
env.respond(
|
||||||
|
text = "$username is not permitted to perform command: ${cmd[0]}"
|
||||||
|
)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
it.execute(cmd[0], username, env, args)
|
||||||
} ?: false
|
} ?: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,4 +128,5 @@ object BridgeCommandRegistry {
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,5 @@
|
||||||
package matterlink.bridge.command
|
package matterlink.bridge.command
|
||||||
|
|
||||||
import matterlink.api.ApiMessage
|
|
||||||
import matterlink.bridge.MessageHandlerInst
|
|
||||||
import matterlink.instance
|
import matterlink.instance
|
||||||
import matterlink.lazyFormat
|
import matterlink.lazyFormat
|
||||||
import matterlink.stripColorIn
|
import matterlink.stripColorIn
|
||||||
|
@ -19,37 +17,27 @@ data class CustomCommand(
|
||||||
val argumentsRegex: Regex? = null
|
val argumentsRegex: Regex? = null
|
||||||
) : IBridgeCommand() {
|
) : IBridgeCommand() {
|
||||||
|
|
||||||
override fun execute(alias: String, user: String, userId: String, platform: String, uuid: String?, args: String): Boolean {
|
override fun execute(alias: String, user: String, env: CommandEnvironment, args: String): Boolean {
|
||||||
if (argumentsRegex != null) {
|
if (argumentsRegex != null) {
|
||||||
instance.debug("testing '$args' against '${argumentsRegex.pattern}'")
|
instance.debug("testing '$args' against '${argumentsRegex.pattern}'")
|
||||||
if (!argumentsRegex.matches(args)) {
|
if (!argumentsRegex.matches(args)) {
|
||||||
MessageHandlerInst.transmit(
|
env.respond("$user sent invalid input to command $alias")
|
||||||
ApiMessage(
|
|
||||||
text = "$user sent invalid input to command $alias".stripColorOut
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val username = instance.uuidToName(uuid)
|
|
||||||
|
|
||||||
return when (type) {
|
return when (type) {
|
||||||
CommandType.EXECUTE -> {
|
CommandType.EXECUTE -> {
|
||||||
// uses a new commandsender for each use
|
// uses a new commandsender for each use
|
||||||
val commandSender = instance.commandSenderFor(user, userId, platform, uuid, username, execOp ?: false)
|
val commandSender = instance.commandSenderFor(user, env, execOp ?: false)
|
||||||
val cmd = execute?.lazyFormat(getReplacements(user, userId, platform, uuid, args))?.stripColorIn
|
val cmd = execute?.lazyFormat(getReplacements(user, env, args))?.stripColorIn
|
||||||
?: return false
|
?: return false
|
||||||
commandSender.execute(cmd) || commandSender.reply.isNotEmpty()
|
commandSender.execute(cmd) || commandSender.reply.isNotEmpty()
|
||||||
}
|
}
|
||||||
CommandType.RESPONSE -> {
|
CommandType.RESPONSE -> {
|
||||||
MessageHandlerInst.transmit(
|
env.respond(response?.lazyFormat(getReplacements(user, env, args))
|
||||||
ApiMessage(
|
?: "", cause = "response to command: $alias")
|
||||||
text = (response?.lazyFormat(getReplacements(user, userId, platform, uuid, args))
|
|
||||||
?: "")
|
|
||||||
),
|
|
||||||
cause = "response to command: $alias"
|
|
||||||
)
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,13 +59,33 @@ data class CustomCommand(
|
||||||
companion object {
|
companion object {
|
||||||
val DEFAULT = CustomCommand()
|
val DEFAULT = CustomCommand()
|
||||||
|
|
||||||
fun getReplacements(user: String, userId: String, platform: String, uuid: String?, args: String): Map<String, () -> String> = mapOf(
|
fun getReplacements(user: String, env: CommandEnvironment, args: String): Map<String, () -> String?> = mapOf(
|
||||||
"{uptime}" to instance::getUptimeAsString,
|
"{uptime}" to instance::getUptimeAsString,
|
||||||
"{user}" to { user },
|
"{user}" to { user },
|
||||||
"{userid}" to { userId },
|
"{userid}" to {
|
||||||
"{uuid}" to { uuid.toString() },
|
when (env) {
|
||||||
"{username}" to { uuid?.let { instance.uuidToName(it) }.toString() },
|
is CommandEnvironment.BridgeEnv -> env.userId
|
||||||
"{platform}" to { platform },
|
else -> null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"{uuid}" to {
|
||||||
|
when (env) {
|
||||||
|
is CommandEnvironment.BridgeEnv -> env.uuid
|
||||||
|
is CommandEnvironment.GameEnv -> env.uuid
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"{username}" to {
|
||||||
|
when (env) {
|
||||||
|
is CommandEnvironment.BridgeEnv -> env.uuid
|
||||||
|
is CommandEnvironment.GameEnv -> env.uuid
|
||||||
|
}?.let { instance.uuidToName(it) }
|
||||||
|
},
|
||||||
|
"{platform}" to {
|
||||||
|
when (env) {
|
||||||
|
is CommandEnvironment.BridgeEnv -> env.platform
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
},
|
||||||
"{args}" to { args }
|
"{args}" to { args }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,19 +10,17 @@ object HelpCommand : IBridgeCommand() {
|
||||||
override val permLevel: Double
|
override val permLevel: Double
|
||||||
get() = cfg.command.defaultPermUnauthenticated
|
get() = cfg.command.defaultPermUnauthenticated
|
||||||
|
|
||||||
override fun execute(alias: String, user: String, userId: String, platform: String, uuid: String?, args: String): Boolean {
|
override fun execute(alias: String, user: String, env: CommandEnvironment, args: String): Boolean {
|
||||||
val msg: String = when {
|
val msg: String = when {
|
||||||
args.isEmpty() ->
|
args.isEmpty() ->
|
||||||
"Available commands: ${BridgeCommandRegistry.getCommandList(IBridgeCommand.getPermLevel(uuid))}"
|
"Available commands: ${BridgeCommandRegistry.getCommandList(IBridgeCommand.getPermLevel(env.uuid))}"
|
||||||
else -> args.split(" ", ignoreCase = false)
|
else -> args.split(" ", ignoreCase = false)
|
||||||
.joinToString(separator = "\n") {
|
.joinToString(separator = "\n") {
|
||||||
"$it: ${BridgeCommandRegistry.getHelpString(it)}"
|
"$it: ${BridgeCommandRegistry.getHelpString(it)}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MessageHandlerInst.transmit(
|
env.respond(
|
||||||
ApiMessage(
|
text = msg,
|
||||||
text = msg.stripColorOut
|
|
||||||
),
|
|
||||||
cause = "Help Requested $args"
|
cause = "Help Requested $args"
|
||||||
)
|
)
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -6,18 +6,55 @@ import matterlink.config.PermissionConfig
|
||||||
import matterlink.config.cfg
|
import matterlink.config.cfg
|
||||||
import matterlink.handlers.TickHandler
|
import matterlink.handlers.TickHandler
|
||||||
import matterlink.instance
|
import matterlink.instance
|
||||||
|
import matterlink.stripColorOut
|
||||||
|
|
||||||
abstract class IBridgeCommand {
|
abstract class IBridgeCommand {
|
||||||
abstract val help: String
|
abstract val help: String
|
||||||
abstract val permLevel: Double
|
abstract val permLevel: Double
|
||||||
open val timeout: Int = 20
|
open val timeout: Int = 20
|
||||||
|
|
||||||
protected var lastUsed: Int = 0
|
sealed class CommandEnvironment {
|
||||||
|
abstract val uuid: String?
|
||||||
|
abstract val username: String?
|
||||||
|
|
||||||
|
data class BridgeEnv(
|
||||||
|
val name: String,
|
||||||
|
val userId: String,
|
||||||
|
val platform: String,
|
||||||
|
override val uuid: String?
|
||||||
|
) : CommandEnvironment() {
|
||||||
|
override val username: String?
|
||||||
|
get() = instance.uuidToName(uuid)
|
||||||
|
}
|
||||||
|
data class GameEnv(
|
||||||
|
override val username: String,
|
||||||
|
override val uuid: String
|
||||||
|
) : CommandEnvironment()
|
||||||
|
|
||||||
|
fun respond(text: String, cause: String = "") {
|
||||||
|
when(this) {
|
||||||
|
is BridgeEnv -> {
|
||||||
|
MessageHandlerInst.transmit(
|
||||||
|
ApiMessage(
|
||||||
|
text = text.stripColorOut
|
||||||
|
),
|
||||||
|
cause = cause
|
||||||
|
)
|
||||||
|
}
|
||||||
|
is GameEnv -> {
|
||||||
|
instance.wrappedSendToPlayer(uuid, text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private var lastUsed: Int = 0
|
||||||
|
|
||||||
val alias: String
|
val alias: String
|
||||||
get() = BridgeCommandRegistry.getName(this)!!
|
get() = BridgeCommandRegistry.getName(this)!!
|
||||||
|
|
||||||
|
|
||||||
fun reachedTimeout(): Boolean {
|
fun reachedTimeout(): Boolean {
|
||||||
return (TickHandler.tickCounter - lastUsed > timeout)
|
return (TickHandler.tickCounter - lastUsed > timeout)
|
||||||
}
|
}
|
||||||
|
@ -30,7 +67,7 @@ abstract class IBridgeCommand {
|
||||||
*
|
*
|
||||||
* @return consume message flag
|
* @return consume message flag
|
||||||
*/
|
*/
|
||||||
abstract fun execute(alias: String, user: String, userId: String, platform: String, uuid: String?, args: String): Boolean
|
abstract fun execute(alias: String, user: String, env: CommandEnvironment, args: String): Boolean
|
||||||
|
|
||||||
fun canExecute(uuid: String?): Boolean {
|
fun canExecute(uuid: String?): Boolean {
|
||||||
instance.trace("canExecute this: $this uuid: $uuid permLevel: $permLevel")
|
instance.trace("canExecute this: $this uuid: $uuid permLevel: $permLevel")
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package matterlink.bridge.command
|
package matterlink.bridge.command
|
||||||
|
|
||||||
import matterlink.api.ApiMessage
|
|
||||||
import matterlink.bridge.MessageHandlerInst
|
|
||||||
import matterlink.stripColorOut
|
import matterlink.stripColorOut
|
||||||
import java.awt.SystemColor.text
|
|
||||||
|
|
||||||
abstract class IMinecraftCommandSender(val user: String, val userId: String, val server: String, val uuid: String?, val username: String?, val op: Boolean) {
|
abstract class IMinecraftCommandSender(val user: String, val env: IBridgeCommand.CommandEnvironment, val op: Boolean) {
|
||||||
/**
|
/**
|
||||||
* @param cmdString The command to execute with its arguments
|
* @param cmdString The command to execute with its arguments
|
||||||
*
|
*
|
||||||
|
@ -13,16 +10,20 @@ abstract class IMinecraftCommandSender(val user: String, val userId: String, val
|
||||||
*/
|
*/
|
||||||
abstract fun execute(cmdString: String): Boolean
|
abstract fun execute(cmdString: String): Boolean
|
||||||
|
|
||||||
val displayName = username ?: user
|
val displayName = env.username ?: user
|
||||||
val accountName = "$user (id=$userId server=$server uuid=$uuid)"
|
val accountName = when (env) {
|
||||||
|
is IBridgeCommand.CommandEnvironment.BridgeEnv -> "$user (id=${env.userId} platform=${env.platform}${env.uuid?.let { " uuid=$it" }
|
||||||
|
?: ""}${env.username?.let { " username=$it" } ?: ""})"
|
||||||
|
is IBridgeCommand.CommandEnvironment.GameEnv -> "$user (username=${env.username} uuid=${env.uuid})"
|
||||||
|
}
|
||||||
|
|
||||||
fun canExecute(commandName: String): Boolean {
|
fun canExecute(commandName: String): Boolean {
|
||||||
if (op) return true
|
if (op) return true
|
||||||
val command = BridgeCommandRegistry[commandName] ?: return false
|
val command = BridgeCommandRegistry[commandName] ?: return false
|
||||||
return command.canExecute(uuid)
|
return command.canExecute(env.uuid)
|
||||||
}
|
}
|
||||||
|
|
||||||
var finished = true
|
private var finished = true
|
||||||
val reply = mutableListOf<String>()
|
val reply = mutableListOf<String>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,10 +38,8 @@ abstract class IMinecraftCommandSender(val user: String, val userId: String, val
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sendReply(cmdString: String) {
|
fun sendReply(cmdString: String) {
|
||||||
MessageHandlerInst.transmit(
|
env.respond(
|
||||||
msg = ApiMessage(
|
text = reply.joinToString("\n"),
|
||||||
text = reply.joinToString("\n").stripColorOut
|
|
||||||
),
|
|
||||||
cause = "executed command: $cmdString"
|
cause = "executed command: $cmdString"
|
||||||
)
|
)
|
||||||
finished = true
|
finished = true
|
||||||
|
|
|
@ -1,29 +1,30 @@
|
||||||
package matterlink.bridge.command
|
package matterlink.bridge.command
|
||||||
|
|
||||||
import matterlink.api.ApiMessage
|
|
||||||
import matterlink.bridge.MessageHandlerInst
|
|
||||||
import matterlink.config.PermissionConfig
|
import matterlink.config.PermissionConfig
|
||||||
import matterlink.config.PermissionRequest
|
import matterlink.config.PermissionRequest
|
||||||
import matterlink.config.cfg
|
import matterlink.config.cfg
|
||||||
import matterlink.randomString
|
import matterlink.randomString
|
||||||
|
|
||||||
object RequestPermissionsCommand : IBridgeCommand() {
|
object RequestPermissionsCommand : IBridgeCommand() {
|
||||||
override val help: String = "Requests permissions on the bridge. Syntax: request [permissionLevel]"
|
val syntax = " Syntax: request [permissionLevel]"
|
||||||
|
override val help: String = "Requests permissions on the bridge. $syntax"
|
||||||
override val permLevel: Double
|
override val permLevel: Double
|
||||||
get() = cfg.command.defaultPermAuthenticated
|
get() = cfg.command.defaultPermAuthenticated
|
||||||
|
|
||||||
override fun execute(alias: String, user: String, userId: String, platform: String, uuid: String?, args: String): Boolean {
|
override fun execute(alias: String, user: String, env: CommandEnvironment, args: String): Boolean {
|
||||||
|
|
||||||
|
val uuid = env.uuid
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
respond("$user is not authenticated (userid: $userId platform: $platform)")
|
env.respond("$user is not authenticated ($env)")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
val argList = args.split(' ', limit = 2)
|
val argList = args.split(' ', limit = 2)
|
||||||
val requestedLevelArg = argList.getOrNull(0)
|
val requestedLevelArg = argList.getOrNull(0)
|
||||||
val requestedlevel = requestedLevelArg?.let {
|
val requestedLevel = requestedLevelArg?.takeIf { it.isNotEmpty() }?.let {
|
||||||
it.toDoubleOrNull() ?: run {
|
it.toDoubleOrNull() ?: run {
|
||||||
respond("cannot parse permlevel")
|
env.respond("cannot parse permlevel '$requestedLevelArg'\n" +
|
||||||
|
syntax)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,19 +33,9 @@ object RequestPermissionsCommand : IBridgeCommand() {
|
||||||
|
|
||||||
val requestId = user.toLowerCase()
|
val requestId = user.toLowerCase()
|
||||||
|
|
||||||
PermissionConfig.permissionRequests.put(requestId, PermissionRequest(uuid = uuid, user = user, nonce = nonce, powerlevel = requestedlevel))
|
PermissionConfig.permissionRequests.put(requestId, PermissionRequest(uuid = uuid, user = user, nonce = nonce, powerlevel = requestedLevel))
|
||||||
respond("please ask a op to accept your permission elevation with `/ml permAccept $requestId $nonce [powerlevel]`")
|
env.respond("please ask a op to accept your permission elevation with `/ml permAccept $requestId $nonce [permLevel]`")
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun respond(text: String) {
|
|
||||||
MessageHandlerInst.transmit(
|
|
||||||
ApiMessage(
|
|
||||||
text = text
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -113,8 +113,8 @@ data class BaseConfig(val rootDir: File) {
|
||||||
|
|
||||||
data class JoinPartOptions(
|
data class JoinPartOptions(
|
||||||
val enable: Boolean = true,
|
val enable: Boolean = true,
|
||||||
val joinServer: String = "{username:antiping} has connected to the server",
|
val joinServer: String = "{username:antiping} has connected to the platform",
|
||||||
val partServer: String = "{username:antiping} has disconnected from the server"
|
val partServer: String = "{username:antiping} has disconnected from the platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
data class UpdateOptions(
|
data class UpdateOptions(
|
||||||
|
@ -208,12 +208,12 @@ data class BaseConfig(val rootDir: File) {
|
||||||
url = it.getOrDefault(
|
url = it.getOrDefault(
|
||||||
"url",
|
"url",
|
||||||
url,
|
url,
|
||||||
"The URL or IP address of the bridge server"
|
"The URL or IP address of the bridge platform"
|
||||||
),
|
),
|
||||||
authToken = it.getOrDefault(
|
authToken = it.getOrDefault(
|
||||||
"authToken",
|
"authToken",
|
||||||
authToken,
|
authToken,
|
||||||
"Auth token used to connect to the bridge server"
|
"Auth token used to connect to the bridge platform"
|
||||||
),
|
),
|
||||||
gateway = it.getOrDefault(
|
gateway = it.getOrDefault(
|
||||||
"gateway",
|
"gateway",
|
||||||
|
@ -267,7 +267,7 @@ data class BaseConfig(val rootDir: File) {
|
||||||
systemUser = it.getOrDefault(
|
systemUser = it.getOrDefault(
|
||||||
"systemUser",
|
"systemUser",
|
||||||
systemUser,
|
systemUser,
|
||||||
"Name of the server user (used by death and advancement messages and the /say command)"
|
"Name of the platform user (used by death and advancement messages and the /say command)"
|
||||||
),
|
),
|
||||||
advancements = it.getOrDefault(
|
advancements = it.getOrDefault(
|
||||||
"advancements",
|
"advancements",
|
||||||
|
|
|
@ -26,7 +26,7 @@ object CommandConfig {
|
||||||
to CustomCommand(
|
to CustomCommand(
|
||||||
type = CommandType.EXECUTE,
|
type = CommandType.EXECUTE,
|
||||||
execute = "forge tps",
|
execute = "forge tps",
|
||||||
help = "Print server tps",
|
help = "Print platform tps",
|
||||||
timeout = 200,
|
timeout = 200,
|
||||||
defaultCommand = true
|
defaultCommand = true
|
||||||
)),
|
)),
|
||||||
|
@ -41,14 +41,14 @@ object CommandConfig {
|
||||||
to CustomCommand(
|
to CustomCommand(
|
||||||
type = CommandType.EXECUTE,
|
type = CommandType.EXECUTE,
|
||||||
execute = "seed",
|
execute = "seed",
|
||||||
help = "Print server world seed",
|
help = "Print platform world seed",
|
||||||
defaultCommand = true
|
defaultCommand = true
|
||||||
)),
|
)),
|
||||||
"uptime" to ("this is a reponse command, it uses the uptime function, time since the mod was first loaded"
|
"uptime" to ("this is a reponse command, it uses the uptime function, time since the mod was first loaded"
|
||||||
to CustomCommand(
|
to CustomCommand(
|
||||||
type = CommandType.RESPONSE,
|
type = CommandType.RESPONSE,
|
||||||
response = "{uptime}",
|
response = "{uptime}",
|
||||||
help = "Print server uptime",
|
help = "Print platform uptime",
|
||||||
defaultCommand = true
|
defaultCommand = true
|
||||||
)),
|
)),
|
||||||
"whoami" to ("this shows you some of the other response macros"
|
"whoami" to ("this shows you some of the other response macros"
|
||||||
|
|
|
@ -2,12 +2,17 @@ package matterlink.handlers
|
||||||
|
|
||||||
import matterlink.api.ApiMessage
|
import matterlink.api.ApiMessage
|
||||||
import matterlink.bridge.MessageHandlerInst
|
import matterlink.bridge.MessageHandlerInst
|
||||||
|
import matterlink.bridge.command.BridgeCommandRegistry
|
||||||
import matterlink.instance
|
import matterlink.instance
|
||||||
import matterlink.stripColorOut
|
import matterlink.stripColorOut
|
||||||
|
|
||||||
object ChatProcessor {
|
object ChatProcessor {
|
||||||
fun sendToBridge(user: String, msg: String, event: String) {
|
/**
|
||||||
|
* @return cancel message flag
|
||||||
|
*/
|
||||||
|
fun sendToBridge(user: String, msg: String, event: String, uuid: String? = null): Boolean {
|
||||||
val message = msg.trim()
|
val message = msg.trim()
|
||||||
|
if(uuid != null && BridgeCommandRegistry.handleCommand(message, user, uuid)) return true
|
||||||
when {
|
when {
|
||||||
message.isNotBlank() -> MessageHandlerInst.transmit(
|
message.isNotBlank() -> MessageHandlerInst.transmit(
|
||||||
ApiMessage(
|
ApiMessage(
|
||||||
|
@ -19,5 +24,6 @@ object ChatProcessor {
|
||||||
)
|
)
|
||||||
else -> instance.warn("WARN: dropped blank message by '$user'")
|
else -> instance.warn("WARN: dropped blank message by '$user'")
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue