Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command: mods-install/update/remove #1255

Merged
merged 183 commits into from Jan 26, 2017
Merged

Command: mods-install/update/remove #1255

merged 183 commits into from Jan 26, 2017

Conversation

UltimateByte
Copy link
Contributor

Installing and keeping external game mods updated have never been so easy.

Introducing

./gameserver mods-install
./gameserver mods-update
./gameserver mods-remove

Fixes #631

demo

Features

  • Install / update / remove a mod
  • Get latest mod URL when needed by scraping host's website
  • Show available mods for a given game/engine (allows for excluding games)
  • Keep track of all installed mods in order to update or remove them
  • Ability to set updates policies (for example: NOUPDATE for a mod that shouldn't be overwritten)
  • Builds a file list of any installed mod in order to cleanly remove any file from it
  • Ability to preserve config files upon mod update
  • Handles many possible errors
  • Allows for specific post-install fixes
  • Allows for easy new mods support
  • Loads of comments and descriptions.

Adding mods support
Everything has been made to allow for adding a mod with two line edits in best case scenari:

  1. Add your mod info into mods_list.sh, in the form of mod_info_name=() array
  2. Add this array to mods_global_array=()
  3. (OPTIONAL) Scrape latest URL if needed, using fn_mods_scrape_urls functions.
  4. (OPTIONAL), Apply some post-install tasks if needed with fn_postinstall_tasks inside mods_core.sh

It will might be polished a little before merging.
Please, point out anything you think could be improved.

@UltimateByte
Copy link
Contributor Author

UltimateByte commented Jan 26, 2017

Note for myself:
Check that totalmods variable works as intended by watching logs.
After reviewing code, i'm not so sure it's being used as it should.

Edit: Confirming totalmods & totalmodsinstalled variable uses need a revision.

@UltimateByte
Copy link
Contributor Author

Fixed wrong counter.
@dgibbs64 Only weird thing now is for some reason, file remove listing is sometimes on 2 lines rather than one.

Example output:


Garry's Mod addons/mods
=================================

Remove addons/mods
=================================
ulx - ULX - Admin Panel (requires ULib)
ulib - ULib - Complete Framework
utime - UTime - Keep track of players play time
metamod - MetaMod - Plugins Framework
darkrpmodification - DarkRP Modification - Customize DarkRP settings

Enter an addon/mod to install (or exit to abort): darkrpmodification
Warning! You are about to remove darkrpmodification.
 * Any custom files/configuration will be removed.
Continue? [Y/n]y
removing DarkRP Modification
* 46 files to be removed
* location: /home/ultimatebyte/serverfiles/garrysmod/addons
OK
removing DarkRP Modification 46 / 46 : darkrpmodification-master/README.md...OK
removing darkrpmodification-files.txt...OK
removing darkrpmodification from ...OK
DarkRP Modification removed
ultimatebyte@game:~$ ./gmodserver mr

Garry's Mod addons/mods
=================================

Remove addons/mods
=================================
ulx - ULX - Admin Panel (requires ULib)
ulib - ULib - Complete Framework
utime - UTime - Keep track of players play time
metamod - MetaMod - Plugins Framework

Enter an addon/mod to install (or exit to abort): metamod
Warning! You are about to remove metamod.
 * Any custom files/configuration will be removed.
Continue? [Y/n]y
removing MetaMod
* 22 files to be removed
* location: /home/ultimatebyte/serverfiles/garrysmod
OK
removing MetaMod 1 / 22 : addons/metamod.vdf...OK
removing MetaMod 22 / 22 : addons/metamod/metaplugins.ini...OK
removing metamod-files.txt...OK
removing metamod from ...OK
MetaMod removed

@dgibbs64 dgibbs64 merged commit 3ea100c into develop Jan 26, 2017
@dgibbs64 dgibbs64 deleted the feature/ultimatebyte-911 branch January 26, 2017 21:40
@lock
Copy link

lock bot commented Jul 18, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants