flagReset

Expand and mod your server.
Post Reply
User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

flagReset

Post by L4m3r »

Just a simple timed flag reset, with an optional warning. Both the reset frequency and the warning delay can be set with parameters. Much easier and cleaner than a bot, IMO.

By default only unused flags are reset, but it can be configured to reset all flags.

As usual, see the readme for details.

And, of course, my server has it loaded, not that that helps you much as a demo. :p unused flag reset every 30 minutes with a 10-second warning.

Have fun.

EDIT: a 2.4 rewrite of this plugin is in the BZFlag source tree. Get it there. :wink:
Attachments
flagReset_source.zip
OOOOOOLD flagReset source
(23.21 KiB) Downloaded 573 times
flagReset_windows.zip
OOOOOOLD flagReset Windows .dll
(6.25 KiB) Downloaded 503 times
flagReset_linux.zip
OOOOOOLD flagReset Linux .so
(8.24 KiB) Downloaded 518 times
Optimism is just a milder alternative to denial.
temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction »

Here is a mac build of the ".so" file - have fun!
Attachments
flagReset.zip
Built on Mac OS X 10.4.5 - YMMV with other systems.
(51.05 KiB) Downloaded 517 times
User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am

Post by Scorch »

How do you get 2.0.5?
Is that the only way to get plugins to work on a mac?
temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction »

You have to build it from CVS. See this thread. Be sure to read the whole thread, as there's important info on page two of it (especially about getting the v2.0 branch rather than the 2.1 development branch)
dango
Private First Class
Private First Class
Posts: 1400
Joined: Sun Feb 06, 2005 5:40 pm
Location: Somewhere over there.

Post by dango »

isn't 2.0.4 compatible with mac plug-ins?
Image
Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

Post by Theme97 »

Finally, you made it! :P
IK is now using this plugin.
Image
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

2.0.4 for macintosh wil not load plugins.
Mac is the only build like this.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am

Post by Scorch »

i got mac 2.0.5, how do i get plugins to work?
p.s. I looked at a real old thread and where someone on 2.0.5 got .dylib on a mac three times at the end of make on a plugin, i got .la
temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction »

This is pretty much off-topic. This plugin file is already built - the flagReset.so file IS what you need to load.

Here's a bit of the readme that I included with the above file.
To use this plugin you must put it into a hidden file on your Mac's main HD. With terminal.app use CP to put this into "/usr/local/lib/" (note there's no "~") - you will need admin password to create the directory - best bet is to use "sudo".

Put this into the *.conf file to load the plugin:
"-loadplugin /usr/local/lib/flagReset" (no need to include the .so suffix)
obviously change the name of the plugin to the one you want to use - each plugin must have an individual line.
User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am

Post by Scorch »

but how do i build this .so file? can i make the stuff like killall that is in the cvs i got 2.0.5 from? when i run make it gives me this... (notice at the end the .la instead of the .dylib that was in that thread.)

Code: Select all

source='killall.cpp' object='killall.lo' libtool=yes \
depfile='.deps/killall.Plo' tmpdepfile='.deps/killall.TPlo' \
depmode=gcc3 /bin/sh ../../misc/depcomp \
/bin/sh ../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../include   -pipe -pedantic -fno-exceptions -W -Wall -Wundef -Wno-import  -g -O2 -O3 -ffast-math -fomit-frame-pointer -fexpensive-optimizations -fno-exceptions -c -o killall.lo `test -f 'killall.cpp' || echo './'`killall.cpp
 g++ -DHAVE_CONFIG_H -I. -I. -I../../include -pipe -pedantic -fno-exceptions -W -Wall -Wundef -Wno-import -g -O2 -O3 -ffast-math -fomit-frame-pointer -fexpensive-optimizations -fno-exceptions -c killall.cpp -MT killall.lo -MD -MP -MF .deps/killall.TPlo -o killall.o
