Skip to content

Self-Host Game Files

Self-Host Game Files

You can self-host the game files for your own or other private servers to fetch files from.

Note

The private server must support NPPS4 DLAPI protocol for it able to use your server to retrieve game files. So far, only NPPS4 is known to support this.

Getting the Game Files

Important

The server where you'll fetch the files from also must support NPPS4 DLAPI protocol.

  1. Clone the https://github.com/DarkEnergyProcessor/NPPS4-DLAPI repository.
    git clone --depth 1 https://github.com/DarkEnergyProcessor/NPPS4-DLAPI NPPS4-DLAPI
    cd NPPS4-DLAPI
    
  2. Setup the virtual environment and install necessary dependencies. You need Python 3.10 or later.
    python -m venv venv
    source venv/bin/activate # or venv\Scripts\activate for Windows
    pip install -r requirements.txt
    
  3. Run the clone.py script with current virtual environment (it will download 48GB of files).
    python clone.py archive-root https://ll.sif.moe/npps4_dlapi
    
  4. Run the update_v1.1 script with current virtual environment.
    python update_v1.1.py archive-root
    

If you just want the game files, you'll have everything in the archive-root folder.

Tell NPPS4 to Use The Downloaded Files

You can tell NPPS4 to use the archive-root folder directly as game file source by modifying the config.toml or with these environment variables:

  • NPPS4_CONFIG_DOWNLOAD_BACKEND=internal
  • NPPS4_CONFIG_DOWNLOAD_INTERNAL_ROOT=path/to/NPPS4-DLAPI/archive-root

Serving the Files to Public

To serve the files to public, and assume active virtual environment in your shell:

  1. Copy config.sample.toml to config.toml. You may configure it as needed.
  2. Run the NPPS4-DLAPI server.
    uvicorn n4dlapi:app --host 0.0.0.0 --port 8002
    
  3. NPPS4-DLAPI compatible server is now running at port 8002 on all interfaces (0.0.0.0). You can then announce it so that other users can use it. Help us spreading the bandwidth.

For more configuration on the uvicorn command, run uvicorn --help.