mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-17 16:25:36 +00:00
lua event onConsoleInput
This commit is contained in:
parent
76b568c248
commit
e621c8dc7c
@ -201,13 +201,21 @@ class Console:
|
|||||||
if cmd == "":
|
if cmd == "":
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
found_in_lua = False
|
||||||
|
d = ev.call_lua_event("onConsoleInput", cmd_in)
|
||||||
|
if len(d) > 0:
|
||||||
|
for text in d:
|
||||||
|
if text is not None:
|
||||||
|
found_in_lua = True
|
||||||
|
self.log(text)
|
||||||
command_object = self.__func.get(cmd)
|
command_object = self.__func.get(cmd)
|
||||||
if command_object:
|
if command_object:
|
||||||
out = command_object['f'](cmd_s[1:])
|
out = command_object['f'](cmd_s[1:])
|
||||||
if out:
|
if out:
|
||||||
self.log(out)
|
self.log(out)
|
||||||
else:
|
else:
|
||||||
self.log(self.__not_found % cmd)
|
if not found_in_lua:
|
||||||
|
self.log(self.__not_found % cmd)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise KeyboardInterrupt
|
raise KeyboardInterrupt
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user