Project Overview‎ > ‎Project Setup‎ > ‎

Modify Sources to use Message Redirector

The following changes need to be made in order to integrate the Message Redirector into PlaneShift.

PlaneShift/src/client/Jamfile

This tells jam to link the client libraries with the PSAI libraries.

Change the section that reads

Application psclient : [ Wildcard *.cpp *.h ] $(extrafiles) ;

ExternalLibs psclient : CRYSTAL CAL3D ;

CompileGroups psclient : client ;

LinkWith psclient : gui psnet psengine psrpgrules pssound psutil paws effects fparser ;

to read

Application psclient : [ Wildcard *.cpp *.h ] $(extrafiles) ;

ExternalLibs psclient : CRYSTAL CAL3D PSAI ;

CompileGroups psclient : client ;

LinkWith psclient : gui psnet psengine psrpgrules pssound psutil paws effects fparser ;

PSAI was added to ExternalLibs on the second line.


PlaneShift/src/client/psengine.h

  • After the Networking Classes forward declarations (about line 78) add
class PsaiMessageRedirector;
  • After the declarations of the various controllers and managers (about line 425) add
PsaiMessageRedirector* redirector; 

PlaneShift/src/client/psengine.cpp

  • Add the include after all others (about line 200)
#include <message/PsaiMessageRedirector.h>
  • After the controllers and managers are initialised (about line 550) add
redirector = new PsaiMessageRedirector(GetMsgHandler());

Additional required includes

In order for the PSAI code to compile (at least on my system) I need to add the following includes to the PlaneShift and CrystalSpace source code.

PlaneShift/src/common/net/netbase.h

After  #include "net/netpacket.h"
#include "net/sockuni.h"
#include <cssysdef.h>
This change should be in the bitbucket repo

CrystalSpace/include/csutil/csendian.h

After #include <math.h>
#include <cssysdef.h>

Comments