ResetServerWhenEmpty plugin

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

ResetServerWhenEmpty plugin

Post by Theme97 » Mon Mar 27, 2006 3:42 am

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. ;)
Attachments
RSWE_linux.zip
Linux version.
(6.41 KiB) Downloaded 224 times
RSWE_source.zip
Source.
(10.47 KiB) Downloaded 220 times
Image

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 » Mon Mar 27, 2006 5:01 am

Wonderfull! Just what I needed!

OK, slightly related: any good repeating shell scripts?
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com

Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

Post by Theme97 » Mon Mar 27, 2006 5:49 am

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
Image

User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am
Contact:

Post by Scorch » Mon Mar 27, 2006 9:23 pm

how to compile on a mac: ?

Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

Post by Theme97 » Tue Mar 28, 2006 1:40 am

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
Last edited by Theme97 on Tue Mar 28, 2006 11:52 pm, edited 1 time in total.
Image

User avatar
tw1sted
Private First Class
Private First Class
Posts: 849
Joined: Tue Feb 21, 2006 10:21 pm

Post by tw1sted » Tue Mar 28, 2006 11:53 am

awsome job theme. of course im on windows....

User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am
Contact:

Post by Scorch » Tue Mar 28, 2006 12:00 pm

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.

Post Reply