Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

ModeHandler Class Reference

This class handles mode messages from the server, specifying "normal", or "combat" or "death", or whatever. More...

#include <modehandler.h>

List of all members.

Public Member Functions

void AddDownfallObject (WeatherObject *weatherobject)
void ClearLightFadeSettings ()
void CreatePortalWeather (iSector *sector, csTicks delta)
 Creates and places a weather object at each portal to a {WEATHER}ing sector.
bool CreatePortalWeather (iPortal *portal, csTicks delta)
void DoneLoading (const char *sectorname)
void FinishLightFade ()
TimeOfDay GetGeneralTime ()
size_t GetTime ()
virtual void HandleMessage (MsgEntry *me)
bool Initialize ()
 ModeHandler (psCelClient *cc, MsgHandler *mh, iObjectRegistry *object_reg)
void PreProcess ()
void ProcessFog (const psWeatherMessage::NetWeatherInfo &info)
void RemoveDownfallObject (WeatherObject *weatherobject)
void RemovePortalWeather ()
 Remove weather from all portals.
void RemoveWeather ()
 Remove fog and downfall from sector.
void SetEntity (GEMClientActor *ent)
void SetModeSounds (uint8_t mode)
void UpdateLights ()
virtual ~ModeHandler ()

Protected Member Functions

bool CheckCurrentSector (GEMClientObject *entity, const char *sectorname, csVector3 &pos, iSector *&sector)
WeatherObjectCreateDownfallWeatherObject (WeatherInfo *ri)
WeatherObjectCreateStaticWeatherObject (WeatherInfo *ri)
bool CreateWeather (WeatherInfo *ri, csTicks delta)
WeatherInfoCreateWeatherInfo (const char *sector)
LightingSettingFindLight (LightingSetting *light, int which)
float GetDensity (WeatherInfo *wi)
WeatherPortalGetPortal (iPortal *portal)
WeatherInfoGetWeatherInfo (const char *sector)
void HandleCachedFile (MsgEntry *me)
void HandleCombatEvent (MsgEntry *me)
void HandleModeMessage (MsgEntry *me)
void HandleNewSectorMessage (MsgEntry *me)
void HandleSpecialCombatEvent (MsgEntry *me)
void HandleWeatherMessage (MsgEntry *me)
bool LoadLightingLevels ()
void ProcessDownfall (const psWeatherMessage::NetWeatherInfo &info)
bool ProcessLighting (LightingSetting *color, float pct)
void ProcessLighting (const psWeatherMessage::NetWeatherInfo &info)
void PublishTime (int newTime)
void SetSectorMusic (const char *sectorname)
void StartFollowWeather ()
void StopFollowWeather ()
void UpdateLights (csTicks when, bool force=false)
void UpdateWeather (csTicks when)
void UpdateWeatherSounds ()

Protected Attributes

GEMClientObjectactorEntity
CS::ShaderVarStringID ambientId
csRef< psCelClientcelclient
uint clockHour
 Stores the time of day in hours.
CS::ShaderVarStringID combinedAmbientId
WeatherObjectdownfall
csRef< iEngine > engine
WeatherObjectfog
bool interpolation_complete
uint interpolation_step
csTicks interpolation_time
csTicks last_interpolation_reset
csTicks last_weather_update
csRef< iSharedVariable > lightningreset
csPDelArray< LightingListlights
csRef< MsgHandlermsghandler
iObjectRegistry * object_reg
csPDelArray< WeatherPortalportals
bool processWeather
csRandomGen * randomgen
csString sound_name
bool sound_queued
csTicks sound_when
uint stepStage
TimeOfDay timeOfDay
 Stores the 'general' time of day it is. One of the TimeOfDay enums.
csRef< iVFS > vfs
csTicks weather_update_time
csHash< WeatherInfo *, csString > weatherlist

Detailed Description

This class handles mode messages from the server, specifying "normal", or "combat" or "death", or whatever.

Right now, all it does is change the background music, but in the future this class could also trigger visual effects, in-game cinematics or whatever else we think of.

Definition at line 107 of file modehandler.h.


Constructor & Destructor Documentation

ModeHandler::ModeHandler ( psCelClient cc,
MsgHandler mh,
iObjectRegistry *  object_reg 
)
virtual ModeHandler::~ModeHandler ( ) [virtual]

Member Function Documentation

void ModeHandler::AddDownfallObject ( WeatherObject weatherobject)
bool ModeHandler::CheckCurrentSector ( GEMClientObject entity,
const char *  sectorname,
csVector3 &  pos,
iSector *&  sector 
) [protected]
void ModeHandler::ClearLightFadeSettings ( )
WeatherObject* ModeHandler::CreateDownfallWeatherObject ( WeatherInfo ri) [protected]
void ModeHandler::CreatePortalWeather ( iSector *  sector,
csTicks  delta 
)

Creates and places a weather object at each portal to a {WEATHER}ing sector.

bool ModeHandler::CreatePortalWeather ( iPortal *  portal,
csTicks  delta 
)
WeatherObject* ModeHandler::CreateStaticWeatherObject ( WeatherInfo ri) [protected]
bool ModeHandler::CreateWeather ( WeatherInfo ri,
csTicks  delta 
) [protected]
WeatherInfo* ModeHandler::CreateWeatherInfo ( const char *  sector) [protected]
void ModeHandler::DoneLoading ( const char *  sectorname)
LightingSetting* ModeHandler::FindLight ( LightingSetting light,
int  which 
) [protected]
void ModeHandler::FinishLightFade ( )
float ModeHandler::GetDensity ( WeatherInfo wi) [protected]
TimeOfDay ModeHandler::GetGeneralTime ( ) [inline]

