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

[FEAT] Mod installer (aka Blue Shift support part 1) #137

Open
Alienmario opened this issue Aug 25, 2024 · 0 comments
Open

[FEAT] Mod installer (aka Blue Shift support part 1) #137

Alienmario opened this issue Aug 25, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed PRIORITY A feature or bug that should be prioritized

Comments

@Alienmario
Copy link
Collaborator

Alienmario commented Aug 25, 2024

In order to support overhaul mods that come with their own game folder + gameinfo.txt (such as Blue Shift) we should devise an automated mod install + launch process for servers.

Mod registry

There should be a central registry file that we can ship, which for each of supported mods includes:

  • workshop id
  • short name
  • sequence of commands needed for installation. These can be generic - create link, copy .. or os specific commands
  • first map

Plugin commands

All commands take workshop id or short name for mod resolution.

Install mod

  • Adds the specified mod to subscribed_file_ids.txt if missing.
  • Prints a message telling the user to restart, so mods can start to download.
  • Prints error message for unsupported mods.
  • sc_install bshift

Launch mod

This is where it gets tricky since overhaul mods require launching with custom -game parameter, which we have no direct way to affect.

As a workaround we can use a static game name scmodlauncher as a dynamically updating symlink pointing to the active mod directory. We then instruct users to launch with -game scmodlauncher.

We'll most likely need to do the same with the +map parameter, since server won't fully start with launch map missing.
We can ship an empty placeholder map.

The final file structure would look like this:

  • Black Mesa Dedicated Server
    • bms
    • bshift [symlink to workshop content (./bms/addons/workshop/content/362890/2424633574/bshift)]
    • scmodlauncher [symlink to active mod (bms, bshift, ..)]

sc_launch would do the following (approximately):

  • checks that the mod has downloaded
  • runs post-download install commands, creating mod symlink in server root
  • creates symlinks for addons, maps, server.cfg and other req files inside the mod folder
  • updates scmodlauncher symlink
  • configures Sourcemod
    • replacing all "bms" references in gamedata
  • kicks clients with instructions
  • quits server

After the restart, we can detect our placeholder map and change to the first map of the mod.

Implementation

  • Can be a part of srccoop_addon_workshop_manager.sp
  • We can use System2 for running commands or archiving functionality.
@Alienmario Alienmario changed the title [FEAT] Mod installer (aka Blue Shift support) [FEAT] Mod installer (aka Blue Shift support part 1) Aug 26, 2024
@Alienmario Alienmario added enhancement New feature or request help wanted Extra attention is needed labels Sep 14, 2024
@Alienmario Alienmario added the PRIORITY A feature or bug that should be prioritized label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed PRIORITY A feature or bug that should be prioritized
Projects
None yet
Development

No branches or pull requests

1 participant