sourcebans-pp icon indicating copy to clipboard operation
sourcebans-pp copied to clipboard

Add cvar sb_id to override serverid in config file

Open sapphonie opened this issue 3 years ago • 4 comments

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.

sapphonie avatar Jul 07 '21 04:07 sapphonie

This is ready for a looksie

sapphonie avatar Aug 15 '21 17:08 sapphonie

What needs to be updated in the docs, and where?

sapphonie avatar Sep 29 '21 21:09 sapphonie

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

Adrianilloo avatar Oct 27 '21 17:10 Adrianilloo

@Groruk What do you need for this to get merged...?

sapphonie avatar Jun 05 '22 05:06 sapphonie

Hello,

Can you please rebase this into the php81 branch?

Thanks!

Hackmastr avatar Sep 23 '22 19:09 Hackmastr

@Hackmastr that work for you?

sapphonie avatar Sep 24 '22 19:09 sapphonie

Thanks!

Hackmastr avatar Sep 25 '22 15:09 Hackmastr