splewis / csgo-practice-mode

CS:GO Sourcemod plugin for private team/individual practice servers
GNU General Public License v3.0
455 stars 70 forks source link

Add Multiserver Support #223

Closed fredmatix closed 2 years ago

fredmatix commented 2 years ago

On Line 815 of practicemode.sp you are defining the Save Location of the grenades: BuildPath(Path_SM, g_GrenadeLocationsFile, sizeof(g_GrenadeLocationsFile), "data/practicemode/grenades/%s.cfg", map);

The problem with that is the staticness of this and no ConVar available to change the path manually.

I run 8 Teamserver with practicemode on it using Linux GSM. The greatness about Linux GSM is the ability to physically utilize only one server directory to run several server instances at once. These instances rely on their own server.cfg files which differentiate each server from another through cvars. My problem now ist that each serverinstance would share their nades with each other through the map.cfg in the path. So this problem enforces me to duplicate each server to run completely separated instances.

The most beautiful solution would be to put the bots, replays, spawns, grenades in ConVars in the practicemode.cfg. Or differentiate by creating a subdirectory of each with the serverport (GetConVarInt( FindConVar( "hostport" ) );) and put it in the path: data/practicemode/%s/grenades/%s.cfg", hostport, map);

Is this possible? I have never done a pull request. Maybe someone else could code that and make a PR.

splewis commented 2 years ago

While this sounds reasonable, I'm hesitant to suggest it's worth trying to support, since sourcemod itself strongly recommends not doing what you're trying to do: https://wiki.alliedmods.net/Multiple_or_Forked_Servers_(SourceMod)