Page 1 of 1

ResetServerWhenEmpty plugin

Posted: Mon Mar 27, 2006 3:42 am
by Theme97
From the README:
ResetServerWhenEmpty
by Theme97, 03/26/06

The plugin idea is very simple. You can toggle an RSWE (Restart Server When Empty) with a simple
/rswe command. You MUST have a repeating batch/shell for an automatic restart.

/rswe on
/rswe off
/rswe toggle
/rswe status

In order to use the first 3 commands, you must have the RSWE perm. In order to use /rswe status,
you need the RSWESTATUS perm.

When loading the plugin, you can also use a parameter called "noTimer". The plugin works by
checking every _rejoinTime seconds to see if there are any players. If there are no players, the
server sends a message in case there are observers and shuts down. The plugin relies on a repeating
batch or shell to start up the server. If noTimer is enabled, the plugin checks for players every
time somebody leaves.

v1.0: Plugin created. Not going in Plug-in Releases quite yet. Not very sure if noTimer works.
I can't compile a Windows version since my computer is a bit outdated. Thanks to Happy Tanker for providing SSH and letting me do everything for this plugin on his computer. ;)

Posted: Mon Mar 27, 2006 5:01 am
by A Meteorite
Wonderfull! Just what I needed!

OK, slightly related: any good repeating shell scripts?

Posted: Mon Mar 27, 2006 5:49 am
by Theme97
I can give you the IKCTF repeating shell script soon.

Edit: I put this in plug-in development because I'm not quite sure everything works. The server used to segfault everytime I had a bz_ePlayerPartEvent. I also am not sure if the timer works and if "noTimer" works too. Can someone please go through rigorous testing? ;)

Edit 2: Can someone compile a Windows version too? Thanks. :D

Edit 3: Got it. This is the one Happy Tanker uses:

Run_Theme97_Map.sh

Code: Select all

while [ 1 ]
do
        #Open a server instance
        ./Single_Server_Instance.sh
done
Single_Server_Instance.sh

Code: Select all

bzfs -conf Conf >> Logs

Posted: Mon Mar 27, 2006 9:23 pm
by Scorch
how to compile on a mac: ?

Posted: Tue Mar 28, 2006 1:40 am
by Theme97
1. I think you might have to ask a temporal distraction for that.

2. AFAIK, these two shells should work:
RunServer.sh

Code: Select all

bzfs -conf Conf >> Logs
./RunServer.sh
A different RunServer.sh

Code: Select all

while [ 1 ]
do
	bzfs -conf Conf >> Logs
done

Posted: Tue Mar 28, 2006 11:53 am
by tw1sted
awsome job theme. of course im on windows....

Posted: Tue Mar 28, 2006 12:00 pm
by Scorch
Theme97 wrote:1. I think you might have to ask a temporal distraction for that.

2. AFAIK, these two shells should work:
RunServer.sh

Code: Select all

bzfs -conf Conf >> Logs
sh RunServer.sh
You can run off the .sh? my plugins went to usr/local/lib/pluginnamehere.so and i run off those successfully.