Page 1 of 1

flagReset

Posted: Mon Mar 06, 2006 9:41 am
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:

Posted: Mon Mar 06, 2006 1:12 pm
by temporal distraction
Here is a mac build of the ".so" file - have fun!

Posted: Mon Mar 06, 2006 1:16 pm
by Scorch
How do you get 2.0.5?
Is that the only way to get plugins to work on a mac?

Posted: Mon Mar 06, 2006 2:15 pm
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)

Posted: Mon Mar 06, 2006 11:15 pm
by khazhyk
isn't 2.0.4 compatible with mac plug-ins?

Posted: Tue Mar 07, 2006 5:18 am
by Theme97
Finally, you made it! :P
IK is now using this plugin.

Posted: Tue Mar 07, 2006 2:31 pm
by optic delusion
2.0.4 for macintosh wil not load plugins.
Mac is the only build like this.

Posted: Tue Mar 07, 2006 8:28 pm
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

Posted: Tue Mar 07, 2006 9:09 pm
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.

Posted: Tue Mar 07, 2006 9:36 pm
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)

Posted: Tue Mar 07, 2006 9:58 pm
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.

Posted: Tue Mar 07, 2006 10:09 pm
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

Posted: Tue Mar 07, 2006 10:12 pm
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.

Posted: Tue Mar 07, 2006 10:20 pm
by temporal distraction
Please see this thread about building plugins for OSX.
http://my.bzflag.org/bb/viewtopic.php?t=6753

Posted: Tue Mar 07, 2006 10:21 pm
by Scorch
why --enable-shared and what does it do? goes off to .configure...

Posted: Tue Mar 07, 2006 10:30 pm
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.

Posted: Tue Mar 07, 2006 10:41 pm
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.

Posted: Tue Mar 07, 2006 11:10 pm
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 .

Posted: Tue Mar 07, 2006 11:38 pm
by Scorch
is make install necessary? isn't that downgrading? what is gcc?

most important: how do i degrade gcc?

Posted: Tue Mar 07, 2006 11:40 pm
by sid6.7
cool finally someone did it....i tried to do it in a batch file
but it never worked...

Posted: Wed Mar 08, 2006 1:05 am
by temporal distraction
Scorch wrote:how do i degrade gcc?
sudo gcc_select 3.3

Posted: Wed Mar 08, 2006 1:05 pm
by Scorch
thanks i degraded, ill try stuff when i get back from school.

Posted: Thu Mar 09, 2006 1:46 am
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?)

Re: flagReset

Posted: Mon Feb 20, 2012 10:46 pm
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.