bzfscron 0.1

Questions, comments, and news on the server side plug-ins and it's API
User avatar
DTRemenak
General
General
Posts: 625
Joined: Thu Jan 16, 2003 4:54 am
Location: U.S.
Contact:

Post by DTRemenak »

I_Died_Once: change that line from bz_setPlayerAdmin to bz_setPlayerOperator and it should work for ya. Some of the internal terminology has changed for clarity.
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

Being (what I can gether) the only person using this (and several other) plugin, I hate to be an annoyance but this is what I have found...

In DTR's readme for this plugin, he gives examples, etc, and one is how one would automate the start and end of a match via the racetoseven plugin. Well, to start a match, you must have the STARTMATCH perm... Now, I know bzfscron derives its "authority" from bzfs at startup - however, with default everything, the match doesnt start. I had to add the MATCHSTART perm to everyone in order to give bzfscron the authority to start a match on its own.

I also found that if you look at the source... the file "bzfscron.cpp" - On Line 291, where bzfscron is quoted... You can change that from bzfscron to whatever you want the bot's name to be. I currently have mine set as "bzfscron Machine of Doom" on MoFo.

Now, I know I am annoying with this and the plugin and all - but since you CAN change out the name the bot uses... and to solve the perm issue and the potential disaster is posseses (I don't like everyone having the ability to start and end a match on MoFo - but its the only way if I want them to be automated) - How hard would it be to implement the usage of global login with the bot bzfscron uses? Or - did I kill development on this plugin?
...This has been a recording.
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

DTRemenak wrote:I_Died_Once: change that line from bz_setPlayerAdmin to bz_setPlayerOperator and it should work for ya. Some of the internal terminology has changed for clarity.
On line 310 of bzfscron.cpp, right, as per the error?

I'll tell when I get home if it worked or not...
...This has been a recording.
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

When i try to run the plugin (on windows) (batch File) i get a popup saying

Code: Select all

The procedure entry piont ?c_str@bzApiString@@QAEPBDXZ could not b loacated in the dynamic link library bzfs.exe

Iam using the latest versions of BZFS (2.0.5b2) as far as im awear and i have run other plugins Why does this happen?
Image
Sig Made By AlliedArmour

TGPH
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

oliver browne wrote:When i try to run the plugin (on windows) (batch File) i get a popup saying

Code: Select all

The procedure entry piont ?c_str@bzApiString@@QAEPBDXZ could not b loacated in the dynamic link library bzfs.exe

Iam using the latest versions of BZFS (2.0.5b2) as far as im awear and i have run other plugins Why does this happen?
When did JeffM2501 start writing error codes for Microsoft?
"could not b loacated"

Sorry for the quip, Oliver. If I knew anything about running a server on win32, I would gladly help you out.

The only thing I can think to tell ya is I saw an error like that before, it was the racetoseven plugin... In my .conf file, I put the -loadplugin command last of my -loadplugin commands, and it worked. But I work in a different environemnt than you do, so who's to say.
...This has been a recording.
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 »

Yeah, Oliver, I cant be sure, in windows. but that kinda looks like this. That we get in unix.

./bzfs: symbol lookup error: /home/death/bzflag/plugins/racetoseven/racetoseven.so: undefined symbol: _Z8tokenizeRKSsS0_ib
linux:/home/death #

In our case, the simple fix was to load another plugin, vocaliser, that we assume defines the symbols before racetoseven loads. It worked linux, and mac, I'm kinda interested if it works for you. If it does work, see if you can track down the specific plugin that does it for you.
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
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

I will see if that works...
Image
Sig Made By AlliedArmour

TGPH
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Can't find Plugin

Post by The Knights Who Say Ni »

It now says that it cant find the plugin and the path is right and there is an error in loading the second plugin and i have tried diffrent plugins
  • shockwaveDeath.dll
    vocaliser.dll
    hiddenAdmin.dll
The error:

Code: Select all

The dynamic link libary MSVCP80D.dll could not be found in the specified path C:\Program Files\BZFlag2.0.5b2;,;C:\WINNT\system32;C\WINNTsystem;C:\WINNT;C:\\WINNT\system32\Wbem;C\Program Files\ATI Technoliges\ATI Control Panel;C:\Program Files\QuickTime\QTSystem\.
and the server out put (at maximum verbosity)
(I have removed the stuff on either side of the the code quote to save space)

Code: Select all

Plugin:C:\BZFlag\plugins\Relay\Relay.dll not found
WARNING: unable to load the plugin; C:\BZFlag\plugins\Relay\Relay.dll
Plugin:C:\Program Files\BZFlag2.0.5b2\hiddenAdmin.dll found but expects an older
 API version (0), upgrade it
WARNING: unable to load the plugin;
C:\ProgramFiles\BZFlag2.0.5b2\hiddenAdmin.dll
Last edited by The Knights Who Say Ni on Sat Oct 29, 2005 8:28 pm, edited 1 time in total.
Image
Sig Made By AlliedArmour

TGPH
User avatar
DTRemenak
General
General
Posts: 625
Joined: Thu Jan 16, 2003 4:54 am
Location: U.S.
Contact:

Post by DTRemenak »

I_Died_Once wrote:In DTR's readme for this plugin, he gives examples, etc, and one is how one would automate the start and end of a match via the racetoseven plugin. Well, to start a match, you must have the STARTMATCH perm... Now, I know bzfscron derives its "authority" from bzfs at startup - however, with default everything, the match doesnt start. I had to add the MATCHSTART perm to everyone in order to give bzfscron the authority to start a match on its own.
This is not correct based on the code. If your experience contradicts the code, then something is wrong ;)

