Planeshift
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes

psEngine Class Reference

psEngine This is the main class that contains all the object. More...

#include <psengine.h>

List of all members.

Classes

class  EventHandler2D
 Embedded iEventHandler interface that handles frame events in the 2D phase.
class  EventHandler3D
 Embedded iEventHandler interface that handles frame events in the 3D phase.
class  FrameEventHandler
 Embedded iEventHandler interface that handles frame events in the Frame phase.
class  LogicEventHandler
 Embedded iEventHandler interface that handles frame events in the logic phase.

Public Types

enum  LoadState {
  LS_NONE, LS_LOAD_SCREEN, LS_INIT_ENGINE, LS_REQUEST_WORLD,
  LS_SETTING_CHARACTERS, LS_CREATE_GUI, LS_DONE, LS_ERROR
}

Public Member Functions

void AddLoadingWindowMsg (const csString &msg)
void AdjustBrightnessCorrectionDown ()
 Adjust brightness down and inform user.
void AdjustBrightnessCorrectionUp ()
 Adjust brightness up and inform user.
bool BackgroundWorldLoading ()
 Whether or not we're background loading.
void Cleanup ()
 Clean up stuff.
void Disconnect ()
 Formally disconnects a client and allows time for an info box to be shown.
void FatalError (const char *msg)
 Shortcut to pawsQuitInfoBox.
const char * FindCommonString (unsigned int cstr_id)
 FindCommonString.
csStringID FindCommonStringId (const char *str)
 FindCommonStringId.
void FinishFrame ()
 Wait to finish drawing the current frame.
void ForceRefresh ()
 Force the next frame to get drawn. Used when updating LoadWindow.
ActionHandlerGetActionHandler ()
AutoexecGetAutoexec ()
float GetBrightnessCorrection ()
 Get the current brightness correlation value.
psCelClientGetCelClient ()
psCharControllerGetCharControl ()
psClientCharManagerGetCharManager ()
psChatBubblesGetChatBubbles ()
CmdHandlerGetCmdHandler ()
iConfigManager * GetConfig ()
psCSSetupGetCSSetup ()
int GetDuelConfirm () const
 Simply returns the duel confirmation setting.
psEffectManagerGetEffectManager ()
iEngine * GetEngine ()
iEventNameRegistry * GetEventNameRegistry ()
float getFPS ()
iGraphics2D * GetG2D ()
iGraphics3D * GetG3D ()
const char * GetGuildName ()
 Get GuildName.
psInventoryCacheGetInventoryCache (void)
 get the inventory cache
float GetKFactor ()
iEvent * GetLastEvent ()
int getLimitFPS ()
iBgLoader * GetLoader ()
const char * GetMainPlayerName ()
 Get the main character's name.
psMainWidgetGetMainWidget ()
bool GetMarriageProposal () const
 Simply returns if marriage proposals should be read or automatically ignored.
ModeHandlerGetModeHandler ()
psMouseBindsGetMouseBinds ()
ClientMsgHandlerGetMsgHandler ()
csStringHashReversible * GetMsgStrings ()
 Get the message strings/common string table.
bool GetMuteSoundsOnFocusLoss (void) const
 Gets whether sounds should be muted when the application loses focus.
psNetManagerGetNetManager ()
int GetNumChars ()
 Get the number of characters this player should have.
iObjectRegistry * GetObjectRegistry ()
psOptionsGetOptions ()
psCameraGetPSCamera ()
float GetRandom ()
csRandomGen & GetRandomGen ()
iSceneManipulate * GetSceneManipulator ()
psSlotManagerGetSlotManager ()
ClientSongManagerGetSongManager ()
iSoundManager * GetSoundManager ()
bool GetSoundStatus ()
 Get the status of the sound plugin, if available or not.
const char * GetTargetPetitioner ()
iTextureManager * GetTextureManager ()
size_t GetTime ()
iVFS * GetVFS ()
iVirtualClock * GetVirtualClock ()
iDocumentSystem * GetXMLParser ()
ZoneHandlerGetZoneHandler ()
bool HasLoadedMap () const
 Checks if the client has loaded its map.
bool Initialize (int level)
 Creates and loads other interfaces.
bool IsGameLoaded ()
 check if the game has been loaded or not
