sourcebans-pp
sourcebans-pp copied to clipboard
Add cvar sb_id to override serverid in config file
Description
Creates a new cvar to facilitate easier management of distributed servers.
Motivation and Context
My specific use case is for gameservers are hosted in a gitlab/github repository - Creators.TF does this, and instead of having to manually install a sourcebans.cfg per server, I can just set this new cvar to one of our "serverids", as there is no requirement that serverids in the sb_servers table be sequential or ordered at all.
How Has This Been Tested?
In use at https://bans.creators.tf
Screenshots (if appropriate):
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] My code follows the code style of this project.
- [x] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
This is ready for a looksie
What needs to be updated in the docs, and where?
I'm very interested in this, as I have a super compact symlinked multi-server setup for reusal of assets, and I'm taking benefit of this feature. Please, SB++ team, consider accepting the PR and updating the docs. For example, I created the following proposal:
content/docs/adding_server.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/docs/adding_server.md b/content/docs/adding_server.md
index 893daf1..e99f81e 100644
--- a/content/docs/adding_server.md
+++ b/content/docs/adding_server.md
@@ -20,6 +20,6 @@ toc = true
1. Navigate to <mark>addons/sourcemod/configs/sourcebans</mark>
-2. Edit <mark>sourcebans.cfg</mark> and modify `ServerID` to the `ID` value you recorded down
+2. Edit <mark>sourcebans.cfg</mark> and modify `ServerID` to the `ID` value you recorded down. Alternatively, you can configure an ID via `sb_id` ConVar (which will take priority over the <mark>sourcebans.cfg</mark> one), e.g. `sb_id 1`.
3. Save, reupload file, and reload map/restart server
@Groruk What do you need for this to get merged...?
Hello,
Can you please rebase this into the php81 branch?
Thanks!
@Hackmastr that work for you?
Thanks!