Code: Select all

bool PlayerAccessInfo::hasPerm(PlayerAccessInfo::AccessPerm right) const
{
  if (serverop && (right != hideAdmin))
    return true;
...
}

bool	PlayerAccessInfo::hasCustomPerm(const char* right) const
{
  if (serverop)
    return true;
...
}
bzfscron sets serverop on itself, so hasPerm and hasCustomPerm will return true for ALL permissions, regardless of whether it existed at server startup.
I also found that if you look at the source... the file "bzfscron.cpp" - On Line 291, where bzfscron is quoted... You can change that from bzfscron to whatever you want the bot's name to be. I currently have mine set as "bzfscron Machine of Doom" on MoFo.

Now, I know I am annoying with this and the plugin and all - but since you CAN change out the name the bot uses... and to solve the perm issue and the potential disaster is posseses (I don't like everyone having the ability to start and end a match on MoFo - but its the only way if I want them to be automated) - How hard would it be to implement the usage of global login with the bot bzfscron uses?
Hard.
I_Died_Once wrote:On line 310 of bzfscron.cpp, right, as per the error?
Yup.
oliver browne wrote:The error:

Code: Select all

The dynamic link libary MSVCP*)D.dll could not be found in the specified path ...
I'm guessing that you meant MSVCP80D and held down shift, which would imply that someone built the plugin on VC8 beta, in debug mode, and didn't give you the correct runtime dll. Everything you get from us should be built in VC7.1, and requires MSVCP71.dll.
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

DTR - I do believe you are correct in theory, however my experience contradicts this.

