1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00
This commit is contained in:
Cedric Beust 2015-10-21 23:48:29 -07:00
parent e285a6a790
commit 42eb5a48d8

View file

@ -83,19 +83,19 @@ public class KobaltServer @Inject constructor(val args: Args) : Runnable, IComma
private fun runCommand(jo: JsonObject) { private fun runCommand(jo: JsonObject) {
val command = jo.get("name").asString val command = jo.get("name").asString
if (command != null) { if (command != null) {
COMMANDS.getOrElse(command, { PingCommand() }).run(this, jo) COMMANDS.getOrElse(command, { COMMANDS.get("ping") })!!.run(this, jo)
} else { } else {
error("Did not find a name in command: $jo") error("Did not find a name in command: $jo")
} }
} }
override fun sendData(info: String) { override fun sendData(content: String) {
if (outgoing != null) { if (outgoing != null) {
outgoing!!.println(info) outgoing!!.println(content)
} else { } else {
log1("Queuing $info") log1("Queuing $content")
synchronized(pending) { synchronized(pending) {
pending.add(info) pending.add(content)
} }
} }
} }