summaryrefslogtreecommitdiff
path: root/webtoken.py
diff options
context:
space:
mode:
authorDico200 <dico.karssiens@gmail.com>2015-03-19 23:51:33 +0100
committerDico200 <dico.karssiens@gmail.com>2015-03-19 23:51:33 +0100
commit1750c8220885348f63e4e07d086a5235ac50dc8d (patch)
tree44a7c4a0c5989049b30d5e1580cfa81d787855a2 /webtoken.py
parentd993cc223ae4cc528def3e249d76b904e3c52f0e (diff)
Changed all CommandExecutor arguments
Added arguments command and label to all command executor functions, hopefully for massive performance increase. This is due to the following mess in PythonLoader: ``` Java @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { boolean result; if (argcount == -1) { try { result = call(4, sender, command, label, args); argcount = 4; } catch (PyException e) { //this could goof up someone ... they'll probably yell at us and eventually read this code ... fuck them if (e.type == Py.TypeError && (e.value.toString().endsWith("takes exactly 3 arguments (4 given)") || e.value.toString().endsWith("takes exactly 4 arguments (5 given)"))) { result = call(3, sender, command, label, args); argcount = 3; } else if (e.type == Py.TypeError && (e.value.toString().endsWith("takes exactly 2 arguments (4 given)") || e.value.toString().endsWith("takes exactly 3 arguments (5 given)"))) { result = call(2, sender, command, label, args); argcount = 2; } else { throw e; } } } else { result = call(argcount, sender, command, label, args); } return result; } ``` Note: Still WIP on reports - I'm working on making it keep solved reports to fix issue 10
Diffstat (limited to 'webtoken.py')
-rw-r--r--webtoken.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/webtoken.py b/webtoken.py
index 2ff97e8..c0066a6 100644
--- a/webtoken.py
+++ b/webtoken.py
@@ -99,13 +99,13 @@ def tokengen_command(sender, args):
@hook.command("token")
-def on_token_command(sender, args):
+def on_token_command(sender, command, label, args):
thread.start_new_thread(token_command, (sender,))
return True
@hook.command("gettoken")
-def on_gettoken_command(sender, args):
+def on_gettoken_command(sender, command, label, args):
thread.start_new_thread(tokengen_command, (sender, args))
return True