Run a CTF server, and load the vocalizer plugin first, then the racetoseven, then bzfscron, and crontab a match to start - see if it does and get ack to me. I scratched for three hours on this. (to get the race plugin to load, you gotta load the vocalizer plugin first in your conf file. Don't ask me why)
...This has been a recording.
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

and i dont want the racetoseven plugin i just want the bzfscron plugin becaues my server is FFA (Will be)

I have also tried to load the vocaliser plugin first and then bzfscron same errror

What runtime DLL i didnt specify one
Image
Sig Made By AlliedArmour

TGPH
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

Would it make a diffrence if I was loading the plugins in my batch file :?:
Just a thought

Ok it dosent ummm...
What is API and why do I need a previous version of it?
Image
Sig Made By AlliedArmour

TGPH
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

Ok i think ive cracked it by using the shockwvadeDeath.dll from 2.0.4 (which has the previous version) i dont get the API Error meaning that shockwaveDeath.dll loads and bzfscron works :D
But i think what did it was the fact that i hadent relized that there were to versions of it and i had the first one and now i have the second
Image
Sig Made By AlliedArmour

TGPH
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

i cant get the bzfscron to do what i want can some one help all i want to do is to change the tank speed after 1 min and then change it back at the second min but then to carry on switching
Here is my crontab

Code: Select all

15	*	*	*	*	/say Welcome to The Palace Wall! Plugin testing taking place!


1	*	*	*	*	/say It's time for the shake up!
1	*	*	*	*	/say Time to crank things up a notch!
1	*	*	*	*	/set _tankSpeed 100
1	*	*	*	*	/set _skyColour green

2	*	*	*	*	/say We hope you enjoyed your the rush!
2	*	*	*	*	/say We'll be doing it again soon!
2	*	*	*	*	/set _tankSpeed 50
2	*	*	*	*	/set _skyColour blue

3	*	*	*	*	/say It's time for the shake up!
3	*	*	*	*	/say Time to crank things up a notch!
3	*	*	*	*	/set _tankSpeed 100
3	*	*	*	*	/set _skyColour green

4	*	*	*	*	/say We hope you enjoyed your the rush!
4	*	*	*	*	/say We'll be doing it again soon!
4	*	*	*	*	/set _tankSpeed 50
4	*	*	*	*	/set _skyColour blue
Image
Sig Made By AlliedArmour

TGPH
User avatar
DTRemenak
General
General
Posts: 625
Joined: Thu Jan 16, 2003 4:54 am
Location: U.S.
Contact:

Post by DTRemenak »

The numbers are values, not repititions. What you asked it to do was to do things on the first, second, third, fourth, and fifteenth minute of every hour, not every minute etc. Please read the readme, particularly examples section.
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

oliver browne wrote:i cant get the bzfscron to do what i want can some one help all i want to do is to change the tank speed after 1 min and then change it back at the second min but then to carry on switching
Here is my crontab

Code: Select all

15	*	*	*	*	/say Welcome to The Palace Wall! Plugin testing taking place!


1	*	*	*	*	/say It's time for the shake up!
1	*	*	*	*	/say Time to crank things up a notch!
1	*	*	*	*	/set _tankSpeed 100
1	*	*	*	*	/set _skyColour green

2	*	*	*	*	/say We hope you enjoyed your the rush!
2	*	*	*	*	/say We'll be doing it again soon!
2	*	*	*	*	/set _tankSpeed 50
2	*	*	*	*	/set _skyColour blue

3	*	*	*	*	/say It's time for the shake up!
3	*	*	*	*	/say Time to crank things up a notch!
3	*	*	*	*	/set _tankSpeed 100
3	*	*	*	*	/set _skyColour green

4	*	*	*	*	/say We hope you enjoyed your the rush!
4	*	*	*	*	/say We'll be doing it again soon!
4	*	*	*	*	/set _tankSpeed 50
4	*	*	*	*	/set _skyColour blue
Its good to know I aint the oly fool out there using this plugin.

What you seek to do is alllllll in the crontab. Those columns of asterics aren't just for looks. You are going to have to get a good mental image of what you want this thing to do and plan out how it'll list on your crontab.

And remember - an asteric in any given field means you want it to do it on every possible value that column provide. Every day, every month, every hour...

So, to base an example, you want it to speed up tanks one minute, slow 'em down the next, I initially think of giving the first field the */2 entry - however, since the commands need to alternate rather than simulateous, I am afraid this is going to have to programmed fo reach and every minute (unless DTR can give a shorter, easier method)

So, lets say speed up on the odd minutes, slow down on the even minutes. At a glance this isn't going to look "right" but it should work.

Code: Select all

1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59	*	*	*	*	/set _tankSpeed FAST (change the fast to desired speed)


0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58	*	*	*	*	/set _tankSpeed SLOW (change the slow to you slow speed)
That should work.

Sorry if I screwed up everyone's page view.

Glad you're making good of my crontab, yo. This plugin can be a pain but is worth it. Great job on behalf of DTR. You 'da man.

And DTR - one idea I had for the implementing of the bot having glodal login would be to steal a page out of the Vaxorcist's book and use a "constants.h" file, and make it clear in the README that you should edit the constants file if you want the bot to take on another identity, and the file could solely have commented "bots name here ___ password here ____" and THEN compile. Include the bzfscron default identity and block hte name out from being registered. (I relinquished it to Jeff) (security reasons? Dont need any shared names and perms)

woot
...This has been a recording.
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

thanks for that and i did read the readme but it really didnt help
and can you change the name of bzfscron as it joins as observer?

Any way Thanks its an amazing plugin
Image
Sig Made By AlliedArmour

TGPH
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

when bzcron connects as observer it is possible to change its name?
Image
Sig Made By AlliedArmour

TGPH
User avatar
silvercat
Private First Class
Private First Class
Posts: 7
Joined: Tue Apr 19, 2005 7:56 pm
Contact:

Trouble Compiling

Post by silvercat »

A INSTALL document might be a nice addition. I'm having trouble compiling. What I've done,

1. Download bzfscron-src-0.3.2.zip and unzip to bzflag/plugins/bzfscron/
2. Edit bzflag/plugins/Makefile.am to include plugins/bzfscron
3. cd bzflag
3. make clean
4. ./configure --enable-shared
5. cd bzflag/plugins/bzfscron
6. make

which results in:

Code: Select all

root@elite:/usr/local/src/bzflag/plugins/bzfscron# make
g++ -g -fPIC -frtti -I../../include -O   -c -o bzfscron.o bzfscron.cpp
bzfscron.cpp: In member function `bool CronManager::connect3()':
bzfscron.cpp:310: error: `bz_setPlayerAdmin' undeclared (first use this
   function)
