2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#ifndef GAME_CLIENT_GAMECLIENT_H
|
|
|
|
#define GAME_CLIENT_GAMECLIENT_H
|
|
|
|
|
2019-04-21 16:20:53 +00:00
|
|
|
#include <base/color.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <base/vmath.h>
|
|
|
|
#include <engine/client.h>
|
|
|
|
#include <engine/console.h>
|
2020-02-19 10:24:58 +00:00
|
|
|
#include <engine/shared/config.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <game/layers.h>
|
2017-07-26 01:58:00 +00:00
|
|
|
#include <game/localization.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <game/gamecore.h>
|
|
|
|
#include "render.h"
|
|
|
|
|
2011-04-09 06:41:31 +00:00
|
|
|
#include <game/teamscore.h>
|
|
|
|
|
2019-04-11 22:46:54 +00:00
|
|
|
#include <game/client/prediction/gameworld.h>
|
|
|
|
#include <game/client/prediction/entities/character.h>
|
|
|
|
#include <game/client/prediction/entities/laser.h>
|
|
|
|
#include <game/client/prediction/entities/pickup.h>
|
|
|
|
|
2019-06-03 19:52:14 +00:00
|
|
|
class CGameInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool m_FlagStartsRace;
|
|
|
|
bool m_TimeScore;
|
|
|
|
bool m_UnlimitedAmmo;
|
|
|
|
bool m_DDRaceRecordMessage;
|
|
|
|
bool m_RaceRecordMessage;
|
|
|
|
|
|
|
|
bool m_AllowEyeWheel;
|
|
|
|
bool m_AllowHookColl;
|
|
|
|
bool m_AllowZoom;
|
|
|
|
|
|
|
|
bool m_BugDDRaceGhost;
|
|
|
|
bool m_BugDDRaceInput;
|
|
|
|
bool m_BugFNGLaserRange;
|
|
|
|
bool m_BugVanillaBounce;
|
|
|
|
|
|
|
|
bool m_PredictFNG;
|
|
|
|
bool m_PredictDDRace;
|
|
|
|
bool m_PredictDDRaceTiles;
|
|
|
|
bool m_PredictVanilla;
|
|
|
|
|
|
|
|
bool m_EntitiesDDNet;
|
|
|
|
bool m_EntitiesDDRace;
|
|
|
|
bool m_EntitiesRace;
|
|
|
|
bool m_EntitiesFNG;
|
|
|
|
bool m_EntitiesVanilla;
|
2020-05-19 14:49:28 +00:00
|
|
|
bool m_EntitiesBW;
|
2019-07-19 08:21:32 +00:00
|
|
|
|
|
|
|
bool m_Race;
|
2019-07-31 19:22:11 +00:00
|
|
|
|
|
|
|
bool m_DontMaskEntities;
|
2019-06-03 19:52:14 +00:00
|
|
|
};
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CGameClient : public IGameClient
|
|
|
|
{
|
|
|
|
class CStack
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
MAX_COMPONENTS = 64,
|
|
|
|
};
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CStack();
|
|
|
|
void Add(class CComponent *pComponent);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CComponent *m_paComponents[MAX_COMPONENTS];
|
|
|
|
int m_Num;
|
|
|
|
};
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CStack m_All;
|
|
|
|
CStack m_Input;
|
|
|
|
CNetObjHandler m_NetObjHandler;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-02-27 16:56:03 +00:00
|
|
|
class IEngine *m_pEngine;
|
2010-05-29 07:25:38 +00:00
|
|
|
class IInput *m_pInput;
|
|
|
|
class IGraphics *m_pGraphics;
|
|
|
|
class ITextRender *m_pTextRender;
|
|
|
|
class IClient *m_pClient;
|
|
|
|
class ISound *m_pSound;
|
|
|
|
class IConsole *m_pConsole;
|
|
|
|
class IStorage *m_pStorage;
|
|
|
|
class IDemoPlayer *m_pDemoPlayer;
|
|
|
|
class IServerBrowser *m_pServerBrowser;
|
2011-03-21 23:31:42 +00:00
|
|
|
class IEditor *m_pEditor;
|
2011-03-23 12:06:35 +00:00
|
|
|
class IFriends *m_pFriends;
|
2015-07-22 20:16:49 +00:00
|
|
|
class IFriends *m_pFoes;
|
2020-07-09 22:01:00 +00:00
|
|
|
#if defined(CONF_AUTOUPDATE)
|
2015-04-18 19:17:27 +00:00
|
|
|
class IUpdater *m_pUpdater;
|
2020-07-09 22:01:00 +00:00
|
|
|
#endif
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CLayers m_Layers;
|
|
|
|
class CCollision m_Collision;
|
|
|
|
CUI m_UI;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void ProcessEvents();
|
2011-03-10 09:08:14 +00:00
|
|
|
void UpdatePositions();
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
int m_PredictedTick;
|
2014-05-23 21:59:26 +00:00
|
|
|
int m_LastNewPredictedTick[2];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2015-05-20 20:23:58 +00:00
|
|
|
int m_LastRoundStartTick;
|
|
|
|
|
|
|
|
int m_LastFlagCarrierRed;
|
|
|
|
int m_LastFlagCarrierBlue;
|
|
|
|
|
2015-04-19 12:03:40 +00:00
|
|
|
int m_CheckInfo[2];
|
2011-01-06 03:46:10 +00:00
|
|
|
|
2020-05-22 15:58:41 +00:00
|
|
|
char m_aDDNetVersionStr[64];
|
|
|
|
|
2011-08-13 00:11:06 +00:00
|
|
|
static void ConTeam(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConKill(IConsole::IResult *pResult, void *pUserData);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
static void ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2014-04-28 13:19:57 +00:00
|
|
|
static void ConchainSpecialDummyInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2014-04-28 13:34:56 +00:00
|
|
|
static void ConchainSpecialDummy(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2019-05-06 12:19:10 +00:00
|
|
|
static void ConchainClTextEntitiesSize(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2019-09-08 22:53:07 +00:00
|
|
|
static void ConTuneZone(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
|
2020-09-18 16:45:42 +00:00
|
|
|
static void ConchainMenuMap(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
public:
|
|
|
|
IKernel *Kernel() { return IInterface::Kernel(); }
|
2011-02-27 16:56:03 +00:00
|
|
|
IEngine *Engine() const { return m_pEngine; }
|
2010-05-29 07:25:38 +00:00
|
|
|
class IGraphics *Graphics() const { return m_pGraphics; }
|
|
|
|
class IClient *Client() const { return m_pClient; }
|
|
|
|
class CUI *UI() { return &m_UI; }
|
|
|
|
class ISound *Sound() const { return m_pSound; }
|
|
|
|
class IInput *Input() const { return m_pInput; }
|
|
|
|
class IStorage *Storage() const { return m_pStorage; }
|
|
|
|
class IConsole *Console() { return m_pConsole; }
|
|
|
|
class ITextRender *TextRender() const { return m_pTextRender; }
|
|
|
|
class IDemoPlayer *DemoPlayer() const { return m_pDemoPlayer; }
|
2014-10-16 15:42:13 +00:00
|
|
|
class IDemoRecorder *DemoRecorder(int Recorder) const { return Client()->DemoRecorder(Recorder); }
|
2010-05-29 07:25:38 +00:00
|
|
|
class IServerBrowser *ServerBrowser() const { return m_pServerBrowser; }
|
|
|
|
class CRenderTools *RenderTools() { return &m_RenderTools; }
|
|
|
|
class CLayers *Layers() { return &m_Layers; };
|
|
|
|
class CCollision *Collision() { return &m_Collision; };
|
2011-03-21 23:31:42 +00:00
|
|
|
class IEditor *Editor() { return m_pEditor; }
|
2011-03-23 12:06:35 +00:00
|
|
|
class IFriends *Friends() { return m_pFriends; }
|
2015-07-22 20:16:49 +00:00
|
|
|
class IFriends *Foes() { return m_pFoes; }
|
2020-07-09 22:01:00 +00:00
|
|
|
#if defined(CONF_AUTOUPDATE)
|
2015-04-18 19:17:27 +00:00
|
|
|
class IUpdater *Updater() { return m_pUpdater; }
|
2020-07-09 22:01:00 +00:00
|
|
|
#endif
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-08-13 01:07:51 +00:00
|
|
|
int NetobjNumCorrections() { return m_NetObjHandler.NumObjCorrections(); }
|
|
|
|
const char *NetobjCorrectedOn() { return m_NetObjHandler.CorrectedObjOn(); }
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
bool m_SuppressEvents;
|
|
|
|
bool m_NewTick;
|
|
|
|
bool m_NewPredictedTick;
|
2011-07-05 21:15:24 +00:00
|
|
|
int m_FlagDropTick[2];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// TODO: move this
|
2014-04-29 01:34:23 +00:00
|
|
|
CTuningParams m_Tuning[2];
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
SERVERMODE_PURE=0,
|
|
|
|
SERVERMODE_MOD,
|
|
|
|
SERVERMODE_PUREMOD,
|
|
|
|
};
|
|
|
|
int m_ServerMode;
|
2019-06-03 19:52:14 +00:00
|
|
|
CGameInfo m_GameInfo;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2011-03-12 17:07:57 +00:00
|
|
|
int m_DemoSpecID;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
vec2 m_LocalCharacterPos;
|
|
|
|
|
|
|
|
// predicted players
|
|
|
|
CCharacterCore m_PredictedPrevChar;
|
|
|
|
CCharacterCore m_PredictedChar;
|
|
|
|
|
|
|
|
// snap pointers
|
|
|
|
struct CSnapState
|
|
|
|
{
|
|
|
|
const CNetObj_Character *m_pLocalCharacter;
|
|
|
|
const CNetObj_Character *m_pLocalPrevCharacter;
|
|
|
|
const CNetObj_PlayerInfo *m_pLocalInfo;
|
2011-03-10 09:08:14 +00:00
|
|
|
const CNetObj_SpectatorInfo *m_pSpectatorInfo;
|
|
|
|
const CNetObj_SpectatorInfo *m_pPrevSpectatorInfo;
|
2010-05-29 07:25:38 +00:00
|
|
|
const CNetObj_Flag *m_paFlags[2];
|
2011-03-04 16:08:10 +00:00
|
|
|
const CNetObj_GameInfo *m_pGameInfoObj;
|
|
|
|
const CNetObj_GameData *m_pGameDataObj;
|
|
|
|
int m_GameDataSnapID;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
const CNetObj_PlayerInfo *m_paPlayerInfos[MAX_CLIENTS];
|
|
|
|
const CNetObj_PlayerInfo *m_paInfoByScore[MAX_CLIENTS];
|
2014-02-08 21:24:57 +00:00
|
|
|
const CNetObj_PlayerInfo *m_paInfoByName[MAX_CLIENTS];
|
2020-09-13 19:20:13 +00:00
|
|
|
const CNetObj_PlayerInfo *m_paInfoByDDTeamScore[MAX_CLIENTS];
|
|
|
|
const CNetObj_PlayerInfo *m_paInfoByDDTeamName[MAX_CLIENTS];
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-02-12 10:40:36 +00:00
|
|
|
int m_LocalClientID;
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_NumPlayers;
|
|
|
|
int m_aTeamSize[2];
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-03-12 17:07:57 +00:00
|
|
|
// spectate data
|
|
|
|
struct CSpectateInfo
|
|
|
|
{
|
|
|
|
bool m_Active;
|
|
|
|
int m_SpectatorID;
|
|
|
|
bool m_UsePosition;
|
|
|
|
vec2 m_Position;
|
|
|
|
} m_SpecInfo;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//
|
|
|
|
struct CCharacterInfo
|
|
|
|
{
|
|
|
|
bool m_Active;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// snapshots
|
|
|
|
CNetObj_Character m_Prev;
|
|
|
|
CNetObj_Character m_Cur;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2019-04-21 22:38:24 +00:00
|
|
|
CNetObj_DDNetCharacter m_ExtendedData;
|
|
|
|
bool m_HasExtendedData;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// interpolated position
|
|
|
|
vec2 m_Position;
|
|
|
|
};
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CCharacterInfo m_aCharacters[MAX_CLIENTS];
|
|
|
|
};
|
|
|
|
|
|
|
|
CSnapState m_Snap;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// client data
|
|
|
|
struct CClientData
|
|
|
|
{
|
|
|
|
int m_UseCustomColor;
|
|
|
|
int m_ColorBody;
|
|
|
|
int m_ColorFeet;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-03-15 10:23:49 +00:00
|
|
|
char m_aName[MAX_NAME_LENGTH];
|
|
|
|
char m_aClan[MAX_CLAN_LENGTH];
|
|
|
|
int m_Country;
|
2010-05-29 07:25:38 +00:00
|
|
|
char m_aSkinName[64];
|
2011-02-12 10:40:36 +00:00
|
|
|
int m_SkinID;
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_SkinColor;
|
|
|
|
int m_Team;
|
|
|
|
int m_Emoticon;
|
|
|
|
int m_EmoticonStart;
|
2019-04-12 14:16:21 +00:00
|
|
|
bool m_Solo;
|
2019-04-19 09:17:28 +00:00
|
|
|
bool m_Jetpack;
|
|
|
|
bool m_NoCollision;
|
|
|
|
bool m_EndlessHook;
|
|
|
|
bool m_EndlessJump;
|
|
|
|
bool m_NoHammerHit;
|
|
|
|
bool m_NoGrenadeHit;
|
2019-11-22 14:37:18 +00:00
|
|
|
bool m_NoLaserHit;
|
2019-04-19 09:17:28 +00:00
|
|
|
bool m_NoShotgunHit;
|
|
|
|
bool m_NoHookHit;
|
|
|
|
bool m_Super;
|
|
|
|
bool m_HasTelegunGun;
|
|
|
|
bool m_HasTelegunGrenade;
|
|
|
|
bool m_HasTelegunLaser;
|
2019-04-23 15:57:26 +00:00
|
|
|
int m_FreezeEnd;
|
2019-04-19 09:17:28 +00:00
|
|
|
bool m_DeepFrozen;
|
|
|
|
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CCharacterCore m_Predicted;
|
2013-10-09 14:02:23 +00:00
|
|
|
CCharacterCore m_PrevPredicted;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CTeeRenderInfo m_SkinInfo; // this is what the server reports
|
|
|
|
CTeeRenderInfo m_RenderInfo; // this is what we use
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
float m_Angle;
|
2011-03-22 21:41:27 +00:00
|
|
|
bool m_Active;
|
|
|
|
bool m_ChatIgnore;
|
2020-06-26 22:06:07 +00:00
|
|
|
bool m_EmoticonIgnore;
|
2011-03-23 12:06:35 +00:00
|
|
|
bool m_Friend;
|
2015-07-22 20:16:49 +00:00
|
|
|
bool m_Foe;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2019-03-02 10:50:33 +00:00
|
|
|
int m_AuthLevel;
|
2019-07-13 10:25:54 +00:00
|
|
|
bool m_Afk;
|
2019-08-02 16:16:58 +00:00
|
|
|
bool m_Paused;
|
|
|
|
bool m_Spec;
|
2019-03-02 10:50:33 +00:00
|
|
|
|
2019-11-09 21:49:53 +00:00
|
|
|
CNetObj_Character m_Snapped;
|
|
|
|
CNetObj_Character m_Evolved;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void UpdateRenderInfo();
|
2011-03-22 21:41:27 +00:00
|
|
|
void Reset();
|
2011-04-09 06:41:31 +00:00
|
|
|
|
2019-04-11 22:46:54 +00:00
|
|
|
// rendered characters
|
|
|
|
CNetObj_Character m_RenderCur;
|
|
|
|
CNetObj_Character m_RenderPrev;
|
|
|
|
vec2 m_RenderPos;
|
|
|
|
bool m_IsPredicted;
|
|
|
|
bool m_IsPredictedLocal;
|
|
|
|
int64 m_SmoothStart[2];
|
|
|
|
int64 m_SmoothLen[2];
|
|
|
|
vec2 m_PredPos[200];
|
|
|
|
int m_PredTick[200];
|
2020-06-25 12:56:23 +00:00
|
|
|
bool m_SpecCharPresent;
|
|
|
|
vec2 m_SpecChar;
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
2010-09-27 19:41:41 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CClientData m_aClients[MAX_CLIENTS];
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2015-05-19 22:51:02 +00:00
|
|
|
class CClientStats
|
|
|
|
{
|
2017-02-15 15:43:45 +00:00
|
|
|
int m_IngameTicks;
|
|
|
|
int m_JoinTick;
|
|
|
|
bool m_Active;
|
2019-03-02 10:50:33 +00:00
|
|
|
|
2017-02-15 15:43:45 +00:00
|
|
|
public:
|
|
|
|
CClientStats();
|
2015-05-19 22:51:02 +00:00
|
|
|
|
2017-02-15 15:43:45 +00:00
|
|
|
int m_aFragsWith[NUM_WEAPONS];
|
|
|
|
int m_aDeathsFrom[NUM_WEAPONS];
|
|
|
|
int m_Frags;
|
|
|
|
int m_Deaths;
|
|
|
|
int m_Suicides;
|
|
|
|
int m_BestSpree;
|
|
|
|
int m_CurrentSpree;
|
2015-05-19 22:51:02 +00:00
|
|
|
|
2017-02-15 15:43:45 +00:00
|
|
|
int m_FlagGrabs;
|
|
|
|
int m_FlagCaptures;
|
2015-05-19 22:51:02 +00:00
|
|
|
|
2017-02-15 15:43:45 +00:00
|
|
|
void Reset();
|
2019-03-02 10:50:33 +00:00
|
|
|
|
2017-02-15 15:43:45 +00:00
|
|
|
bool IsActive() const { return m_Active; }
|
|
|
|
void JoinGame(int Tick) { m_Active = true; m_JoinTick = Tick; };
|
|
|
|
void JoinSpec(int Tick) { m_Active = false; m_IngameTicks += Tick - m_JoinTick; };
|
|
|
|
int GetIngameTicks(int Tick) const { return m_IngameTicks + Tick - m_JoinTick; };
|
|
|
|
float GetFPM(int Tick, int TickSpeed) const { return (float)(m_Frags * TickSpeed * 60) / GetIngameTicks(Tick); };
|
2015-05-19 22:51:02 +00:00
|
|
|
};
|
|
|
|
|
2015-05-21 12:34:20 +00:00
|
|
|
CClientStats m_aStats[MAX_CLIENTS];
|
2015-05-19 22:51:02 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CRenderTools m_RenderTools;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void OnReset();
|
|
|
|
|
|
|
|
// hooks
|
|
|
|
virtual void OnConnected();
|
|
|
|
virtual void OnRender();
|
2016-04-29 21:05:20 +00:00
|
|
|
virtual void OnUpdate();
|
2014-04-28 14:47:44 +00:00
|
|
|
virtual void OnDummyDisconnect();
|
2010-09-12 10:43:03 +00:00
|
|
|
virtual void OnRelease();
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual void OnInit();
|
|
|
|
virtual void OnConsoleInit();
|
|
|
|
virtual void OnStateChange(int NewState, int OldState);
|
2014-05-03 00:30:05 +00:00
|
|
|
virtual void OnMessage(int MsgId, CUnpacker *pUnpacker, bool IsDummy = 0);
|
2020-07-12 15:32:56 +00:00
|
|
|
virtual void InvalidateSnapshot();
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual void OnNewSnapshot();
|
|
|
|
virtual void OnPredict();
|
2011-01-17 11:28:37 +00:00
|
|
|
virtual void OnActivateEditor();
|
2017-02-28 09:08:14 +00:00
|
|
|
virtual void OnDummySwap();
|
|
|
|
virtual int OnSnapInput(int *pData, bool Dummy, bool Force);
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual void OnShutdown();
|
|
|
|
virtual void OnEnterGame();
|
2017-07-24 19:43:55 +00:00
|
|
|
virtual void OnRconType(bool UsernameReq);
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual void OnRconLine(const char *pLine);
|
2010-12-12 15:48:13 +00:00
|
|
|
virtual void OnGameOver();
|
2011-01-06 22:21:51 +00:00
|
|
|
virtual void OnStartGame();
|
2015-05-20 20:23:58 +00:00
|
|
|
virtual void OnFlagGrab(int TeamID);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2018-03-21 14:54:51 +00:00
|
|
|
void OnWindowResize();
|
|
|
|
static void OnWindowResizeCB(void *pUser);
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual const char *GetItemName(int Type);
|
|
|
|
virtual const char *Version();
|
|
|
|
virtual const char *NetVersion();
|
2020-05-22 15:58:41 +00:00
|
|
|
virtual int DDNetVersion();
|
|
|
|
virtual const char *DDNetVersionStr();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// actions
|
|
|
|
// TODO: move these
|
|
|
|
void SendSwitchTeam(int Team);
|
|
|
|
void SendInfo(bool Start);
|
2014-04-28 13:19:57 +00:00
|
|
|
virtual void SendDummyInfo(bool Start);
|
2011-02-12 10:40:36 +00:00
|
|
|
void SendKill(int ClientID);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// pointers to all systems
|
2020-09-18 16:45:42 +00:00
|
|
|
class CMenuBackground *m_pMenuBackground;
|
2010-05-29 07:25:38 +00:00
|
|
|
class CGameConsole *m_pGameConsole;
|
|
|
|
class CBinds *m_pBinds;
|
|
|
|
class CParticles *m_pParticles;
|
|
|
|
class CMenus *m_pMenus;
|
|
|
|
class CSkins *m_pSkins;
|
2011-03-16 11:09:22 +00:00
|
|
|
class CCountryFlags *m_pCountryFlags;
|
2010-05-29 07:25:38 +00:00
|
|
|
class CFlow *m_pFlow;
|
|
|
|
class CChat *m_pChat;
|
|
|
|
class CDamageInd *m_pDamageind;
|
|
|
|
class CCamera *m_pCamera;
|
|
|
|
class CControls *m_pControls;
|
|
|
|
class CEffects *m_pEffects;
|
|
|
|
class CSounds *m_pSounds;
|
|
|
|
class CMotd *m_pMotd;
|
|
|
|
class CMapImages *m_pMapimages;
|
|
|
|
class CVoting *m_pVoting;
|
2010-08-18 01:57:35 +00:00
|
|
|
class CScoreboard *m_pScoreboard;
|
2015-05-21 09:41:59 +00:00
|
|
|
class CStatboard *m_pStatboard;
|
2011-04-03 08:11:23 +00:00
|
|
|
class CItems *m_pItems;
|
2011-12-04 13:04:12 +00:00
|
|
|
class CMapLayers *m_pMapLayersBackGround;
|
|
|
|
class CMapLayers *m_pMapLayersForeGround;
|
2015-08-25 00:11:04 +00:00
|
|
|
class CBackground *m_pBackGround;
|
2011-04-09 06:41:31 +00:00
|
|
|
|
2014-10-10 17:10:57 +00:00
|
|
|
class CMapSounds *m_pMapSounds;
|
2017-09-09 22:57:32 +00:00
|
|
|
class CPlayers *m_pPlayers;
|
2014-10-10 17:10:57 +00:00
|
|
|
|
2011-04-09 06:41:31 +00:00
|
|
|
// DDRace
|
2011-02-04 17:25:04 +00:00
|
|
|
|
2017-02-28 09:08:14 +00:00
|
|
|
int m_LocalIDs[2];
|
|
|
|
CNetObj_PlayerInput m_DummyInput;
|
|
|
|
CNetObj_PlayerInput m_HammerInput;
|
|
|
|
int m_DummyFire;
|
2020-09-05 08:44:50 +00:00
|
|
|
bool m_ReceivedDDNetPlayer;
|
2017-02-28 09:08:14 +00:00
|
|
|
|
2011-02-04 17:25:04 +00:00
|
|
|
class CRaceDemo *m_pRaceDemo;
|
|
|
|
class CGhost *m_pGhost;
|
2014-01-21 23:08:30 +00:00
|
|
|
class CTeamsCore m_Teams;
|
2011-04-09 06:41:31 +00:00
|
|
|
|
2014-01-30 03:10:52 +00:00
|
|
|
int IntersectCharacter(vec2 Pos0, vec2 Pos1, vec2& NewPos, int ownID);
|
2013-08-23 23:50:35 +00:00
|
|
|
|
2019-03-25 19:02:50 +00:00
|
|
|
virtual int GetLastRaceTick();
|
|
|
|
|
2016-05-05 16:57:35 +00:00
|
|
|
bool AntiPingPlayers() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingPlayers && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK && (m_Tuning[g_Config.m_ClDummy].m_PlayerCollision || m_Tuning[g_Config.m_ClDummy].m_PlayerHooking); }
|
2016-04-23 23:57:01 +00:00
|
|
|
bool AntiPingGrenade() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingGrenade && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK; }
|
|
|
|
bool AntiPingWeapons() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingWeapons && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK; }
|
2019-06-19 00:12:57 +00:00
|
|
|
bool AntiPingGunfire() { return AntiPingGrenade() && AntiPingWeapons() && g_Config.m_ClAntiPingGunfire; }
|
2019-04-11 22:46:54 +00:00
|
|
|
bool Predict() { return g_Config.m_ClPredict && !(m_Snap.m_pGameInfoObj && m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER) && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK && m_Snap.m_pLocalCharacter; }
|
2020-04-18 21:28:06 +00:00
|
|
|
bool PredictDummy() { return g_Config.m_ClPredictDummy && Client()->DummyConnected() && m_Snap.m_LocalClientID >= 0 && m_PredictedDummyID >= 0; }
|
2019-04-11 22:46:54 +00:00
|
|
|
|
2019-04-13 22:54:29 +00:00
|
|
|
CGameWorld m_GameWorld;
|
|
|
|
CGameWorld m_PredictedWorld;
|
|
|
|
CGameWorld m_PrevPredictedWorld;
|
|
|
|
|
2019-06-05 17:17:55 +00:00
|
|
|
void Echo(const char *pString);
|
2019-07-16 20:06:57 +00:00
|
|
|
bool IsOtherTeam(int ClientID);
|
2019-06-05 17:17:55 +00:00
|
|
|
|
2019-04-13 22:54:29 +00:00
|
|
|
private:
|
|
|
|
bool m_DDRaceMsgSent[2];
|
|
|
|
int m_ShowOthers[2];
|
|
|
|
|
2019-04-11 22:46:54 +00:00
|
|
|
void UpdatePrediction();
|
|
|
|
void UpdateRenderedCharacters();
|
|
|
|
void DetectStrongHook();
|
|
|
|
vec2 GetSmoothPos(int ClientID);
|
|
|
|
|
2020-04-18 20:16:25 +00:00
|
|
|
int m_PredictedDummyID;
|
|
|
|
int m_IsDummySwapping;
|
2019-04-11 22:46:54 +00:00
|
|
|
CCharOrder m_CharOrder;
|
|
|
|
class CCharacter m_aLastWorldCharacters[MAX_CLIENTS];
|
2019-09-08 22:53:07 +00:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
NUM_TUNEZONES = 256
|
|
|
|
};
|
|
|
|
void LoadMapSettings();
|
|
|
|
CTuningParams m_aTuningList[NUM_TUNEZONES];
|
2019-09-17 15:04:56 +00:00
|
|
|
CTuningParams *TuningList() { return m_aTuningList; }
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
|
2019-04-25 16:49:27 +00:00
|
|
|
ColorRGBA CalculateNameColor(ColorHSLA TextColorHSL);
|
2011-01-04 10:58:25 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
#endif
|