Skip to main content

Configure Document

Lost-MSthApril 14, 2024About 4 min

Info

The configuration file of the main server is config.py, and the import method is module import. Therefore, you need to provide a Config class, such as:

class Config:
    HOST = '0.0.0.0'
    PORT = 80

Network

Main Server

KeyTypeDefaultDescription
HOSTstr'0.0.0.0'Host address
PORTint80Listening port

Flask Extension

KeyTypeDefaultDescription
DEPLOY_MODEstr'flask_multithread'Deployment mode, optional values: {"waitress", "gevent", "flask_multithread"}
USE_PROXY_FIXboolFalseProxyFix
USE_CORSboolFalseCORS in server side Flask-CORS
KeyTypeDefaultDescription
LINKPLAY_HOSTstr'0.0.0.0'The sub server address based on the main server
LINKPLAY_UDP_PORTint10900UDP port open to clients
LINKPLAY_TCP_PORTint10901TCP port open to the main server
LINKPLAY_AUTHENTICATIONstr'my_link_play_server'TCP communication verification
LINKPLAY_DISPLAY_HOSTstr''The sub server address based on clients
LINKPLAY_TCP_SECRET_KEYstr'1145141919810'AES key for TCP communication

SSL

KeyTypeDefaultDescription
SSL_CERTstr''The file path of the SSL certificate
SSL_KEYstr''The file path of the SSL certificate private key

Warning

It is not recommended to use HTTPS in this way. It is better to use SSL provided by middleware, CDN, etc.

About Downloading

KeyTypeDefaultDescription
DOWNLOAD_LINK_PREFIXstr''Song data's download link prefix
BUNDLE_DOWNLOAD_LINK_PREFIXstr''Content bundle's download link prefix
DOWNLOAD_USE_NGINX_X_ACCEL_REDIRECTboolFalseWhether to use NGINX's X-Accel-Redirect
NGINX_X_ACCEL_REDIRECT_PREFIXstr'/nginx_download/'Prefix path of X-Accel-Redirect
BUNDLE_NGINX_X_ACCEL_REDIRECT_PREFIXstr'/nginx_bundle_download/'Prefix path of X-Accel-Redirect for bundle downloading
BUNDLE_STRICT_MODEboolTrueWhether to strictly limit the corresponding client version for downloading content bundles

Server Settings

Startup Options

KeyTypeDefaultDescription
SONG_FILE_HASH_PRE_CALCULATEboolTrueIs song data cache calculation performed at startup
SET_LINKPLAY_SERVER_AS_SUB_PROCESSboolTrueWhether to run the Link Play sub server with the main server locally at the same time

Game API

KeyTypeDefaultDescription
GAME_API_PREFIXstr | list[str]'/<some_word>/<int>'Game API's URL prefixes
OLD_GAME_API_PREFIXlist[str][]Old game API's URL prefixes
ALLOW_APPVERSIONlist[str][]Allowed game version

Log

KeyTypeDefaultDescription
ALLOW_INFO_LOGboolFalseWhether to record detailed server info logs
ALLOW_WARNING_LOGboolFalseWhether to record detailed server warning logs

Database Update

KeyTypeDefaultDescription
UPDATE_WITH_NEW_CHARACTER_DATAboolTrueWhether to use the latest character data when updating database

Game Parameters

KeyTypeDefaultDescription
IS_APRILFOOLSboolTrueSwitch of April Fool's Day
WORLD_RANK_MAXint200The largest number of global rank
AVAILABLE_MAPlist[str][]Current available event maps in World Mode
DEFAULT_MEMORIESint0The default amount of memories at the time of user registration
ALLOW_SCORE_WITH_NO_SONGboolTrueWhether to accept the scores with the song unranked
CHARACTER_FULL_UNLOCKboolTrueWhether to unlock all partners
WORLD_SONG_FULL_UNLOCKboolTrueWhether to unlock all world songs
WORLD_SCENERY_FULL_UNLOCKboolTrueWhether to unlock all world sceneries
SAVE_FULL_UNLOCKboolFalseWhether to force using full unlocked cloud save
BEST30_WEIGHTfloat0.025Weight of Best 30 potential
RECENT10_WEIGHTfloat0.025Weight of Recent Top 10 potential
INVASION_START_WEIGHTfloat0.1The possibility weight of "Invasion Start"
INVASION_HARD_WEIGHTfloat0.1The possibility weight of "Invasion Hard"
MAX_FRIEND_COUNTint50Maximum number of one user's friends
NOTIFICATION_EXPIRE_TIMEint180000Expire time of Link Play invitation, unit: seconds

Safety

Web

KeyTypeDefaultDescription
USERNAMEstr'admin'Username of web background management page
PASSWORDstr'admin'Password of web background management page
SECRET_KEYstr1145141919810Session key of web background management page

API

KeyTypeDefaultDescription
API_TOKENstr''API Token of system power
API_LOGIN_RATE_LIMITstr'10/5 minutes'API login rate limit

Game Login and Register

KeyTypeDefaultDescription
LOGIN_DEVICE_NUMBER_LIMITint1Maximum number of devices that can be logged in
ALLOW_LOGIN_SAME_DEVICEboolFalseWhether logging in from multiple applications on the same device is allowed
ALLOW_BAN_MULTIDEVICE_USER_AUTOboolTrueWhether to enable automatic banning for too many devices
GAME_LOGIN_RATE_LIMITstr'30/5 minutes'Game login rate limit
GAME_REGISTER_IP_RATE_LIMITstr'10/1 day'Game register IP rate limit
GAME_REGISTER_DEVICE_RATE_LIMITstr'3/1 day'Game register device rate limit

Game Resource Downloading

KeyTypeDefaultDescription
DOWNLOAD_TIMES_LIMITint3000Player's song download limit times in 24 hours
DOWNLOAD_TIME_GAP_LIMITint1000Expire time of song download link, unit: seconds
DOWNLOAD_FORBID_WHEN_NO_ITEMboolFalseWhether to restrict users from downloading data for songs they have not purchased
BUNDLE_DOWNLOAD_TIMES_LIMITstr'100/60 minutes'Player's content bundle download limit rate
BUNDLE_DOWNLOAD_TIME_GAP_LIMITint3000Expire time of content bundle download link, unit: seconds

File Path

KeyTypeDefaultDescription
WORLD_MAP_FOLDER_PATHstr'./database/map/'Data folder of world maps
SONG_FILE_FOLDER_PATHstr'./database/songs/'Data folder of song data
SONGLIST_FILE_PATHstr'./database/songs/songlist'Path of the songlist file
CONTENT_BUNDLE_FOLDER_PATHstr'./database/bundle/'Data folder of content bundles with metadata
SQLITE_DATABASE_PATHstr'./database/arcaea_database.db'Path of the main database
SQLITE_DATABASE_BACKUP_FOLDER_PATHstr'./database/backup/'Old database backup folder
DATABASE_INIT_PATHstr'./database/init/'Initial data folder of database
SQLITE_LOG_DATABASE_PATHstr'./database/arcaea_log.db'Path of the record database
SQLITE_DATABASE_DELETED_PATHstr'./database/arcaea_database_deleted.db'Path of the database which contains deleted data