bzfscron.cpp:310: error: (Each undeclared identifier is reported only once for
   each function it appears in.)
make: *** [bzfscron.o] Error 1
I've tried a handful of other things with similar results. Any help/pointers would be appreciated.

I'm using debian sarge:

Code: Select all

$ uname -a
Linux silvercat 2.4.27-2-386 #1 Mon May 16 16:47:51 JST 2005 i686 GNU/Linux
-SilverFox
User avatar
silvercat
Private First Class
Private First Class
Posts: 7
Joined: Tue Apr 19, 2005 7:56 pm
Contact:

Fix

Post by silvercat »

brlcad figured this out:
<brlcad> instead edit bzfscron.cpp and replace bz_setPlayerAdmin with bz_setPlayerOperator
Attachments
bzfscronfix.patch.zip
patch to fix bzfscron to compile w/current cvs
(4.91 KiB) Downloaded 373 times
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

Silverfox - this plugin is a great addition to the bzflag arsenal. As you can see, I've has extensive problems with this plugin, however, I have manages to get them all worked out.

The error you posted rgarding line 310 is one I had as well. From what I can gather, the plugin was written under one set of the API, and when the API changed, that line of the source needed to be changed to compensate for the changes.
I_Died_Once: change that line from bz_setPlayerAdmin to bz_setPlayerOperator and it should work for ya. Some of the internal terminology has changed for clarity.
Make that change, and recompile. It should work.
...This has been a recording.
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

new problem

Post by SilverFox »

Now I'm having trouble loading the plugin:

Code: Select all

Plugin:/home/bzfs/lib/bzfscron.o not found, error /home/bzfs/lib/bzfscron.o: ELF file's phentsize not the expected size
WARNING: unable to load the plugin; /home/bzfs/lib/bzfscron.o
Remember this is my first time using a plugin, so I appreciate the kid gloves.

Edit: Just found more info via the /loadplugin command:

Code: Select all

Player silverfox [0] -> All: /loadplugin ~bzfs/lib/bzfscron
Plugin:~bzfs/lib/bzfscron found but does not contain bz_Load method, error ./bin/bzfs: undefined symbol: bz_Load
Editx2: Apparen't this is from loading from the conf file using ~, if you use the full path of the file, rather than the home (~) shortcut, it loads fine.

Now that I can load it, the server seems to "lock up" and not write anything to the log file, or allow connections or do anything really. The last two lines written to STDOUT:

