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

#include <gameworld.h>

Collaboration diagram for CGameWorld:
[legend]

Public Types

enum  {
  ENTTYPE_PROJECTILE = 0 , ENTTYPE_LASER , ENTTYPE_DOOR , ENTTYPE_DRAGGER ,
  ENTTYPE_LIGHT , ENTTYPE_GUN , ENTTYPE_PLASMA , ENTTYPE_PICKUP ,
  ENTTYPE_FLAG , ENTTYPE_CHARACTER , NUM_ENTTYPES
}
enum  {
  ENTTYPE_PROJECTILE = 0 , ENTTYPE_LASER , ENTTYPE_PICKUP , ENTTYPE_FLAG ,
  ENTTYPE_CHARACTER , NUM_ENTTYPES
}

Public Member Functions

 CGameWorld ()
 ~CGameWorld ()
void Init (CCollision *pCollision, CTuningParams *pTuningList, const CMapBugs *pMapBugs)
CEntityFindFirst (int Type)
CEntityFindLast (int Type)
int FindEntities (vec2 Pos, float Radius, CEntity **ppEnts, int Max, int Type)
CCharacterIntersectCharacter (vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, const CCharacter *pNotThis=nullptr, int CollideWith=-1, const CCharacter *pThisOnly=nullptr)
CEntityIntersectEntity (vec2 Pos0, vec2 Pos1, float Radius, int Type, vec2 &NewPos, const CEntity *pNotThis=nullptr, int CollideWith=-1, const CEntity *pThisOnly=nullptr)
void InsertEntity (CEntity *pEntity, bool Last=false)
void RemoveEntity (CEntity *pEntity)
void RemoveCharacter (CCharacter *pChar)
void Tick ()
void ReleaseHooked (int ClientId)
std::vector< CCharacter * > IntersectedCharacters (vec2 Pos0, vec2 Pos1, float Radius, const CEntity *pNotThis=nullptr)
int GameTick () const
int GameTickSpeed () const
const CCollisionCollision () const
CCollisionCollision ()
CTeamsCoreTeams ()
std::vector< SSwitchers > & Switchers ()
CEntityGetEntity (int Id, int EntityType)
CCharacterGetCharacterById (int Id)
void CreateExplosion (vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, CClientMask Mask)
bool IsLocalTeam (int OwnerId) const
void OnModified () const
void NetObjBegin (CTeamsCore Teams, int LocalClientId)
void NetCharAdd (int ObjId, CNetObj_Character *pChar, CNetObj_DDNetCharacter *pExtended, int GameTeam, bool IsLocal)
void NetObjAdd (int ObjId, int ObjType, const void *pObjData, const CNetObj_EntityEx *pDataEx)
void NetObjEnd ()
void CopyWorld (CGameWorld *pFrom)
CEntityFindMatch (int ObjId, int ObjType, const void *pObjData)
void Clear ()
const CTuningParamsTuningList () const
CTuningParamsTuningList ()
const CTuningParamsGlobalTuning () const
CTuningParamsGlobalTuning ()
const CTuningParamsGetTuning (int i) const
CTuningParamsGetTuning (int i)
bool EmulateBug (int Bug) const
class CGameContextGameServer ()
class CConfigConfig ()
class IServerServer ()
 CGameWorld ()
 ~CGameWorld ()
void SetGameServer (CGameContext *pGameServer)
void Init (CCollision *pCollision, CTuningParams *pTuningList)
CEntityFindFirst (int Type)
int FindEntities (vec2 Pos, float Radius, CEntity **ppEnts, int Max, int Type)
CCharacterIntersectCharacter (vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, const CCharacter *pNotThis=nullptr, int CollideWith=-1, const CCharacter *pThisOnly=nullptr)
CEntityIntersectEntity (vec2 Pos0, vec2 Pos1, float Radius, int Type, vec2 &NewPos, const CEntity *pNotThis=nullptr, int CollideWith=-1, const CEntity *pThisOnly=nullptr)
CCharacterClosestCharacter (vec2 Pos, float Radius, const CEntity *pNotThis)
void InsertEntity (CEntity *pEntity)
void RemoveEntity (CEntity *pEntity)
void RemoveEntitiesFromPlayer (int PlayerId)
void RemoveEntitiesFromPlayers (int PlayerIds[], int NumPlayers)
void Snap (int SnappingClient)
void Tick ()
void SwapClients (int Client1, int Client2)
ESaveResult BlocksSave (int ClientId)
void ReleaseHooked (int ClientId)
std::vector< CCharacter * > IntersectedCharacters (vec2 Pos0, vec2 Pos1, float Radius, const CEntity *pNotThis=nullptr)
const CTuningParamsTuningList () const
CTuningParamsTuningList ()
const CTuningParamsGetTuning (int i) const
CTuningParamsGetTuning (int i)

