mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-18 00:35:36 +00:00
Minor
This commit is contained in:
parent
56c1da1134
commit
4d8cd4e559
@ -9,7 +9,7 @@ __title__ = 'KuiToi-Server'
|
|||||||
__description__ = 'BeamingDrive Multiplayer server compatible with BeamMP clients.'
|
__description__ = 'BeamingDrive Multiplayer server compatible with BeamMP clients.'
|
||||||
__url__ = 'https://github.com/kuitoi/kuitoi-Server'
|
__url__ = 'https://github.com/kuitoi/kuitoi-Server'
|
||||||
__version__ = '0.1.3'
|
__version__ = '0.1.3'
|
||||||
__build__ = 214
|
__build__ = 218
|
||||||
__author__ = 'SantaSpeen'
|
__author__ = 'SantaSpeen'
|
||||||
__author_email__ = 'admin@kuitoi.su'
|
__author_email__ = 'admin@kuitoi.su'
|
||||||
__license__ = "FPA"
|
__license__ = "FPA"
|
||||||
@ -64,13 +64,6 @@ log.info(i18n.hello)
|
|||||||
ev = EventsSystem()
|
ev = EventsSystem()
|
||||||
ev.builtins_hook()
|
ev.builtins_hook()
|
||||||
|
|
||||||
if not os.path.exists("plugins"):
|
|
||||||
os.mkdir("plugins")
|
|
||||||
pl = PluginsLoader("plugins")
|
|
||||||
pl.load_plugins()
|
|
||||||
|
|
||||||
ev.call_event("on_starting")
|
|
||||||
|
|
||||||
# Key handler..
|
# Key handler..
|
||||||
if not config.Auth['key']:
|
if not config.Auth['key']:
|
||||||
log.warn("Key needed for starting the server!")
|
log.warn("Key needed for starting the server!")
|
||||||
@ -101,5 +94,11 @@ console.add_command("exit", console.stop, "stop - Just shutting down the server.
|
|||||||
|
|
||||||
if not os.path.exists("mods"):
|
if not os.path.exists("mods"):
|
||||||
os.mkdir("mods")
|
os.mkdir("mods")
|
||||||
|
if not os.path.exists("plugins"):
|
||||||
|
os.mkdir("plugins")
|
||||||
|
|
||||||
|
pl = PluginsLoader("plugins")
|
||||||
|
pl.load_plugins()
|
||||||
|
ev.call_event("on_started")
|
||||||
|
|
||||||
log.info(i18n.init)
|
log.info(i18n.init)
|
||||||
|
@ -7,7 +7,6 @@ class EventsSystem:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.__events = {
|
self.__events = {
|
||||||
"on_starting": [self.on_starting],
|
|
||||||
"on_started": [self.on_started],
|
"on_started": [self.on_started],
|
||||||
"on_stop": [self.on_stop],
|
"on_stop": [self.on_stop],
|
||||||
"on_auth": [self.on_auth]
|
"on_auth": [self.on_auth]
|
||||||
@ -36,9 +35,6 @@ class EventsSystem:
|
|||||||
else:
|
else:
|
||||||
self.log.warning(f"Event {event_name} does not exist. Just skipping it...")
|
self.log.warning(f"Event {event_name} does not exist. Just skipping it...")
|
||||||
|
|
||||||
def on_starting(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def on_started(self):
|
def on_started(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ class BEAMP:
|
|||||||
def __init__(self, name=None):
|
def __init__(self, name=None):
|
||||||
if name is None:
|
if name is None:
|
||||||
raise Exception("BEAMP: Name is required")
|
raise Exception("BEAMP: Name is required")
|
||||||
self.log = get_logger(f"BEAMP({name})")
|
self.log = get_logger(f"PluginsLoader | {name}")
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def set_name(self, name):
|
def set_name(self, name):
|
||||||
@ -41,6 +41,7 @@ class PluginsLoader:
|
|||||||
self.log.debug(f"Loading plugin: {file}")
|
self.log.debug(f"Loading plugin: {file}")
|
||||||
plugin = types.ModuleType('plugin')
|
plugin = types.ModuleType('plugin')
|
||||||
plugin.BEAMP = BEAMP
|
plugin.BEAMP = BEAMP
|
||||||
|
plugin.print = print
|
||||||
file = os.path.join(self.__plugins_dir, file)
|
file = os.path.join(self.__plugins_dir, file)
|
||||||
with open(f'{file}', 'r') as f:
|
with open(f'{file}', 'r') as f:
|
||||||
code = f.read().replace("import BEAMP\n", "")
|
code = f.read().replace("import BEAMP\n", "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user