Code: Select all

 File transfer terminated with error from libcurl 28 : Operation too slow. Less than 1024 bytes/sec transfered the last 10 seconds
 bzfscron 0.3.2: plugin unloaded
Editx3: As it turns out, this was being caused by the fourth -d I was using. So, all seems to be working now.

Is there a way to execute an external program using bzfscron?

Of maybe put something like:

Code: Select all

#*/10   *       *       *       *       @/path/to/include
Where /path/to/include was a file which list things to run, and include file, if you will. This would be nice for two reasons 1) organizes the crontab a little nicer. If you want to do 10 things at once, this can be done with one line, and 2) outside programs/scripts can modify the include file, so it could change each time it was run.

-SilverFox
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Re: new problem

Post by The Knights Who Say Ni »

SilverFox wrote:

Code: Select all

 File transfer terminated with error from libcurl 28 : Operation too slow. Less than 1024 bytes/sec transfered the last 10 seconds
i think that means that your not connected to the internet and trying to run a public server...

just a guess... :?
Image
Sig Made By AlliedArmour

TGPH
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox »

Nope. Once I went from 4 -d's to 3 -d's, this problem went away. I was doing this testing on silvercat.tybox.net:5154
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

Listen... coming from someone who has monk'd with this plugin extensively, you want to load this at server startup. I know, Jeff and all the dev's will tell you you can load any plugin at anytime with the

/loadplugin /path/to/plugin.so

command. And in most cases this is true. But I swear, I have never once gotten this plugin to work at any other time adise from startup. If you get it loaded at startup, and get it runing successfully... If you /unloadplugin and unload the plugin, it will not successfully load.

If you start your server without this plugin loaded, THEN go to load it, it will not load successfully. Well, its never worked for me - and believe you me, I've tried. Everyone will tell you otherwise til they are blue in the face - but dammit, I'm telling you - if you want to use this plugin - you are going to have to put it in your .conf file. That means somewhere in your configuration file for your server...

Code: Select all

-loadplugin /path/to/bzfscron.so
or

Code: Select all

-loadplugin "C:/Path/To/bzfscron.dll
is going to have to be somewhere in your .conf file. Trust me on the sunscreen. This is the ONLY way I have ever gotten this plugin to work.

Before you go monking with the name, make sure you can get the plugin itself working first.

Some other tips I can provide linux users wanting to use this one is to edit the bzfscron.cpp file in the source. Among the header information, add

Code: Select all

#include </path/to/bzflag/include/bzfsAPI.h>
But make that point to the bzfsAPI.h in the bzflag source. Having it link directly to that seems to work better for me for some reason.

Now, as far as naming goes...

I could have sworn I posted this before... And if it was deleted, then they can edit this out. But here is how I changed the name of the observer that the plugin produces. If no one has noticed, on my server, there is a "bzfscron Machine of Doom" - and you know the event? Well, this plugin is how it is done. And as far as I know (like many other plugins) I am the only server owner that actively uses this plugin.

In the bzfscron.cpp file, open it in your text editor of choice. On mine, its line 291, but I might have hit return once or twice somewhere in the mix. The line in the source is

Code: Select all

    return false;
  }

  sLink->sendEnter(TankPlayer, ObserverTeam, "bzfscron", "", "");

  return true;
You can change THAT "bzfscron" to whatever name you want. Keep the name in quotes, and watch your syntax. Bad syntax in the name, when compiled and loaded, will crash the server. So just watch it, dammit. Be mindful of the name.

Also remember that this "bot" will have admin authority, it will NOT have the "@" next to it's name, and the server does not give it or even try to globally recognize it, so unless DTR says otherwise, it is useless to register a name for YOUR bzfscron machine, or add that name to a group, or any of that. Pointless. Pushing the limits on this is likely to either crash the plugin or the server.

The ony other trick I can give is... I see where someone is recompiling their whole binary to conplile this plugin. You can just change to directory the bzfscron source is located and run make there. It comes with a well equipped makefile. I never had to edit my makefile.

Read this thread carefully, this post, its all in here.

Now, I wanna see someone do up a sweet crontab, better than mine.
...This has been a recording.
Post Reply