bool IsLoggedIn ()
 Logged in?
bool LoadConfirmationSettings ()
 Confirmation settings for marriage proposals and duels are read from /planeshift/userdata/options/confirmation.xml.
bool LoadCustomPawsWidgets (const char *filename)
 Loads custom paws widgets that are specified as a list in an xml file.
void LoadError (bool value)
 Sets the LoadError value.
void LoadGame ()
 Load game calls LoadWorld and also load characters, cameras, items, etc.
bool LoadingError ()
 Checks if the client had any errors during the loading state.
bool LoadPawsWidget (const char *title, const char *filename)
 Loads a widget.
bool LoadSoundSettings (bool forceDef)
 Loads and applies the sound settings.
void MuteAllSounds (void)
 Mute all sounds.
bool Process2D (iEvent &Event)
bool Process3D (iEvent &Event)
bool ProcessFrame (iEvent &Event)
bool ProcessLogic (iEvent &Event)
 Everything is event base for csApp based system.
 psEngine (iObjectRegistry *object_reg, psCSSetup *CSSetup)
 Default constructor. It calls csApp constructor.
void QuitClient ()
 Quits client.
void RegisterDelayedLoader (DelayedLoader *obj)
void ResetBrightnessCorrection ()
 Reset brightness and inform user.
void ResetEngine ()
 Resets the engine to a state in which we can login again, without requiring a reload of the entire application or CS stuff.
void SetBrightnessCorrection (float B)
 Set the current brightness correlation value.
void SetDuelConfirm (int confirmType)
 Sets the duel confirm type and updates the confirmation settings XML.
void SetGuildName (const char *name)
 Set Guild Name here for use with Entity labels.
void SetKFactor (float K)
void setLimitFPS (int)
void SetLoadedMap (bool value)
 Sets the HasLoadedMap value.
void SetLoggedIn (bool v)
void SetMarriageProposal (bool ignore)
 Sets if marriage proposals should be ignored and updates the confirmation settings XML.
void SetMuteSoundsOnFocusLoss (bool value)
 Sets whether sounds should be muted when the application loses focus.
void SetNumChars (int chars)
 Set the number of characters this player has.
void SetTargetPetitioner (const char *pet)
 Access the player's petitioner target.
void StartLoad ()
 Tell the engine to start the load proceedure.
bool toggleFPS ()
void UnmuteAllSounds (void)
 Unmute all sounds.
void UnregisterDelayedLoader (DelayedLoader *obj)
void UpdateLights ()
void UpdatePerFrame ()
 Do anything that needs to happen after the frame is rendered each time.
bool UpdateWindowTitleInformations ()
 Update the window title with the current informations.
void WriteConfirmationSettings ()
 Confirmation settings for marriage proposals and duels are written to /planeshift/userdata/options/confirmation.xml.
virtual ~psEngine ()
 Destructor.

Public Attributes

LoadState loadstate
SlotNameHash slotName

Static Public Attributes

static csString hwRenderer
static csString hwVersion
static csString playerName

Detailed Description

psEngine This is the main class that contains all the object.

This class responsible for the whole game functionality.

Definition at line 94 of file psengine.h.


Member Enumeration Documentation

Enumerator:
LS_NONE 
LS_LOAD_SCREEN 
LS_INIT_ENGINE 
LS_REQUEST_WORLD 
LS_SETTING_CHARACTERS 
LS_CREATE_GUI 
LS_DONE 
LS_ERROR 

Definition at line 97 of file psengine.h.


Constructor & Destructor Documentation

psEngine::psEngine ( iObjectRegistry *  object_reg,
psCSSetup CSSetup 
)

Default constructor. It calls csApp constructor.

virtual psEngine::~psEngine ( ) [virtual]

Destructor.


Member Function Documentation

void psEngine::AddLoadingWindowMsg ( const csString &  msg)
void psEngine::AdjustBrightnessCorrectionDown ( )

Adjust brightness down and inform user.

void psEngine::AdjustBrightnessCorrectionUp ( )

Adjust brightness up and inform user.

bool psEngine::BackgroundWorldLoading ( ) [inline]

Whether or not we're background loading.

Definition at line 618 of file psengine.h.

void psEngine::Cleanup ( )

Clean up stuff.

