GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.24k stars 811 forks source link

Arma 3 Updater with mod support #1894

Open JediNarwals opened 6 years ago

JediNarwals commented 6 years ago

I haven't seen anything for support for mods, especially for Arma. So I've made a code that helps makes this work. PasteBin

This will require you to have your own repository so it doesn't get updated back to default on the Update LGMS command. (Maybe there is a way to retry this without it self updating under the functions.)

You'll also need to add a line into the file: command_update.sh

elif [ "${gamename}" == "ARMA 3" ]; then
    updateserver.sh

This will go before the else at the end. So it'll look like this:

#!/bin/bash
# LinuxGSM command_update.sh function
# Author: Daniel Gibbs
# Website: https://gameservermanagers.com
# Description: Handles updating of servers.

local commandname="UPDATE"
local commandaction="Update"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

fn_print_dots ""
sleep 0.5
check.sh
logs.sh

if [ "${gamename}" == "TeamSpeak 3" ]; then
    update_ts3.sh
elif [ "${engine}" == "lwjgl2" ]; then
    update_minecraft.sh
elif [ "${gamename}" == "Mumble" ]; then
    update_mumble.sh
elif [ "${gamename}" == "Factorio" ]; then
    update_factorio.sh
elif [ "${gamename}" == "Multi Theft Auto" ]; then
    update_mta.sh
elif [ "${gamename}" == "ARMA 3" ]; then
    updateserver.sh
else
    update_steamcmd.sh
fi

core_exit.sh
UltimateByte commented 6 years ago

Even though this one is a bit different from other mods downloaded using ZIPs, I believe we could add it to https://github.com/GameServerManagers/LinuxGSM/wiki/mods with some painful adaptations :)

GitHub
GameServerManagers/LinuxGSM
LinuxGSM - Linux Game Server Managers_
draakuns commented 6 years ago

Hi,

Arma3 is very different in the way it manages mods, as they are missions and mods on the same web place, but dont reside on the same directory after that. To complicate more, the missions are not downloaded with names but a dirty name from workshop. Therefore i created a quick'n'dirty mod management (sorry, no time to make it better yet, it's a pre-alpha WIP)... You can't just download from zips that change names, or install & go. It needs subscriptions on the workshop to work, and also a valid steam account that owns the game to download the mods.

TO_DO: (and probably will never be done) The mods required for each mission must be human-read by hand on the workshop page and add it to the armaserver.cfg on the mods var. This can be solved by creating a var on the script itself, but it's not so smart to read from the workshop yet.

That can serve as a basis (if you want), but beware of all the dirty tricks I used for now... And beware that Bohemia Int. complicated things a lot on this mod game.

If want anything, let me know.

Best of luck Draakuns

JediNarwals commented 6 years ago

So I haven't really gone into detail on what this script actually does.

So this will make the server stop and validate all files (including the mods) if it requires an update it will update that file. If it doesn't need an update then it won't re-download the file. This process will however move the file every time. It will delete the previous mod location, to help with different server keys/bikeys. It will then move all the files over and lowercase all the files and folders so that they will read on Linux. After that it will move the server keys over to the keys folder so that the server can read it and suggest it to the player. I've also made it check for the Update-Linux command and run that as well so both the server and the LinuxGSM files are up to date. And it will start the server then push an update notification (If applicable).

Let me know if you have any other questions JediNarwals

draakuns commented 6 years ago

Hmmm... I see... Some points below (not saying it's better, but it suits my needs in a better way).

lrwxrwxrwx 1 steamsrv users   81 Apr 26 01:19 @ace -> /home/steamsrv/arma3/serverfiles/mods/steamapps/workshop/content/107410/463939057
....blablablah..........................
lrwxrwxrwx 1 steamsrv users   81 Apr 26 01:19 @Zombies_and_Demons -> /home/steamsrv/arma3/serverfiles/mods/steamapps/workshop/content/107410/501966277

and same applies for the mpmissions:

lrwxrwxrwx 1 steamsrv users 111 Apr 26 16:48 coop-04_a_long_way.altis.pbo -> /home/steamsrv/arma3/serverfiles/mods/steamapps/workshop/content/107410/349220853/419187061830718204_legacy.bin
lrwxrwxrwx 1 steamsrv users 112 Apr 26 16:47 coop_1-4_drug_war_tanoa.tanoa.pbo -> /home/steamsrv/arma3/serverfiles/mods/steamapps/workshop/content/107410/752795234/2432383864451690455_legacy.bin
.....BLAHBLAHBLAH....
lrwxrwxrwx 1 steamsrv users 111 Apr 26 16:48 sp_co-06_disarmament.altis.pbo -> /home/steamsrv/arma3/serverfiles/mods/steamapps/workshop/content/107410/410243478/419187061830802126_legacy.bin
lrwxrwxrwx 1 steamsrv users 112 May  9 00:52 SP_COOP_06_World_War_2_Battle_of_Berlin.SWU_Germany_Streets_of_Berlin.pbo -> /home/steamsrv/arma3/serverfiles/mods/steamapps/workshop/content/107410/1376202051/930434406210962787_legacy.bin

Hope that helps, Draakuns

JediNarwals commented 6 years ago

So what we're trying to do (this is just the file that I use on my own server) is integrate it into the mods command for LinuxGSM. So this is all skeptical. But what the file that I have right now does is goes through and downloads the mods from the previously set variables. Once downloaded they're in the root of the users (same location of the "serverfiles" folder, not in it). The script then takes the files that were downloaded (addons folder, keys folder, and the files that you'd typically find in a mod for Arma 3 without all the folder-ception) and places them in the "serverfiles" folder under the corresponding name to the variable that was set. It'll then look for the keys in the mod folder and move them to the "keys" folder in the Arma directory so the server can suggest the mod to the client as a mod to join with.

This file will automatically use the login that was used when you first installed the game for the steamCMD and will handle the steamCMD commands for you to install/validate all the mods and games.

But as for mission downloading this file was purely intended for the mods. There's no intention for the mission files to be downloaded/installed this way. Though it can be done. And I may have a more powerful dedicated server than most. But to validate 3 servers each with ~45Gb of mods plus the server files it only takes my server about 4-5 minutes for all 3 servers to run and validate on the same machine at the same time.

I do have some ideas on how to integrate this type of script with the current mod script in LinuxGSM however it is all theory right now and we are opening to ideas and speculation to make it better and integrate with the current standing files.

draakuns commented 6 years ago

Hi @JediNarwals,

different approaches then... But each one serve a different purpose ;)

WOW, 4-5min... it tooks some time for my 50gig, but I am kind of shorthanded on CPU power at all, as it is a small NAS with dual core AMD 1.6Ghz... I run the games with 4 to 10 mods for 8 people tops, but it serves my purpose... only that I need to wait a lil' more than u hehe.

Good luck on your trip towards your mod management, though! I will keep trying to create a full suite for dynamic mod-missions. Draakuns.

gbschenkel commented 5 years ago

Hi everyone, I found this script built with python3. a3update.py. The mods are validated against the changelog from steam workshop page(at least was what I understood), maybe it can help in your development. Cheers.

cydactyl commented 4 years ago

+1 support this idea, mod management is a pain with the Steam Workshop, especially with large mod files like Arma 3 uses...