3
2
forked from Dniel97/artemis

make threading optional

This commit is contained in:
Hay1tsme 2023-07-08 00:34:55 -04:00
parent 6c155a5e48
commit 03cf535ff6
4 changed files with 12 additions and 1 deletions

View File

@ -36,6 +36,12 @@ class ServerConfig:
self.__config, "core", "server", "is_develop", default=True
)
@property
def threading(self) -> bool:
return CoreConfig.get_config_field(
self.__config, "core", "server", "threading", default=False
)
@property
def log_dir(self) -> str:
return CoreConfig.get_config_field(

View File

@ -5,6 +5,7 @@
- `allow_unregistered_serials`: Allows games that do not have registered keychips to connect and authenticate. Disable to restrict who can connect to your server. Recomended to disable for production setups. Default `True`
- `name`: Name for the server, used by some games in their default MOTDs. Default `ARTEMiS`
- `is_develop`: Flags that the server is a development instance without a proxy standing in front of it. Setting to `False` tells the server not to listen for SSL, because the proxy should be handling all SSL-related things, among other things. Default `True`
- `threading`: Flags that `reactor.run` should be called via the `Thread` standard library. May provide a speed boost, but removes the ability to kill the server via `Ctrl + C`. Default: `False`
- `log_dir`: Directory to store logs. Server MUST have read and write permissions to this directory or you will have issues. Default `logs`
## Title
- `loglevel`: Logging level for the title server. Default `info`

View File

@ -4,6 +4,7 @@ server:
allow_unregistered_serials: True
name: "ARTEMiS"
is_develop: True
threading: False
log_dir: "logs"
title:

View File

@ -283,4 +283,7 @@ if __name__ == "__main__":
server.Site(dispatcher)
)
Thread(target=reactor.run, args=(False,)).start()
if cfg.server.threading:
Thread(target=reactor.run, args=(False,)).start()
else:
reactor.run()