From 3150bc48187d0aa2b1b7fded441edfef2b5346e4 Mon Sep 17 00:00:00 2001 From: Paul Scheunemann Date: Thu, 13 Apr 2017 11:05:49 +0200 Subject: [PATCH] truncate history --- .gitignore | 1 + Dockerfile | 12 ++++ README.md | 22 ++++++ bin/entrypoint.sh | 71 +++++++++++++++++++ player.armaProfile | 168 +++++++++++++++++++++++++++++++++++++++++++++ server.cfg.example | 12 ++++ 6 files changed, 286 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 bin/entrypoint.sh create mode 100644 player.armaProfile create mode 100644 server.cfg.example diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1a3acf7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +server.cfg diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5ec5fe2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM zombi/steam-base +MAINTAINER MadMaurice , Paul +EXPOSE 2302-2305/udp + +ADD bin/entrypoint.sh /entrypoint.sh +ADD server.cfg /home/steam +ADD player.armaProfile /home/steam +RUN chmod +xr /entrypoint.sh +USER steam + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["-world=empty"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..01e5f34 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +## steam-arma3 +steam-arma3 is the base image for an ARMA3 Server. + +### Data locations + +### Building steam-arma3 + +first build the `steam-base` image. + +``` +docker build -t zombi/steam-arma3 . +``` + +### Running steam-arma3 + +``` +docker run -d \ + --name arma3 \ + -p 2302-2305:2302-2305/udp \ + -v /data/steam-games:/home/steam/games \ + zombi/steam-arma3 +``` diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh new file mode 100644 index 0000000..2b69d15 --- /dev/null +++ b/bin/entrypoint.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# what are we trying to install? +game_nm=arma3 +game_id=233780 + +profile_location=~/.local/share/"Arma 3 - Other Profiles"/server +profile_name=server.Arma3Profile + +# install game to this directory +installdir=/home/steam/games/$game_nm + +# if path does not exist, create it +mkdir -p $installdir + +if [ "$1" == "update" -o ! -d "$installdir" ]; then + install="1" +else + install="0" +fi + +if [ "$install" == "1" ] # should we start update or install? +then + if [ ! -w "$installdir" ]; then + echo "Cannot write to installation dir." + exit 1 + fi + echo "---- Steam login" + echo -n "Username:" + read steam_user + echo -n "Password:" + read -s steam_password + + # Install or update the game in /home/steam/games/[game name] + /opt/steamcmd/steamcmd.sh \ + +login $steam_user $steam_password\ + +force_install_dir $installdir \ + +app_update $game_id -beta legacyPorts -betapassword Arma3LegacyPorts validate \ + +quit + + exit 0 +else + # install dir maybe mounted read-only, simply + # skip installing/updating and inform the user. + echo "Skipped game installation." +fi + +# run the next commands from the installdir +cd $installdir + +if [ ! -f "./server.cfg" ]; then + echo "missing server.cfg, copying default one" + cp /home/steam/server.cfg . +fi + +if [ ! -f "${profile_location}/${profile_name}" ]; then + echo "missing ${profile_name}, copying default one" + mkdir -p "${profile_location}" + cp /home/steam/player.armaProfile "${profile_location}/${profile_name}" +fi + +# is the game launcher not executable? +if [ ! -x ./arma3server ] +then + # we cant run the game then. + echo "game launcher not found, installed incorrectly?" + exit 1 +fi + +# launch the game! +exec ./arma3server -config=server.cfg -mod="mods/@nss_ac" -name=server "$@" diff --git a/player.armaProfile b/player.armaProfile new file mode 100644 index 0000000..4efec70 --- /dev/null +++ b/player.armaProfile @@ -0,0 +1,168 @@ +version=1; +blood=1; +singleVoice=0; +gamma=1; +brightness=1; +class Difficulties +{ + class recruit + { + class Options + { + groupIndicators=0; + friendlyTags=0; + enemyTags=0; + detectedMines=0; + commands=0; + waypoints=0; + weaponInfo=2; + stanceIndicator=2; + reducedDamage=0; + staminaBar=1; + weaponCrosshair=0; + visionAid=0; + thirdPersonView=0; + cameraShake=1; + scoreTable=0; + deathMessages=0; + vonID=1; + mapContent=0; + autoReport=0; + multipleSaves=1; + }; + aiLevelPreset=2; + skillAI=0.5; + precisionAI=0.69999999; + }; + class regular + { + class Flags + { + Armor=0; + FriendlyTag=0; + EnemyTag=0; + MineTag=0; + HUD=0; + HUDPerm=0; + HUDWp=0; + HUDWpPerm=0; + HUDGroupInfo=0; + StanceIndicator=1; + AutoSpot=0; + Map=0; + WeaponCursor=0; + AutoGuideAT=1; + ClockIndicator=0; + 3rdPersonView=0; + CameraShake=1; + UnlimitedSaves=1; + DeathMessages=0; + NetStats=1; + VonID=1; + ExtendetInfoType=1; + StaminaBar=1; + }; + aiLevelPreset=3; + skillAI=0.60000002; + precisionAI=0.40000001; + }; + class veteran + { + class Flags + { + HUD=0; + HUDWp=0; + HUDWpPerm=0; + HUDGroupInfo=0; + StanceIndicator=1; + AutoSpot=0; + WeaponCursor=0; + ClockIndicator=0; + 3rdPersonView=0; + CameraShake=1; + DeathMessages=0; + NetStats=0; + VonID=1; + ExtendetInfoType=0; + StaminaBar=1; + }; + aiLevelPreset=3; + skillAI=0.30000001; + precisionAI=0.69999999; + }; + class mercenary + { + class Flags + { + HUD=0; + AutoSpot=0; + WeaponCursor=0; + DeathMessages=0; + NetStats=0; + VonID=1; + }; + aiLevelPreset=3; + skillAI=0.60000002; + precisionAI=0.40000001; + }; +}; +maxSamplesPlayed=96; +activeKeys[]= +{ + "BIS_ACE3.Takistan_done", + "BIS_ACE3_Base.Altis_done", + "BIS_ACE3_Base.Takistan_done", + "BIS_ACE3_Base.Zargabad_done", + "BIS_AFRF.Chernarus_done", + "BIS_ACE3_Base.Stratis_done", + "BIS_USAF.Chernarus_done" +}; +difficulty = "Custom"; +class DifficultyPresets +{ + class CustomDifficulty + { + class Options + { + groupIndicators=0; + friendlyTags=0; + enemyTags=0; + detectedMines=0; + commands=0; + waypoints=0; + weaponInfo=1; + stanceIndicator=1; + reducedDamage=0; + staminaBar=0; + weaponCrosshair=0; + visionAid=0; + thirdPersonView=0; + cameraShake=1; + scoreTable=0; + deathMessages=0; + vonID=1; + mapContent=0; + autoReport=0; + multipleSaves=1; + }; + aiLevelPreset=3; + skillAI=0.5; + precisionAI=0.7; + }; + class CustomAILevel + { + skillAI=0.5; + precisionAI=0.7; + }; +}; +headBob=0; +sceneComplexity=1000000; +shadowZDistance=100; +viewDistance=3800; +preferredObjectViewDistance=3200; +terrainGrid=3.125; +volumeCD=10; +volumeFX=10; +volumeSpeech=10; +volumeVoN=10; +vonRecThreshold=0.029999999; diff --git a/server.cfg.example b/server.cfg.example new file mode 100644 index 0000000..8d7098d --- /dev/null +++ b/server.cfg.example @@ -0,0 +1,12 @@ +hostname="Community Server"; +passwordAdmin = "password"; +maxPlayers = 20; +motd[] = {"Welcome to the ARMA3 Server","Please enjoy your stay!"}; + +kickDuplicate = 1; +voteMissionPlayers = 1; +voteThreshold = 0.33; + + +onUnsignedData = "kick (_this select 0)"; +onHackedData = "kick (_this select 0)";