Skip to content

Instruction for use

Lost-MSth edited this page Mar 17, 2024 · 23 revisions

Server

Take Windows as an example, Linux can refer to #64.

Environment construction

Operating system

The server has only been tested on Windows 10 & Windows 11 platform. Logically speaking, it can be run on any platform with the sufficient permissions and the ability to run python code.

Python 3

Installation and environment variable configuration of Python 3 are omitted here.

The program runs successfully in Python 3.7.
The version of Python should be greater than or equal to 3.6.

Python module

Use pip provided by Python for installation.

pip install -r requirements.txt

Run

  1. Put the folder anywhere in the computer. Then refer to config.example.py and Config document to write a config.py file and put it in the same folder with main.py. Set HOST to the local IP address and PORT to the open port (80 or 81 or 8080 is recommended). Be careful of port conflicts.
  2. If you choose to use Charles, please configure it correctly.
  3. Click run.bat to run. Please do not click on the interface, in order to avoid the server stuck because of entering the selected state. (Press Enter to cancel the selection)

It is no need to care about other information in the CMD window. If there is Running on ...... (Press CTRL+C to quit), the server runs successfully.

The above is the simplest way to run the server code. If you need a deployment scheme, please refer to the official document of Flask.

Run a stand-alone Link Play server

If you don't need to run it stand-alone, just ensure that the ports are correct.

When both linkplay_server folder and run_linkplay_server.py file exist, the Link Play server(hereinafter referred to as "sub service") is able to be run stand-alone. At this time, pay attention to the communication settings of the two servers.

  • The main server setting file is setting.py. Please make sure that the settings are correct, including the address(LINKPLAY_HOST), the TCP port and the communication authentication(LINKPLAY_AUTHENTICATION) of the sub server based on the main server, the UDP port and the address(LINKPLAY_DISPLAY_HOST) open to the public at the sub server.

  • The sub server setting file is linkplay_server/config.py, where two ports and communication authentication(AUTHENTICATION) should be consistent with the settings of the main server.

Initialize database

In the database folder, you can find a py file, which is the database initialization program. If you need to delete all user data, you can delete arcaea_database.db and then run database_initialize.py.

About song database

The arcsong.db in database folder is the song database, and you can change it via a sqlite operating software like sqlite3. You also can use other softwares which have GUI.
The sqlite3.exe is in the tools folder.

Import song data

Since v2.9, the song database arcsong.db will merge into arcaea_database.db, and the initial data is no longer provided. You can use update_song.py under the tools folder to do data migration or import.

At present, both old and new version of arcsong.db are supported.

Data source

Data source 2

How to do it via sqlite3

