OneVsOne Plugin for 2.4.x

Expand and mod your server.
Post Reply
mr64bit
Private First Class
Private First Class
Posts: 89
Joined: Fri May 06, 2011 4:58 pm
Location: Hang on, let me get a map...
Contact:

OneVsOne Plugin for 2.4.x

Post by mr64bit » Thu Aug 02, 2012 9:55 pm

I'm trying to host a private OneVsOne server for some tourneys, and I'd really like the plugin that is on many of the public 1vs1 servers. I don't care about reporting matches, ZELO scores, but I would like to be able to have the plugin keep score, and record the matches. (through the "/ovso match official" command)
I have downloaded catay's OneVsOne from here: https://github.com/catay/OneVsOne But, the .cpp file hasn't been updated in 3 years, and won't work with 2.4.x.
SO, can someone please get me the current OneVsOne plugin, compiled or source? (I'm running Ubuntu Server 12.04) I suppose updating https://github.com/catay/OneVsOne/blob/ ... eVsOne.cpp to work with 2.4.x would suffice however, but whichever is easiest, THANKS!
---mr64bit

User avatar
strayer
Sergeant Major
Sergeant Major
Posts: 191
Joined: Sat May 24, 2003 3:54 pm
Location: Germany
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by strayer » Fri Aug 03, 2012 9:40 pm

https://github.com/catay/OneVsOne is the correct source repository. As you might know git allows different branches. The one you are looking for is 2.4_compat.
(If you want to view the files via web-browser you can use https://github.com/catay/OneVsOne/tree/2.4_compat )

First, check for existing 2.4_compat branch by listing all branches:

Code: Select all

git branch -a
Then, switch to branch mentioned above:

Code: Select all

git checkout 2.4_compat
Tattaa...done... :)
A pessimist is an optimist with experience... ;o)

User avatar
blast
General
General
Posts: 4737
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by blast » Fri Aug 03, 2012 9:58 pm

It's too bad it wasn't done the other way around (with a 2.0_compat and then with the master targeting the current release).
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

mr64bit
Private First Class
Private First Class
Posts: 89
Joined: Fri May 06, 2011 4:58 pm
Location: Hang on, let me get a map...
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by mr64bit » Fri Aug 03, 2012 10:11 pm

strayer wrote:Tattaa...done... :)
Thanks a lot! I will try that.
blast wrote:It's too bad it wasn't done the other way around (with a 2.0_compat and then with the master targeting the current release).
That's what I was thinking too. I haven't used github all that much, and I assumed that "Branches" would be, well, branches of the main code, not updates to it.
---mr64bit

mr64bit
Private First Class
Private First Class
Posts: 89
Joined: Fri May 06, 2011 4:58 pm
Location: Hang on, let me get a map...
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by mr64bit » Sun Aug 05, 2012 1:37 am

Ok, got the 2.4_compat branch, tried it. It compiles fine, but when I try to load it, I get this (-ddd):

Code: Select all

2012-08-04 18:39:03: Plugin: /usr/local/lib/bzflag/OneVsOne.so not found, error /usr/local/lib/bzflag/OneVsOne.so: undefined symbol: _ZTV14BaseUrlHandler
2012-08-04 18:39:03: WARNING: unable to load the plugin; /usr/local/lib/bzflag/OneVsOne.so
One a somewhat related note, does anyone know where I can find a 2.4.x compatible oneOnOneRules plugin? I got an old one from here, but that was 2006. It compiles fine, but when I try to load it, I get

Code: Select all

2012-08-04 18:39:03: Plugin: /usr/local/lib/bzflag/oneOnOneRules.so found but does not contain bz_GetPlugin method, error /usr/local/lib/bzflag/oneOnOneRules.so: undefined symbol: bz_GetPlugin
Any more help will be greatly appreciated!
---mr64bit

User avatar
blast
General
General
Posts: 4737
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by blast » Sun Aug 05, 2012 1:53 am

Is your bzfs and OneVsOne plugin from the same build of the source?

And as for the oneOnOneRules plugin, that should not have compiled on 2.4, unless perhaps you put the bzfsAPI.h file in the directory as well. If you did, don't. You need to actually upgrade the plugin.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

mr64bit
Private First Class
Private First Class
Posts: 89
Joined: Fri May 06, 2011 4:58 pm
Location: Hang on, let me get a map...
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by mr64bit » Mon Aug 06, 2012 7:22 pm

blast wrote:Is your bzfs and OneVsOne plugin from the same build of the source?
I'm not sure what you mean. I compiled them together, I have the latest SVN trunk source of bzfs, and I got the OneVsOne source from the 2.4_compat branch above.
I can go without the oneOnOneRules plugin for now, but I would really like to get this one working.
---mr64bit

User avatar
strayer
Sergeant Major
Sergeant Major
Posts: 191
Joined: Sat May 24, 2003 3:54 pm
Location: Germany
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by strayer » Mon Aug 06, 2012 9:31 pm

OneVsOne - 2.4_compat