Public Attributes

CWorldCore m_Core
CTeamsCore m_Teams
int m_GameTick
struct { 
   bool   m_IsDDRace 
   bool   m_IsVanilla 
   bool   m_IsFNG 
   bool   m_InfiniteAmmo 
   bool   m_PredictTiles 
   int   m_PredictFreeze 
   bool   m_PredictWeapons 
   bool   m_PredictDDRace 
   bool   m_IsSolo 
   bool   m_UseTuneZones 
   bool   m_BugDDRaceInput 
   bool   m_NoWeakHookAndBounce 
m_WorldConfig
bool m_IsValidCopy
CGameWorldm_pParent
CGameWorldm_pChild
int m_LocalClientId
bool m_ResetRequested
bool m_Paused

Private Member Functions

void RemoveEntities ()
void Reset ()
void RemoveEntities ()

Private Attributes

CEntitym_pNextTraverseEntity = nullptr
CEntitym_apFirstEntityTypes [NUM_ENTTYPES]
CCharacterm_apCharacters [MAX_CLIENTS]
CCollisionm_pCollision
CTuningParamsm_pTuningList
const CMapBugsm_pMapBugs
class CGameContextm_pGameServer
class CConfigm_pConfig
class IServerm_pServer

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ENTTYPE_PROJECTILE 
ENTTYPE_LASER 
ENTTYPE_DOOR 
ENTTYPE_DRAGGER 
ENTTYPE_LIGHT 
ENTTYPE_GUN 
ENTTYPE_PLASMA 
ENTTYPE_PICKUP 
ENTTYPE_FLAG 
ENTTYPE_CHARACTER 
NUM_ENTTYPES 

◆ anonymous enum

anonymous enum
Enumerator
ENTTYPE_PROJECTILE 
ENTTYPE_LASER 
ENTTYPE_PICKUP 
ENTTYPE_FLAG 
ENTTYPE_CHARACTER 
NUM_ENTTYPES 

Constructor & Destructor Documentation

◆ CGameWorld() [1/2]

CGameWorld::CGameWorld ( )

◆ ~CGameWorld() [1/2]

CGameWorld::~CGameWorld ( )

◆ CGameWorld() [2/2]

CGameWorld::CGameWorld ( )

◆ ~CGameWorld() [2/2]

CGameWorld::~CGameWorld ( )

Member Function Documentation

◆ BlocksSave()

ESaveResult CGameWorld::BlocksSave ( int ClientId)

◆ Clear()

void CGameWorld::Clear ( )

◆ ClosestCharacter()

CCharacter * CGameWorld::ClosestCharacter ( vec2 Pos,
float Radius,
const CEntity * pNotThis )

◆ Collision() [1/2]

CCollision * CGameWorld::Collision ( )
inline

◆ Collision() [2/2]

const CCollision * CGameWorld::Collision ( ) const
inline

◆ Config()

class CConfig * CGameWorld::Config ( )
inline

◆ CopyWorld()

void CGameWorld::CopyWorld ( CGameWorld * pFrom)

◆ CreateExplosion()

void CGameWorld::CreateExplosion ( vec2 Pos,
int Owner,
int Weapon,
bool NoDamage,
int ActivatedTeam,
CClientMask Mask )

◆ EmulateBug()

bool CGameWorld::EmulateBug ( int Bug) const

◆ FindEntities() [1/2]

int CGameWorld::FindEntities ( vec2 Pos,
float Radius,
CEntity ** ppEnts,
int Max,
int Type )

◆ FindEntities() [2/2]

int CGameWorld::FindEntities ( vec2 Pos,
float Radius,
CEntity ** ppEnts,
int Max,
int Type )

◆ FindFirst() [1/2]

CEntity * CGameWorld::FindFirst ( int Type)

◆ FindFirst() [2/2]

CEntity * CGameWorld::FindFirst ( int Type)

◆ FindLast()

CEntity * CGameWorld::FindLast ( int Type)

◆ FindMatch()

CEntity * CGameWorld::FindMatch ( int ObjId,
int ObjType,
const void * pObjData )

◆ GameServer()

class CGameContext * CGameWorld::GameServer ( )
inline

◆ GameTick()

int CGameWorld::GameTick ( ) const
inline

◆ GameTickSpeed()

int CGameWorld::GameTickSpeed ( ) const
inline

◆ GetCharacterById()

CCharacter * CGameWorld::GetCharacterById ( int Id)
inline

◆ GetEntity()

CEntity * CGameWorld::GetEntity ( int Id,
int EntityType )

◆ GetTuning() [1/4]

CTuningParams * CGameWorld::GetTuning ( int i)
inline

◆ GetTuning() [2/4]

CTuningParams * CGameWorld::GetTuning ( int i)
inline

◆ GetTuning() [3/4]

const CTuningParams * CGameWorld::GetTuning ( int i) const
inline

◆ GetTuning() [4/4]

const CTuningParams * CGameWorld::GetTuning ( int i) const
inline

◆ GlobalTuning() [1/2]

CTuningParams * CGameWorld::GlobalTuning ( )
inline

◆ GlobalTuning() [2/2]

const CTuningParams * CGameWorld::GlobalTuning ( ) const
inline

◆ Init() [1/2]

void CGameWorld::Init ( CCollision * pCollision,
CTuningParams * pTuningList )

◆ Init() [2/2]

void CGameWorld::Init ( CCollision * pCollision,
CTuningParams * pTuningList,
const CMapBugs * pMapBugs )

◆ InsertEntity() [1/2]

void CGameWorld::InsertEntity ( CEntity * pEntity)

◆ InsertEntity() [2/2]

void CGameWorld::InsertEntity ( CEntity * pEntity,
bool Last = false )

◆ IntersectCharacter() [1/2]

CCharacter * CGameWorld::IntersectCharacter ( vec2 Pos0,
vec2 Pos1,
float Radius,
vec2 & NewPos,
const CCharacter * pNotThis = nullptr,
int CollideWith = -1,
const CCharacter * pThisOnly = nullptr )

◆ IntersectCharacter() [2/2]

CCharacter * CGameWorld::IntersectCharacter ( vec2 Pos0,
vec2 Pos1,
float Radius,
vec2 & NewPos,
const CCharacter * pNotThis = nullptr,
int CollideWith = -1,
const CCharacter * pThisOnly = nullptr )

Finds the CCharacter that intersects the line.

See also
IntersectEntity
Parameters
Pos0Start position
Pos1End position
RadiusHow far from the line the CCharacter is allowed to be
NewPosIntersection position
pNotThisCharacter to ignore intersecting with
CollideWithOnly find entities that can collide with that Client Id (pass -1 to ignore this check)
pThisOnlyOnly search this specific character and ignore all others
Returns
Pointer to the closest hit or nullptr if there is no intersection.

◆ IntersectedCharacters() [1/2]

std::vector< CCharacter * > CGameWorld::IntersectedCharacters ( vec2 Pos0,
vec2 Pos1,
float Radius,
const CEntity * pNotThis = nullptr )

◆ IntersectedCharacters() [2/2]

std::vector< CCharacter * > CGameWorld::IntersectedCharacters ( vec2 Pos0,
vec2 Pos1,
float Radius,
const CEntity * pNotThis = nullptr )

◆ IntersectEntity() [1/2]

CEntity * CGameWorld::IntersectEntity ( vec2 Pos0,
vec2 Pos1,
float Radius,
int Type,
vec2 & NewPos,
const CEntity * pNotThis = nullptr,
int CollideWith = -1,
const CEntity * pThisOnly = nullptr )

◆ IntersectEntity() [2/2]

CEntity * CGameWorld::IntersectEntity ( vec2 Pos0,
vec2 Pos1,
float Radius,
int Type,
vec2 & NewPos,
const CEntity * pNotThis = nullptr,
int CollideWith = -1,
const CEntity * pThisOnly = nullptr )

Finds the CEntity that intersects the line.

See also
IntersectCharacter
Parameters
Pos0Start position
Pos1End position
RadiusHow far from the line the CEntity is allowed to be
TypeType of the entity to intersect
NewPosIntersection position
pNotThisEntity to ignore intersecting with
CollideWithOnly find entities that can collide with that Client Id (pass -1 to ignore this check)
pThisOnlyOnly search this specific entity and ignore all others
Returns
Pointer to the closest hit or nullptr if there is no intersection.

◆ IsLocalTeam()

bool CGameWorld::IsLocalTeam ( int OwnerId) const

◆ NetCharAdd()

void CGameWorld::NetCharAdd ( int ObjId,
CNetObj_Character * pChar,
CNetObj_DDNetCharacter * pExtended,
int GameTeam,
bool IsLocal )

◆ NetObjAdd()

void CGameWorld::NetObjAdd ( int ObjId,
int ObjType,
const void * pObjData,
const CNetObj_EntityEx * pDataEx )

◆ NetObjBegin()

void CGameWorld::NetObjBegin ( CTeamsCore Teams,
int LocalClientId )

◆ NetObjEnd()

void CGameWorld::NetObjEnd ( )

◆ OnModified()

void CGameWorld::OnModified ( ) const

◆ ReleaseHooked() [1/2]

void CGameWorld::ReleaseHooked ( int ClientId)

◆ ReleaseHooked() [2/2]

void CGameWorld::ReleaseHooked ( int ClientId)

◆ RemoveCharacter()

void CGameWorld::RemoveCharacter ( CCharacter * pChar)

◆ RemoveEntities() [1/2]

void CGameWorld::RemoveEntities ( )
private

◆ RemoveEntities() [2/2]

void CGameWorld::RemoveEntities ( )
private

◆ RemoveEntitiesFromPlayer()

void CGameWorld::RemoveEntitiesFromPlayer ( int PlayerId)

◆ RemoveEntitiesFromPlayers()

void CGameWorld::RemoveEntitiesFromPlayers ( int PlayerIds[],
int NumPlayers )

◆ RemoveEntity() [1/2]

void CGameWorld::RemoveEntity ( CEntity * pEntity)

◆ RemoveEntity() [2/2]

void CGameWorld::RemoveEntity ( CEntity * pEntity)

◆ Reset()

void CGameWorld::Reset ( )
private

◆ Server()

class IServer * CGameWorld::Server ( )
inline

◆ SetGameServer()

void CGameWorld::SetGameServer ( CGameContext * pGameServer)

◆ Snap()

void CGameWorld::Snap ( int SnappingClient)

◆ SwapClients()

void CGameWorld::SwapClients ( int Client1,
int Client2 )

◆ Switchers()

std::vector< SSwitchers > & CGameWorld::Switchers ( )
inline

◆ Teams()

CTeamsCore * CGameWorld::Teams ( )
inline

◆ Tick() [1/2]

void CGameWorld::Tick ( )

◆ Tick() [2/2]

void CGameWorld::Tick ( )

◆ TuningList() [1/4]

CTuningParams * CGameWorld::TuningList ( )
inline

◆ TuningList() [2/4]

CTuningParams * CGameWorld::TuningList ( )
inline

◆ TuningList() [3/4]

const CTuningParams * CGameWorld::TuningList ( ) const
inline

◆ TuningList() [4/4]

const CTuningParams * CGameWorld::TuningList ( ) const
inline

Member Data Documentation

◆ m_apCharacters

CCharacter* CGameWorld::m_apCharacters[MAX_CLIENTS]
private

◆ m_apFirstEntityTypes

CEntity * CGameWorld::m_apFirstEntityTypes
private

◆ m_BugDDRaceInput

bool CGameWorld::m_BugDDRaceInput

◆ m_Core

CWorldCore CGameWorld::m_Core

◆ m_GameTick

int CGameWorld::m_GameTick

◆ m_InfiniteAmmo

bool CGameWorld::m_InfiniteAmmo

◆ m_IsDDRace

bool CGameWorld::m_IsDDRace

◆ m_IsFNG

bool CGameWorld::m_IsFNG

◆ m_IsSolo

bool CGameWorld::m_IsSolo

◆ m_IsValidCopy

bool CGameWorld::m_IsValidCopy

◆ m_IsVanilla

bool CGameWorld::m_IsVanilla

◆ m_LocalClientId

int CGameWorld::m_LocalClientId

◆ m_NoWeakHookAndBounce

bool CGameWorld::m_NoWeakHookAndBounce

◆ m_Paused

bool CGameWorld::m_Paused

◆ m_pChild

CGameWorld* CGameWorld::m_pChild

◆ m_pCollision

CCollision* CGameWorld::m_pCollision
private

◆ m_pConfig

class CConfig* CGameWorld::m_pConfig
private

◆ m_pGameServer

class CGameContext* CGameWorld::m_pGameServer
private

◆ m_pMapBugs

const CMapBugs* CGameWorld::m_pMapBugs
private

◆ m_pNextTraverseEntity

CEntity * CGameWorld::m_pNextTraverseEntity = nullptr
private

◆ m_pParent

CGameWorld* CGameWorld::m_pParent

◆ m_PredictDDRace

bool CGameWorld::m_PredictDDRace

◆ m_PredictFreeze

int CGameWorld::m_PredictFreeze

◆ m_PredictTiles

bool CGameWorld::m_PredictTiles

◆ m_PredictWeapons

bool CGameWorld::m_PredictWeapons

◆ m_pServer

class IServer* CGameWorld::m_pServer
private

◆ m_pTuningList

CTuningParams * CGameWorld::m_pTuningList
private

◆ m_ResetRequested

bool CGameWorld::m_ResetRequested

◆ m_Teams

CTeamsCore CGameWorld::m_Teams

◆ m_UseTuneZones

bool CGameWorld::m_UseTuneZones

◆ [struct]

struct { ... } CGameWorld::m_WorldConfig

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