roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2
https://docs.cssharp.dev
Other
711 stars 110 forks source link

CounterStrikeSharp NOT WORKING if its location is changed in the addons folder #391

Open aronmgv opened 3 months ago

aronmgv commented 3 months ago

Hey, I am trying to host multiple servers and taking advantage of the same game binaries.. So my plan is to have different CounterStrikeSharp folder per game server:

The way I am trying to achieve is via separate metamod.ini file per server which is configured as a server starting parameter mm_pluginsfile addons/metamod/cwtg.ini

addons folder:

image

metamod folder:

image

metamod file of cwtg.ini

;If your plugin came with a .vdf file, you do not need to use this file.
;
;List one plugin per line.  Each line should contain the path to the plugin's binary.
;Any line starting with a ';' character is a comment line, and is ignored.
;
;You do not need to include the _i486.so or .dll part of the file name.  Example:
; addons/sourcemod/bin/sourcemod_mm
;You may also put an alias in front of the file, for example:
; sm addons/sourcemod/bin/sourcemod_mm
;Will allow you to use "meta load sm" from the console.
;
;********* LIST PLUGINS BELOW ***********

cwtg addons/css_cwtg/bin/linuxsteamrt64/counterstrikesharp

meta list

meta list
Listing 1 plugin:
  [01] <FAILED>

Error message from logs:

[13:29:31.785] CSSharp: Could not read '/srv/cs2/serverfiles/game/csgo/addons/counterstrikesharp/configs/core'. Error: CoreConfig file not found.

Dont understand why it is looking into addons/counterstrikesharp folder if metamod specifically says addons/css_cwtg??

Thanks for the help!

roflmuffin commented 3 months ago

This would require something like sm_basepath, #117

aronmgv commented 3 months ago

Would you please consider implementing it? The quick way would be respecting the basepath of counterstrikesharp root folder configured at metamod level..

However better approach would be to outsource just configuration so we dont have to update each server folder there is an update.. AMXX did it via server starting parameter amxx_cfg="addons/amxmodx/configs/core.ini" where in our case it would point to addons/counterstrikesharp /configs/core.json and there we would configure server specific folders for everything required..

Anyway for faster implementation first option would be much appreciated. Thanks a lot

mrc4tt commented 1 month ago

@aronmgv You will need to re-compile the whole CounterStrikeSharp (separated) if you want to use a custom addon folder name. :-)

I don't think this is something we won't see +css_basepath in the near future unfortunately