AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Source Servers (SRCDS) (https://forums.alliedmods.net/forumdisplay.php?f=130)
-   -   Guide to gameinfo cloning - alternative way of forking servers (https://forums.alliedmods.net/showthread.php?t=318775)

nosoop 09-19-2019 19:52

Guide to gameinfo cloning - alternative way of forking servers
 
Disclaimer: This is a completely unsupported configuration. Various things may break.

This currently segfaults with CS:GO servers when a player joins. I don't do CS:GO, so I'm not going to try diagnosing the issue (especially since they lack symbols). Please post if you've experimented with this and managed to get a stable setup.

Thanks to Gamecube762 for pointing out this method; I've been using it to spin up fresh TF2 servers for various plugin projects.

At its core, gameinfo cloning is pretty straightforward: You copy / symlink a bunch of base files that SRCDS needs, but you point gameinfo.txt to a "core" installation of files, which the game will read from.

The result is effectively an empty game directory for each new "server", besides your configuration files and addons.

Installation, the long way:
  1. Create a fresh install of your game of choice. The installation folder will be your "core" instance; the only thing you should be doing is running updates to these.
  2. Create a new, empty folder
  3. Symlink the game install's bin/ directory, plus the srcds_run and game/steam.inf files to your new folder. On Windows, you'll want SeCreateSymbolicLinkPrivilege privileges.
  4. Copy srcds_run, steam_appid.txt, and $game/steam.inf to your new folder.
  5. Copy gameinfo.txt to your new folder, then modify the SearchPaths subsection as follows:
    • Any paths to VPKs should be changed to a full path name or one pointing to the path of your "core" installation.
    • All instances of |all_source_engine_paths| should be replaced with the path to your core installation.
    • If any are present, keep game_write and mod_write directories as-is, to ensure that files intended to be written are saved to your cloned installation.
    • For my brief testing with CS:GO, I just added a new "Game" entry directed at my core's csgo/ subdirectory. Feel free to experiment with the other search paths, as I'm not sure which folder CS:GO will end up writing to by default.
  6. Launch your cloned game's srcds_run and assert that it works.
  7. Install MM:S and SM under your cloned install.
  8. In the case of TF2, MM:S doesn't load automatically (probably only loads from a particular search directory). Add +plugin_load /full/path/to/addons/metamod/bin/server. SourceMod loads fine. Source.Python needs the game's server binary symlinked to tf/bin/.
  9. When you need to update the game, force_install_dir in your core game path as you did the first time.

Installation, the short way:

Here's a set of quick-install scripts for TF2, and CS:GO. Follow the instructions in the comments.

If anything goes wrong during the installation, you'll want to look over the long installation method. If anything is problematic while the server is running, well, you're probably on your own at that point.

8guawong 09-20-2019 02:39

Re: Guide to gameinfo cloning - alternative way of forking servers
 
Quote:

Originally Posted by nosoop (Post 2667638)
Disclaimer: This is a completely unsupported configuration. Various things may break.

This currently segfaults with CS:GO servers when a player joins. I don't do CS:GO, so I'm not going to try diagnosing the issue (especially since they lack symbols). Please post if you've experimented with this and managed to get a stable setup.

Thanks to Gamecube762 for pointing out this method; I've been using it to spin up fresh TF2 servers for various plugin projects.

At its core, gameinfo cloning is pretty straightforward: You copy / symlink a bunch of base files that SRCDS needs, but you point gameinfo.txt to a "core" installation of files, which the game will read from.

The result is effectively an empty game directory for each new "server", besides your configuration files and addons.

Installation, the long way:
  1. Create a fresh install of your game of choice. The installation folder will be your "core" instance; the only thing you should be doing is running updates to these.
  2. Create a new, empty folder
  3. Symlink the game install's bin/ directory, plus the srcds_run and game/steam.inf files to your new folder. On Windows, you'll want SeCreateSymbolicLinkPrivilege privileges.
  4. Copy srcds_run, steam_appid.txt, and $game/steam.inf to your new folder.
  5. Copy gameinfo.txt to your new folder, then modify the SearchPaths subsection as follows:
    • Any paths to VPKs should be changed to a full path name or one pointing to the path of your "core" installation.
    • All instances of |all_source_engine_paths| should be replaced with the path to your core installation.
    • If any are present, keep game_write and mod_write directories as-is, to ensure that files intended to be written are saved to your cloned installation.
    • For my brief testing with CS:GO, I just added a new "Game" entry directed at my core's csgo/ subdirectory. Feel free to experiment with the other search paths, as I'm not sure which folder CS:GO will end up writing to by default.
  6. Launch your cloned game's srcds_run and assert that it works.
  7. Install MM:S and SM under your cloned install.
  8. In the case of TF2, MM:S doesn't load automatically (probably only loads from a particular search directory). Add +plugin_load /full/path/to/addons/metamod/bin/server. SourceMod loads fine. Source.Python needs the game's server binary symlinked to tf/bin/.
  9. When you need to update the game, force_install_dir in your core game path as you did the first time.

Installation, the short way:

Here's a set of quick-install scripts for TF2, and CS:GO. Follow the instructions in the comments.

If anything goes wrong during the installation, you'll want to look over the long installation method. If anything is problematic while the server is running, well, you're probably on your own at that point.

if i'm reading it correctly currently this won't work for csgo, right?

nosoop 09-20-2019 04:50

Re: Guide to gameinfo cloning - alternative way of forking servers
 
Quote:

Originally Posted by 8guawong (Post 2667653)
if i'm reading it correctly currently this won't work for csgo, right?

I figured the red text would stand out.

As far as the scripts go, this currently does not work for CS:GO as-is. Feel free to experiment with the setup to see if you can make it work. Worth a shot to get rid of 60GB of duplicate server copies, right?

I've managed to get the server launched, MM:S and SM installed in the cloned server's directory works (as far as meta version and sm version does), but attempting to join a playing team after connecting causes it to segfault (spectate is fine). Placing the core directory's path first makes everything except MM:S and SM load.

Might need to symlink more files / folders. It might just be that it expects something in that path that is currently missing. Hard to really say, because the CS:GO developers don't provide help in that aspect.

Maybe CS:GO straight-up actually lacks the facilities that make it viable for other Source game servers to be cloned in this way.

8guawong 09-20-2019 09:35

Re: Guide to gameinfo cloning - alternative way of forking servers
 
Quote:

Originally Posted by nosoop (Post 2667659)
I figured the red text would stand out.

As far as the scripts go, this currently does not work for CS:GO as-is. Feel free to experiment with the setup to see if you can make it work. Worth a shot to get rid of 60GB of duplicate server copies, right?

I've managed to get the server launched, MM:S and SM installed in the cloned server's directory works (as far as meta version and sm version does), but attempting to join a playing team after connecting causes it to segfault (spectate is fine). Placing the core directory's path first makes everything except MM:S and SM load.

Might need to symlink more files / folders. It might just be that it expects something in that path that is currently missing. Hard to really say, because the CS:GO developers don't provide help in that aspect.

Maybe CS:GO straight-up actually lacks the facilities that make it viable for other Source game servers to be cloned in this way.

guess you noticed my complaint in discord :mrgreen:


All times are GMT -4. The time now is 02:47.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.