DDraceNetwork Documentation
Loading...
Searching...
No Matches
IGameController Class Reference

#include <gamecontroller.h>

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

Classes

struct  CSpawnEval
class  CFinishTime

Public Member Functions

 IGameController (class CGameContext *pGameServer)
virtual ~IGameController ()
virtual int OnCharacterDeath (class CCharacter *pVictim, class CPlayer *pKiller, int Weapon)
virtual void OnCharacterSpawn (class CCharacter *pChr)
virtual void HandleCharacterTiles (class CCharacter *pChr, int MapIndex)
virtual void SetArmorProgress (CCharacter *pCharacter, int Progress)
virtual bool OnEntity (int Index, int x, int y, int Layer, int Flags, bool Initial, int Number=0)
virtual void OnPlayerConnect (class CPlayer *pPlayer)
virtual void OnPlayerDisconnect (class CPlayer *pPlayer, const char *pReason)
virtual void OnReset ()
virtual void DoWarmup (int Seconds)
void StartRound ()
void EndRound ()
void ChangeMap (const char *pToMap)
virtual void Tick ()
virtual void Snap (int SnappingClient)
virtual int SnapPlayerScore (int SnappingClient, CPlayer *pPlayer)
virtual CFinishTime SnapPlayerTime (int SnappingClient, CPlayer *pPlayer)
virtual CFinishTime SnapMapBestTime (int SnappingClient)
virtual bool CanSpawn (int Team, vec2 *pOutPos, int ClientId)
virtual void DoTeamChange (class CPlayer *pPlayer, int Team, bool DoChatMsg=true)
int TileFlagsToPickupFlags (int TileFlags) const
virtual bool IsValidTeam (int Team)
virtual const char * GetTeamName (int Team)
virtual int GetAutoTeam (int NotThisId)
virtual bool CanJoinTeam (int Team, int NotThisId, char *pErrorReason, int ErrorReasonSize)
CClientMask GetMaskForPlayerWorldEvent (int Asker, int ExceptID=-1)
bool IsTeamPlay () const
CGameTeamsTeams ()

Public Attributes

const char * m_pGameType
std::optional< float > m_CurrentRecord
std::shared_ptr< CScoreLoadBestTimeResultm_pLoadBestTimeResult

Protected Types

enum  ESpawnType { SPAWNTYPE_DEFAULT = 0 , SPAWNTYPE_RED , SPAWNTYPE_BLUE , NUM_SPAWNTYPES }

Protected Member Functions

CGameContextGameServer () const
CConfigConfig ()
IServerServer () const
void DoActivityCheck ()
float EvaluateSpawnPos (CSpawnEval *pEval, vec2 Pos, int ClientId)
void EvaluateSpawnType (CSpawnEval *pEval, ESpawnType SpawnType, int ClientId)
void ResetGame ()

Protected Attributes

char m_aMapWish [MAX_MAP_LENGTH]
int m_RoundStartTick
int m_GameOverTick
int m_SuddenDeath
int m_Warmup
int m_RoundCount
int m_GameFlags

Private Attributes

std::vector< vec2m_avSpawnPoints [NUM_SPAWNTYPES]
class CGameContextm_pGameServer
class CConfigm_pConfig
class IServerm_pServer
CGameTeams m_Teams

Friends

class CSaveTeam

Member Enumeration Documentation

◆ ESpawnType

Enumerator
SPAWNTYPE_DEFAULT 
SPAWNTYPE_RED 
SPAWNTYPE_BLUE 
NUM_SPAWNTYPES 

Constructor & Destructor Documentation

◆ IGameController()

IGameController::IGameController ( class CGameContext * pGameServer)

◆ ~IGameController()

IGameController::~IGameController ( )
virtualdefault

Member Function Documentation

◆ CanJoinTeam()

bool IGameController::CanJoinTeam ( int Team,
int NotThisId,
char * pErrorReason,
int ErrorReasonSize )
virtual

◆ CanSpawn()

bool IGameController::CanSpawn ( int Team,
vec2 * pOutPos,
int ClientId )
virtual

◆ ChangeMap()

void IGameController::ChangeMap ( const char * pToMap)

◆ Config()

CConfig * IGameController::Config ( )
inlineprotected

◆ DoActivityCheck()

void IGameController::DoActivityCheck ( )
protected

◆ DoTeamChange()

void IGameController::DoTeamChange ( class CPlayer * pPlayer,
int Team,
bool DoChatMsg = true )
virtual

Reimplemented in CGameControllerDDNet.

◆ DoWarmup()

void IGameController::DoWarmup ( int Seconds)
virtual

◆ EndRound()

void IGameController::EndRound ( )

◆ EvaluateSpawnPos()

float IGameController::EvaluateSpawnPos ( CSpawnEval * pEval,
vec2 Pos,
int ClientId )
protected

◆ EvaluateSpawnType()

void IGameController::EvaluateSpawnType ( CSpawnEval * pEval,
ESpawnType SpawnType,
int ClientId )
protected

◆ GameServer()

CGameContext * IGameController::GameServer ( ) const
inlineprotected

◆ GetAutoTeam()

int IGameController::GetAutoTeam ( int NotThisId)
virtual

◆ GetMaskForPlayerWorldEvent()

CClientMask IGameController::GetMaskForPlayerWorldEvent ( int Asker,
int ExceptID = -1 )

◆ GetTeamName()

const char * IGameController::GetTeamName ( int Team)
virtual

◆ HandleCharacterTiles()

void IGameController::HandleCharacterTiles ( class CCharacter * pChr,
int MapIndex )
virtual

Reimplemented in CGameControllerDDNet.

◆ IsTeamPlay()

bool IGameController::IsTeamPlay ( ) const
inline

◆ IsValidTeam()

bool IGameController::IsValidTeam ( int Team)
virtual

◆ OnCharacterDeath()

int IGameController::OnCharacterDeath ( class CCharacter * pVictim,
class CPlayer * pKiller,
int Weapon )
virtual

◆ OnCharacterSpawn()

void IGameController::OnCharacterSpawn ( class CCharacter * pChr)
virtual

◆ OnEntity()

bool IGameController::OnEntity ( int Index,
int x,
int y,
int Layer,
int Flags,
bool Initial,
int Number = 0 )
virtual

◆ OnPlayerConnect()

void IGameController::OnPlayerConnect ( class CPlayer * pPlayer)
virtual

Reimplemented in CGameControllerDDNet.

◆ OnPlayerDisconnect()

void IGameController::OnPlayerDisconnect ( class CPlayer * pPlayer,
const char * pReason )
virtual

Reimplemented in CGameControllerDDNet.

◆ OnReset()

void IGameController::OnReset ( )
virtual

Reimplemented in CGameControllerDDNet.

◆ ResetGame()

void IGameController::ResetGame ( )
protected

◆ Server()

IServer * IGameController::Server ( ) const
inlineprotected

◆ SetArmorProgress()

virtual void IGameController::SetArmorProgress ( CCharacter * pCharacter,
int Progress )
inlinevirtual

Reimplemented in CGameControllerDDNet.

◆ Snap()

void IGameController::Snap ( int SnappingClient)
virtual

◆ SnapMapBestTime()

virtual CFinishTime IGameController::SnapMapBestTime ( int SnappingClient)
inlinevirtual

Snaps the current server record / best time of the current map.

Parameters
SnappingClientClient ID of the player that will receive the snapshot.
Returns
The the map best time split into seconds and the milliseconds remainder, use CFinishTime::Unset if you want the server to prefer scores.

Reimplemented in CGameControllerDDNet.

◆ SnapPlayerScore()

virtual int IGameController::SnapPlayerScore ( int SnappingClient,
CPlayer * pPlayer )
inlinevirtual

Sets the score value that will be shown in the scoreboard.

Parameters
SnappingClientClient ID of the player that will receive the snapshot.
pPlayerPlayer that is being snapped.
Returns
the score value that will be included in the snapshot.

Reimplemented in CGameControllerDDNet.

◆ SnapPlayerTime()

virtual CFinishTime IGameController::SnapPlayerTime ( int SnappingClient,
CPlayer * pPlayer )
inlinevirtual

Returns the finish time value that will be shown in the scoreboard.

Parameters
SnappingClientClient ID of the player that will receive the snapshot.
pPlayerPlayer that is being snapped.
Returns
The time split into seconds and the milliseconds remainder, use CFinishTime::Unset if you want the server to prefer scores.

Reimplemented in CGameControllerDDNet.

◆ StartRound()

void IGameController::StartRound ( )

◆ Teams()

CGameTeams & IGameController::Teams ( )
inline

◆ Tick()

void IGameController::Tick ( )
virtual

Reimplemented in CGameControllerDDNet, and CGameControllerMod.

◆ TileFlagsToPickupFlags()

int IGameController::TileFlagsToPickupFlags ( int TileFlags) const

◆ CSaveTeam

friend class CSaveTeam
friend

Member Data Documentation

◆ m_aMapWish

char IGameController::m_aMapWish[MAX_MAP_LENGTH]
protected

◆ m_avSpawnPoints

std::vector<vec2> IGameController::m_avSpawnPoints[NUM_SPAWNTYPES]
private

◆ m_CurrentRecord

std::optional<float> IGameController::m_CurrentRecord

◆ m_GameFlags

int IGameController::m_GameFlags
protected

◆ m_GameOverTick

int IGameController::m_GameOverTick
protected

◆ m_pConfig

class CConfig* IGameController::m_pConfig
private

◆ m_pGameServer

class CGameContext* IGameController::m_pGameServer
private

◆ m_pGameType

const char* IGameController::m_pGameType

◆ m_pLoadBestTimeResult

std::shared_ptr<CScoreLoadBestTimeResult> IGameController::m_pLoadBestTimeResult

◆ m_pServer

class IServer* IGameController::m_pServer
private

◆ m_RoundCount

int IGameController::m_RoundCount
protected

◆ m_RoundStartTick

int IGameController::m_RoundStartTick
protected

◆ m_SuddenDeath

int IGameController::m_SuddenDeath
protected

◆ m_Teams

CGameTeams IGameController::m_Teams
private

◆ m_Warmup

int IGameController::m_Warmup
protected

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