console command dictionary is now automatically filled using reflection

This commit is contained in:
minjaesong
2021-08-29 20:36:11 +09:00
parent 3fc6e28c4d
commit c610bd1ac6
28 changed files with 143 additions and 91 deletions

View File

@@ -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()]