mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-16 05:24:06 +09:00
console command dictionary is now automatically filled using reflection
This commit is contained in:
@@ -16,14 +16,15 @@ internal object CommandInterpreter {
|
||||
private val commandsNoAuth = arrayOf(
|
||||
"auth",
|
||||
"qqq",
|
||||
"zoom",
|
||||
"setlocale",
|
||||
"getlocale",
|
||||
"help",
|
||||
"version",
|
||||
"tips",
|
||||
"screenshot",
|
||||
"resize"
|
||||
"resize",
|
||||
"echo",
|
||||
"error"
|
||||
)
|
||||
|
||||
internal fun execute(command: String) {
|
||||
@@ -38,7 +39,7 @@ internal object CommandInterpreter {
|
||||
var commandObj: ConsoleCommand? = null
|
||||
try {
|
||||
if (single_command.name.toLowerCase().startsWith("qqq")) {
|
||||
commandObj = CommandDict["qqq"]
|
||||
commandObj = CommandDict["QuitApp"]
|
||||
}
|
||||
else if (commandsNoAuth.contains(single_command.name.toLowerCase())) {
|
||||
commandObj = CommandDict[single_command.name.toLowerCase()]
|
||||
|
||||
Reference in New Issue
Block a user