In v1.2 and later version, you can use the administration webpage to update and change it.

  1. Make the exe file in the database folder, and run it.

  2. Use .open arcaea_database.db to open the database at first.

  3. Use insert into chart(song_id,name,rating_pst,rating_prs,rating_ftr,rating_byn) values('goodtek','GOODTEK (Arcaea Edit)',40,65,93,98); to add the song which is not in the database. (GOODTEK is already in the database, you know.)

    song_id means the unique name to show what the song is. (Use '' or "" to show it is a text value.)

    rating_(pst/prs/ftr/byn) means the define number(chart const) of the song. (pst=past prs=present ftr=future byn=beyond)
    The value is ten times of the chart const. (For example, 98 means it is 9.8 and if the song doesn't have a beyond chart, the value should be -1.)

    name is not important and you can fill it at random. (Use '' or "" to show it is a text value.)

    Only the define number(chart const) and song_id of the song is neccessary. You don't need to add other information. (The song database is from another github repository, so it has many things the server doesn't care.)

  4. If you want to do other things with the datebase, you can refer to any websites or books which teach you sql language.
    Here is some useful command.
    Delete one: delete from chart where song_id='goodtek';
    Change one: update chart set rating_byn=100 where song_id='goodtek';
    Find one: select * from chart where song_id='goodtek';
    Find all (It's better not to use it.): select * from chart;

About world mode

Since v1.3, world mode will be available. Here is the way to customize maps.
The map data is in database/map, saving in json format. You can modify them with a text editor, but pay attention to the format.

About song download

Since v1.4, you can download songs.
For those songs that need to be downloaded, you can provide files from the local server. Of course, you can add fanmade charts and other songs.
Put the required files into the folder named song song_id, and then put it into the database/songs folder. There is a reference file in the folder, which is a short chart of the past difficulty of the song dement.
Arcaea will only download the files which are missing.

Optionally, you can put songlist in the database/songs folder, in order to allow the client to download only some files. The songs which are not mentioned will not be limited.

Chart file

It must be *.aff. The number in the front represents difficulty. 0 to 3 represent Past to Beyond; 4 represents Eternal.

Song file

It much be base.ogg. Remember to convert your file format.

Additional file

Only and only 3.ogg, video.mp4, video_audio.ogg are available.

About content bundle

  • You can use the sub repo Arcaea-Bundler to generate content bundles and metadata files, or directly use official data.
  • The data directory is located in database/bundle, allowing for the creation of subdirectories for easy manual management.
  • Paired bundles and metadata file names need to be the same and in the same directory, with suffixes of . cb and . json, respectively. This also means that they are binary files and JSON files, respectively.
  • The server will limit the client version applicable to this content bundle based on the applicationVersionNumber in the metadata, and sort it in ascending order according to the versionNumber, providing data to the client as needed.
  • Please note that when there is a higher version of the content bundle that is compatible with the client, users will be forced to update it.
  • When modifying the content bundle related data during the runtime of the server, it is necessary to restart the server or refresh the data in the web background to obtain the latest data.

Webpage

Tips:

  1. The document may be out of date.
  2. The web page based on back-end rendering may not be updated any more, and some data can be directly modified in the database instead.

V1.2 version adds a management web page, you can carry out some auxiliary operations. The web address is http:// IP : PORT /web (For example, the server port is 80 and the IP address is 192.168.1.2, so the webpage is http://192.168.1.2:80/web.)

Login

The default account is admin and the password is admin.

Abort game part

Single player score

Enter Username or Usercode to find all the best scores of the player.

Single player ptt

Enter Username or Usercode to find the player information, including best30 and recent30 data.

All players

Here you can directly see the basic information of all players.

All songs

Here you can directly see the song_ids and English names of all songs, as well as the chart const for each difficulty.

All characters

Here you can see the ID, name, skills, and values of all the characters directly.

All items

Here you can see the ID, type, availability of all items.

All purchases

Here you can see the name, price, original price, discount period and items of all purchases.

All presents

Here you can directly see the ID, expiration time, description and items of all presents.

All redeem codes

Here you can directly see redeem codes, items and users who use the redeem code.

Single song chart tops

After entering the partial song_id of the song and selecting the difficulty, you can query the leaderboard indistinctly. (For example, the song_id of BADTEK is badtek, and if you enter bad, you can find it.)

Abort system part

Update databases

  • Here you can synchronize the old version of the database to the new version of the database and refresh the list of full characters owned by players.
    Uploadable files: arcaea_database.db
    Data that does not exist in the new database will be added and the existing duplicate data will also be changed.
    Updated tables include best_score, friend, recent30, user, user_world, item, user_item, purchase, purchase_item, user_save, login, present, user_present, present_item, redeem, user_redeem, redeem_item, role, user_role, power, power_role, api_auth, user_char, character.

    If you register first, recent30 will add a new user. Now if you update the database, recent30 of this user will not be synchronized.

  • Here you can refresh the hash values of all the files stored in the chart folder in the database. The purpose is to deal with the updating of songs' files.

  • Here you can refresh the cache of content bundles with metadata.

  • Here you can refresh the ratings of all scores in the database. The purpose is to deal with the updating of songs' chart consts.

Change user password

Here you can modify the user's password. Note that the password length is 8 to 20 digits, and there is no background check. If you enter a password that cannot be entered by the client, you may not be able to log in.

Ban the user

Here you can ban specific users, or delete all the scores of a user, including best_score and recent30, as well as recentdata, but not cloud saves.
Changing the user's password can unseal the user.

Delete the scores

Here you can clear the scores. For example, clear all the scores of a user, clear all the scores of a chart...

Update user saves

Here you can synchronize the game cloud saves to best_score table. Please remember that it is an overlay action, so scores will not be compared.

Change the songs

Here you can add or delete the song which you give a specified song_id to the database. The chart const is a floating point number, such as 9.8. If there is no certain chart of some difficulty, please fill in -1 instead.

Change the characters

Here you can modify the character skills to the database, and update the characters owned by users.

Change the items

Here you can add or delete items.

Change the purchases

Here, you can modify the purchases to the database. For a single song, the discount is invalid; for a song pack, the availability is invalid.

Change the purchase's items

Here you can add or delete items to the purchase.

Change user information

Here you can change user's memories.

Change user purchase information

Here you can modify the whole purchase information of users.

Change the presents

Here you can add or delete the present.
The ID is the unique identification of the present; the description is the information displayed in the login interface, which should not be too long; the expiration time will limit the distribution of the present, and the expired reward will not be distributed.

Deliver the presents

Here you can deliver a present to the player individually or in batches. The present can be received only once when the players log in.

Change the redeem codes

Redeem codes can be added or deleted here. There are two types of redeem codes, which can only be used once or each user can use once.
When the redeem codes are randomly generated, the length is fixed at 10 bits, and the specified generation length is 10-20 bits.
The amount of random generation should not be too many, otherwise the background query interface is likely to get stuck.