mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-18 00:35:36 +00:00
Minor update
This commit is contained in:
parent
f52c73ab76
commit
c1cb8dcdba
@ -62,6 +62,7 @@ class EventsSystem:
|
|||||||
"onVehicleDeleted": [], # onCarDelete
|
"onVehicleDeleted": [], # onCarDelete
|
||||||
"onVehicleReset": [], # onCarReset
|
"onVehicleReset": [], # onCarReset
|
||||||
"onFileChanged": [], # TODO lua onFileChanged
|
"onFileChanged": [], # TODO lua onFileChanged
|
||||||
|
"onConsoleInput": [], # kt.add_command
|
||||||
}
|
}
|
||||||
|
|
||||||
def builtins_hook(self):
|
def builtins_hook(self):
|
||||||
|
@ -63,6 +63,11 @@ class MP:
|
|||||||
def _print(self, *args):
|
def _print(self, *args):
|
||||||
args = list(args)
|
args = list(args)
|
||||||
for i, arg in enumerate(args):
|
for i, arg in enumerate(args):
|
||||||
|
if isinstance(arg, str):
|
||||||
|
try:
|
||||||
|
args[i] = arg.encode("CP1251").decode(config.enc)
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
pass
|
||||||
if "LuaTable" in str(type(arg)):
|
if "LuaTable" in str(type(arg)):
|
||||||
args[i] = self._lua.globals().Util.JsonEncode(arg)
|
args[i] = self._lua.globals().Util.JsonEncode(arg)
|
||||||
s = " ".join(map(str, args))
|
s = " ".join(map(str, args))
|
||||||
|
@ -91,6 +91,10 @@ class KuiToi:
|
|||||||
return False
|
return False
|
||||||
return bool(self.get_player(cid=pid, nick=nick))
|
return bool(self.get_player(cid=pid, nick=nick))
|
||||||
|
|
||||||
|
def add_command(self, key, func, man, desc, custom_completer) -> dict:
|
||||||
|
self.log.debug("Requests add_command")
|
||||||
|
return console.add_command(key, func, man, desc, custom_completer)
|
||||||
|
|
||||||
|
|
||||||
class PluginsLoader:
|
class PluginsLoader:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user