DDraceNetwork Docs
CGhost Class Reference

#include <ghost.h>

Inheritance diagram for CGhost:
[legend]
Collaboration diagram for CGhost:
[legend]

Classes

class  CGhostItem
 
class  CGhostPath
 

Public Member Functions

virtual int Sizeof () const override
 
virtual void OnRender () override
 
virtual void OnConsoleInit () override
 
virtual void OnReset () override
 
virtual void OnRefreshSkins () override
 
virtual void OnMessage (int MsgType, void *pRawMsg) override
 
virtual void OnMapLoad () override
 
virtual void OnShutdown () override
 
virtual void OnNewSnapshot () override
 
void OnNewPredictedSnapshot ()
 
int FreeSlots () const
 
int Load (const char *pFilename)
 
void Unload (int Slot)
 
void UnloadAll ()
 
void SaveGhost (CMenus::CGhostItem *pItem)
 
const char * GetGhostDir () const
 
class IGhostLoaderGhostLoader () const
 
class IGhostRecorderGhostRecorder () const
 
- Public Member Functions inherited from CComponent
virtual ~CComponent ()
 
virtual int Sizeof () const =0
 
class CGameClientGameClient () const
 
class IClientClient () const
 
virtual void OnStateChange (int NewState, int OldState)
 
virtual void OnConsoleInit ()
 
virtual void OnInit ()
 
virtual void OnShutdown ()
 
virtual void OnReset ()
 
virtual void OnWindowResize ()
 
virtual void OnRefreshSkins ()
 
virtual void OnRender ()
 
virtual void OnNewSnapshot ()
 
virtual void OnRelease ()
 
virtual void OnMapLoad ()
 
virtual void OnMessage (int Msg, void *pRawMsg)
 
virtual bool OnCursorMove (float x, float y, IInput::ECursorType CursorType)
 
virtual bool OnInput (const IInput::CEvent &Event)
 

Public Attributes

bool m_AllowRestart
 

Private Types

enum  { MAX_ACTIVE_GHOSTS = 256 }
 

Private Member Functions

void GetPath (char *pBuf, int Size, const char *pPlayerName, int Time=-1) const
 
void AddInfos (const CNetObj_Character *pChar, const CNetObj_DDNetCharacter *pDDnetChar)
 
int GetSlot () const
 
void CheckStart ()
 
void CheckStartLocal (bool Predicted)
 
void TryRenderStart (int Tick, bool ServerControl)
 
void StartRecord (int Tick)
 
void StopRecord (int Time=-1)
 
void StartRender (int Tick)
 
void StopRender ()
 
void InitRenderInfos (CGhostItem *pGhost)
 

Static Private Member Functions

static void GetGhostSkin (CGhostSkin *pSkin, const char *pSkinName, int UseCustomColor, int ColorBody, int ColorFeet)
 
static void GetGhostCharacter (CGhostCharacter *pGhostChar, const CNetObj_Character *pChar, const CNetObj_DDNetCharacter *pDDnetChar)
 
static void GetNetObjCharacter (CNetObj_Character *pChar, const CGhostCharacter *pGhostChar)
 
static void ConGPlay (IConsole::IResult *pResult, void *pUserData)
 

Private Attributes

class IGhostLoaderm_pGhostLoader
 
class IGhostRecorderm_pGhostRecorder
 
CGhostItem m_aActiveGhosts [MAX_ACTIVE_GHOSTS]
 
CGhostItem m_CurGhost
 
char m_aTmpFilename [IO_MAX_PATH_LENGTH]
 
int m_NewRenderTick = -1
 
int m_StartRenderTick = -1
 
int m_LastDeathTick = -1
 
bool m_Recording = false
 
bool m_Rendering = false
 
bool m_RenderingStartedByServer = false
 

Static Private Attributes

static const char * ms_pGhostDir = "ghosts"
 

Additional Inherited Members

- Protected Member Functions inherited from CComponent
class IKernelKernel () const
 
class IEngineEngine () const
 
class IGraphicsGraphics () const
 
class ITextRenderTextRender () const
 
class IInputInput () const
 
class IStorageStorage () const
 
class CUiUi () const
 
class ISoundSound () const
 
class CRenderToolsRenderTools () const
 
class IConfigManagerConfigManager () const
 
class CConfigConfig () const
 
class IConsoleConsole () const
 
class IDemoPlayerDemoPlayer () const
 
class IDemoRecorderDemoRecorder (int Recorder) const
 
class IFavoritesFavorites () const
 
class IServerBrowserServerBrowser () const
 
class CLayersLayers () const
 
class CCollisionCollision () const
 
int64_t time () const
 
float LocalTime () const
 
class IHttpHttp () const
 
- Protected Attributes inherited from CComponent
CGameClientm_pClient
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
MAX_ACTIVE_GHOSTS 

Member Function Documentation

◆ AddInfos()

void CGhost::AddInfos ( const CNetObj_Character pChar,
const CNetObj_DDNetCharacter pDDnetChar 
)
private

◆ CheckStart()

void CGhost::CheckStart ( )
private

◆ CheckStartLocal()

void CGhost::CheckStartLocal ( bool  Predicted)
private

◆ ConGPlay()

