Installation and Running
Environments
Note
Taking the Windows OS as an example, my testing environment is Windows 11 and Python 3.7. In theory, the server can run on all platforms with sufficient permissions.
Downloading
You can directly download the zip file from Releases, or you can clone the repository. Some small changes or experimental updates will be committed in dev branch. Please carefully review it if necessary.
Installing Python Dependencies
Info
Require Python >= 3.6.
At present, there are not many dependencies used in this project. Please choose whether to create a virtual environment as needed.
Install requirements using Python's built-in pip
:
pip install -r requirements.txt
Main Server Configuration
The configuration file for the main server is config.py
, or it can be also be a config
folder that complies with module specifications. The program will use from config import Config
to import user configuration, which will overwrite the default configuration. Unspecified options will use the default values located in core/config_manager.py
.
The config.py
file and the main.py
file need to be in the same folder, and the configuration file itself should contain a Config
class with class attributes being config options. Here is a brief example, including several commonly used config options:
class Config:
HOST = '0.0.0.0' # Listening address of the main server
PORT = 80 # Port of the main server (be careful of port conflicts)
GAME_API_PREFIX: str | list[str] = '/my_game_api/233' # Prefix of Game API
ALLOW_APPVERSION: list[str] = ['9.9.9', '2.3.3'] # Allowed client versions
Tips
You can also imitate the example file config.example.py
. The complete config options are listed in the Configure Document.
Link Play Sub Server Configuration
Caution
If you are not sure what some of these settings are and what their purposes are, please do not make any changes. By default, the Link Play feature is directly available.
class Config:
HOST = '0.0.0.0' # Listening address of the sub server
UDP_PORT = 10900 # UDP port of the sub server
TCP_PORT = 10901 # TCP port of the sub server (used for communication with the main server)
AUTHENTICATION = 'my_link_play_server' # TCP verification
TCP_SECRET_KEY = '1145141919810' # TCP transport encryption key
class Config:
SET_LINKPLAY_SERVER_AS_SUB_PROCESS = True # Whether to run the sub server as a sub process
LINKPLAY_HOST = '127.0.0.1' # Address of the sub server based on the main server
LINKPLAY_UDP_PORT = 10900 # UDP port of the sub server
LINKPLAY_TCP_PORT = 10901 # TCP port of the sub server (used for communication with the sub server)
LINKPLAY_AUTHENTICATION = 'my_link_play_server' # TCP verification
# LINKPLAY_DISPLAY_HOST = 'my_linkplay_server.com' # Address of the sub server based on the client
LINKPLAY_TCP_SECRET_KEY = '1145141919810' # TCP transport encryption key
The above are some configurations of the Link Play sub server and related configurations in the main server, and it is obvious that some items in both need to be the same.
Running
Main Server
Double click on the run.bat
script to run. If there is no error message, it is considered successful. Of course, you can achieve the same effect using the command line python main.py
.
Tips
This is the simplest way to run it, based on Flask's own multi-threaded testing server. If you need a deployment plan, please check Flask's official documentation.
Link Play Sub Server
As long as the linkplay_server
folder and the run_linkplay_server.py
file exist, the Link Play sub server can be started separately.