Nuclide
Software Development Kit for id Technology (BETA)
ncSpectator Class Reference

About this class

This entity class represents every spectator client.

These types of clients are not meant to interfere with the gameplay, they are merely observers.

ncPlayer is a sub-class which has the ability to interact with games.

When clients connect via the spectate command, they will findthemselves of type ncSpectator.

Inheritance diagram for ncSpectator:
ncClient ncPlayer

Public Member Functions

void ncSpectator (void)
 
virtual void ProcessInput (void)
 Called within the class to deal with the final input handling of the client. More...
 
virtual void PreFrame (void)
 Run once, every frame, before physics are run on the player. More...
 
virtual void PostFrame (void)
 Run once, every frame, after physics are run on the player. More...
 
virtual bool IsFakeSpectator (void)
 Returns if we're a 'fake' spectator. More...
 
virtual bool IsRealSpectator (void)
 Returns if we're a 'real' spectator. More...
 
virtual bool IsDead (void)
 Returns if we're considered 'dead'. More...
 
virtual bool IsPlayer (void)
 Returns if we're a player. More...
 
virtual void SharedInputFrame (void)
 Like ClientInputFrame and ServerInputFrame, but run on both client and server at the same time. More...
 
virtual void InputNext (void)
 Call to spectate the next spectating target. More...
 
virtual void InputPrevious (void)
 Call to spectate the previous player target. More...
 
virtual void InputMode (void)
 Call to change the spectating mode. More...
 
virtual void WarpToTarget (void)
 Re-teleport to the target we're spectating. More...
 
virtual void SpectatorTrackPlayer (void)
 Called every frame to track with our target player. More...
 
virtual void ClientInputFrame (void)
 Client: Called on the client to give a chance to override input_* variables before networking them takes place. More...
 
virtual void ReceiveEntity (float, float)
 Client: Handles network updates from the server for the associated entity. More...
 
virtual float predraw (void)
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to ncIO::SpawnKey() but for save-game fields. More...
 
virtual void EvaluateEntity (void)
 Run each tic after physics are run to determine if we need to send updates over the network. More...
 
virtual float SendEntity (entity, float)
 Called by the engine whenever we need to send a client an update about this entity. More...
 
virtual void ServerInputFrame (void)
 Server: This is where the input* variables arrive after sending them out from the client (see ClientInputFrame). More...
 
nonvirtual void SpectatorDeathcam (ncRenderableEntity, ncEntity, float)
 

Constructor & Destructor Documentation

◆ ncSpectator()

void ncSpectator::ncSpectator ( void  )

Member Function Documentation

◆ ClientInputFrame()

virtual void ncSpectator::ClientInputFrame ( void  )
virtual

Client: Called on the client to give a chance to override input_* variables before networking them takes place.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ EvaluateEntity()

void ncSpectator::EvaluateEntity ( void  )
virtual

Run each tic after physics are run to determine if we need to send updates over the network.

Reimplemented from ncSurfacePropEntity.

Reimplemented in ncPlayer.

◆ InputMode()

void ncSpectator::InputMode ( void  )
virtual

Call to change the spectating mode.

◆ InputNext()

void ncSpectator::InputNext ( void  )
virtual

Call to spectate the next spectating target.

◆ InputPrevious()

void ncSpectator::InputPrevious ( void  )
virtual

Call to spectate the previous player target.

◆ IsDead()

bool ncSpectator::IsDead ( void  )
virtual

Returns if we're considered 'dead'.

ncClient, ncSpectator will always return false.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ IsFakeSpectator()

bool ncSpectator::IsFakeSpectator ( void  )
virtual

Returns if we're a 'fake' spectator.

This is a regular player acting as a spectator.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ IsPlayer()

bool ncSpectator::IsPlayer ( void  )
virtual

Returns if we're a player.

That is a type of client that is built on top of ncPlayer.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ IsRealSpectator()

bool ncSpectator::IsRealSpectator ( void  )
virtual

Returns if we're a 'real' spectator.

That is a client that can only spectate.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ PostFrame()

void ncSpectator::PostFrame ( void  )
virtual

Run once, every frame, after physics are run on the player.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ predraw()

virtual float ncSpectator::predraw ( void  )
virtual

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ PreFrame()

void ncSpectator::PreFrame ( void  )
virtual

Run once, every frame, before physics are run on the player.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ ProcessInput()

void ncSpectator::ProcessInput ( void  )
virtual

Called within the class to deal with the final input handling of the client.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ ReceiveEntity()

virtual void ncSpectator::ReceiveEntity ( float  flNew,
float  flChanged 
)
virtual

Client: Handles network updates from the server for the associated entity.

Reimplemented from ncSurfacePropEntity.

Reimplemented in ncPlayer.

◆ Restore()

void ncSpectator::Restore ( string  strKey,
string  strValue 
)
virtual

Similar to ncIO::SpawnKey() but for save-game fields.

Whatever you write into file handles within your ncIO::Save() method needs to be read back in here.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ Save()

void ncSpectator::Save ( float  handle)
virtual

Handles saving a copy of this entity to a given filehandle.

Within you want to use the ncIO::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ SendEntity()

float ncSpectator::SendEntity ( entity  ,
float   
)
virtual

Called by the engine whenever we need to send a client an update about this entity.

Reimplemented from ncSurfacePropEntity.

Reimplemented in ncPlayer.

◆ ServerInputFrame()

void ncSpectator::ServerInputFrame ( void  )
virtual

Server: This is where the input* variables arrive after sending them out from the client (see ClientInputFrame).

This is also where we will instruct the server to run physics on the client.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ SharedInputFrame()

void ncSpectator::SharedInputFrame ( void  )
virtual

Like ClientInputFrame and ServerInputFrame, but run on both client and server at the same time.

It is run before ClientInputFrame and ServerInputFrame. When overriding, Make sure to call the super method to enable Nuclide to handle spectator controls properly.

Reimplemented from ncClient.

Reimplemented in ncPlayer.

◆ SpectatorDeathcam()

void ncSpectator::SpectatorDeathcam ( ncRenderableEntity  ourCorpse,
ncEntity  trackEntity,
float  waitTime 
)

◆ SpectatorTrackPlayer()

void ncSpectator::SpectatorTrackPlayer ( void  )
virtual

Called every frame to track with our target player.

◆ WarpToTarget()

void ncSpectator::WarpToTarget ( void  )
virtual

Re-teleport to the target we're spectating.

Called once by InputNext/Previous.


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