void CGhost::ConGPlay ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ FreeSlots()

int CGhost::FreeSlots ( ) const

◆ GetGhostCharacter()

void CGhost::GetGhostCharacter ( CGhostCharacter pGhostChar,
const CNetObj_Character pChar,
const CNetObj_DDNetCharacter pDDnetChar 
)
staticprivate

◆ GetGhostDir()

const char * CGhost::GetGhostDir ( ) const
inline

◆ GetGhostSkin()

void CGhost::GetGhostSkin ( CGhostSkin pSkin,
const char *  pSkinName,
int  UseCustomColor,
int  ColorBody,
int  ColorFeet 
)
staticprivate

◆ GetNetObjCharacter()

void CGhost::GetNetObjCharacter ( CNetObj_Character pChar,
const CGhostCharacter pGhostChar 
)
staticprivate

◆ GetPath()

void CGhost::GetPath ( char *  pBuf,
int  Size,
const char *  pPlayerName,
int  Time = -1 
) const
private

◆ GetSlot()

int CGhost::GetSlot ( ) const
private

◆ GhostLoader()

class IGhostLoader * CGhost::GhostLoader ( ) const
inline

◆ GhostRecorder()

class IGhostRecorder * CGhost::GhostRecorder ( ) const
inline

◆ InitRenderInfos()

void CGhost::InitRenderInfos ( CGhostItem pGhost)
private

◆ Load()

int CGhost::Load ( const char *  pFilename)

◆ OnConsoleInit()

void CGhost::OnConsoleInit ( )
overridevirtual

Called to let the components register their console commands.

Reimplemented from CComponent.

◆ OnMapLoad()

void CGhost::OnMapLoad ( )
overridevirtual

Called on map load.

Reimplemented from CComponent.

◆ OnMessage()

void CGhost::OnMessage ( int  Msg,
void *  pRawMsg 
)
overridevirtual

Called when receiving a network message.

Parameters
MsgThe message type.
pRawMsgThe message data.
See also
NETMSGTYPE_SV_DDRACETIME
CNetMsg_Sv_DDRaceTime

Reimplemented from CComponent.

◆ OnNewPredictedSnapshot()

void CGhost::OnNewPredictedSnapshot ( )

◆ OnNewSnapshot()

void CGhost::OnNewSnapshot ( )
overridevirtual

Called when a new snapshot is received.

Reimplemented from CComponent.

◆ OnRefreshSkins()

void CGhost::OnRefreshSkins ( )
overridevirtual

Called when skins have been invalidated and must be updated.

Reimplemented from CComponent.

◆ OnRender()

void CGhost::OnRender ( )
overridevirtual

Called when the component should get rendered.

The render order depends on the component insertion order.

Reimplemented from CComponent.

◆ OnReset()

void CGhost::OnReset ( )
overridevirtual

Called to reset the component. This method is usually called on your component constructor to avoid code duplication.

See also
CHud::CHud()
CHud::OnReset()

Reimplemented from CComponent.

◆ OnShutdown()

void CGhost::OnShutdown ( )
overridevirtual

Called to cleanup the component. This method is called when the client is closed.

Reimplemented from CComponent.

◆ SaveGhost()

void CGhost::SaveGhost ( CMenus::CGhostItem pItem)

◆ Sizeof()

virtual int CGhost::Sizeof ( ) const
inlineoverridevirtual

Gets the size of the non-abstract component.

Implements CComponent.

◆ StartRecord()

void CGhost::StartRecord ( int  Tick)
private

◆ StartRender()

void CGhost::StartRender ( int  Tick)
private

◆ StopRecord()

void CGhost::StopRecord ( int  Time = -1)
private

◆ StopRender()

void CGhost::StopRender ( )
private

◆ TryRenderStart()

void CGhost::TryRenderStart ( int  Tick,
bool  ServerControl 
)
private

◆ Unload()

void CGhost::Unload ( int  Slot)

◆ UnloadAll()

void CGhost::UnloadAll ( )

Member Data Documentation

◆ m_aActiveGhosts

CGhostItem CGhost::m_aActiveGhosts[MAX_ACTIVE_GHOSTS]
private

◆ m_AllowRestart

bool CGhost::m_AllowRestart

◆ m_aTmpFilename

char CGhost::m_aTmpFilename[IO_MAX_PATH_LENGTH]
private

◆ m_CurGhost

CGhostItem CGhost::m_CurGhost
private

◆ m_LastDeathTick

int CGhost::m_LastDeathTick = -1
private

◆ m_NewRenderTick

int CGhost::m_NewRenderTick = -1
private

◆ m_pGhostLoader

class IGhostLoader* CGhost::m_pGhostLoader
private

◆ m_pGhostRecorder

class IGhostRecorder* CGhost::m_pGhostRecorder
private

◆ m_Recording

bool CGhost::m_Recording = false
private

◆ m_Rendering

bool CGhost::m_Rendering = false
private

◆ m_RenderingStartedByServer

bool CGhost::m_RenderingStartedByServer = false
private

◆ m_StartRenderTick

int CGhost::m_StartRenderTick = -1
private

◆ ms_pGhostDir

const char * CGhost::ms_pGhostDir = "ghosts"
staticprivate

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