mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
asynchronous lightmap update wip
This commit is contained in:
@@ -33,8 +33,11 @@ internal object Authenticator : ConsoleCommand {
|
||||
val pwd = args[1]
|
||||
val hashedPwd = DigestUtils.sha256Hex(pwd)
|
||||
|
||||
if ("65b9aa150332ed7096134efb20220e5ebec04d4dbe1c537ff3816f68c2391c1c".equals(hashedPwd, ignoreCase = true)) {
|
||||
// aryll
|
||||
println("auth passwd: '$pwd'")
|
||||
println("hash: $hashedPwd")
|
||||
|
||||
if ("09ccf5067db6f58265b004829e33e715e819ba0984f1e1fcef49c36fcd5f745f".equals(hashedPwd, ignoreCase = true)) {
|
||||
// beedle
|
||||
val msg = if (a) "Locked" else "Authenticated"
|
||||
Echo(msg)
|
||||
println("[Authenticator] " + msg)
|
||||
|
||||
@@ -13,15 +13,42 @@ object CommandDict {
|
||||
|
||||
internal val dict = hashMapOf<String, ConsoleCommand>()
|
||||
|
||||
private val engineCommandList = listOf(
|
||||
"ActorsList",
|
||||
"Authenticator",
|
||||
"AVTracker",
|
||||
"Batch",
|
||||
"Echo",
|
||||
"EchoConsole",
|
||||
"EchoError",
|
||||
"Pause",
|
||||
"QuitApp",
|
||||
"ResizeScreen",
|
||||
"ScreencapNogui",
|
||||
"SetGlobalLightOverride",
|
||||
"SetLocale",
|
||||
"TakeScreenshot",
|
||||
"Unpause",
|
||||
"Version"
|
||||
)
|
||||
|
||||
init {
|
||||
printdbg(this, ModMgr.loadOrder.reversed())
|
||||
printdbg(this, ModMgr.loadOrder.reversed().map { ModMgr.moduleInfo[it]?.packageName })
|
||||
|
||||
(listOf("net.torvald.terrarum") + ModMgr.loadOrder.reversed().mapNotNull { ModMgr.moduleInfo[it]?.packageName }).forEach { packageRoot ->
|
||||
printdbg(this, packageRoot)
|
||||
((listOf("$" to "net.torvald.terrarum")) + ModMgr.loadOrder.reversed().map { it to ModMgr.moduleInfo[it]?.packageName }).forEach { (modName, packageRoot) ->
|
||||
val commandsList = if (modName == "$") engineCommandList else ModMgr.getFile(modName, "commands.csv").readLines()
|
||||
val packageConsole = "$packageRoot.console"
|
||||
|
||||
printdbg(this, "Loading console commands from '${packageConsole}'")
|
||||
|
||||
|
||||
// TODO load commands using commandsList
|
||||
|
||||
|
||||
val stream = ClassLoader.getSystemClassLoader().getResourceAsStream(packageConsole.replace('.', '/'))
|
||||
|
||||
|
||||
if (stream != null) { // not all modules have extra console commands
|
||||
|
||||
val reader = BufferedReader(InputStreamReader(stream))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.torvald.terrarum.console
|
||||
|
||||
import net.torvald.terrarum.App.printdbg
|
||||
import net.torvald.terrarum.ccG
|
||||
import net.torvald.terrarum.ccW
|
||||
import net.torvald.terrarum.ccY
|
||||
@@ -32,8 +33,6 @@ internal object CommandInterpreter {
|
||||
internal fun execute(command: String) {
|
||||
val cmd: Array<CommandInput?> = parse(command)
|
||||
|
||||
val error = Error()
|
||||
|
||||
for (single_command in cmd) {
|
||||
|
||||
if (single_command == null || single_command.argsCount == 0) continue
|
||||
@@ -65,6 +64,7 @@ internal object CommandInterpreter {
|
||||
}
|
||||
}
|
||||
catch (e: NullPointerException) {
|
||||
e.printStackTrace()
|
||||
echoUnknownCmd(single_command.name)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user