GameServerManagers / LinuxGSM

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

Integration with mods for applicable games #631

Closed KroniK907 closed 7 years ago

KroniK907 commented 8 years ago

Many server admins want to have an easy way to add/remove SourceMod plugins. Would it be possible to add support for managing SourceMod plugins through LGSM? Or at least having the ability to install SourceMod and MetaMod by default for any games that support it?

It would be cool to be able to have a package manager for SourceMod plugins that was a part of LGSM that would not only install the plugins but also create the default CVARs etc in the config file.

UltimateByte commented 8 years ago

I've had that idea for a while, it could definitely happen, yes. It could also propose, ULX for gmod. 2 things to face btw :

jaredballou commented 8 years ago

There really isn't even a "SourceMod official" installer, so this would be waaaaaay more work than we can reasonably take on. I built something much simpler just for my own plugins - https://github.com/jaredballou/insurgency-sourcemod/blob/master/tools/download-plugin.sh - it finds the list of plugins I created, then downloads the updater files and sees what is needed to install, and pulls from Git. I just threw it together in an hour or two, so it's pretty raw, but if you had a list of known good plugins we might be able to leverage it that way. My guess is that you're going ti have to just download them on your own, however, unless there is an API to the AlliedModders forums that we could use to do this.

KroniK907 commented 8 years ago

Even without the the package manager, installing the current version of SourceMod and MetaMod by default when installing a compatible game would be a nice step up. The plugins are fairly easy to manage but getting SourceMod installed for the first time can be a bit confusing.

UltimateByte commented 8 years ago

We still have to figure out a reliable way to get the latest version at any given time. It's true that sourcemod don't seem to provide an "always up to date link".

jaredballou commented 8 years ago

So, Christmas comes early for you guys. I created a new function, install_sourcemod.sh, that does the following:

  1. Checks ${systemdir}/addons/metamod and confirms install if existing
  2. Downloads MetaMod download page, finds mirror list
  3. Tries each mirror until file is downloaded
  4. Unzips MetaMod to systemdir
  5. Checks if SM is installed same way, same confirmation
  6. Finds latest SM version from pointer file, downloads it
  7. Unzips SourceMod to systemdir

It "works for me", as I just installed it into an Insurgency server. I added a "sourcemod" parameter to core_getopt and install_sourcemod.sh to core_functions.sh. If you want it "out of the box" you'll need my super modified https://github.com/jaredballou/linuxgsm/blob/master/_MasterScript/lgsm-core script to start with. The files are all in my repo if ytou want to try to merge them into the master without all the other things I have done.

Give it a shot, let me know what you guys get.

UltimateByte commented 8 years ago

Me like ! :drool: We need this ! @dgibbs64 You're OK for me to start a branch and pull request it ?

dgibbs64 commented 8 years ago

Go for it :-)

KroniK907 commented 8 years ago

You guys are awesome! @jaredballou, you are a code writing machine in your free time! :smile:

UltimateByte commented 8 years ago

Note to myself : start a new branch asap.

New note to myself : We want to call functions module_sourcemod_install.sh and module_sourcemod_update.sh and so on for good alphabetical sorting. This will be a base for future modules/addons of that kind.

jaredballou commented 8 years ago

The code train is moving on without you. Ping me when you get a minute, I'll help tidy up my code and get a PR together.

UltimateByte commented 8 years ago

