Page 1 of 1

UNVERIFIED SPAWN REVOKE script

Posted: Sun Jan 01, 2006 10:40 pm
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

Posted: Sun Jan 01, 2006 11:40 pm
by loophole
good idea :D

Posted: Mon Jan 02, 2006 1:23 am
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?

Posted: Tue Jan 03, 2006 7:28 pm
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

Registrations Up!

Posted: Sat Jan 07, 2006 6:02 am
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 !#$%.

Posted: Sat Jan 07, 2006 4:38 pm
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

Posted: Sat Jan 07, 2006 10:04 pm
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.

Posted: Sun Jan 08, 2006 3:37 am
by Matt?
this is awsome. schould severly cut down on cheater's if everyone registered

Posted: Sun Jan 08, 2006 5:34 am
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)

Posted: Thu Jan 19, 2006 5:03 am
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.