mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-17 16:25:36 +00:00
Compare commits
7 Commits
a50decb470
...
76b568c248
Author | SHA1 | Date | |
---|---|---|---|
76b568c248 | |||
4c7f5ac14b | |||
28386a0300 | |||
8140b3347a | |||
4276eb0fdb | |||
d92aae7c47 | |||
6ccbe99d47 |
32
README.md
32
README.md
@ -6,7 +6,7 @@ BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
||||
|
||||
## TODOs
|
||||
|
||||
- [x] Server core
|
||||
- [x] Server core:
|
||||
- [x] BeamMP System:
|
||||
- [x] Private access (Without key, Direct connect)
|
||||
- [x] Public access (With key, listing in Launcher)
|
||||
@ -26,18 +26,14 @@ BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
||||
- [x] Delete cars
|
||||
- [x] Edit cars
|
||||
- [x] Reset cars
|
||||
- [x] "ABG:" (compressed data)
|
||||
- [x] "ABG": (compressed data)
|
||||
- [x] Decompress data
|
||||
- [x] Compress data
|
||||
- [x] UDP Server part:
|
||||
- [x] Ping
|
||||
- [x] Position synchronizations
|
||||
- [x] Additional:
|
||||
- [ ] KuiToi System
|
||||
- [ ] Servers counter
|
||||
- [ ] Players counter
|
||||
- [ ] Etc.
|
||||
- [x] Logger
|
||||
- [x] Logger:
|
||||
- [x] Just logging
|
||||
- [x] Log in file
|
||||
- [x] Log history (.1.log, .2.log, ...)
|
||||
@ -45,13 +41,17 @@ BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
||||
- [x] Tabulation
|
||||
- [x] History
|
||||
- [x] Autocomplete
|
||||
- [x] Events System
|
||||
- [x] Events System:
|
||||
- [x] Call events
|
||||
- [x] Create custom events
|
||||
- [x] Return from events
|
||||
- [x] Async support
|
||||
- [ ] Add all events
|
||||
- [x] Plugins supports
|
||||
- [x] MultiLanguage: (i18n support)
|
||||
- [ ] Core
|
||||
- [x] Console
|
||||
- [x] WebAPI
|
||||
- [x] Plugins supports:
|
||||
- [x] Python part:
|
||||
- [x] Load Python plugins
|
||||
- [x] Async support
|
||||
@ -62,15 +62,19 @@ BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
||||
- [x] MP Class
|
||||
- [x] Util class
|
||||
- [x] FS class
|
||||
- [x] MultiLanguage (i18n support)
|
||||
- [ ] Core
|
||||
- [x] Console
|
||||
- [x] WebAPI
|
||||
- [ ] HTTP API Server (fastapi)
|
||||
- [ ] HTTP API Server: (fastapi)
|
||||
- [x] Stop and Start with core
|
||||
- [x] Configure FastAPI logger
|
||||
- [ ] Sync with event system
|
||||
- [ ] Add methods...
|
||||
- [ ] RCON System:
|
||||
- [ ] Serving
|
||||
- [ ] Client
|
||||
- [ ] SSL encryption
|
||||
- [ ] KuiToi System
|
||||
- [ ] Servers counter
|
||||
- [ ] Players counter
|
||||
- [ ] Etc.
|
||||
- [ ] [Documentation](./docs/)
|
||||
|
||||
## Installation
|
||||
|
@ -11,18 +11,6 @@ KiuToi几乎完全支持BeamMP的lua插件,所有必要的方法都已经创
|
||||
#### Cobalt Essentials V1.7.5(免费,[github ↗](https://github.com/prestonelam2003/CobaltEssentials/))
|
||||
|
||||
1. 要获取`pluginPath`,需要:`debug.getinfo(1).source:gsub("\\","/")` => `debug.getinfo(1).source:gsub("\\","/"):gsub("@", "")`,因为路径返回值中包含`@`,这破坏了插件。
|
||||
2. 必须将所有的`require()`移动到`onInit`之后。
|
||||
3. 在某些情况下,必须在函数声明之后注册`MP.RegisterEvent`,即:
|
||||
```lua
|
||||
--这样不正确,可能无法注册
|
||||
MP.RegisterEvent("onPlayerAuth","onPlayerAuth")
|
||||
function onPlayerAuth(name, role, isGuest)
|
||||
-- Some plugin code
|
||||
end
|
||||
|
||||
--这样就可以了
|
||||
MP.RegisterEvent("onPlayerAuth","onPlayerAuth")
|
||||
```
|
||||
|
||||
### 工作原理
|
||||
|
||||
|
@ -11,18 +11,6 @@ KiuToi does not support: `MP.Set()`
|
||||
#### 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.
|
||||
2. All `require()` statements had to be moved after `onInit`.
|
||||
3. In some cases, `MP.RegisterEvent` had to be moved after the function declaration, i.e.:
|
||||
```lua
|
||||
--This is incorrect, registration may fail
|
||||
MP.RegisterEvent("onPlayerAuth","onPlayerAuth")
|
||||
function onPlayerAuth(name, role, isGuest)
|
||||
-- Some plugin code
|
||||
end
|
||||
|
||||
--This is the correct version
|
||||
MP.RegisterEvent("onPlayerAuth","onPlayerAuth")
|
||||
```
|
||||
|
||||
### A Little About How it Works
|
||||
|
||||
|
@ -11,18 +11,6 @@
|
||||
#### Cobalt Essentials V1.7.5 (Бесплатный, [github](https://github.com/prestonelam2003/CobaltEssentials/))
|
||||
|
||||
1. Для получения `pluginPath` нужно: `debug.getinfo(1).source:gsub("\\","/")` => `debug.getinfo(1).source:gsub("\\","/"):gsub("@", "")` так как пусть возвращается с `@`, что сломало плагин.
|
||||
2. Пришлось перенести все `require()` за `onInit`
|
||||
3. В некоторых моментах пришлось перенести `MP.RegisterEvent` уже после объявления функции, т.е.:
|
||||
```lua
|
||||
--Вот так не правильно, может не пройти регистрация
|
||||
MP.RegisterEvent("onPlayerAuth","onPlayerAuth")
|
||||
function onPlayerAuth(name, role, isGuest)
|
||||
-- Some plugin code
|
||||
end
|
||||
|
||||
--Вот такой вариант пройдёт
|
||||
MP.RegisterEvent("onPlayerAuth","onPlayerAuth")
|
||||
```
|
||||
|
||||
### Немного о принципе работы
|
||||
|
||||
|
@ -152,8 +152,9 @@ class EventsSystem:
|
||||
funcs_data.append(fd)
|
||||
except Exception as e:
|
||||
# TODO: i18n
|
||||
self.log.error(f'Error while calling lua event "{event_name}"; In function: "{func_name}"')
|
||||
self.log.exception(e)
|
||||
self.log.error(f'Error: "{e}" - while calling lua event "{event_name}" with arguments: {args} - '
|
||||
f'in function: "{func_name}"')
|
||||
# self.log.exception(e)
|
||||
else:
|
||||
# TODO: i18n
|
||||
self.log.warning(f"Event {event_name} does not exist, maybe ev.call_lua_event() or MP.Trigger<>Event()?. "
|
||||
|
@ -116,8 +116,9 @@ class MP:
|
||||
funcs_data.append(fd)
|
||||
except Exception as e:
|
||||
# TODO: i18n
|
||||
self.log.error(f'Error while calling lua event "{event_name}"; In function: "{func_name}"')
|
||||
self.log.exception(e)
|
||||
self.log.error(f'Error: "{e}" - while calling lua event "{event_name}" with arguments: {args} - '
|
||||
f'in function: "{func_name}"')
|
||||
# self.log.exception(e)
|
||||
else:
|
||||
# TODO: i18n
|
||||
self.log.warning(f"Event {event_name} does not exist, maybe ev.call_lua_event() or MP.Trigger<>Event()?. "
|
||||
@ -626,7 +627,7 @@ class LuaPluginsLoader:
|
||||
|
||||
for name in self.lua_dirs:
|
||||
# noinspection PyArgumentList
|
||||
lua = LuaRuntime(encoding=config.enc, source_encoding=config.enc, unpack_returned_tuples=True)
|
||||
lua = LuaRuntime(encoding="CP1251", source_encoding=config.enc, unpack_returned_tuples=True)
|
||||
lua_globals = lua.globals()
|
||||
lua_globals.printRaw = lua.globals().print
|
||||
lua_globals.exit = lambda x: self.log.info(f"KuiToi: You can't disable server..")
|
||||
|
Loading…
x
Reference in New Issue
Block a user