Definition at line 124 of file modehandler.h.

WeatherPortal* ModeHandler::GetPortal ( iPortal *  portal) [protected]
size_t ModeHandler::GetTime ( ) [inline]

Definition at line 127 of file modehandler.h.

WeatherInfo* ModeHandler::GetWeatherInfo ( const char *  sector) [protected]
void ModeHandler::HandleCachedFile ( MsgEntry me) [protected]
void ModeHandler::HandleCombatEvent ( MsgEntry me) [protected]
virtual void ModeHandler::HandleMessage ( MsgEntry me) [virtual]

Implements psClientNetSubscriber.

void ModeHandler::HandleModeMessage ( MsgEntry me) [protected]
void ModeHandler::HandleNewSectorMessage ( MsgEntry me) [protected]
void ModeHandler::HandleSpecialCombatEvent ( MsgEntry me) [protected]
void ModeHandler::HandleWeatherMessage ( MsgEntry me) [protected]
bool ModeHandler::Initialize ( )
bool ModeHandler::LoadLightingLevels ( ) [protected]
void ModeHandler::PreProcess ( )
void ModeHandler::ProcessDownfall ( const psWeatherMessage::NetWeatherInfo info) [protected]
void ModeHandler::ProcessFog ( const psWeatherMessage::NetWeatherInfo info)
bool ModeHandler::ProcessLighting ( LightingSetting color,
float  pct 
) [protected]
void ModeHandler::ProcessLighting ( const psWeatherMessage::NetWeatherInfo info) [protected]
void ModeHandler::PublishTime ( int  newTime) [protected]
void ModeHandler::RemoveDownfallObject ( WeatherObject weatherobject)
void ModeHandler::RemovePortalWeather ( )

Remove weather from all portals.

void ModeHandler::RemoveWeather ( )

Remove fog and downfall from sector.

void ModeHandler::SetEntity ( GEMClientActor ent)
void ModeHandler::SetModeSounds ( uint8_t  mode)
void ModeHandler::SetSectorMusic ( const char *  sectorname) [protected]
void ModeHandler::StartFollowWeather ( ) [protected]
void ModeHandler::StopFollowWeather ( ) [protected]
void ModeHandler::UpdateLights ( csTicks  when,
bool  force = false 
) [protected]
void ModeHandler::UpdateLights ( )
void ModeHandler::UpdateWeather ( csTicks  when) [protected]
void ModeHandler::UpdateWeatherSounds ( ) [protected]

Member Data Documentation

Definition at line 146 of file modehandler.h.

CS::ShaderVarStringID ModeHandler::ambientId [protected]

Definition at line 175 of file modehandler.h.

csRef<psCelClient> ModeHandler::celclient [protected]

Definition at line 155 of file modehandler.h.

uint ModeHandler::clockHour [protected]

Stores the time of day in hours.

Definition at line 152 of file modehandler.h.

CS::ShaderVarStringID ModeHandler::combinedAmbientId [protected]

Definition at line 176 of file modehandler.h.

Definition at line 185 of file modehandler.h.

csRef<iEngine> ModeHandler::engine [protected]

Definition at line 157 of file modehandler.h.

Definition at line 186 of file modehandler.h.

Definition at line 167 of file modehandler.h.

Definition at line 165 of file modehandler.h.

csTicks ModeHandler::interpolation_time [protected]

Definition at line 164 of file modehandler.h.

Definition at line 166 of file modehandler.h.

csTicks ModeHandler::last_weather_update [protected]

Definition at line 179 of file modehandler.h.

csRef<iSharedVariable> ModeHandler::lightningreset [protected]

Definition at line 174 of file modehandler.h.

csPDelArray<LightingList> ModeHandler::lights [protected]

Definition at line 161 of file modehandler.h.

csRef<MsgHandler> ModeHandler::msghandler [protected]

Definition at line 156 of file modehandler.h.

iObjectRegistry* ModeHandler::object_reg [protected]

Definition at line 154 of file modehandler.h.

csPDelArray<WeatherPortal> ModeHandler::portals [protected]

Definition at line 187 of file modehandler.h.

bool ModeHandler::processWeather [protected]

Definition at line 188 of file modehandler.h.

csRandomGen* ModeHandler::randomgen [protected]

Definition at line 168 of file modehandler.h.

csString ModeHandler::sound_name [protected]

Definition at line 170 of file modehandler.h.

bool ModeHandler::sound_queued [protected]

Definition at line 169 of file modehandler.h.

csTicks ModeHandler::sound_when [protected]

Definition at line 171 of file modehandler.h.

uint ModeHandler::stepStage [protected]

Definition at line 163 of file modehandler.h.

Stores the 'general' time of day it is. One of the TimeOfDay enums.

Definition at line 149 of file modehandler.h.

csRef<iVFS> ModeHandler::vfs [protected]

Definition at line 158 of file modehandler.h.

csTicks ModeHandler::weather_update_time [protected]

Definition at line 180 of file modehandler.h.

csHash<WeatherInfo*, csString> ModeHandler::weatherlist [protected]

Definition at line 182 of file modehandler.h.


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