diff --git a/.env b/.env.sample similarity index 69% rename from .env rename to .env.sample index 320eadd..22951b5 100644 --- a/.env +++ b/.env.sample @@ -79,6 +79,30 @@ H2SERVER1_USERNAME= # The password used to login to the defined account. H2SERVER1_PASSWORD= +# The stats api key (without this, your server won't record stats) +H2SERVER1_STATS_AUTH_KEY= + +# vip_lock (Server): +# This flag tells the server to lock the game to VIP mode when the game starts +# Players who are in the lobby when the game starts are added to VIP and can rejoin if there are connection issues +# The VIP list will be cleared when the lobby reaches Post game +H2SERVER1_VIP_LOCK=false + +# minimum_player_start options (Server): +# Changes the starting behaviour of the countdown, setting this to any value (1-16) will cause the +# Server to not start until the player count is equal to or above the given value. A value of 0 will disable this setting. +H2SERVER1_MINIMUM_PLAYER_START=0 + +# teams_enabled_bit_flags (Server) +# By default, the game reads team bitflags from the current map. +# With this option, you can enable which teams are enabled. +# Each bit corresponds to a team. Example bellow where we disable Blue, Green and Pink teams: +# Teams: Red Blue Yellow Green Purple Orange Brown Pink +# | | | | | | | | +# \/ \/ \/ \/ \/ \/ \/ \/ +# 1 - 0 - 1 - 0 - 1 - 1 - 1 - 0 +H2SERVER1_TEAMS_ENABLED_BIT_FLAGS=1-1-1-1-1-1-1-1 + # To add more servers just add more configs and port ranges (with approriate port forward on host) # and add more blocks to the docker-compose.yml file #H2SERVER2_UDP_PORT_RANGE= @@ -91,4 +115,8 @@ H2SERVER1_PASSWORD= #H2SERVER2_SERVER_NAME= #H2SERVER2_SERVER_PLAYLIST= #H2SERVER2_USERNAME= -#H2SERVER2_PASSWORD= \ No newline at end of file +#H2SERVER2_PASSWORD= +#H2SERVER2_STATS_AUTH_KEY= +#H2SERVER2_VIP_LOCK= +#H2SERVER2_MINIMUM_PLAYER_START= +#H2SERVER2_TEAMS_ENABLED_BIT_FLAGS= \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/Dockerfiles/Dockerfile b/Dockerfiles/Dockerfile index 494c245..d8f0e18 100644 --- a/Dockerfiles/Dockerfile +++ b/Dockerfiles/Dockerfile @@ -22,6 +22,10 @@ ARG server_name ARG server_playlist ARG username ARG password +ARG stats_auth_key +ARG vip_lock +ARG minimum_player_start +ARG teams_enabled_bit_flags # Build h2server registry file ADD createRegistryFile.sh . @@ -33,7 +37,7 @@ RUN ./createRegistryFile.sh "$description" "$owner" ADD createServerConfig.sh . ADD h2serverconfig.ini.template . RUN chmod 755 createServerConfig.sh -RUN ./createServerConfig.sh "$wan_ip" "$lan_ip" "$enable_xdelay" "$debug_log" "$debug_log_level" "$debug_log_console" "$server_name" "$server_playlist" "$pcr_time" "$username" "$password" "$udp_port_range" +RUN ./createServerConfig.sh "$wan_ip" "$lan_ip" "$enable_xdelay" "$debug_log" "$debug_log_level" "$debug_log_console" "$server_name" "$server_playlist" "$pcr_time" "$username" "$password" "$udp_port_range" "$stats_auth_key" "$vip_lock" "$minimum_player_start" "$teams_enabled_bit_flags" RUN mkdir /home/config RUN mv h2serverconfig.ini /home/config/ diff --git a/Dockerfiles/createServerConfig.sh b/Dockerfiles/createServerConfig.sh index df8cd47..138604c 100644 --- a/Dockerfiles/createServerConfig.sh +++ b/Dockerfiles/createServerConfig.sh @@ -3,4 +3,4 @@ portRange="${12}" basePort="${portRange%-*}" -sed -e "s/\${var1}/$1/" -e "s/\${var2}/$2/" -e "s/\${var3}/$3/" -e "s/\${var4}/$4/" -e "s/\${var5}/$5/" -e "s/\${var6}/$6/" -e "s/\${var7}/$7/" -e "s/\${var8}/$8/" -e "s/\${var9}/$9/" -e "s/\${var10}/${10}/" -e "s/\${var11}/${11}/" -e "s/\${var12}/${basePort}/" h2serverconfig.ini.template | tee h2serverconfig.ini \ No newline at end of file +sed -e "s/\${var1}/$1/" -e "s/\${var2}/$2/" -e "s/\${var3}/$3/" -e "s/\${var4}/$4/" -e "s/\${var5}/$5/" -e "s/\${var6}/$6/" -e "s/\${var7}/$7/" -e "s/\${var8}/$8/" -e "s/\${var9}/$9/" -e "s/\${var10}/${10}/" -e "s/\${var11}/${11}/" -e "s/\${var12}/${basePort}/" -e "s/\${var13}/${13}/" -e "s/\${var14}/${14}/" -e "s/\${var15}/${15}/" -e "s/\${var16}/${16}/" h2serverconfig.ini.template | tee h2serverconfig.ini \ No newline at end of file diff --git a/Dockerfiles/h2serverconfig.ini.template b/Dockerfiles/h2serverconfig.ini.template index cb5a66f..86683ec 100644 --- a/Dockerfiles/h2serverconfig.ini.template +++ b/Dockerfiles/h2serverconfig.ini.template @@ -67,5 +67,8 @@ server_playlist = ${var8} additional_pcr_time = ${var9} login_identifier = ${var10} login_password = ${var11} - +stats_auth_key = ${var13} +vip_lock = ${var14} +minimum_player_start = ${var15} +teams_enabled_bit_flags = ${var16} diff --git a/README.md b/README.md index 9c20b72..ae760ee 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ This set of docker configurations enables someone to host halo2vista dedicated ( - Ability to open ports - Ability to use linux based distributions - Ability to use git +- Make sure following is installed: + - git + - docker + - docker-compose + - python + - python-yaml ## Setup diff --git a/build.py b/build.py index 1e9fc7c..98aff03 100644 --- a/build.py +++ b/build.py @@ -77,6 +77,10 @@ def getH2ServerBlock(id): h2ServerPlaylist = validateValueAndGetKey(h2ServerUniqueStringPrefix + "SERVER_PLAYLIST") h2ServerUsername = validateValueAndGetKey(h2ServerUniqueStringPrefix + "USERNAME") h2ServerPassword = validateValueAndGetKey(h2ServerUniqueStringPrefix + "PASSWORD") + h2ServerStatsAuthKey = validateValueAndGetKey(h2ServerUniqueStringPrefix + "STATS_AUTH_KEY") + h2ServerVipLock = validateValueAndGetKey(h2ServerUniqueStringPrefix + "VIP_LOCK") + h2ServerMinimumPlayerStart = validateValueAndGetKey(h2ServerUniqueStringPrefix + "MINIMUM_PLAYER_START") + h2ServerTeamsEnabledBitFlags = validateValueAndGetKey(h2ServerUniqueStringPrefix + "TEAMS_ENABLED_BIT_FLAGS") h2ServerArgs = { "description": variablize(h2ServerDescription), @@ -88,7 +92,11 @@ def getH2ServerBlock(id): "server_name": variablize(h2ServerName), "server_playlist": variablize(h2ServerPlaylist), "username": variablize(h2ServerUsername), - "password": variablize(h2ServerPassword) + "password": variablize(h2ServerPassword), + "stats_auth_key": variablize(h2ServerStatsAuthKey), + "vip_lock": variablize(h2ServerVipLock), + "minimum_player_start": variablize(h2ServerMinimumPlayerStart), + "teams_enabled_bit_flags": variablize(h2ServerTeamsEnabledBitFlags) } h2ServerBuild = {"context": "./Dockerfiles", "dockerfile": "Dockerfile", "args": h2ServerArgs}