mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2026-04-24 09:06:36 +00:00
Compare commits
9 Commits
0.4.2-beta
...
0.4.3-beta
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d01f0ef8d | |||
| eea03c835f | |||
| f28a783f7e | |||
| dbb27ff6d5 | |||
| e621c8dc7c | |||
| 76b568c248 | |||
| 4c7f5ac14b | |||
| 28386a0300 | |||
| 8140b3347a |
39
README.md
39
README.md
@@ -4,9 +4,16 @@
|
|||||||
**_[Status: Beta]_** \
|
**_[Status: Beta]_** \
|
||||||
BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
||||||
|
|
||||||
|
Why did I decide to write my own kernel from scratch?\
|
||||||
|
I didn't like writing plugins in Lua after using Python; it was very inconvenient, there were always some nuances, which ultimately led me to create KuiToi!
|
||||||
|
|
||||||
|
**Our site**: [kuitoi.su](https://kuitoi.su) (WIP)\
|
||||||
|
**Our forum**: [forum.kuitoi.su](https://forum.kuitoi.su) (WIP)\
|
||||||
|
**Our discord**: [KuiToi](https://discord.gg/BAcgaAmdkJ)
|
||||||
|
|
||||||
## TODOs
|
## TODOs
|
||||||
|
|
||||||
- [x] Server core
|
- [x] Server core:
|
||||||
- [x] BeamMP System:
|
- [x] BeamMP System:
|
||||||
- [x] Private access (Without key, Direct connect)
|
- [x] Private access (Without key, Direct connect)
|
||||||
- [x] Public access (With key, listing in Launcher)
|
- [x] Public access (With key, listing in Launcher)
|
||||||
@@ -26,18 +33,14 @@ BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
|||||||
- [x] Delete cars
|
- [x] Delete cars
|
||||||
- [x] Edit cars
|
- [x] Edit cars
|
||||||
- [x] Reset cars
|
- [x] Reset cars
|
||||||
- [x] "ABG:" (compressed data)
|
- [x] "ABG": (compressed data)
|
||||||
- [x] Decompress data
|
- [x] Decompress data
|
||||||
- [x] Compress data
|
- [x] Compress data
|
||||||
- [x] UDP Server part:
|
- [x] UDP Server part:
|
||||||
- [x] Ping
|
- [x] Ping
|
||||||
- [x] Position synchronizations
|
- [x] Position synchronizations
|
||||||
- [x] Additional:
|
- [x] Additional:
|
||||||
- [ ] KuiToi System
|
- [x] Logger:
|
||||||
- [ ] Servers counter
|
|
||||||
- [ ] Players counter
|
|
||||||
- [ ] Etc.
|
|
||||||
- [x] Logger
|
|
||||||
- [x] Just logging
|
- [x] Just logging
|
||||||
- [x] Log in file
|
- [x] Log in file
|
||||||
- [x] Log history (.1.log, .2.log, ...)
|
- [x] Log history (.1.log, .2.log, ...)
|
||||||
@@ -45,13 +48,17 @@ BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
|||||||
- [x] Tabulation
|
- [x] Tabulation
|
||||||
- [x] History
|
- [x] History
|
||||||
- [x] Autocomplete
|
- [x] Autocomplete
|
||||||
- [x] Events System
|
- [x] Events System:
|
||||||
- [x] Call events
|
- [x] Call events
|
||||||
- [x] Create custom events
|
- [x] Create custom events
|
||||||
- [x] Return from events
|
- [x] Return from events
|
||||||
- [x] Async support
|
- [x] Async support
|
||||||
- [ ] Add all events
|
- [ ] Add all events
|
||||||
- [x] Plugins supports
|
- [x] MultiLanguage: (i18n support)
|
||||||
|
- [ ] Core
|
||||||
|
- [x] Console
|
||||||
|
- [x] WebAPI
|
||||||
|
- [x] Plugins supports:
|
||||||
- [x] Python part:
|
- [x] Python part:
|
||||||
- [x] Load Python plugins
|
- [x] Load Python plugins
|
||||||
- [x] Async support
|
- [x] Async support
|
||||||
@@ -62,15 +69,19 @@ BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
|||||||
- [x] MP Class
|
- [x] MP Class
|
||||||
- [x] Util class
|
- [x] Util class
|
||||||
- [x] FS class
|
- [x] FS class
|
||||||
- [x] MultiLanguage (i18n support)
|
- [ ] HTTP API Server: (fastapi)
|
||||||
- [ ] Core
|
|
||||||
- [x] Console
|
|
||||||
- [x] WebAPI
|
|
||||||
- [ ] HTTP API Server (fastapi)
|
|
||||||
- [x] Stop and Start with core
|
- [x] Stop and Start with core
|
||||||
- [x] Configure FastAPI logger
|
- [x] Configure FastAPI logger
|
||||||
- [ ] Sync with event system
|
- [ ] Sync with event system
|
||||||
- [ ] Add methods...
|
- [ ] Add methods...
|
||||||
|
- [ ] RCON System:
|
||||||
|
- [ ] Serving
|
||||||
|
- [ ] Client
|
||||||
|
- [ ] SSL encryption
|
||||||
|
- [ ] KuiToi System
|
||||||
|
- [ ] Servers counter
|
||||||
|
- [ ] Players counter
|
||||||
|
- [ ] Etc.
|
||||||
- [ ] [Documentation](./docs/)
|
- [ ] [Documentation](./docs/)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ KiuToi几乎完全支持BeamMP的lua插件,所有必要的方法都已经创
|
|||||||
#### Cobalt Essentials V1.7.5(免费,[github ↗](https://github.com/prestonelam2003/CobaltEssentials/))
|
#### Cobalt Essentials V1.7.5(免费,[github ↗](https://github.com/prestonelam2003/CobaltEssentials/))
|
||||||
|
|
||||||
1. 要获取`pluginPath`,需要:`debug.getinfo(1).source:gsub("\\","/")` => `debug.getinfo(1).source:gsub("\\","/"):gsub("@", "")`,因为路径返回值中包含`@`,这破坏了插件。
|
1. 要获取`pluginPath`,需要:`debug.getinfo(1).source:gsub("\\","/")` => `debug.getinfo(1).source:gsub("\\","/"):gsub("@", "")`,因为路径返回值中包含`@`,这破坏了插件。
|
||||||
2. `cobaltSysChar`
|
|
||||||
|
|
||||||
### 工作原理
|
### 工作原理
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ KiuToi does not support: `MP.Set()`
|
|||||||
#### Cobalt Essentials V1.7.5 (Free, [github](https://github.com/prestonelam2003/CobaltEssentials/))
|
#### Cobalt Essentials V1.7.5 (Free, [github](https://github.com/prestonelam2003/CobaltEssentials/))
|
||||||
|
|
||||||
1. To obtain `pluginPath`, use: `debug.getinfo(1).source:gsub("\\","/")` => `debug.getinfo(1).source:gsub("\\","/"):gsub("@", "")` as the path returns with `@`, which broke the plugin.
|
1. To obtain `pluginPath`, use: `debug.getinfo(1).source:gsub("\\","/")` => `debug.getinfo(1).source:gsub("\\","/"):gsub("@", "")` as the path returns with `@`, which broke the plugin.
|
||||||
2. `cobaltSysChar`
|
|
||||||
|
|
||||||
### A Little About How it Works
|
### A Little About How it Works
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#### Cobalt Essentials V1.7.5 (Бесплатный, [github](https://github.com/prestonelam2003/CobaltEssentials/))
|
#### Cobalt Essentials V1.7.5 (Бесплатный, [github](https://github.com/prestonelam2003/CobaltEssentials/))
|
||||||
|
|
||||||
1. Для получения `pluginPath` нужно: `debug.getinfo(1).source:gsub("\\","/")` => `debug.getinfo(1).source:gsub("\\","/"):gsub("@", "")` так как пусть возвращается с `@`, что сломало плагин.
|
1. Для получения `pluginPath` нужно: `debug.getinfo(1).source:gsub("\\","/")` => `debug.getinfo(1).source:gsub("\\","/"):gsub("@", "")` так как пусть возвращается с `@`, что сломало плагин.
|
||||||
2. `cobaltSysChar`
|
|
||||||
|
|
||||||
### Немного о принципе работы
|
### Немного о принципе работы
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Developed by KuiToi Dev
|
# Developed by KuiToi Dev
|
||||||
# File core.tcp_server.py
|
# File core.tcp_server.py
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Core version: 0.4.1
|
# Core version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Developed by KuiToi Dev
|
# Developed by KuiToi Dev
|
||||||
# File core.tcp_server.py
|
# File core.tcp_server.py
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Core version: 0.4.1
|
# Core version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Developed by KuiToi Dev
|
# Developed by KuiToi Dev
|
||||||
# File core.__init__.py
|
# File core.__init__.py
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Version 1.3
|
# Version 1.4
|
||||||
# Core version: 0.4.1
|
# Core version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
# Special thanks to: AI Sage(https://poe.com/Sage), AI falcon-40b-v7(https://OpenBuddy.ai)
|
# Special thanks to: AI Sage(https://poe.com/Sage), AI falcon-40b-v7(https://OpenBuddy.ai)
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
__title__ = 'KuiToi-Server'
|
__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.4.1'
|
__version__ = '0.4.3'
|
||||||
__build__ = 1925 # Я это считаю лог файлами
|
__build__ = 2125 # Я это считаю лог файлами
|
||||||
__author__ = 'SantaSpeen'
|
__author__ = 'SantaSpeen'
|
||||||
__author_email__ = 'admin@kuitoi.su'
|
__author_email__ = 'admin@kuitoi.su'
|
||||||
__license__ = "FPA"
|
__license__ = "FPA"
|
||||||
@@ -102,7 +102,7 @@ if not config.Auth['private'] and not config.Auth['key']:
|
|||||||
log.debug("Initializing console...")
|
log.debug("Initializing console...")
|
||||||
console = Console()
|
console = Console()
|
||||||
console.builtins_hook()
|
console.builtins_hook()
|
||||||
# console.logger_hook()
|
console.logger_hook()
|
||||||
console.add_command("stop", console.stop, i18n.man_message_stop, i18n.help_message_stop)
|
console.add_command("stop", console.stop, i18n.man_message_stop, i18n.help_message_stop)
|
||||||
console.add_command("exit", console.stop, i18n.man_message_exit, i18n.help_message_exit)
|
console.add_command("exit", console.stop, i18n.man_message_exit, i18n.help_message_exit)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Developed by KuiToi Dev
|
# Developed by KuiToi Dev
|
||||||
# File core.core.py
|
# File core.core.py
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Version: 0.4.1
|
# Version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Developed by KuiToi Dev
|
# Developed by KuiToi Dev
|
||||||
# File core.core.pyi
|
# File core.core.pyi
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Version 0.4.1
|
# Core version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Developed by KuiToi Dev
|
# Developed by KuiToi Dev
|
||||||
# File core.tcp_server.py
|
# File core.tcp_server.py
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Core version: 0.4.1
|
# Core version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Developed by KuiToi Dev
|
# Developed by KuiToi Dev
|
||||||
# File core.tcp_server.pyi
|
# File core.tcp_server.pyi
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Core version: 0.4.1
|
# Core version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Developed by KuiToi Dev
|
# Developed by KuiToi Dev
|
||||||
# File core.udp_server.py
|
# File core.udp_server.py
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Core version: 0.4.1
|
# Core version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Developed by KuiToi Dev
|
# Developed by KuiToi Dev
|
||||||
# File core.udp_server.py
|
# File core.udp_server.py
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Core version: 0.4.1
|
# Core version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# File core.utils.py
|
# File core.utils.py
|
||||||
# Written by: SantaSpeen
|
# Written by: SantaSpeen
|
||||||
# Version 1.1
|
# Version 1.1
|
||||||
# Core version: 0.4.1
|
# Core version: 0.4.3
|
||||||
# Licence: FPA
|
# Licence: FPA
|
||||||
# (c) kuitoi.su 2023
|
# (c) kuitoi.su 2023
|
||||||
import datetime
|
import datetime
|
||||||
|
|||||||
@@ -122,19 +122,30 @@ class Console:
|
|||||||
self.__alias.update(custom_completer or {key: None})
|
self.__alias.update(custom_completer or {key: None})
|
||||||
self.__alias["man"].update({key: None})
|
self.__alias["man"].update({key: None})
|
||||||
self.__func.update({key: {"f": func}})
|
self.__func.update({key: {"f": func}})
|
||||||
self.__man.update({key: f'html<seagreen>{i18n.man_for} <b>{key}</b>\n{man}</seagreen>' if man else None})
|
self.__man.update({key: f'html:<seagreen>{i18n.man_for} <b>{key}</b>\n{man}</seagreen>' if man else None})
|
||||||
self.__desc.update({key: desc})
|
self.__desc.update({key: desc})
|
||||||
self.__update_completer()
|
self.__update_completer()
|
||||||
return self.__alias.copy()
|
return self.__alias.copy()
|
||||||
|
|
||||||
def write(self, s: AnyStr):
|
def _write(self, t):
|
||||||
if s.startswith("html"):
|
if t.startswith("html:"):
|
||||||
print_formatted_text(HTML(s[4:]))
|
print_formatted_text(HTML(t[5:]))
|
||||||
else:
|
else:
|
||||||
print_formatted_text(s)
|
print_formatted_text(t)
|
||||||
|
|
||||||
|
def write(self, s: AnyStr):
|
||||||
|
if isinstance(s, (list, tuple)):
|
||||||
|
for text in s:
|
||||||
|
self._write(text)
|
||||||
|
else:
|
||||||
|
self._write(s)
|
||||||
|
|
||||||
def log(self, s: AnyStr) -> None:
|
def log(self, s: AnyStr) -> None:
|
||||||
self.__logger.info(f"{s}")
|
if isinstance(s, (list, tuple)):
|
||||||
|
for text in s:
|
||||||
|
self.__logger.info(f"{text}")
|
||||||
|
else:
|
||||||
|
self.__logger.info(f"{s}")
|
||||||
# self.write(s)
|
# self.write(s)
|
||||||
|
|
||||||
def __lshift__(self, s: AnyStr) -> None:
|
def __lshift__(self, s: AnyStr) -> None:
|
||||||
@@ -201,13 +212,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:
|
||||||
|
|||||||
Reference in New Issue
Block a user