Skip to content

Commit

Permalink
[release] v2.5 Public Release
Browse files Browse the repository at this point in the history
- Added 'GamePassword' support
- Added Maps & Mutators support
- Updated README
  • Loading branch information
Vel-San committed May 19, 2020
1 parent b8591c2 commit 5c1e989
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ COPY --from=builder --chown=steam:steam /home/steam/servers/kf /home/steam/serve

# Add scripts needed for entry point
WORKDIR /home/steam/servers/kf/System
# Copy Maps and Systems for customized mutators
COPY Maps/ /home/steam/servers/kf/
COPY System/ /home/steam/servers/kf/
# Initialize KF.ini
COPY KillingFloor.ini KillingFloor.ini
# Needed scripts - DO NOT REMOVE
ADD kf1_functions.sh kf1_functions.sh
ADD main main

# Will enable this later to make custom Maps & Mutators support
# COPY Maps /home/steam/servers/kf/
# COPY System /home/steam/servers/kf/

# Expose needed ports
EXPOSE 7707/udp 7708/udp 7717/udp 28852/udp 28852/tcp 8075/tcp 20560/udp
# Do some magic!
Expand Down
Empty file added Maps/.placeholder
Empty file.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ KF_DIFFICULTY=
KF_GAME_LENGTH=
# Server Name
KF_SERVER_NAME=
# Game Password, Do not provide the parameter if you want no password
KF_GAME_PASS=
# Mutators to be enabled by default on server startup; sepereate by a Comma
# And make sure to configure your System/ directory before building to add the mutators
KF_MUTATORS=
# Admin Name
KF_ADMIN_NAME=
# WebAdmin Password
Expand All @@ -47,7 +52,10 @@ KF_MOTD=

## Build Command

Put your password inside the hyphons to avoid any errors from bash, e.g 'password'
- Put your `password` inside the `hyphons` to avoid any errors from bash, e.g 'password'
- Place any Maps or mutators inside `Maps & System` directory (*pre-configure them*)
- Pre-configure `KillingFloor.ini` to your liking (in case you need to add custom mutators in ServerPackages or so)
- Run the following command or use `build_docker` with the arguments

```bash
docker build -t vel7an/kf1-docker --build-arg steamU=... --build-arg steamP=... --build-arg code=... .
Expand Down
Empty file added System/.placeholder
Empty file.
6 changes: 2 additions & 4 deletions kf1_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function load_config() {
## Now we edit the config files to set the config
sed -i "s/ServerName=Killing Floor Server/ServerName=$KF_SERVER_NAME/g" KillingFloor.ini
sed -i "s/KFGameLength=/KFGameLength=$KF_GAME_LENGTH/g" KillingFloor.ini
[[ -z "$KF_GAME_PASS" ]] || sed -i "s/GamePassword=/GamePassword=$KF_GAME_PASS/g" KillingFloor.ini
sed -i "s/GameDifficulty=/GameDifficulty=$KF_DIFFICULTY/g" KillingFloor.ini
sed -i "s/AdminName=/AdminName=$KF_ADMIN_NAME/g" KillingFloor.ini
sed -i "s/AdminPassword=/AdminPassword=$KF_ADMIN_PASS/g" KillingFloor.ini
Expand All @@ -75,10 +76,7 @@ function launch() {

cmd="./ucc-bin server "
cmd+="$KF_MAP.rom?game=KFmod.KFGameType?"
# To be enabled later
# [[ -z "$KF_GAME_PASS" ]] || cmd+="GamePassword=$KF_GAME_PASS?"
# [[ -z "$KF_MUTATORS" ]] || cmd+="?Mutator=$KF_MUTATORS"

[[ -z "$KF_MUTATORS" ]] || cmd+="?Mutator=$KF_MUTATORS"
cmd+="VACSecured=true?MaxPlayers=6 -nohomedir"
echo "Running command: $cmd" > $0-cmd.log
exec $cmd
Expand Down

0 comments on commit 5c1e989

Please sign in to comment.