Needs to be called before the engine is destroyed, since some objects owned by the engine require the engine during their destruction.

void psEngine::Disconnect ( )

Formally disconnects a client and allows time for an info box to be shown.

void psEngine::FatalError ( const char *  msg)

Shortcut to pawsQuitInfoBox.

Parameters:
msgMessage to display before quiting
const char* psEngine::FindCommonString ( unsigned int  cstr_id)

FindCommonString.

Parameters:
cstr_idThe id of the common string to find.
csStringID psEngine::FindCommonStringId ( const char *  str)

FindCommonStringId.

Parameters:
[in]strThe string we are looking for
Returns:
The id of the common string or csInvalidStringID if not found
void psEngine::FinishFrame ( ) [inline]

Wait to finish drawing the current frame.

Definition at line 153 of file psengine.h.

void psEngine::ForceRefresh ( ) [inline]

Force the next frame to get drawn. Used when updating LoadWindow.

Definition at line 553 of file psengine.h.

ActionHandler* psEngine::GetActionHandler ( ) [inline]

Definition at line 285 of file psengine.h.

Autoexec* psEngine::GetAutoexec ( ) [inline]

Definition at line 310 of file psengine.h.

float psEngine::GetBrightnessCorrection ( ) [inline]

Get the current brightness correlation value.

Definition at line 352 of file psengine.h.

psCelClient* psEngine::GetCelClient ( ) [inline]

Definition at line 261 of file psengine.h.

psCharController* psEngine::GetCharControl ( ) [inline]

Definition at line 289 of file psengine.h.

psClientCharManager* psEngine::GetCharManager ( ) [inline]

Definition at line 257 of file psengine.h.

psChatBubbles* psEngine::GetChatBubbles ( ) [inline]

Definition at line 273 of file psengine.h.

CmdHandler* psEngine::GetCmdHandler ( ) [inline]

Definition at line 245 of file psengine.h.

iConfigManager* psEngine::GetConfig ( ) [inline]

< config file

Definition at line 215 of file psengine.h.

psCSSetup* psEngine::GetCSSetup ( ) [inline]

Definition at line 302 of file psengine.h.

int psEngine::GetDuelConfirm ( ) const [inline]

Simply returns the duel confirmation setting.

Returns:
duelConfirmation

Definition at line 425 of file psengine.h.

psEffectManager* psEngine::GetEffectManager ( ) [inline]

Definition at line 269 of file psengine.h.

iEngine* psEngine::GetEngine ( ) [inline]

Definition at line 187 of file psengine.h.

iEventNameRegistry* psEngine::GetEventNameRegistry ( ) [inline]

Definition at line 183 of file psengine.h.

float psEngine::getFPS ( ) [inline]

Definition at line 399 of file psengine.h.

iGraphics2D* psEngine::GetG2D ( ) [inline]

Definition at line 195 of file psengine.h.

iGraphics3D* psEngine::GetG3D ( ) [inline]

Definition at line 191 of file psengine.h.

const char* psEngine::GetGuildName ( ) [inline]

Get GuildName.

Definition at line 565 of file psengine.h.

psInventoryCache* psEngine::GetInventoryCache ( void  ) [inline]

get the inventory cache

Definition at line 612 of file psengine.h.

float psEngine::GetKFactor ( ) [inline]

Definition at line 379 of file psengine.h.

iEvent* psEngine::GetLastEvent ( ) [inline]

Definition at line 388 of file psengine.h.

int psEngine::getLimitFPS ( ) [inline]

Definition at line 395 of file psengine.h.

iBgLoader* psEngine::GetLoader ( ) [inline]

Definition at line 219 of file psengine.h.

const char* psEngine::GetMainPlayerName ( )

Get the main character's name.

psMainWidget* psEngine::GetMainWidget ( ) [inline]

Definition at line 265 of file psengine.h.

bool psEngine::GetMarriageProposal ( ) const [inline]

Simply returns if marriage proposals should be read or automatically ignored.

Returns:
marriageProposal

Definition at line 443 of file psengine.h.

ModeHandler* psEngine::GetModeHandler ( ) [inline]

Definition at line 281 of file psengine.h.

psMouseBinds* psEngine::GetMouseBinds ( )
ClientMsgHandler* psEngine::GetMsgHandler ( ) [inline]