Your error message is telling you everything you need to know. The library file ("OneVsOne.so") is not where it should be. You can either place the file in the correct folder (e.g. "/usr/local/lib/bzflag/" as shown in the error message) or you specify the correct name and path (e.g. "bzfs -loadplugin /home/mr64bit/opt/bzflag_2.4.2/lib/bzflag/OneVsOne.so").
That's all written down in the README.txt file.
A pessimist is an optimist with experience... ;o)

mr64bit
Private First Class
Private First Class
Posts: 89
Joined: Fri May 06, 2011 4:58 pm
Location: Hang on, let me get a map...
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by mr64bit » Mon Aug 06, 2012 9:45 pm

The exact command I am using is

Code: Select all

-loadplugin /usr/local/lib/bzflag/OneVsOne.so
which is where all my plugins are located after I "sudo make install". I can load any other plugin (except for oneOnOneRules, but that's a different matter) by using this line with the correct plugin name.
Could it be that not all of my -loadplugin commands are not next to each other in my config file?
(it kinda looks like this)

Code: Select all

#####################################################################
#######################Global Settings
#####################################################################

-loadplugin /usr/local/lib/bzflag/logDetail.so
-loadplugin /usr/local/lib/bzflag/chathistory.so,1000
-loadplugin /usr/local/lib/bzflag/playHistoryTracker.so
-loadplugin /usr/local/lib/bzflag/bigbrother.so,/home/bzflag/bzflag_stuff/bigbro.cfg
-loadplugin /usr/local/lib/bzflag/sayFTwelve.so

#other stuff#

#####################################################################
########################Per Map Settings
#####################################################################

-loadplugin /usr/local/lib/bzflag/OneVsOne.so,/home/bzflag/bzflag_stuff/qs_1vs1/noflags.ini
-loadplugin /usr/local/lib/bzflag/oneOnOneRules.so

#some more stuff#
---mr64bit

User avatar
blast
General
General
Posts: 4737
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by blast » Tue Aug 07, 2012 2:27 am

From the source directory, try this: src/bzfs/bzfs -dddd -loadplugin plugins/OneVsOne/.libs/OneVsOne.so

Also, ensure that the OneVsOne.so file exists in plugins/OneVsOne/.libs/
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

mr64bit
Private First Class
Private First Class
Posts: 89
Joined: Fri May 06, 2011 4:58 pm
Location: Hang on, let me get a map...
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by mr64bit » Tue Aug 07, 2012 2:43 am

Did exactly that.

Code: Select all

Plugin: plugins/OneVsOne/.libs/OneVsOne.so not found, error plugins/OneVsOne/.libs/OneVsOne.so: undefined symbol: _ZTV14BaseUrlHandler
WARNING: unable to load the plugin; plugins/OneVsOne/.libs/OneVsOne.so
If it helps, here is what's in the /plugins/OneVsOne/ folder

Code: Select all

examples       Makefile.am   OneVsOne_la-OneVsOne.lo  UrlHandler.cpp
INIParser.cpp  Makefile.in   OneVsOne_la-OneVsOne.o   UrlHandler.h
INIParser.h    OneVsOne.cpp  OneVsOne.sln
LICENSE        OneVsOne.def  OneVsOne.vcxproj
Makefile       OneVsOne.la   README.txt
Also, the string "_ZTV14BaseUrlHandler" is found in "/.libs/OneVsOne.so", and "/.libs/OneVsOne_la-OneVsOne.o"
Thank you all for the help!
---mr64bit

User avatar
Bullet Catcher
Captain
Captain
Posts: 552
Joined: Sat Dec 23, 2006 7:56 am
Location: Escondido, California

Re: OneVsOne Plugin for 2.4.x

Post by Bullet Catcher » Tue Aug 07, 2012 4:46 am

It looks like you need to replace BaseUrlHandler with bz_BaseURLHandler in the source code and recompile.

mr64bit
Private First Class
Private First Class
Posts: 89
Joined: Fri May 06, 2011 4:58 pm
Location: Hang on, let me get a map...
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by mr64bit » Wed Aug 08, 2012 12:54 am

Nope, no good. I replaced "BaseUrlHandler" with "bz_BaseURLHandler" in OneVsOne.cpp, then it wouldn't compile. I replaced the same string in UrlHandler.cpp and UrlHandler.h, still no luck. Now I get this when I compile.

Code: Select all

In file included from OneVsOne.cpp:12:0:
UrlHandler.h:14:7: error: redefinition of 'class bz_BaseURLHandler'
../../include/bzfsAPI.h:1558:7: error: previous definition of 'class bz_BaseURLHandler'
OneVsOne.cpp:92:23: error: cannot declare field 'OneVsOne::playerInfoHandler' to be of abstract type 'bz_BaseURLHandler'
../../include/bzfsAPI.h:1558:7: note:   because the following virtual functions are pure within 'bz_BaseURLHandler':
../../include/bzfsAPI.h:1563:16: note:  virtual void bz_BaseURLHandler::URLDone(const char*, void*, unsigned int, bool)
OneVsOne.cpp:93:23: error: cannot declare field 'OneVsOne::topScoreHandler' to be of abstract type 'bz_BaseURLHandler'
../../include/bzfsAPI.h:1558:7: note:   since type 'bz_BaseURLHandler' has pure virtual functions
OneVsOne.cpp:94:23: error: cannot declare field 'OneVsOne::topZeloHandler' to be of abstract type 'bz_BaseURLHandler'
../../include/bzfsAPI.h:1558:7: note:   since type 'bz_BaseURLHandler' has pure virtual functions
OneVsOne.cpp:95:23: error: cannot declare field 'OneVsOne::registerHandler' to be of abstract type 'bz_BaseURLHandler'
../../include/bzfsAPI.h:1558:7: note:   since type 'bz_BaseURLHandler' has pure virtual functions
OneVsOne.cpp:96:23: error: cannot declare field 'OneVsOne::reportHandler' to be of abstract type 'bz_BaseURLHandler'
../../include/bzfsAPI.h:1558:7: note:   since type 'bz_BaseURLHandler' has pure virtual functions
OneVsOne.cpp:97:23: error: cannot declare field 'OneVsOne::motdHandler' to be of abstract type 'bz_BaseURLHandler'
../../include/bzfsAPI.h:1558:7: note:   since type 'bz_BaseURLHandler' has pure virtual functions
OneVsOne.cpp:98:23: error: cannot declare field 'OneVsOne::welcomeMessageHandler' to be of abstract type 'bz_BaseURLHandler'
../../include/bzfsAPI.h:1558:7: note:   since type 'bz_BaseURLHandler' has pure virtual functions
OneVsOne.cpp: In constructor 'OneVsOne::OneVsOne()':
OneVsOne.cpp:161:15: error: 'class bz_BaseURLHandler' has no member named 'setNoNoKNotify'
OneVsOne.cpp: In member function 'void OneVsOne::registerPlayer(int, bz_APIStringList*)':
OneVsOne.cpp:274:23: error: 'class bz_BaseURLHandler' has no member named 'setPlayerId'
OneVsOne.cpp: In member function 'void OneVsOne::getPlayerInfo(int, bz_APIStringList*)':
OneVsOne.cpp:296:23: error: 'class bz_BaseURLHandler' has no member named 'setPlayerId'
OneVsOne.cpp: In member function 'void OneVsOne::getTopScore(int, bz_APIStringList*)':
OneVsOne.cpp:320:21: error: 'class bz_BaseURLHandler' has no member named 'setPlayerId'
OneVsOne.cpp: In member function 'void OneVsOne::getTopZelo(int, bz_APIStringList*)':
OneVsOne.cpp:343:20: error: 'class bz_BaseURLHandler' has no member named 'setPlayerId'
OneVsOne.cpp: In member function 'void OneVsOne::handleMotd(int, bz_APIStringList*)':
OneVsOne.cpp:450:17: error: 'class bz_BaseURLHandler' has no member named 'setPlayerId'
OneVsOne.cpp: In member function 'void OneVsOne::showMotdBanner(int, bool)':
OneVsOne.cpp:652:17: error: 'class bz_BaseURLHandler' has no member named 'setPlayerId'
OneVsOne.cpp:656:20: error: 'class bz_BaseURLHandler' has no member named 'showData'
OneVsOne.cpp: In member function 'void OneVsOne::showWelcomeMessage(int, bool)':
OneVsOne.cpp:664:27: error: 'class bz_BaseURLHandler' has no member named 'setPlayerId'
OneVsOne.cpp:668:30: error: 'class bz_BaseURLHandler' has no member named 'showData'
OneVsOne.cpp: In member function 'void OneVsOne::logRecordMatch(std::string, int, int)':
OneVsOne.cpp:739:19: error: 'class bz_BaseURLHandler' has no member named 'setPlayerId'
Is there something else I need to change? or was I better off before?
---mr64bit

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by JeffM » Wed Aug 08, 2012 2:46 am

You should not be defining bz_BaseURLHandler you should be deriving from it.

Other then an error in BaseUrlHandler::setNoNoKNotify(bool notify) not returning a value the code from Catay's 2.4 tree should compile and link fine on linux if you are using the correct headers and runtimes.

On windows not so much.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Re: OneVsOne Plugin for 2.4.x

Post by JeffM » Wed Aug 08, 2012 3:44 am

Here is a fixed version of the plugin that works on windows and linux, and follows our current build system. It builds and loads fine with no code modification in the current release.

Please note that you need to add this to the build files for an existing install if you use the command line build like we do for all plugins based on the samples.
1) add OneVsOne to the plugins dir
2) edit plugins/makefile.am and add the OneVsOne folder to the list of pluigns
3) edit config.ac in the root and add plugins/OneVsOne/Makefile to the list of plugins near the bottom.

Run ./configure from the command line on the root, then make. This will build OneVsOne with the other plugins.
Attachments
OneVsOne.zip
Fixed plugin
(28.74 KiB) Downloaded 145 times

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest