UNVERIFIED SPAWN REVOKE script

Place for people to discuss public servers, and also for admins to lay out the details of their servers
Post Reply
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

UNVERIFIED SPAWN REVOKE script

Post by SilverFox »

If you've been to silvercat lately, you may or may not have noticed a admsg stating that the server will kick unregistered players to make room for registered players. You may be wondering how we do that. Well, in the interest in encouraging players to register (the goal is to go register-only to discourage cheaters and such), I'll share the script we use.

This script runs as a cronjob to check if there are more than x players, and if so remove SPAWN priveledges for y minutes.

Take a look at the script here: http://bzflag.pastebin.ca/35460

The way this is done, is we have a groupdb "standard" which has normal priveledges, and another that is named "regonly" which has -SPAWN for EVERYONE and +SPAWN for VERIFIED. When the script runs, it checks to see how many players there is (the preferred way to do this is to look at bzfquery output) and creates a symlink from either "standard" or "regonly" to the file your server is using for groupdb. Next, bzadmin logs in (as a user in your admin group) and runs /reload which causes the new groupdb file to take effect.

We run the script every 15 minutes. The defaults are to revoke priveledges for 60 seconds if there are more than 10 players.

As an added "feature" bzadmin outputs to a file which can be parsed by bzstats or some other stat generating program.

If you have questions, post them here, since I don't really want to answer the same question twice.

I'd really like to know if anyone else uses this. Thanks,

Silver Fox
loophole
Private First Class
Private First Class
Posts: 56
Joined: Fri Oct 14, 2005 11:43 pm

Post by loophole »

good idea :D
User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite »

OK, sorry if I don't get this... (we had talked on IRC)

There's a line here:

Code: Select all

groupdir="/usr/local/bzfs/server/groupfiles"
How do you set groups in your config file??

Can you give me an example of two configs with the relevant -groupdb and setting in the shell file?
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox »

Sure.

in /usr/local/bzfs/server/groupfiles/standard:

Code: Select all

EVERYONE: +SPAWN +TALK
in /usr/local/bzfs/server/groupfiles/regonly:

Code: Select all

EVERYONE: -SPAWN +TALK
VERIFIED: +SPAWN +TALK
Or whatever you'd like it to be...

Then in your bzfs config:

Code: Select all

-groupdb /usr/local/bzfs/server/groupfiles/5154
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Registrations Up!

Post by SilverFox »

Tonight, we had 24 players online. This wouldn't be unusual if it weren't for the fact that they were ALL REGISTERED!

I believe this script is really making a difference. Since we began running it Dec 30th, there have been 284 registrations. Of course, I can't take credit for all of them, but I believe that this script has really encouraged a lot of them. If more servers use this, we should be able to do a reg-only campaign, and make it difficult to hide behind an anonymouse playername and be a !#$%.
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

ok how do you run this script is it a batch file or what ive changed all the server names and passwords
Image
Sig Made By AlliedArmour

TGPH
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox »

This is a bash script written for *nix systems. I would be happy to rewrite it as a MS-DOS bat/cmd script, but the problem is, I can't think of a way to get the playercount w/out an external program. I'll think about it a bit. Right now, the only thing I can think of is to require the use of wget.

My fear is the folks who run windows won't be savvy enough to use the script, and get the scripts prerequisites, and use it properly (w/out me doing it for them)

I'll think about it a bit before doing any work.

Its probably better/easier for these folks to just wait for the nagware plugin to come out.
Last edited by SilverFox on Tue Jan 10, 2006 4:40 am, edited 1 time in total.
User avatar
Matt?
Private First Class
Private First Class
Posts: 281
Joined: Sun Jan 09, 2005 10:15 pm
Location: st. john wa
Contact:

Post by Matt? »

this is awsome. schould severly cut down on cheater's if everyone registered
Image
User avatar
Tropican8
Private First Class
Private First Class
Posts: 312
Joined: Fri Mar 18, 2005 11:51 pm
Location: As close to the grove as you can get

Post by Tropican8 »

SilverFox wrote:This is a bash script written for *nix systems. I would be happy to rewrite it as a MS-DOS bat/cmd script, but the problem is, I can't think of a way to get the playercount w/out an external program. I'll think about it a bit. Right now, the only thing I can think of is to require the use of wget.

My fear is the folks who run windows won't be savvy enough to use the script, and get the scripts prerequisites, and use it properly (w/out me doing it for them)

I'll think about it a bit before doing any work.
I believe an easier solution is to use the MSYS package from MinGW. It lets you run Unix Shell Scripts in Windows among many other things. This would also ensure intelligent people use it. (I think)
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox »

I noticed 28 registered players on silvercat tonight. We've stopped using the revoke script and are now using the nagware plugin by menotume. This plugin sends a message to unregistered players every x minutes and optionally kicks them after y seconds. Its quite configurable and is working VERY well for us so far. Other popular servers are encouraged to use this plugin. I'll start another thread for questions/discussion on this new plugin.
Post Reply