After 4 days straight of working on this I have gotten all the components working. This is not a step by step to setup chessd and the webclient, this is to supplement information that is not explained in the INSTALL file. I got this running on Ubuntu Server running apache, ejabberd, and postgresql.
Chessd server
Configuration
Before you compile chessd you may(most likely will) need to modify some of the .cc files. The chessd program is designed to process xml node stanzas(xmlns) being sent from the webclient to execute commands. They look like this:
<body xmlns='http://jabber.org/protocol/httpbind'><iq from='player1@chess.com' to='player2@chess.com/ChessD' id='GetAnnounceMatch' type='result'><search xmlns='http://chess.com/chessd#match_announcement'/></iq></body>
In the above xml, chess.com comes from the jabber server Virtual host you setup and configured to have chessd connected as an jabber service.
However, chessd is hardcoded to only respond to xmlns statements coming from the developers website http://c3sl.ufpr.br. So while your xlmns being to the jabber server looks like this: <search xmlns='http://chess.com/chessd#match_announcement'/>, chessd is looking for this <search xmlns='http://c3sl.ufpr.br/chessd#match_announcement'/> and will immediately return a unimplemented feature response.
To fix this you must modify the following files by changing http://c3sl.ufpr.br to your jabber host name:
ProfileManager.cc
Line 35: #define XMLNS_CHESSD_INFO "http://c3sl.ufpr.br/chessd#info"
Line 36: #define XMLNS_CHESSD_PROFILE "http://c3sl.ufpr.br/chessd#profile"
Line 37: #define XMLNS_CHESSD_GAME_SEARCH "http://c3sl.ufpr.br/chessd#search_game"
Line 38: #define XMLNS_CHESSD_GAME_FETCH "http://c3sl.ufpr.br/chessd#fetch_game"
ServerCore.cc
Line 37: #define XMLNS_CHESSD_GAME "http://c3sl.ufpr.br/chessd#game"
TourneyManager.cc
Line 31: #define XMLNS_CHESSD_TOURNEY "http://c3sl.ufpr.br/chessd#tourney"
AdminComponent.cc
Line 31: #define XMLNS_CHESSD_ADMIN "http://c3sl.ufpr.br/chessd#admin"
AnnouncementManager.cc
Line 32: #define XMLNS_CHESSD_MATCH_ANNOUNCEMENT "http://c3sl.ufpr.br/chessd#match_announcement"
GameRoom.cc
Line 29: #define XMLNS_GAME "http://c3sl.ufpr.br/chessd#game"
Line 30: #define XMLNS_GAME_MOVE "http://c3sl.ufpr.br/chessd#game#move"
Line 31: #define XMLNS_GAME_RESIGN "http://c3sl.ufpr.br/chessd#game#resign"
Line 32: #define XMLNS_GAME_DRAW "http://c3sl.ufpr.br/chessd#game#draw"
Line 33: #define XMLNS_GAME_DRAW_DECLINE "http://c3sl.ufpr.br/chessd#game#draw-decline"
Line 34: #define XMLNS_GAME_CANCEL "http://c3sl.ufpr.br/chessd#game#cancel"
Line 35: #define XMLNS_GAME_CANCEL_DECLINE "http://c3sl.ufpr.br/chessd#game#cancel-decline"
Line 36: #define XMLNS_GAME_CANCELED "http://c3sl.ufpr.br/chessd#game#canceled"
Line 37: #define XMLNS_GAME_ADJOURN "http://c3sl.ufpr.br/chessd#game#adjourn"
Line 38: #define XMLNS_GAME_ADJOURN_DECLINE "http://c3sl.ufpr.br/chessd#game#adjourn-decline"
Line 39: #define XMLNS_GAME_START "http://c3sl.ufpr.br/chessd#game#start"
Line 40: #define XMLNS_GAME_STATE "http://c3sl.ufpr.br/chessd#game#state"
Line 41: #define XMLNS_GAME_END "http://c3sl.ufpr.br/chessd#game#end"
Line 42: #define XMLNS_GAME_MOVE "http://c3sl.ufpr.br/chessd#game#move"
MatchManager.cc
Line 33: #define XMLNS_MATCH "http://c3sl.ufpr.br/chessd#match"
Line 34: #define XMLNS_MATCH_OFFER "http://c3sl.ufpr.br/chessd#match#offer"
Line 35: #define XMLNS_MATCH_ACCEPT "http://c3sl.ufpr.br/chessd#match#accept"
Line 36: #define XMLNS_MATCH_DECLINE "http://c3sl.ufpr.br/chessd#match#decline"
Line 38: #define XMLNS_ADJOURNED_LIST "http://c3sl.ufpr.br/chessd#adjourned#list"
You must also modify the message.js file of the webclient due to it using hard-coded messages:
message.js
Line 708: XMPP += "<search xmlns='http://c3sl.ufpr.br/chessd#game'>";
Line 899: XMPP += "<banned-list xmlns='http://c3sl.ufpr.br/chessd#admin'/>"
Line 1004: XMPP += "<create xmlns='http://c3sl.ufpr.br/chessd#match_announcement'>";
Line 1035: XMPP += "<search xmlns='http://c3sl.ufpr.br/chessd#match_announcement'>";
Line 1071: XMPP += "<delete xmlns='http://c3sl.ufpr.br/chessd#match_announcement'>";
Line 1083: XMPP += "<accept xmlns='http://c3sl.ufpr.br/chessd#match_announcement'>";
Compiling
I could not get chessd to compile with the current version of gcc and g++ which was 4.6 as of this writing. Some research into the errors seem to indicate the problem was due to a tightening of the function call standards with the newer versions. Instead of debugging I downgraded to version 4.4 and everything compiled fine.
To do this I modified the following lines in the Makefile.2 file:
CC=gcc to CC=gcc-4.4 CXX=g++ to CXX=g++-4.4
I also had no luck compiling using ./configure and make. Instead I used make -f Makefile.2 as recommended in the INSTALL file.
Running chessd
If you run chesdd as explained in the INSTALL file you will get a segmentation fault. To get this to work you must seperate the chessd executable and the config.xml file. I placed chessd in /usr/sbin/, the config.xml in /etc/chessd. Then ran this command to get it to work: chessd /etc/chessd/config.xml. Your mileage may vary.
Chessd bosh
The webclient software used by chessd is "NOT" bosh compliant in terms of respecting transmission limits and acknowledgements so you have no choice but to use the developers bosh server.
You will need to modify the Makefile file and modify the same two items as explained in the Compiling section in chessd to use gcc and g++ 4.4.
Ejabberd
Do not use the built in BOSH server if it comes with your jabber server implementation. The webclient software used by chessd is not bosh compliant with regards to respecting transmission limits and using acknowledgements. Compile and use the bosh server provided by chessd as it ignores these violations.
Webclient
I had several parts of the webclient that did not work with regards to changing your profile or adding a room. The issue stems from javascript code that that is trying to use the the Replace method on a null value returned from a function.
Original Code:
CounterLabel = UTILS_CreateElement("span",null,null,UTILS_GetText("window_character").replace(/%s/,"200"));
Fixed code:
CounterLabelResult = UTILS_GetText("window_character");
if (CounterLabelResult == null)
{
CounterLabel = UTILS_CreateElement("span",null,null,"200");
}
else
{
CounterLabel = UTILS_CreateElement("span",null,null,UTILS_GetText("window_character").replace(/%s/,"200"));
}
There are four or five of these that you will have to find and fix. Fortunately they all have "window_character" so use that as a search term
Apache notes for Chessd
You need to add the following to your Virtual Host configuration file:
ProxyPass /jabber http://localhost:8082
ProxyPassReverse /jabber http://localhost:8082
<Location /jabber>
Order allow,deny
Allow from all
</Location>
In Proxy.conf file
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
# Allow from localhost
ProxyVia on
If you are using mod_evasive you will have to increase your connections per second because of the noisy improperly implemented bosh server. Settings to increase in mod-evasive.conf:
DOSPageCount 40 (from 2)
DOSSiteCount 80 (from 10)
Modify the above to taste
Hope this helps someone.