DDraceNetwork Docs
CPlayer Class Reference

#include <player.h>

Collaboration diagram for CPlayer:
[legend]

Public Types

enum  { PAUSE_NONE = 0 , PAUSE_PAUSED , PAUSE_SPEC }
 
enum  {
  TIMERTYPE_DEFAULT = -1 , TIMERTYPE_GAMETIMER = 0 , TIMERTYPE_BROADCAST , TIMERTYPE_GAMETIMER_AND_BROADCAST ,
  TIMERTYPE_SIXUP , TIMERTYPE_NONE
}
 

Public Member Functions

 CPlayer (CGameContext *pGameServer, uint32_t UniqueClientId, int ClientId, int Team)
 
 ~CPlayer ()
 
void Reset ()
 
void TryRespawn ()
 
void Respawn (bool WeakHook=false)
 
CCharacterForceSpawn (vec2 Pos)
 
void SetTeam (int Team, bool DoChatMsg=true)
 
int GetTeam () const
 
int GetCid () const
 
uint32_t GetUniqueCid () const
 
int GetClientVersion () const
 
bool SetTimerType (int TimerType)
 
void Tick ()
 
void PostTick ()
 
void PostPostTick ()
 
void Snap (int SnappingClient)
 
void FakeSnap ()
 
void OnDirectInput (CNetObj_PlayerInput *pNewInput)
 
void OnPredictedInput (CNetObj_PlayerInput *pNewInput)
 
void OnPredictedEarlyInput (CNetObj_PlayerInput *pNewInput)
 
void OnDisconnect ()
 
void KillCharacter (int Weapon=WEAPON_GAME, bool SendKillMsg=true)
 
CCharacterGetCharacter ()
 
const CCharacterGetCharacter () const
 
void SpectatePlayerName (const char *pName)
 
void ProcessPause ()
 
int Pause (int State, bool Force)
 
int ForcePause (int Time)
 
int IsPaused () const
 
bool CanSpec () const
 
bool IsPlaying () const
 
void UpdatePlaytime ()
 
void AfkTimer ()
 
void SetAfk (bool Afk)
 
void SetInitialAfk (bool Afk)
 
bool IsAfk () const
 
int GetDefaultEmote () const
 
void OverrideDefaultEmote (int Emote, int Tick)
 
bool CanOverrideDefaultEmote () const
 
void ProcessScoreResult (CScorePlayerResult &Result)
 

Public Attributes

vec2 m_ViewPos
 
int m_TuneZone
 
int m_TuneZoneOld
 
int m_PlayerFlags
 
int m_aCurLatency [MAX_CLIENTS]
 
int m_SentSnaps = 0
 
int m_SpectatorId
 
bool m_IsReady
 
int m_Vote
 
int m_VotePos
 
int m_LastVoteCall
 
int m_LastVoteTry
 
int m_LastChat
 
int m_LastSetTeam
 
int m_LastSetSpectatorMode
 
int m_LastChangeInfo
 
int m_LastEmote
 
int m_LastEmoteGlobal
 
int m_LastKill
 
int m_aLastCommands [4]
 
int m_LastCommandPos
 
int m_LastWhisperTo
 
int m_LastInvited
 
int m_SendVoteIndex
 
CTeeInfo m_TeeInfos
 
int m_DieTick
 
int m_PreviousDieTick
 
std::optional< int > m_Score
 
int m_JoinTick
 
bool m_ForceBalanced
 
int m_LastActionTick
 
int m_TeamChangeTick
 
struct {
   int   m_Accum
 
   int   m_AccumMin
 
   int   m_AccumMax
 
   int   m_Avg
 
   int   m_Min
 