Sorry about that, i started a new job 7 days ago, and had many urgent personal stuff to do, i end up my days too tired to work on that, but the rythm will slow down soon. I accepted your request (i suppose it's you) so we can talk more easily.

jaredballou commented 8 years ago

Yep, my schedule will be filling up shortly and my blitzkreig code war will be wound down for a while. Still got some neat stuff done, if only to show a different way to structure things.

dgibbs64 commented 8 years ago

Currently working on this by converting @jaredballou version to work with master repo only a few changes are required.

UltimateByte commented 8 years ago

@dgibbs64 Update on this ? Now we've got your download feature, the only thing that would take a bit of time would be finding an updated link. I can go from scratch btw, now i'm comfy with this kind of stuff.

UltimateByte commented 8 years ago

Discussions for SourceMod https://forums.alliedmods.net/showthread.php?p=2448658 https://forums.alliedmods.net/showthread.php?p=2448693

UltimateByte commented 8 years ago

Some ideas of how i see the implementation

./gameserver install-mods | im - Select a mod or plugin to auto install

For supported Source games

Command   |  Mod to install
SM | SourceMod
MM | MetaMod
q | to exit the installer, or press ctrl + c

For Garry's Mod

Command   |  Mod to install
ULB | Ulib (required for ULX)
ULX | ULX
q | to exit the installer, or press ctrl + c

For Rust / Hurtworld

Command   |  Mod to install
OX | Oxide
q | to exit the installer, or press ctrl + c

Then in main game script, next to updateonstart :

updateamodsonstart="no/yes"
KroniK907 commented 8 years ago

Looks like you may or may not be able to get a nice permanent link to the latest sourcemod builds.

While doing the download from the downloads.php page might not work, the latest build is in fact listed in plain text on that page and could then be used for choosing what build to download from the /smdrop/ page.

For the stable build see: http://www.sourcemod.net/downloads.php?branch=stable For the dev build see: http://www.sourcemod.net/downloads.php?branch=dev

IDK if you can reliably scrape those pages for the bold text that lists the latest version and build number, but that might be a temporary way to do it until they can be convinced to create a permanent link to the stable/dev download.

UltimateByte commented 8 years ago

@KroniK907 Thx for the info. I've seen an SM staff member advise against scraping the download page, so this is probably not the best idea. Hopefully a staff members will actually read and reply my topic. If they don't, we're gonna have to chose between scraping the download page or use the incomplete latest.php link. I need to start looking for MetaMod. I'm pretty sure it'll be kind of the same issue.

Didn't mention, but for Gmod, ULX and Ulib are are on GitHub, it'll be quite easy to add. :)

UltimateByte commented 7 years ago

I'm on it, will try to figure out how to do this. Starting with sourcemod/metamod for source games, then ulx/ulib for gmod.

UltimateByte commented 7 years ago

Well, i see some progress !

ultimatebyte@game:~$ ./csgoserver mi
=================================
Counter-Strike: Global Offensive mods & addons installation

Available mods:
sm | sourcemod | http://www.sourcemod.net/
mm | metamod | https://www.sourcemm.net/
(input exit to abort)

Enter the mod you wish to install:
mm
[ .... ] Mod Installation csgo-server: Installing MetaMod

Downloading mods to /home/ultimatebyte/lgsm/tmp/mods
    fetching mmsource-1.10.6-linux.tar.gz...OK
extracting mmsource-1.10.6-linux.tar.gz...OK
[  OK  ] Mod Installation csgo-server: MetaMod installed.

Anyone wanting to see the current progress: https://github.com/GameServerManagers/LinuxGSM/blob/ultimatebyte-sourcemod/lgsm/functions/command_mods_install.sh https://github.com/GameServerManagers/LinuxGSM/blob/ultimatebyte-sourcemod/lgsm/functions/mods_list.sh

Now for gmod:

ultimatebyte@game:~$ ./gmodserver mi
=================================
Garry's Mod mods & addons installation

Available mods:
ulib | ub | http://ulyssesmod.net/
ulx | ux | http://ulyssesmod.net/
(input exit to abort)

Enter the mod you wish to install:
ulib
[ .... ] Mod Installation gmod-server: Installing ULib    fetching ulib-master.zip...OK
extracting ulib-master.zip...OK
[  OK  ] Mod Installation gmod-server: ULib installed.
UltimateByte commented 7 years ago

Current output style: curr output

I'm looking to get it into a nice table, but it's kinda tricky. Next will be mods updates, then mods remove.

UltimateByte commented 7 years ago

Well, guyz, 95% of the job is done. Now it's all reviewing, testing, maybe polishing a bit, but it's ready. See #1255

UltimateByte commented 7 years ago

Merged soon. (first to devbranch, then master) Closing.

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.