Definition at line 241 of file psengine.h.

csStringHashReversible* psEngine::GetMsgStrings ( )

Get the message strings/common string table.

bool psEngine::GetMuteSoundsOnFocusLoss ( void  ) const [inline]

Gets whether sounds should be muted when the application loses focus.

Returns:
true if sounds should be muted, false otherwise

Definition at line 573 of file psengine.h.

psNetManager* psEngine::GetNetManager ( ) [inline]

Definition at line 298 of file psengine.h.

int psEngine::GetNumChars ( ) [inline]

Get the number of characters this player should have.

Definition at line 541 of file psengine.h.

iObjectRegistry* psEngine::GetObjectRegistry ( ) [inline]

Definition at line 179 of file psengine.h.

psOptions* psEngine::GetOptions ( ) [inline]

Definition at line 277 of file psengine.h.

psCamera* psEngine::GetPSCamera ( ) [inline]

Definition at line 294 of file psengine.h.

float psEngine::GetRandom ( ) [inline]

Definition at line 236 of file psengine.h.

csRandomGen& psEngine::GetRandomGen ( ) [inline]

Definition at line 232 of file psengine.h.

iSceneManipulate* psEngine::GetSceneManipulator ( ) [inline]

Definition at line 223 of file psengine.h.

psSlotManager* psEngine::GetSlotManager ( ) [inline]

Definition at line 249 of file psengine.h.

ClientSongManager* psEngine::GetSongManager ( ) [inline]

Definition at line 253 of file psengine.h.

iSoundManager* psEngine::GetSoundManager ( ) [inline]

Definition at line 227 of file psengine.h.

bool psEngine::GetSoundStatus ( ) [inline]

Get the status of the sound plugin, if available or not.

Definition at line 606 of file psengine.h.

const char* psEngine::GetTargetPetitioner ( ) [inline]

Definition at line 323 of file psengine.h.

iTextureManager* psEngine::GetTextureManager ( ) [inline]

Definition at line 199 of file psengine.h.

size_t psEngine::GetTime ( )
iVFS* psEngine::GetVFS ( ) [inline]

Definition at line 203 of file psengine.h.

iVirtualClock* psEngine::GetVirtualClock ( ) [inline]

Definition at line 207 of file psengine.h.

iDocumentSystem* psEngine::GetXMLParser ( ) [inline]

Definition at line 211 of file psengine.h.

ZoneHandler* psEngine::GetZoneHandler ( ) [inline]

Definition at line 306 of file psengine.h.

bool psEngine::HasLoadedMap ( ) const [inline]

Checks if the client has loaded its map.

Definition at line 470 of file psengine.h.

bool psEngine::Initialize ( int  level)

Creates and loads other interfaces.

There are 2 levels for the setup.

Parameters:
levelThe level we want to load At level 0:

  • Various Crystal Space plugins are loaded.
  • Crash/Dump system intialized.
  • Sound manager is loaded.
  • Log system loaded.
  • PAWS windowing system and skins setup.

At level 1:

Returns:
True if the level was successful in loading/setting up all components.
bool psEngine::IsGameLoaded ( ) [inline]

check if the game has been loaded or not

Definition at line 173 of file psengine.h.

bool psEngine::IsLoggedIn ( ) [inline]

Logged in?

Definition at line 521 of file psengine.h.

bool psEngine::LoadConfirmationSettings ( )

Confirmation settings for marriage proposals and duels are read from /planeshift/userdata/options/confirmation.xml.

Loads confimration settings for duels and marriages

Returns:
True on success, False otherwise
bool psEngine::LoadCustomPawsWidgets ( const char *  filename)

Loads custom paws widgets that are specified as a list in an xml file.

Parameters:
filenameThe xml file that holds the list of custom widgets.
void psEngine::LoadError ( bool  value) [inline]

Sets the LoadError value.

Definition at line 488 of file psengine.h.

void psEngine::LoadGame ( )

Load game calls LoadWorld and also load characters, cameras, items, etc.

bool psEngine::LoadingError ( ) [inline]

Checks if the client had any errors during the loading state.

Definition at line 482 of file psengine.h.

bool psEngine::LoadPawsWidget ( const char *  title,
const char *  filename 
)