   int   m_Max
 
m_Latency
 
bool m_DND
 
bool m_Whispers
 
int64_t m_FirstVoteTick
 
char m_aTimeoutCode [64]
 
int64_t m_Last_KickVote
 
int64_t m_Last_Team
 
int m_ShowOthers
 
bool m_ShowAll
 
vec2 m_ShowDistance
 
bool m_SpecTeam
 
bool m_NinjaJetpack
 
int m_ChatScore
 
bool m_Moderating
 
int64_t m_LastPlaytime
 
int64_t m_LastEyeEmote
 
int64_t m_LastBroadcast
 
bool m_LastBroadcastImportance
 
CNetObj_PlayerInputm_pLastTarget
 
bool m_LastTargetInit
 
bool m_EyeEmoteEnabled
 
int m_TimerType
 
bool m_FirstPacket
 
int64_t m_LastSqlQuery
 
std::shared_ptr< CScorePlayerResultm_ScoreQueryResult
 
std::shared_ptr< CScorePlayerResultm_ScoreFinishResult
 
bool m_NotEligibleForFinish
 
int64_t m_EligibleForFinishCheck
 
bool m_VotedForPractice
 
int m_SwapTargetsClientId
 
bool m_BirthdayAnnounced
 
int m_RescueMode
 
CSaveTee m_LastTeleTee
 

Private Member Functions

CGameContextGameServer () const
 
IServerServer () const
 

Private Attributes

const uint32_t m_UniqueClientId
 
CCharacterm_pCharacter
 
int m_NumInputs
 
CGameContextm_pGameServer
 
bool m_Spawning
 
bool m_WeakHookSpawn
 
int m_ClientId
 
int m_Team
 
int m_Paused
 
int64_t m_ForcePauseTime
 
int64_t m_LastPause
 
bool m_Afk
 
int m_DefEmote
 
int m_OverrideEmote
 
int m_OverrideEmoteReset
 
bool m_Halloween
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PAUSE_NONE 
PAUSE_PAUSED 
PAUSE_SPEC 

◆ anonymous enum

anonymous enum
Enumerator
TIMERTYPE_DEFAULT 
TIMERTYPE_GAMETIMER 
TIMERTYPE_BROADCAST 
TIMERTYPE_GAMETIMER_AND_BROADCAST 
TIMERTYPE_SIXUP 
TIMERTYPE_NONE 

Constructor & Destructor Documentation

◆ CPlayer()

CPlayer::CPlayer ( CGameContext pGameServer,
uint32_t  UniqueClientId,
int  ClientId,
int  Team 
)

◆ ~CPlayer()

CPlayer::~CPlayer ( )

Member Function Documentation

◆ AfkTimer()

void CPlayer::AfkTimer ( )

◆ CanOverrideDefaultEmote()

bool CPlayer::CanOverrideDefaultEmote ( ) const

◆ CanSpec()

bool CPlayer::CanSpec ( ) const

◆ FakeSnap()

void CPlayer::FakeSnap ( )

◆ ForcePause()

int CPlayer::ForcePause ( int  Time)

◆ ForceSpawn()

CCharacter * CPlayer::ForceSpawn ( vec2  Pos)

◆ GameServer()

CGameContext * CPlayer::GameServer ( ) const
inlineprivate

◆ GetCharacter() [1/2]

CCharacter * CPlayer::GetCharacter ( )

◆ GetCharacter() [2/2]

const CCharacter * CPlayer::GetCharacter ( ) const

◆ GetCid()

int CPlayer::GetCid ( ) const
inline

◆ GetClientVersion()

int CPlayer::GetClientVersion ( ) const

◆ GetDefaultEmote()

int CPlayer::GetDefaultEmote ( ) const

◆ GetTeam()

int CPlayer::GetTeam ( ) const
inline

◆ GetUniqueCid()

uint32_t CPlayer::GetUniqueCid ( ) const
inline

◆ IsAfk()

bool CPlayer::IsAfk ( ) const
inline

◆ IsPaused()

int CPlayer::IsPaused ( ) const

◆ IsPlaying()

bool CPlayer::IsPlaying ( ) const

◆ KillCharacter()

void CPlayer::KillCharacter ( int  Weapon = WEAPON_GAME,
bool  SendKillMsg = true 
)

◆ OnDirectInput()

void CPlayer::OnDirectInput ( CNetObj_PlayerInput pNewInput)

◆ OnDisconnect()

void CPlayer::OnDisconnect ( )

◆ OnPredictedEarlyInput()

void CPlayer::OnPredictedEarlyInput ( CNetObj_PlayerInput pNewInput)

◆ OnPredictedInput()

void CPlayer::OnPredictedInput ( CNetObj_PlayerInput pNewInput)

◆ OverrideDefaultEmote()

void CPlayer::OverrideDefaultEmote ( int  Emote,
int  Tick 
)

◆ Pause()

int CPlayer::Pause ( int  State,
bool  Force 
)

◆ PostPostTick()

void CPlayer::PostPostTick ( )

◆ PostTick()

void CPlayer::PostTick ( )

◆ ProcessPause()

void CPlayer::ProcessPause ( )

◆ ProcessScoreResult()

void CPlayer::ProcessScoreResult ( CScorePlayerResult Result)

◆ Reset()

void CPlayer::Reset ( )

◆ Respawn()

void CPlayer::Respawn ( bool  WeakHook = false)

◆ Server()

IServer * CPlayer::Server ( ) const
private

◆ SetAfk()

void CPlayer::SetAfk ( bool  Afk)

◆ SetInitialAfk()

void CPlayer::SetInitialAfk ( bool  Afk)

◆ SetTeam()

void CPlayer::SetTeam ( int  Team,
bool  DoChatMsg = true 
)

◆ SetTimerType()

bool CPlayer::SetTimerType ( int  TimerType)

◆ Snap()

void CPlayer::Snap ( int  SnappingClient)

◆ SpectatePlayerName()

void CPlayer::SpectatePlayerName ( const char *  pName)

◆ Tick()

void CPlayer::Tick ( )

◆ TryRespawn()

void CPlayer::TryRespawn ( )

◆ UpdatePlaytime()

void CPlayer::UpdatePlaytime ( )

Member Data Documentation

◆ m_Accum

int CPlayer::m_Accum

◆ m_AccumMax

int CPlayer::m_AccumMax

◆ m_AccumMin

int CPlayer::m_AccumMin

◆ m_aCurLatency

int CPlayer::m_aCurLatency[MAX_CLIENTS]

◆ m_Afk

bool CPlayer::m_Afk
private

◆ m_aLastCommands

int CPlayer::m_aLastCommands[4]

◆ m_aTimeoutCode

char CPlayer::m_aTimeoutCode[64]

◆ m_Avg

int CPlayer::m_Avg

◆ m_BirthdayAnnounced

bool CPlayer::m_BirthdayAnnounced

◆ m_ChatScore

int CPlayer::m_ChatScore

◆ m_ClientId

int CPlayer::m_ClientId
private

◆ m_DefEmote

int CPlayer::m_DefEmote
private

◆ m_DieTick

int CPlayer::m_DieTick

◆ m_DND

bool CPlayer::m_DND

◆ m_EligibleForFinishCheck

int64_t CPlayer::m_EligibleForFinishCheck

◆ m_EyeEmoteEnabled

bool CPlayer::m_EyeEmoteEnabled

◆ m_FirstPacket

bool CPlayer::m_FirstPacket

◆ m_FirstVoteTick

int64_t CPlayer::m_FirstVoteTick

◆ m_ForceBalanced

bool CPlayer::m_ForceBalanced

◆ m_ForcePauseTime

int64_t CPlayer::m_ForcePauseTime
private

◆ m_Halloween

bool CPlayer::m_Halloween
private

◆ m_IsReady

bool CPlayer::m_IsReady

◆ m_JoinTick

int CPlayer::m_JoinTick

◆ m_Last_KickVote

int64_t CPlayer::m_Last_KickVote

◆ m_Last_Team

int64_t CPlayer::m_Last_Team

◆ m_LastActionTick

int CPlayer::m_LastActionTick

◆ m_LastBroadcast

int64_t CPlayer::m_LastBroadcast

◆ m_LastBroadcastImportance

bool CPlayer::m_LastBroadcastImportance

◆ m_LastChangeInfo

int CPlayer::m_LastChangeInfo

◆ m_LastChat

int CPlayer::m_LastChat

◆ m_LastCommandPos

int CPlayer::m_LastCommandPos

◆ m_LastEmote

int CPlayer::m_LastEmote

◆ m_LastEmoteGlobal

int CPlayer::m_LastEmoteGlobal

◆ m_LastEyeEmote

int64_t CPlayer::m_LastEyeEmote

◆ m_LastInvited

int CPlayer::m_LastInvited

◆ m_LastKill

int CPlayer::m_LastKill

◆ m_LastPause

int64_t CPlayer::m_LastPause
private

◆ m_LastPlaytime

int64_t CPlayer::m_LastPlaytime

◆ m_LastSetSpectatorMode

int CPlayer::m_LastSetSpectatorMode

◆ m_LastSetTeam

int CPlayer::m_LastSetTeam

◆ m_LastSqlQuery

int64_t CPlayer::m_LastSqlQuery

◆ m_LastTargetInit

bool CPlayer::m_LastTargetInit

◆ m_LastTeleTee

CSaveTee CPlayer::m_LastTeleTee

◆ m_LastVoteCall

int CPlayer::m_LastVoteCall

◆ m_LastVoteTry

int CPlayer::m_LastVoteTry

◆ m_LastWhisperTo

int CPlayer::m_LastWhisperTo

◆ 

struct { ... } CPlayer::m_Latency

◆ m_Max

int CPlayer::m_Max

◆ m_Min

int CPlayer::m_Min

◆ m_Moderating

bool CPlayer::m_Moderating

◆ m_NinjaJetpack

bool CPlayer::m_NinjaJetpack

◆ m_NotEligibleForFinish

bool CPlayer::m_NotEligibleForFinish

◆ m_NumInputs

int CPlayer::m_NumInputs
private

◆ m_OverrideEmote

int CPlayer::m_OverrideEmote
private

◆ m_OverrideEmoteReset

int CPlayer::m_OverrideEmoteReset
private

◆ m_Paused

int CPlayer::m_Paused
private

◆ m_pCharacter

CCharacter* CPlayer::m_pCharacter
private

◆ m_pGameServer

CGameContext* CPlayer::m_pGameServer
private

◆ m_pLastTarget

CNetObj_PlayerInput* CPlayer::m_pLastTarget

◆ m_PlayerFlags

int CPlayer::m_PlayerFlags

◆ m_PreviousDieTick

int CPlayer::m_PreviousDieTick

◆ m_RescueMode

int CPlayer::m_RescueMode

◆ m_Score

std::optional<int> CPlayer::m_Score

◆ m_ScoreFinishResult

std::shared_ptr<CScorePlayerResult> CPlayer::m_ScoreFinishResult

◆ m_ScoreQueryResult

std::shared_ptr<CScorePlayerResult> CPlayer::m_ScoreQueryResult

◆ m_SendVoteIndex

int CPlayer::m_SendVoteIndex

◆ m_SentSnaps

int CPlayer::m_SentSnaps = 0

◆ m_ShowAll

bool CPlayer::m_ShowAll

◆ m_ShowDistance

vec2 CPlayer::m_ShowDistance

◆ m_ShowOthers

int CPlayer::m_ShowOthers

◆ m_Spawning

bool CPlayer::m_Spawning
private

◆ m_SpectatorId

int CPlayer::m_SpectatorId

◆ m_SpecTeam

bool CPlayer::m_SpecTeam

◆ m_SwapTargetsClientId

int CPlayer::m_SwapTargetsClientId

◆ m_Team

int CPlayer::m_Team
private

◆ m_TeamChangeTick

int CPlayer::m_TeamChangeTick

◆ m_TeeInfos

CTeeInfo CPlayer::m_TeeInfos

◆ m_TimerType

int CPlayer::m_TimerType

◆ m_TuneZone

int CPlayer::m_TuneZone

◆ m_TuneZoneOld

int CPlayer::m_TuneZoneOld

◆ m_UniqueClientId

const uint32_t CPlayer::m_UniqueClientId
private

◆ m_ViewPos

vec2 CPlayer::m_ViewPos

◆ m_Vote

int CPlayer::m_Vote

◆ m_VotedForPractice

bool CPlayer::m_VotedForPractice

◆ m_VotePos

int CPlayer::m_VotePos

◆ m_WeakHookSpawn

bool CPlayer::m_WeakHookSpawn
private

◆ m_Whispers

bool CPlayer::m_Whispers

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