From 05ed3b4a9bafa84c6b4d0cdb459dc0c90290d533 Mon Sep 17 00:00:00 2001 From: NikkyAI Date: Wed, 28 Nov 2018 15:23:47 +0100 Subject: [PATCH] do not use the same arguments as nonce and perm level --- core/src/main/kotlin/matterlink/command/CommandCoreML.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/kotlin/matterlink/command/CommandCoreML.kt b/core/src/main/kotlin/matterlink/command/CommandCoreML.kt index a05690e..eddf03b 100644 --- a/core/src/main/kotlin/matterlink/command/CommandCoreML.kt +++ b/core/src/main/kotlin/matterlink/command/CommandCoreML.kt @@ -45,10 +45,10 @@ object CommandCoreML { return "no code passed" } if (request.nonce != nonce) { - return "nonce in request does not match" + return "nonce in request does not match with $nonce" } - val powerLevelArg = args.getOrNull(2)?.toDoubleOrNull() - val powerLevel = powerLevelArg ?: run { return "permLevel cannot be parsed (args: $args)" } + val powerLevelArg = args.getOrNull(3)?.toDoubleOrNull() + val powerLevel = powerLevelArg ?: run { return "permLevel cannot be parsed: ${args.getOrNull(3)}" } ?: request.powerlevel ?: return "no permLevel provided" PermissionConfig.add(request.uuid, powerLevel, "${request.user} Authorized by $user")