shayaantx / h2server-docker

Scripts to run halo2vista dedicated server in docker
6 stars 0 forks source link
dedicated-server docker docker-compose halo2 wine

Summary

This set of docker configurations enables someone to host halo2vista dedicated (h2server) in docker via wine.

Prerequisites

Setup

  1. Clone the git repo
  2. Edit the .env file (all the h2server properties live in this file)
    • The environment file consists of global variables and server specific variables
    • All the global variables are required (see .env file for explanations of variables)
      • H2SERVER_PLAYLISTS_DIRECTORY
      • H2SERVER_BINARIES
      • H2SERVER_WAN_IP
      • H2SERVER_LAN_IP
      • H2SERVER_DEBUG_LOG
      • H2SERVER_DEBUG_LOG_LEVEL
      • H2SERVER_DEBUG_LOG_CONSOLE
      • H2SERVER_PCR_TIME
    • The individual server config variables are all named H2SERVER_
    • For example: H2SERVER1_UDP_PORT_RANGE, H2SERVER2_OWNER, etc (see the .env file for the list of these variables)
    • All variables should be set
  3. You have two options at this point: manually configure docker-compose.yml or use build.sh (which builds the yml from the .env file)

Usage

  1. I've made a few scripts to assist users with starting and stopping containers (for the less docker friendly people)
    • restart.sh
    • stop.sh
  2. Both of these scripts basically call docker-compose up or docker-compose down
  3. If you want to connect to administer your h2server, follow below steps
    1. docker ps
    2. Get the container id
    3. docker exec -it \<container-id> screen -r
    4. Don't ctrl+c or type exit, since that will exit the server, always end with Ctrl+a+d (we are running screen here due to some interactive shell annoyance with h2server.exe -live mode)

Other

If you don't want to use docker-compose, running the the default wine container with below syntax works just as well

docker run -p <udp-port-range>:<udp-port-range>/udp -p <tcp-port>:<tcp-port>/tcp -v "<host-location-of-h2server-playlists>:/home/wineuser/.wine/drive_c/users/wineuser/My Documents/My Games/Halo 2/Server" -v <host-location-of-h2server-binaries>:/home/h2server -v <host-location-of-h2server-config-ini>:/home/h2serverconfig1.ini -it scottyhardy/docker-wine wine /home/h2server/h2server.exe -live -h2config=/home/h2serverconfig1.ini
docker run -p 50000-50009:50000-50009/udp -p 50010:50010/tcp -v "/root/h2server-binaries/playlists:/home/wineuser/.wine/drive_c/users/wineuser/My Documents/My Games/Halo 2/Server" -v /root/h2server-binaries:/home/h2server -v /root/h2serverconfig1.ini:/home/h2serverconfig1.ini -it scottyhardy/docker-wine wine /home/h2server/h2server.exe -live -h2config=/home/h2serverconfig1.ini