/bin/sh ../../libtool --mode=link g++  -g -O2 -O3 -ffast-math -fomit-frame-pointer -fexpensive-optimizations -fno-exceptions  -L/usr/X11R6/lib -framework SDL -Wl,-search_paths_first -mdynamic-no-pic -o killall.la -rpath /usr/local/lib -module -avoid-version killall.lo  -lm -L/usr/lib -lcurl -lssl -lcrypto -lz  -framework Carbon -framework Cocoa -framework OpenGL
mkdir .libs
ar cru .libs/killall.a  killall.o
ranlib .libs/killall.a
creating killall.la
(cd .libs && rm -f killall.la && ln -s ../killall.la killall.la)
btw, I have a sweet hack that lets me see everything in finder (.filename and just plain hidden stuff) so its easy for me to fish in bins 8)
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

A temporal Distraction Has built the .so for you. (If you are mac)
All you need to do is place it in usr/local/lib/
then -loadplugin /usr/local/lib/flagreset

.dylib is for windows (i think) but was also used for macintosh plugins awhile back, i think that lasted for about 36 hours, then changed to .so
.So you can forget .dylib on mac.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am

Post by Scorch »

ok, btw all the stuff for the system in /usr/local/libs/ is .dylib.

I want to do it myself :) how?

i tried his and it didn't complain but was inefective
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

Uh, if your trying to build the plugins available in the CVS, your best bet is to do a full compile, using ./configure --enable-shared
if you don't need a client, i also suggest using --disable-client
So it would be...
./configure --enable-shared --disable-client; make
The compiler will put the plugin .so files into /usr/local/lib for you

The best way to build plugins, is as part of a full server compile.
Download the full BZFlag source from CVS, then just before ./autogen.sh place your additional plugin sources in the same folder as the plugins in the full source, then proceed as above.
Last edited by optic delusion on Tue Mar 07, 2006 10:21 pm, edited 1 time in total.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction »

Please see this thread about building plugins for OSX.
http://my.bzflag.org/bb/viewtopic.php?t=6753
User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am

Post by Scorch »

why --enable-shared and what does it do? goes off to .configure...
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

Damned if I know what it does, you can also use --enable-plugins but I'm told that -enable-shared is better. I just do what I'm told.
The hard part is getting your build environment just right, for help on that, you will have to go elsewhere. This is a plugin release thread.
And remember to cd into the new bzfs when you start the server.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am

Post by Scorch »

i didn't see enable plugins when i ran ./configure -help. i tried what you said and i still got the thing with the .la s and did i mention that the .so doesnt work? im using the same version as a temp distract.
temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction »

I was told yesterday that "--enable-shared" is for the 2.0.x branch and that "--enable-plugins" is for the 2.1.x branch. I use both and I don't have a problem with it.

I don't know what "./configure -help" is.

In the thread I referenced above, I got my plugins to build by changing gcc from 4 to 3.3 and after the make I added make install .
User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am

Post by Scorch »

is make install necessary? isn't that downgrading? what is gcc?

most important: how do i degrade gcc?
User avatar
sid6.7
Private First Class
Private First Class
Posts: 614
Joined: Mon Oct 06, 2003 9:58 pm
Location: West USA
Contact:

Post by sid6.7 »

cool finally someone did it....i tried to do it in a batch file
but it never worked...
temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction »

Scorch wrote:how do i degrade gcc?
sudo gcc_select 3.3
User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am

Post by Scorch »

thanks i degraded, ill try stuff when i get back from school.
User avatar
Scorch
Private First Class
Private First Class
Posts: 747
Joined: Thu Sep 30, 2004 12:16 am

Post by Scorch »

Ok, i still get .la's ill tell you after the compilation what extensions i get

.cpp
.def
.la
.lo
.o
.sln
.vcproj
.am
.in


(I didn't make install, does that affect if its a .dylib or .la?)
User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Re: flagReset

Post by L4m3r »

This plugin has been rewritten for 2.4 and added to the source tree. It is now called "autoFlagReset" for clarity.

The features are a little bit different also. It only resets unused superflags (not team flags). There is an option to reset flags one at a time, continuously, to avoid the client hangs and lag spikes that can happen when a lot of flags get reset at once. I had forgotten that the original version gave a warning, but since the new one avoids team flags it probably isn't needed anyway.
Optimism is just a milder alternative to denial.
Post Reply