Nuclide
Software Development Kit for id Tech
NSClientSpectator Class Reference

This entity class represents every spectator client. More...

#include <NSClientSpectator.h>

Inheritance diagram for NSClientSpectator:
NSClient NSClientPlayer

Public Member Functions

void NSClientSpectator (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 ::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 (NSRenderableEntity, NSEntity, float)
 

Detailed Description

This entity class represents every spectator client.

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

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

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

Constructor & Destructor Documentation

◆ NSClientSpectator()

void NSClientSpectator::NSClientSpectator ( void  )

Member Function Documentation

◆ ClientInputFrame()

virtual void NSClientSpectator::ClientInputFrame ( void  )
virtual

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

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ EvaluateEntity()

void NSClientSpectator::EvaluateEntity ( void  )
virtual

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

Reimplemented from NSSurfacePropEntity.

Reimplemented in NSClientPlayer.

◆ InputMode()

void NSClientSpectator::InputMode ( void  )
virtual

Call to change the spectating mode.

◆ InputNext()

void NSClientSpectator::InputNext ( void  )
virtual

Call to spectate the next spectating target.

◆ InputPrevious()

void NSClientSpectator::InputPrevious ( void  )
virtual

Call to spectate the previous player target.

◆ IsDead()

bool NSClientSpectator::IsDead ( void  )
virtual

Returns if we're considered 'dead'.

NSClient, NSClientSpectator will always return false.

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ IsFakeSpectator()

bool NSClientSpectator::IsFakeSpectator ( void  )
virtual

Returns if we're a 'fake' spectator.

This is a regular player acting as a spectator.

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ IsPlayer()

bool NSClientSpectator::IsPlayer ( void  )
virtual

Returns if we're a player.

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

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ IsRealSpectator()

bool NSClientSpectator::IsRealSpectator ( void  )
virtual

Returns if we're a 'real' spectator.

That is a client that can only spectate.

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ PostFrame()

void NSClientSpectator::PostFrame ( void  )
virtual

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

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ predraw()

virtual float NSClientSpectator::predraw ( void  )
virtual

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ PreFrame()

void NSClientSpectator::PreFrame ( void  )
virtual

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

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ ProcessInput()

void NSClientSpectator::ProcessInput ( void  )
virtual

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

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ ReceiveEntity()

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

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

Reimplemented from NSSurfacePropEntity.

Reimplemented in NSClientPlayer.

◆ Restore()

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

Similar to ::SpawnKey but for save-game fields.

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

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ Save()

void NSClientSpectator::Save ( float  handle)
virtual

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

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

Reimplemented from NSClient.

Reimplemented in NSClientPlayer.

◆ SendEntity()

float NSClientSpectator::SendEntity ( entity  ,
float   
)
virtual

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

Reimplemented from NSSurfacePropEntity.

Reimplemented in NSClientPlayer.

◆ ServerInputFrame()

void NSClientSpectator::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 NSClient.

Reimplemented in NSClientPlayer.

◆ SharedInputFrame()

void NSClientSpectator::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 NSClient.

Reimplemented in NSClientPlayer.

◆ SpectatorDeathcam()

void NSClientSpectator::SpectatorDeathcam ( NSRenderableEntity  ourCorpse,
NSEntity  trackEntity,
float  waitTime 
)

◆ SpectatorTrackPlayer()

void NSClientSpectator::SpectatorTrackPlayer ( void  )
virtual

Called every frame to track with our target player.

◆ WarpToTarget()

void NSClientSpectator::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: