BEAMP -> BeamMP

This commit is contained in:
2023-07-12 20:56:14 +03:00
parent f364f29d79
commit 541849642c
8 changed files with 19 additions and 19 deletions
+3 -3
View File
@@ -7,8 +7,8 @@
"stop": "Сервер остановлен!", "stop": "Сервер остановлен!",
"": "Server auth", "": "Server auth",
"auth_need_key": "Нужен BEAMP ключ для запуска!", "auth_need_key": "Нужен BeamMP ключ для запуска!",
"auth_empty_key": "BEAMP ключ пустой!", "auth_empty_key": "BeamMP ключ пустой!",
"auth_cannot_open_browser": "Не получилось открыть браузер: {}", "auth_cannot_open_browser": "Не получилось открыть браузер: {}",
"auth_use_link": "Используй эту ссылку: {}", "auth_use_link": "Используй эту ссылку: {}",
@@ -17,7 +17,7 @@
"GUI_no": "Нет", "GUI_no": "Нет",
"GUI_ok": "Окей", "GUI_ok": "Окей",
"GUI_cancel": "Отмена", "GUI_cancel": "Отмена",
"GUI_need_key_message": "Нужен BEAMP ключ для запуска!\nХотите открыть ссылку в браузере для получения ключа?", "GUI_need_key_message": "Нужен BeamMP ключ для запуска!\nХотите открыть ссылку в браузере для получения ключа?",
"GUI_enter_key_message": "Пожалуйста введите ключ:", "GUI_enter_key_message": "Пожалуйста введите ключ:",
"GUI_cannot_open_browser": "Не получилось открыть браузер.\nИспользуй эту ссылку: {}", "GUI_cannot_open_browser": "Не получилось открыть браузер.\nИспользуй эту ссылку: {}",
+2 -2
View File
@@ -43,7 +43,7 @@ Server:
server_ip: 0.0.0.0 server_ip: 0.0.0.0
server_port: 30814 server_port: 30814
``` ```
* Если поставить `private: false` и не установить `key`, то сервер запросит BEAMP ключ, без него не запустится. * Если поставить `private: false` и не установить `key`, то сервер запросит BeamMP ключ, без него не запустится.
* Введя BEAMP ключ сервер появится в списке лаунчера. * Введя BeamMP ключ сервер появится в списке лаунчера.
* Взять ключ можно тут: [https://beammp.com/k/keys](https://beammp.com/k/keys) * Взять ключ можно тут: [https://beammp.com/k/keys](https://beammp.com/k/keys)
+4 -4
View File
@@ -67,13 +67,13 @@ ev.builtins_hook()
log.info(i18n.hello) log.info(i18n.hello)
log.info(i18n.config_path.format(config_path)) log.info(i18n.config_path.format(config_path))
log.debug("Initializing BEAMP Server system...") log.debug("Initializing BeamMP Server system...")
# Key handler.. # Key handler..
if not config.Auth['private'] and not config.Auth['key']: if not config.Auth['private'] and not config.Auth['key']:
log.warn(i18n.auth_need_key) log.warn(i18n.auth_need_key)
url = "https://beammp.com/k/keys" url = "https://beammp.com/k/keys"
if shortcuts.yes_no_dialog( if shortcuts.yes_no_dialog(
title='BEAMP Server Key', title='BeamMP Server Key',
text=i18n.GUI_need_key_message, text=i18n.GUI_need_key_message,
yes_text=i18n.GUI_yes, yes_text=i18n.GUI_yes,
no_text=i18n.GUI_no).run(): no_text=i18n.GUI_no).run():
@@ -84,12 +84,12 @@ if not config.Auth['private'] and not config.Auth['key']:
log.error(i18n.auth_cannot_open_browser.format(e)) log.error(i18n.auth_cannot_open_browser.format(e))
log.info(i18n.auth_use_link.format(url)) log.info(i18n.auth_use_link.format(url))
shortcuts.message_dialog( shortcuts.message_dialog(
title='BEAMP Server Key', title='BeamMP Server Key',
text=i18n.GUI_cannot_open_browser.format(url), text=i18n.GUI_cannot_open_browser.format(url),
ok_text=i18n.GUI_ok).run() ok_text=i18n.GUI_ok).run()
config.Auth['key'] = shortcuts.input_dialog( config.Auth['key'] = shortcuts.input_dialog(
title='BEAMP Server Key', title='BeamMP Server Key',
text=i18n.GUI_enter_key_message, text=i18n.GUI_enter_key_message,
ok_text=i18n.GUI_ok, ok_text=i18n.GUI_ok,
cancel_text=i18n.GUI_cancel).run() cancel_text=i18n.GUI_cancel).run()
+3 -3
View File
@@ -61,7 +61,7 @@ class Client:
async def tcp_send(self, data): async def tcp_send(self, data):
# TNetwork.cpp; Line: 383 # TNetwork.cpp; Line: 383
# BEAMP TCP protocol sends a header of 4 bytes, followed by the data. # BeamMP TCP protocol sends a header of 4 bytes, followed by the data.
# [][][][][][]...[] # [][][][][][]...[]
# ^------^^---...-^ # ^------^^---...-^
# size data # size data
@@ -160,7 +160,7 @@ class Core:
self.web_stop = None self.web_stop = None
self.client_major_version = "2.0" self.client_major_version = "2.0"
self.BEAMP_version = "3.2.0" self.BeamMP_version = "3.2.0"
def get_client(self, sock=None, cid=None): def get_client(self, sock=None, cid=None):
if cid: if cid:
@@ -224,7 +224,7 @@ class Core:
while self.run: while self.run:
data = {"uuid": config.Auth["key"], "players": len(self.clients), "maxplayers": config.Game["players"], data = {"uuid": config.Auth["key"], "players": len(self.clients), "maxplayers": config.Game["players"],
"port": config.Server["server_port"], "map": f"/levels/{config.Game['map']}/info.json", "port": config.Server["server_port"], "map": f"/levels/{config.Game['map']}/info.json",
"private": config.Auth['private'], "version": self.BEAMP_version, "private": config.Auth['private'], "version": self.BeamMP_version,
"clientversion": self.client_major_version, "clientversion": self.client_major_version,
"name": config.Server["name"], "modlist": modlist, "modstotalsize": modstotalsize, "name": config.Server["name"], "modlist": modlist, "modstotalsize": modstotalsize,
"modstotal": modstotal, "playerslist": "", "desc": config.Server['description'], "pass": False} "modstotal": modstotal, "playerslist": "", "desc": config.Server['description'], "pass": False}
+1 -1
View File
@@ -55,7 +55,7 @@ class Core:
self.web_thread: Thread = None self.web_thread: Thread = None
self.web_stop: Callable = lambda: None self.web_stop: Callable = lambda: None
self.client_major_version = "2.0" self.client_major_version = "2.0"
self.BEAMP_version = "3.2.0" self.BeamMP_version = "3.2.0"
def insert_client(self, client: Client) -> None: ... def insert_client(self, client: Client) -> None: ...
def create_client(self, *args, **kwargs) -> Client: ... def create_client(self, *args, **kwargs) -> Client: ...
async def check_alive(self) -> None: ... async def check_alive(self) -> None: ...
+1 -1
View File
@@ -21,7 +21,7 @@ class EventsSystem:
self.log.debug(f"register_event({event_name}, {event_func}):") self.log.debug(f"register_event({event_name}, {event_func}):")
if not callable(event_func): if not callable(event_func):
self.log.error(f"Cannot add event '{event_name}'. " self.log.error(f"Cannot add event '{event_name}'. "
f"Use `BEAMP.add_event({event_name}', function)` instead. Skipping it...") f"Use `KuiToi.add_event({event_name}', function)` instead. Skipping it...")
return return
if event_name not in self.__events: if event_name not in self.__events:
self.__events.update({str(event_name): [event_func]}) self.__events.update({str(event_name): [event_func]})
+2 -2
View File
@@ -8,7 +8,7 @@ class KuiToi:
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("BeamMP: Name is required")
self.log = get_logger(f"PluginsLoader | {name}") self.log = get_logger(f"PluginsLoader | {name}")
self.name = name self.name = name
@@ -43,7 +43,7 @@ class PluginsLoader:
plugin.print = print 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 KuiToi\n", "")
exec(code, plugin.__dict__) exec(code, plugin.__dict__)
plugin.load() plugin.load()
self.__plugins.update({file[:-3]: plugin}) self.__plugins.update({file[:-3]: plugin})
+3 -3
View File
@@ -7,8 +7,8 @@
"stop": "Сервер остановлен!", "stop": "Сервер остановлен!",
"": "Server auth", "": "Server auth",
"auth_need_key": "Нужен BEAMP ключ для запуска!", "auth_need_key": "Нужен BeamMP ключ для запуска!",
"auth_empty_key": "BEAMP ключ пустой!", "auth_empty_key": "BeamMP ключ пустой!",
"auth_cannot_open_browser": "Не получилось открыть браузер: {}", "auth_cannot_open_browser": "Не получилось открыть браузер: {}",
"auth_use_link": "Используй эту ссылку: {}", "auth_use_link": "Используй эту ссылку: {}",
@@ -17,7 +17,7 @@
"GUI_no": "Нет", "GUI_no": "Нет",
"GUI_ok": "Окей", "GUI_ok": "Окей",
"GUI_cancel": "Отмена", "GUI_cancel": "Отмена",
"GUI_need_key_message": "Нужен BEAMP ключ для запуска!\nХотите открыть ссылку в браузере для получения ключа?", "GUI_need_key_message": "Нужен BeamMP ключ для запуска!\nХотите открыть ссылку в браузере для получения ключа?",
"GUI_enter_key_message": "Пожалуйста введите ключ:", "GUI_enter_key_message": "Пожалуйста введите ключ:",
"GUI_cannot_open_browser": "Не получилось открыть браузер.\nИспользуй эту ссылку: {}", "GUI_cannot_open_browser": "Не получилось открыть браузер.\nИспользуй эту ссылку: {}",