mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-17 16:25: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.'
|
||||
__url__ = 'https://github.com/kuitoi/kuitoi-Server'
|
||||
__version__ = '0.1.3'
|
||||
__build__ = 214
|
||||
__build__ = 218
|
||||
__author__ = 'SantaSpeen'
|
||||
__author_email__ = 'admin@kuitoi.su'
|
||||
__license__ = "FPA"
|
||||
@ -64,13 +64,6 @@ log.info(i18n.hello)
|
||||
ev = EventsSystem()
|
||||
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..
|
||||
if not config.Auth['key']:
|
||||
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"):
|
||||
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)
|
||||
|
@ -7,7 +7,6 @@ class EventsSystem:
|
||||
|
||||
def __init__(self):
|
||||
self.__events = {
|
||||
"on_starting": [self.on_starting],
|
||||
"on_started": [self.on_started],
|
||||
"on_stop": [self.on_stop],
|
||||
"on_auth": [self.on_auth]
|
||||
@ -36,9 +35,6 @@ class EventsSystem:
|
||||
else:
|
||||
self.log.warning(f"Event {event_name} does not exist. Just skipping it...")
|
||||
|
||||
def on_starting(self):
|
||||
pass
|
||||
|
||||
def on_started(self):
|
||||
pass
|
||||
|
||||
|
@ -9,7 +9,7 @@ class BEAMP:
|
||||
def __init__(self, name=None):
|
||||
if name is None:
|
||||
raise Exception("BEAMP: Name is required")
|
||||
self.log = get_logger(f"BEAMP({name})")
|
||||
self.log = get_logger(f"PluginsLoader | {name}")
|
||||
self.name = name
|
||||
|
||||
def set_name(self, name):
|
||||
@ -41,6 +41,7 @@ class PluginsLoader:
|
||||
self.log.debug(f"Loading plugin: {file}")
|
||||
plugin = types.ModuleType('plugin')
|
||||
plugin.BEAMP = BEAMP
|
||||
plugin.print = print
|
||||
file = os.path.join(self.__plugins_dir, file)
|
||||
with open(f'{file}', 'r') as f:
|
||||
code = f.read().replace("import BEAMP\n", "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user