Loads a widget.

Parameters:
titleTitle to show in the logs if an error occurs
filenameXML file
Returns:
Append this to a var and check it after all loading is done
bool psEngine::LoadSoundSettings ( bool  forceDef)

Loads and applies the sound settings.

Parameters:
forceDefTrue if you want to load the default settings
Returns:
true if it was successfully done
void psEngine::MuteAllSounds ( void  )

Mute all sounds.

bool psEngine::Process2D ( iEvent &  Event)
bool psEngine::Process3D ( iEvent &  Event)
bool psEngine::ProcessFrame ( iEvent &  Event)
bool psEngine::ProcessLogic ( iEvent &  Event)

Everything is event base for csApp based system.

This method is called when any event is triggered such as when a button is pushed, mouse move, or keyboard pressed.

void psEngine::QuitClient ( )

Quits client.

void psEngine::RegisterDelayedLoader ( DelayedLoader obj) [inline]

Definition at line 623 of file psengine.h.

void psEngine::ResetBrightnessCorrection ( )

Reset brightness and inform user.

void psEngine::ResetEngine ( )

Resets the engine to a state in which we can login again, without requiring a reload of the entire application or CS stuff.

void psEngine::SetBrightnessCorrection ( float  B)

Set the current brightness correlation value.

void psEngine::SetDuelConfirm ( int  confirmType) [inline]

Sets the duel confirm type and updates the confirmation settings XML.

Sets duel confirm type

Parameters:
confirmTypeUpdates duelConfirmation with this value

Definition at line 416 of file psengine.h.

void psEngine::SetGuildName ( const char *  name) [inline]

Set Guild Name here for use with Entity labels.

Definition at line 559 of file psengine.h.

void psEngine::SetKFactor ( float  K) [inline]

Definition at line 383 of file psengine.h.

void psEngine::setLimitFPS ( int  )
void psEngine::SetLoadedMap ( bool  value) [inline]

Sets the HasLoadedMap value.

Definition at line 476 of file psengine.h.

void psEngine::SetLoggedIn ( bool  v) [inline]

Definition at line 525 of file psengine.h.

void psEngine::SetMarriageProposal ( bool  ignore) [inline]

Sets if marriage proposals should be ignored and updates the confirmation settings XML.

Sets if marriage proposals should be ignored

Parameters:
ignoreUpdates marriageProposal with this value

Definition at line 434 of file psengine.h.

void psEngine::SetMuteSoundsOnFocusLoss ( bool  value) [inline]

Sets whether sounds should be muted when the application loses focus.

Parameters:
valuetrue if sounds should be muted, false otherwise

Definition at line 580 of file psengine.h.

void psEngine::SetNumChars ( int  chars) [inline]

Set the number of characters this player has.

Used to wait for full loading of characters in selection screen.

Definition at line 535 of file psengine.h.

void psEngine::SetTargetPetitioner ( const char *  pet) [inline]

Access the player's petitioner target.

Definition at line 318 of file psengine.h.

void psEngine::StartLoad ( ) [inline]

Tell the engine to start the load proceedure.

Definition at line 341 of file psengine.h.

bool psEngine::toggleFPS ( ) [inline]

Definition at line 404 of file psengine.h.

void psEngine::UnmuteAllSounds ( void  )

Unmute all sounds.

void psEngine::UnregisterDelayedLoader ( DelayedLoader obj) [inline]

Definition at line 627 of file psengine.h.

void psEngine::UpdateLights ( )
void psEngine::UpdatePerFrame ( )

Do anything that needs to happen after the frame is rendered each time.

bool psEngine::UpdateWindowTitleInformations ( )

Update the window title with the current informations.

void psEngine::WriteConfirmationSettings ( )

Confirmation settings for marriage proposals and duels are written to /planeshift/userdata/options/confirmation.xml.

Writes confirmation settings for duels and marriages


Member Data Documentation

csString psEngine::hwRenderer [static]

Definition at line 632 of file psengine.h.

csString psEngine::hwVersion [static]

Definition at line 633 of file psengine.h.

Definition at line 345 of file psengine.h.

csString psEngine::playerName [static]

Definition at line 634 of file psengine.h.

Definition at line 509 of file psengine.h.


The documentation for this class was generated from the following file: