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 ENGINE_CLIENT_CLIENT_H
|
|
|
|
#define ENGINE_CLIENT_CLIENT_H
|
2009-10-29 12:14:31 +00:00
|
|
|
|
Make sure headers compile standalone
Not planning to do this automatically, but at least cleaning it up once
provides some benefit. Every header should include what it uses.
$ for i in src/**/*.h; do j=${i#"src/"}; echo $j; echo "#include <$j>\nint main() { return 0; }" | /usr/bin/c++ -DCONF_OPENSSL -DCONF_SQL -DCONF_VIDEORECORDER -DCONF_WAVPACK_CLOSE_FILE -DCONF_WAVPACK_OPEN_FILE_INPUT_EX -DGAME_RELEASE_VERSION=\"15.0.5\" -DGLEW_STATIC -D_FORTIFY_SOURCE=2 -I/usr/include/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/usr/include/wavpack -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -Isrc -I/usr/include/mysql -I/home/deen/sys/include/ -O2 -g -DNDEBUG -fdiagnostics-color=always -fstack-protector-all -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -o /dev/null -x c++ -; done
Ignored: tuning.h, variables.h, config_common.h, mapitems_ex_types.h, mapbugs_list.h, protocol7.h, teehistorian_ex_chunks.h, protocol_ex_msgs.h, config.h, config_variables.h, external, keynames.h
2020-09-26 08:23:33 +00:00
|
|
|
#include <list>
|
2017-11-23 14:47:38 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2018-06-05 19:22:40 +00:00
|
|
|
#include <base/hash.h>
|
Make sure headers compile standalone
Not planning to do this automatically, but at least cleaning it up once
provides some benefit. Every header should include what it uses.
$ for i in src/**/*.h; do j=${i#"src/"}; echo $j; echo "#include <$j>\nint main() { return 0; }" | /usr/bin/c++ -DCONF_OPENSSL -DCONF_SQL -DCONF_VIDEORECORDER -DCONF_WAVPACK_CLOSE_FILE -DCONF_WAVPACK_OPEN_FILE_INPUT_EX -DGAME_RELEASE_VERSION=\"15.0.5\" -DGLEW_STATIC -D_FORTIFY_SOURCE=2 -I/usr/include/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/usr/include/wavpack -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -Isrc -I/usr/include/mysql -I/home/deen/sys/include/ -O2 -g -DNDEBUG -fdiagnostics-color=always -fstack-protector-all -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -o /dev/null -x c++ -; done
Ignored: tuning.h, variables.h, config_common.h, mapitems_ex_types.h, mapbugs_list.h, protocol7.h, teehistorian_ex_chunks.h, protocol_ex_msgs.h, config.h, config_variables.h, external, keynames.h
2020-09-26 08:23:33 +00:00
|
|
|
#include <engine/client.h>
|
2022-01-31 02:11:47 +00:00
|
|
|
#include <engine/client/checksum.h>
|
2020-09-10 18:14:47 +00:00
|
|
|
#include <engine/client/friends.h>
|
2020-10-10 21:01:57 +00:00
|
|
|
#include <engine/client/ghost.h>
|
Make sure headers compile standalone
Not planning to do this automatically, but at least cleaning it up once
provides some benefit. Every header should include what it uses.
$ for i in src/**/*.h; do j=${i#"src/"}; echo $j; echo "#include <$j>\nint main() { return 0; }" | /usr/bin/c++ -DCONF_OPENSSL -DCONF_SQL -DCONF_VIDEORECORDER -DCONF_WAVPACK_CLOSE_FILE -DCONF_WAVPACK_OPEN_FILE_INPUT_EX -DGAME_RELEASE_VERSION=\"15.0.5\" -DGLEW_STATIC -D_FORTIFY_SOURCE=2 -I/usr/include/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/usr/include/wavpack -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -Isrc -I/usr/include/mysql -I/home/deen/sys/include/ -O2 -g -DNDEBUG -fdiagnostics-color=always -fstack-protector-all -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -o /dev/null -x c++ -; done
Ignored: tuning.h, variables.h, config_common.h, mapitems_ex_types.h, mapbugs_list.h, protocol7.h, teehistorian_ex_chunks.h, protocol_ex_msgs.h, config.h, config_variables.h, external, keynames.h
2020-09-26 08:23:33 +00:00
|
|
|
#include <engine/client/serverbrowser.h>
|
2020-09-03 12:08:26 +00:00
|
|
|
#include <engine/client/updater.h>
|
Make sure headers compile standalone
Not planning to do this automatically, but at least cleaning it up once
provides some benefit. Every header should include what it uses.
$ for i in src/**/*.h; do j=${i#"src/"}; echo $j; echo "#include <$j>\nint main() { return 0; }" | /usr/bin/c++ -DCONF_OPENSSL -DCONF_SQL -DCONF_VIDEORECORDER -DCONF_WAVPACK_CLOSE_FILE -DCONF_WAVPACK_OPEN_FILE_INPUT_EX -DGAME_RELEASE_VERSION=\"15.0.5\" -DGLEW_STATIC -D_FORTIFY_SOURCE=2 -I/usr/include/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/usr/include/wavpack -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -Isrc -I/usr/include/mysql -I/home/deen/sys/include/ -O2 -g -DNDEBUG -fdiagnostics-color=always -fstack-protector-all -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -o /dev/null -x c++ -; done
Ignored: tuning.h, variables.h, config_common.h, mapitems_ex_types.h, mapbugs_list.h, protocol7.h, teehistorian_ex_chunks.h, protocol_ex_msgs.h, config.h, config_variables.h, external, keynames.h
2020-09-26 08:23:33 +00:00
|
|
|
#include <engine/editor.h>
|
|
|
|
#include <engine/engine.h>
|
|
|
|
#include <engine/graphics.h>
|
|
|
|
#include <engine/shared/config.h>
|
|
|
|
#include <engine/shared/demo.h>
|
|
|
|
#include <engine/shared/fifo.h>
|
2021-12-24 11:17:46 +00:00
|
|
|
#include <engine/shared/http.h>
|
Make sure headers compile standalone
Not planning to do this automatically, but at least cleaning it up once
provides some benefit. Every header should include what it uses.
$ for i in src/**/*.h; do j=${i#"src/"}; echo $j; echo "#include <$j>\nint main() { return 0; }" | /usr/bin/c++ -DCONF_OPENSSL -DCONF_SQL -DCONF_VIDEORECORDER -DCONF_WAVPACK_CLOSE_FILE -DCONF_WAVPACK_OPEN_FILE_INPUT_EX -DGAME_RELEASE_VERSION=\"15.0.5\" -DGLEW_STATIC -D_FORTIFY_SOURCE=2 -I/usr/include/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/usr/include/wavpack -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -Isrc -I/usr/include/mysql -I/home/deen/sys/include/ -O2 -g -DNDEBUG -fdiagnostics-color=always -fstack-protector-all -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -o /dev/null -x c++ -; done
Ignored: tuning.h, variables.h, config_common.h, mapitems_ex_types.h, mapbugs_list.h, protocol7.h, teehistorian_ex_chunks.h, protocol_ex_msgs.h, config.h, config_variables.h, external, keynames.h
2020-09-26 08:23:33 +00:00
|
|
|
#include <engine/shared/network.h>
|
2020-10-02 13:43:52 +00:00
|
|
|
#include <engine/warning.h>
|
2017-11-23 14:47:38 +00:00
|
|
|
|
2022-06-16 17:50:46 +00:00
|
|
|
class CDemoEdit;
|
|
|
|
class IDemoRecorder;
|
|
|
|
class CMsgPacker;
|
|
|
|
class CUnpacker;
|
|
|
|
class IConfigManager;
|
|
|
|
class IDiscord;
|
|
|
|
class IEngineInput;
|
|
|
|
class IEngineMap;
|
|
|
|
class IEngineSound;
|
|
|
|
class IFriends;
|
|
|
|
class ISteam;
|
|
|
|
class IStorage;
|
|
|
|
class IUpdater;
|
|
|
|
|
2022-11-29 17:14:38 +00:00
|
|
|
#define CONNECTLINK_DOUBLE_SLASH "ddnet://"
|
|
|
|
#define CONNECTLINK_NO_SLASH "ddnet:"
|
2018-12-13 18:57:32 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CGraph
|
2009-10-29 12:14:31 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-05-29 07:25:38 +00:00
|
|
|
enum
|
|
|
|
{
|
2020-09-26 19:41:58 +00:00
|
|
|
MAX_VALUES = 128,
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:23:50 +00:00
|
|
|
private:
|
2010-05-29 07:25:38 +00:00
|
|
|
float m_Min, m_Max;
|
2015-11-08 15:25:14 +00:00
|
|
|
float m_MinRange, m_MaxRange;
|
2010-05-29 07:25:38 +00:00
|
|
|
float m_aValues[MAX_VALUES];
|
|
|
|
float m_aColors[MAX_VALUES][3];
|
2022-08-12 12:10:40 +00:00
|
|
|
size_t m_Index;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-08-12 12:23:50 +00:00
|
|
|
public:
|
2010-05-29 07:25:38 +00:00
|
|
|
void Init(float Min, float Max);
|
2022-08-12 12:23:50 +00:00
|
|
|
void SetMin(float Min);
|
|
|
|
void SetMax(float Max);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-08-12 11:58:07 +00:00
|
|
|
void Scale();
|
2010-05-29 07:25:38 +00:00
|
|
|
void Add(float v, float r, float g, float b);
|
2022-08-12 12:10:40 +00:00
|
|
|
void InsertAt(size_t Index, float v, float r, float g, float b);
|
2012-08-12 10:41:50 +00:00
|
|
|
void Render(IGraphics *pGraphics, IGraphics::CTextureHandle FontTexture, float x, float y, float w, float h, const char *pDescription);
|
2009-10-29 12:14:31 +00:00
|
|
|
};
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CSmoothTime
|
2009-10-29 12:14:31 +00:00
|
|
|
{
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_Snap;
|
|
|
|
int64_t m_Current;
|
|
|
|
int64_t m_Target;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-01-09 12:06:41 +00:00
|
|
|
int64_t m_SnapMargin;
|
|
|
|
int64_t m_CurrentMargin;
|
|
|
|
int64_t m_TargetMargin;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CGraph m_Graph;
|
|
|
|
|
|
|
|
int m_SpikeCounter;
|
|
|
|
|
|
|
|
float m_aAdjustSpeed[2]; // 0 = down, 1 = up
|
2009-10-29 12:14:31 +00:00
|
|
|
public:
|
2021-06-23 05:05:49 +00:00
|
|
|
void Init(int64_t Target);
|
2010-05-29 07:25:38 +00:00
|
|
|
void SetAdjustSpeed(int Direction, float Value);
|
|
|
|
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t Get(int64_t Now);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2021-06-23 05:05:49 +00:00
|
|
|
void UpdateInt(int64_t Target);
|
|
|
|
void Update(CGraph *pGraph, int64_t Target, int TimeLeft, int AdjustDirection);
|
2022-01-09 12:06:41 +00:00
|
|
|
|
|
|
|
int64_t GetMargin(int64_t Now);
|
|
|
|
void UpdateMargin(int64_t TargetMargin);
|
2009-10-29 12:14:31 +00:00
|
|
|
};
|
|
|
|
|
2019-06-03 19:52:14 +00:00
|
|
|
class CServerCapabilities
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool m_ChatTimeoutCode;
|
2021-01-10 16:23:00 +00:00
|
|
|
bool m_AnyPlayerFlag;
|
2021-04-23 21:29:01 +00:00
|
|
|
bool m_PingEx;
|
2021-11-17 19:35:39 +00:00
|
|
|
bool m_AllowDummy;
|
2022-01-09 13:14:45 +00:00
|
|
|
bool m_SyncWeaponInput;
|
2019-06-03 19:52:14 +00:00
|
|
|
};
|
|
|
|
|
2016-04-27 15:05:30 +00:00
|
|
|
class CClient : public IClient, public CDemoPlayer::IListener
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
|
|
|
// needed interfaces
|
2011-02-27 14:03:57 +00:00
|
|
|
IEngine *m_pEngine;
|
2010-05-29 07:25:38 +00:00
|
|
|
IEditor *m_pEditor;
|
|
|
|
IEngineInput *m_pInput;
|
|
|
|
IEngineGraphics *m_pGraphics;
|
|
|
|
IEngineSound *m_pSound;
|
2022-05-23 18:16:18 +00:00
|
|
|
IFavorites *m_pFavorites;
|
2010-05-29 07:25:38 +00:00
|
|
|
IGameClient *m_pGameClient;
|
|
|
|
IEngineMap *m_pMap;
|
2021-01-10 12:47:07 +00:00
|
|
|
IConfigManager *m_pConfigManager;
|
|
|
|
CConfig *m_pConfig;
|
2010-05-29 07:25:38 +00:00
|
|
|
IConsole *m_pConsole;
|
|
|
|
IStorage *m_pStorage;
|
2015-04-18 19:17:27 +00:00
|
|
|
IUpdater *m_pUpdater;
|
2021-01-17 23:52:58 +00:00
|
|
|
IDiscord *m_pDiscord;
|
2020-08-20 10:17:44 +00:00
|
|
|
ISteam *m_pSteam;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-30 22:36:32 +00:00
|
|
|
CNetClient m_aNetClient[NUM_CONNS];
|
2022-06-16 17:50:46 +00:00
|
|
|
CDemoPlayer m_DemoPlayer;
|
2022-06-30 22:36:32 +00:00
|
|
|
CDemoRecorder m_aDemoRecorder[RECORDER_MAX];
|
2022-06-16 17:50:46 +00:00
|
|
|
CDemoEditor m_DemoEditor;
|
|
|
|
CGhostRecorder m_GhostRecorder;
|
|
|
|
CGhostLoader m_GhostLoader;
|
|
|
|
CServerBrowser m_ServerBrowser;
|
|
|
|
CUpdater m_Updater;
|
|
|
|
CFriends m_Friends;
|
|
|
|
CFriends m_Foes;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-01 10:09:22 +00:00
|
|
|
char m_aConnectAddressStr[MAX_SERVER_ADDRESSES * NETADDR_MAXSTRSIZE];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2020-05-22 15:58:41 +00:00
|
|
|
CUuid m_ConnectionID;
|
|
|
|
|
2022-05-15 19:59:17 +00:00
|
|
|
bool m_HaveGlobalTcpAddr = false;
|
|
|
|
NETADDR m_GlobalTcpAddr;
|
|
|
|
|
2022-06-30 22:36:32 +00:00
|
|
|
uint64_t m_aSnapshotParts[NUM_DUMMIES];
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_LocalStartTime;
|
2022-12-15 17:18:06 +00:00
|
|
|
int64_t m_GlobalStartTime;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2012-08-12 10:41:50 +00:00
|
|
|
IGraphics::CTextureHandle m_DebugFont;
|
2019-06-05 17:17:55 +00:00
|
|
|
int m_DebugSoundIndex = 0;
|
2015-07-09 00:08:14 +00:00
|
|
|
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_LastRenderTime;
|
2012-01-01 12:38:46 +00:00
|
|
|
float m_RenderFrameTimeLow;
|
|
|
|
float m_RenderFrameTimeHigh;
|
|
|
|
int m_RenderFrames;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_SnapCrcErrors;
|
2010-12-12 15:48:13 +00:00
|
|
|
bool m_AutoScreenshotRecycle;
|
2015-05-19 22:51:02 +00:00
|
|
|
bool m_AutoStatScreenshotRecycle;
|
2017-04-26 03:10:31 +00:00
|
|
|
bool m_AutoCSVRecycle;
|
2011-01-17 11:28:37 +00:00
|
|
|
bool m_EditorActive;
|
2011-01-17 12:28:15 +00:00
|
|
|
bool m_SoundInitFailed;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-30 22:36:32 +00:00
|
|
|
int m_aAckGameTick[NUM_DUMMIES];
|
|
|
|
int m_aCurrentRecvTick[NUM_DUMMIES];
|
|
|
|
int m_aRconAuthed[NUM_DUMMIES];
|
|
|
|
char m_aRconPassword[32];
|
2011-07-14 20:07:21 +00:00
|
|
|
int m_UseTempRconCommands;
|
2022-06-30 22:36:32 +00:00
|
|
|
char m_aPassword[32];
|
2018-06-15 23:44:24 +00:00
|
|
|
bool m_SendPassword;
|
2020-09-26 19:41:58 +00:00
|
|
|
bool m_ButtonRender = false;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// version-checking
|
|
|
|
char m_aVersionStr[10];
|
|
|
|
|
|
|
|
// pinging
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_PingStartTime;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2021-09-13 08:06:34 +00:00
|
|
|
char m_aCurrentMap[IO_MAX_PATH_LENGTH];
|
|
|
|
char m_aCurrentMapPath[IO_MAX_PATH_LENGTH];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2020-10-18 14:51:26 +00:00
|
|
|
char m_aTimeoutCodes[NUM_DUMMIES][32];
|
2022-06-30 22:36:32 +00:00
|
|
|
bool m_aCodeRunAfterJoin[NUM_DUMMIES];
|
2016-10-02 09:31:11 +00:00
|
|
|
bool m_GenerateTimeoutSeed;
|
2014-08-17 17:19:40 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//
|
|
|
|
char m_aCmdConnect[256];
|
2021-09-13 08:06:34 +00:00
|
|
|
char m_aCmdPlayDemo[IO_MAX_PATH_LENGTH];
|
|
|
|
char m_aCmdEditMap[IO_MAX_PATH_LENGTH];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// map download
|
2022-05-05 12:49:25 +00:00
|
|
|
std::shared_ptr<CHttpRequest> m_pMapdownloadTask;
|
2010-05-29 07:25:38 +00:00
|
|
|
char m_aMapdownloadFilename[256];
|
2020-04-14 10:00:20 +00:00
|
|
|
char m_aMapdownloadFilenameTemp[256];
|
2010-05-29 07:25:38 +00:00
|
|
|
char m_aMapdownloadName[256];
|
2020-04-14 10:00:20 +00:00
|
|
|
IOHANDLE m_MapdownloadFileTemp;
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_MapdownloadChunk;
|
|
|
|
int m_MapdownloadCrc;
|
|
|
|
int m_MapdownloadAmount;
|
|
|
|
int m_MapdownloadTotalsize;
|
2018-06-05 19:22:40 +00:00
|
|
|
bool m_MapdownloadSha256Present;
|
|
|
|
SHA256_DIGEST m_MapdownloadSha256;
|
|
|
|
|
|
|
|
bool m_MapDetailsPresent;
|
|
|
|
char m_aMapDetailsName[256];
|
|
|
|
int m_MapDetailsCrc;
|
|
|
|
SHA256_DIGEST m_MapDetailsSha256;
|
2022-09-11 22:43:57 +00:00
|
|
|
char m_aMapDetailsUrl[256];
|
2017-09-03 15:36:51 +00:00
|
|
|
|
2020-02-12 21:39:37 +00:00
|
|
|
char m_aDDNetInfoTmp[64];
|
2022-05-05 12:49:25 +00:00
|
|
|
std::shared_ptr<CHttpRequest> m_pDDNetInfoTask;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// time
|
2022-06-30 22:36:32 +00:00
|
|
|
CSmoothTime m_aGameTime[NUM_DUMMIES];
|
2014-05-03 21:28:48 +00:00
|
|
|
CSmoothTime m_PredictedTime;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// input
|
|
|
|
struct // TODO: handle input better
|
|
|
|
{
|
|
|
|
int m_aData[MAX_INPUT_SIZE]; // the input data
|
|
|
|
int m_Tick; // the tick that the input is for
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_PredictedTime; // prediction latency when we sent this input
|
2022-01-09 12:06:41 +00:00
|
|
|
int64_t m_PredictionMargin; // prediction margin when we sent this input
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_Time;
|
2020-10-18 14:51:26 +00:00
|
|
|
} m_aInputs[NUM_DUMMIES][200];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-30 22:36:32 +00:00
|
|
|
int m_aCurrentInput[NUM_DUMMIES];
|
2014-04-28 18:43:08 +00:00
|
|
|
bool m_LastDummy;
|
2017-02-28 09:08:14 +00:00
|
|
|
bool m_DummySendConnInfo;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// graphs
|
|
|
|
CGraph m_InputtimeMarginGraph;
|
|
|
|
CGraph m_GametimeMarginGraph;
|
|
|
|
CGraph m_FpsGraph;
|
|
|
|
|
|
|
|
// the game snapshots are modifiable by the game
|
2022-06-30 22:36:32 +00:00
|
|
|
CSnapshotStorage m_aSnapshotStorage[NUM_DUMMIES];
|
|
|
|
CSnapshotStorage::CHolder *m_aapSnapshots[NUM_DUMMIES][NUM_SNAPSHOT_TYPES];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-30 22:36:32 +00:00
|
|
|
int m_aReceivedSnapshots[NUM_DUMMIES];
|
|
|
|
char m_aaSnapshotIncomingData[NUM_DUMMIES][CSnapshot::MAX_SIZE];
|
|
|
|
int m_aSnapshotIncomingDataSize[NUM_DUMMIES];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-16 17:50:46 +00:00
|
|
|
CSnapshotStorage::CHolder m_aDemorecSnapshotHolders[NUM_SNAPSHOT_TYPES];
|
2022-11-12 19:12:24 +00:00
|
|
|
char m_aaaDemorecSnapshotData[NUM_SNAPSHOT_TYPES][2][CSnapshot::MAX_SIZE];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-16 17:50:46 +00:00
|
|
|
CSnapshotDelta m_SnapshotDelta;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-30 22:36:32 +00:00
|
|
|
std::list<std::shared_ptr<CDemoEdit>> m_lpEditJobs;
|
2019-05-28 11:24:55 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//
|
2019-06-13 22:24:50 +00:00
|
|
|
bool m_CanReceiveServerCapabilities;
|
2019-06-03 19:52:14 +00:00
|
|
|
bool m_ServerSentCapabilities;
|
|
|
|
CServerCapabilities m_ServerCapabilities;
|
|
|
|
|
2022-06-16 17:50:46 +00:00
|
|
|
CServerInfo m_CurrentServerInfo;
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_CurrentServerInfoRequestTime; // >= 0 should request, == -1 got info
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2021-04-23 21:12:16 +00:00
|
|
|
int m_CurrentServerPingInfoType;
|
|
|
|
int m_CurrentServerPingBasicToken;
|
|
|
|
int m_CurrentServerPingToken;
|
2021-04-24 12:23:35 +00:00
|
|
|
CUuid m_CurrentServerPingUuid;
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_CurrentServerCurrentPingTime; // >= 0 request running
|
|
|
|
int64_t m_CurrentServerNextPingTime; // >= 0 should request
|
2021-04-23 21:12:16 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// version info
|
2011-03-17 16:41:57 +00:00
|
|
|
struct CVersionInfo
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2011-03-17 16:41:57 +00:00
|
|
|
enum
|
|
|
|
{
|
2020-09-26 19:41:58 +00:00
|
|
|
STATE_INIT = 0,
|
2011-03-17 16:41:57 +00:00
|
|
|
STATE_START,
|
|
|
|
STATE_READY,
|
|
|
|
};
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_State;
|
2011-02-27 14:03:57 +00:00
|
|
|
class CHostLookup m_VersionServeraddr;
|
2010-05-29 07:25:38 +00:00
|
|
|
} m_VersionInfo;
|
2011-02-27 14:03:57 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
static void GraphicsThreadProxy(void *pThis) { ((CClient *)pThis)->GraphicsThread(); }
|
2011-12-30 15:02:22 +00:00
|
|
|
void GraphicsThread();
|
|
|
|
|
2022-06-11 19:38:18 +00:00
|
|
|
std::vector<SWarning> m_vWarnings;
|
2020-10-02 13:43:52 +00:00
|
|
|
|
2016-05-02 21:36:21 +00:00
|
|
|
#if defined(CONF_FAMILY_UNIX)
|
|
|
|
CFifo m_Fifo;
|
|
|
|
#endif
|
|
|
|
|
2020-11-19 15:15:07 +00:00
|
|
|
IOHANDLE m_BenchmarkFile;
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_BenchmarkStopTime;
|
2020-11-19 15:15:07 +00:00
|
|
|
|
2022-01-31 02:11:47 +00:00
|
|
|
CChecksum m_Checksum;
|
|
|
|
int m_OwnExecutableSize = 0;
|
|
|
|
IOHANDLE m_OwnExecutable;
|
|
|
|
|
2022-05-23 18:16:18 +00:00
|
|
|
// favorite command handling
|
|
|
|
bool m_FavoritesGroup = false;
|
|
|
|
bool m_FavoritesGroupAllowPing = false;
|
|
|
|
int m_FavoritesGroupNum = 0;
|
|
|
|
NETADDR m_aFavoritesGroupAddresses[MAX_SERVER_ADDRESSES];
|
|
|
|
|
2021-07-19 18:14:12 +00:00
|
|
|
void UpdateDemoIntraTimers();
|
2022-01-09 12:06:41 +00:00
|
|
|
int MaxLatencyTicks() const;
|
2022-01-09 13:14:45 +00:00
|
|
|
int PredictionMargin() const;
|
2021-07-19 18:14:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
public:
|
2011-02-27 14:03:57 +00:00
|
|
|
IEngine *Engine() { return m_pEngine; }
|
2010-05-29 07:25:38 +00:00
|
|
|
IEngineGraphics *Graphics() { return m_pGraphics; }
|
|
|
|
IEngineInput *Input() { return m_pInput; }
|
|
|
|
IEngineSound *Sound() { return m_pSound; }
|
|
|
|
IGameClient *GameClient() { return m_pGameClient; }
|
2021-01-10 12:47:07 +00:00
|
|
|
IConfigManager *ConfigManager() { return m_pConfigManager; }
|
|
|
|
CConfig *Config() { return m_pConfig; }
|
2010-05-29 07:25:38 +00:00
|
|
|
IStorage *Storage() { return m_pStorage; }
|
2015-04-18 19:17:27 +00:00
|
|
|
IUpdater *Updater() { return m_pUpdater; }
|
2021-01-17 23:52:58 +00:00
|
|
|
IDiscord *Discord() { return m_pDiscord; }
|
2020-08-20 10:17:44 +00:00
|
|
|
ISteam *Steam() { return m_pSteam; }
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
CClient();
|
|
|
|
|
|
|
|
// ----- send functions -----
|
2022-05-17 20:13:44 +00:00
|
|
|
int SendMsg(int Conn, CMsgPacker *pMsg, int Flags) override;
|
2022-01-21 00:54:14 +00:00
|
|
|
// Send via the currently active client (main/dummy)
|
2022-05-17 20:13:44 +00:00
|
|
|
int SendMsgActive(CMsgPacker *pMsg, int Flags) override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
void SendInfo();
|
2022-01-21 21:13:35 +00:00
|
|
|
void SendEnterGame(int Conn);
|
2010-05-29 07:25:38 +00:00
|
|
|
void SendReady();
|
2014-10-29 12:37:38 +00:00
|
|
|
void SendMapRequest();
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-30 22:36:32 +00:00
|
|
|
bool RconAuthed() const override { return m_aRconAuthed[g_Config.m_ClDummy] != 0; }
|
2022-05-17 20:13:44 +00:00
|
|
|
bool UseTempRconCommands() const override { return m_UseTempRconCommands != 0; }
|
|
|
|
void RconAuth(const char *pName, const char *pPassword) override;
|
|
|
|
void Rcon(const char *pCmd) override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
bool ConnectionProblems() const override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
bool SoundInitFailed() const override { return m_SoundInitFailed; }
|
2011-01-17 12:28:15 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
IGraphics::CTextureHandle GetDebugFont() const override { return m_DebugFont; }
|
2011-02-18 10:41:27 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void DirectInput(int *pInput, int Size);
|
|
|
|
void SendInput();
|
|
|
|
|
2018-02-04 15:00:47 +00:00
|
|
|
// TODO: OPT: do this a lot smarter!
|
2022-05-17 20:13:44 +00:00
|
|
|
int *GetInput(int Tick, int IsDummy) const override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
const char *LatestVersion() const override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// ------ state handling -----
|
2022-06-23 17:59:38 +00:00
|
|
|
void SetState(EClientState s);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// called when the map is loaded and we should init for a new round
|
2021-12-20 22:17:09 +00:00
|
|
|
void OnEnterGame(bool Dummy);
|
2022-05-17 20:13:44 +00:00
|
|
|
void EnterGame(int Conn) override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-13 16:28:13 +00:00
|
|
|
void Connect(const char *pAddress, const char *pPassword = nullptr) override;
|
2010-05-29 07:25:38 +00:00
|
|
|
void DisconnectWithReason(const char *pReason);
|
2022-05-17 20:13:44 +00:00
|
|
|
void Disconnect() override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void DummyDisconnect(const char *pReason) override;
|
|
|
|
void DummyConnect() override;
|
|
|
|
bool DummyConnected() override;
|
|
|
|
bool DummyConnecting() override;
|
|
|
|
bool DummyAllowed() override;
|
2014-04-26 18:29:42 +00:00
|
|
|
int m_DummyConnected;
|
|
|
|
int m_LastDummyConnectTime;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void GetServerInfo(CServerInfo *pServerInfo) const override;
|
2010-05-29 07:25:38 +00:00
|
|
|
void ServerInfoRequest();
|
|
|
|
|
|
|
|
int LoadData();
|
|
|
|
|
|
|
|
// ---
|
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
int GetPredictionTime() override;
|
|
|
|
void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem) const override;
|
|
|
|
int SnapItemSize(int SnapID, int Index) const override;
|
2022-10-09 10:59:30 +00:00
|
|
|
const void *SnapFindItem(int SnapID, int Type, int ID) const override;
|
2022-05-17 20:13:44 +00:00
|
|
|
int SnapNumItems(int SnapID) const override;
|
|
|
|
void SnapSetStaticsize(int ItemType, int Size) override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
void Render();
|
|
|
|
void DebugRender();
|
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void Restart() override;
|
|
|
|
void Quit() override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
const char *PlayerName() const override;
|
|
|
|
const char *DummyName() const override;
|
|
|
|
const char *ErrorString() const override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2018-06-05 19:22:40 +00:00
|
|
|
const char *LoadMap(const char *pName, const char *pFilename, SHA256_DIGEST *pWantedSha256, unsigned WantedCrc);
|
|
|
|
const char *LoadMapSearch(const char *pMapName, SHA256_DIGEST *pWantedSha256, int WantedCrc);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2011-03-17 16:41:57 +00:00
|
|
|
void ProcessConnlessPacket(CNetChunk *pPacket);
|
2017-03-29 10:56:13 +00:00
|
|
|
void ProcessServerInfo(int Type, NETADDR *pFrom, const void *pData, int DataSize);
|
2022-01-21 21:13:35 +00:00
|
|
|
void ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-22 21:46:25 +00:00
|
|
|
int UnpackAndValidateSnapshot(CSnapshot *pFrom, CSnapshot *pTo);
|
|
|
|
|
2014-10-29 12:37:38 +00:00
|
|
|
void ResetMapDownload();
|
|
|
|
void FinishMapDownload();
|
2017-09-03 15:36:51 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void RequestDDNetInfo() override;
|
2017-09-03 15:36:51 +00:00
|
|
|
void ResetDDNetInfo();
|
2020-09-09 15:49:29 +00:00
|
|
|
bool IsDDNetInfoChanged();
|
2017-09-03 15:36:51 +00:00
|
|
|
void FinishDDNetInfo();
|
|
|
|
void LoadDDNetInfo();
|
2014-10-29 12:37:38 +00:00
|
|
|
|
2022-06-01 10:09:22 +00:00
|
|
|
const NETADDR &ServerAddress() const override { return *m_aNetClient[CONN_MAIN].ServerAddress(); }
|
|
|
|
int ConnectNetTypes() const override;
|
2022-05-14 17:30:26 +00:00
|
|
|
const char *ConnectAddressString() const override { return m_aConnectAddressStr; }
|
2022-05-17 20:13:44 +00:00
|
|
|
const char *MapDownloadName() const override { return m_aMapdownloadName; }
|
|
|
|
int MapDownloadAmount() const override { return !m_pMapdownloadTask ? m_MapdownloadAmount : (int)m_pMapdownloadTask->Current(); }
|
|
|
|
int MapDownloadTotalsize() const override { return !m_pMapdownloadTask ? m_MapdownloadTotalsize : (int)m_pMapdownloadTask->Size(); }
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
void PumpNetwork();
|
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void OnDemoPlayerSnapshot(void *pData, int Size) override;
|
|
|
|
void OnDemoPlayerMessage(void *pData, int Size) override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
void Update();
|
|
|
|
|
|
|
|
void RegisterInterfaces();
|
|
|
|
void InitInterfaces();
|
|
|
|
|
|
|
|
void Run();
|
|
|
|
|
2014-01-31 00:41:57 +00:00
|
|
|
bool CtrlShiftKey(int Key, bool &Last);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2011-08-13 00:11:06 +00:00
|
|
|
static void Con_Connect(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_Disconnect(IConsole::IResult *pResult, void *pUserData);
|
2014-04-26 18:29:42 +00:00
|
|
|
|
|
|
|
static void Con_DummyConnect(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_DummyDisconnect(IConsole::IResult *pResult, void *pUserData);
|
2021-03-17 15:09:39 +00:00
|
|
|
static void Con_DummyResetInput(IConsole::IResult *pResult, void *pUserData);
|
2014-04-26 18:29:42 +00:00
|
|
|
|
2011-08-13 00:11:06 +00:00
|
|
|
static void Con_Quit(IConsole::IResult *pResult, void *pUserData);
|
2015-08-12 12:26:48 +00:00
|
|
|
static void Con_DemoPlay(IConsole::IResult *pResult, void *pUserData);
|
2016-04-27 15:21:40 +00:00
|
|
|
static void Con_DemoSpeed(IConsole::IResult *pResult, void *pUserData);
|
2011-08-13 00:11:06 +00:00
|
|
|
static void Con_Minimize(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_Ping(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_Screenshot(IConsole::IResult *pResult, void *pUserData);
|
2021-12-27 00:13:09 +00:00
|
|
|
static void Con_Reset(IConsole::IResult *pResult, void *pUserData);
|
2016-08-27 19:10:27 +00:00
|
|
|
|
|
|
|
#if defined(CONF_VIDEORECORDER)
|
2022-03-01 22:52:46 +00:00
|
|
|
static void StartVideo(IConsole::IResult *pResult, void *pUserData, const char *pVideoName);
|
2016-08-27 15:51:23 +00:00
|
|
|
static void Con_StartVideo(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_StopVideo(IConsole::IResult *pResult, void *pUserData);
|
2022-05-17 20:13:44 +00:00
|
|
|
const char *DemoPlayer_Render(const char *pFilename, int StorageType, const char *pVideoName, int SpeedIndex) override;
|
2016-08-27 19:10:27 +00:00
|
|
|
#endif
|
|
|
|
|
2011-08-13 00:11:06 +00:00
|
|
|
static void Con_Rcon(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_RconAuth(IConsole::IResult *pResult, void *pUserData);
|
2017-03-06 09:31:05 +00:00
|
|
|
static void Con_RconLogin(IConsole::IResult *pResult, void *pUserData);
|
2022-05-23 18:16:18 +00:00
|
|
|
static void Con_BeginFavoriteGroup(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_EndFavoriteGroup(IConsole::IResult *pResult, void *pUserData);
|
2011-08-13 00:11:06 +00:00
|
|
|
static void Con_AddFavorite(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_RemoveFavorite(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_Play(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_Record(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void Con_StopRecord(IConsole::IResult *pResult, void *pUserData);
|
2012-01-10 22:13:19 +00:00
|
|
|
static void Con_AddDemoMarker(IConsole::IResult *pResult, void *pUserData);
|
2020-11-19 15:15:07 +00:00
|
|
|
static void Con_BenchmarkQuit(IConsole::IResult *pResult, void *pUserData);
|
2011-03-18 18:03:13 +00:00
|
|
|
static void ConchainServerBrowserUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2016-04-29 22:34:12 +00:00
|
|
|
static void ConchainFullscreen(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
|
|
|
static void ConchainWindowBordered(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
|
|
|
static void ConchainWindowScreen(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
|
|
|
static void ConchainWindowVSync(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2016-10-02 09:31:11 +00:00
|
|
|
static void ConchainTimeoutSeed(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2022-06-13 20:33:39 +00:00
|
|
|
static void ConchainLoglevel(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2018-06-20 06:36:10 +00:00
|
|
|
static void ConchainPassword(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2019-06-05 17:17:55 +00:00
|
|
|
static void ConchainReplays(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2019-04-21 16:20:53 +00:00
|
|
|
|
2014-08-12 14:21:06 +00:00
|
|
|
static void Con_DemoSlice(IConsole::IResult *pResult, void *pUserData);
|
2014-08-13 14:35:15 +00:00
|
|
|
static void Con_DemoSliceBegin(IConsole::IResult *pResult, void *pUserData);
|
2014-08-12 14:21:06 +00:00
|
|
|
static void Con_DemoSliceEnd(IConsole::IResult *pResult, void *pUserData);
|
2019-05-20 21:55:40 +00:00
|
|
|
static void Con_SaveReplay(IConsole::IResult *pResult, void *pUserData);
|
2014-08-12 14:21:06 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void RegisterCommands();
|
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
const char *DemoPlayer_Play(const char *pFilename, int StorageType) override;
|
|
|
|
void DemoRecorder_Start(const char *pFilename, bool WithTimestamp, int Recorder) override;
|
|
|
|
void DemoRecorder_HandleAutoStart() override;
|
2019-05-21 15:21:53 +00:00
|
|
|
void DemoRecorder_StartReplayRecorder();
|
2022-05-17 20:13:44 +00:00
|
|
|
void DemoRecorder_Stop(int Recorder, bool RemoveFile = false) override;
|
2014-10-16 15:42:13 +00:00
|
|
|
void DemoRecorder_AddDemoMarker(int Recorder);
|
2022-06-16 17:50:46 +00:00
|
|
|
IDemoRecorder *DemoRecorder(int Recorder) override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void AutoScreenshot_Start() override;
|
|
|
|
void AutoStatScreenshot_Start() override;
|
2010-12-12 15:48:13 +00:00
|
|
|
void AutoScreenshot_Cleanup();
|
2015-05-19 22:51:02 +00:00
|
|
|
void AutoStatScreenshot_Cleanup();
|
2010-12-12 15:48:13 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void AutoCSV_Start() override;
|
2017-04-26 03:10:31 +00:00
|
|
|
void AutoCSV_Cleanup();
|
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void ServerBrowserUpdate() override;
|
2011-02-13 05:35:13 +00:00
|
|
|
|
2020-09-06 11:37:48 +00:00
|
|
|
void HandleConnectAddress(const NETADDR *pAddr);
|
2018-12-13 18:57:32 +00:00
|
|
|
void HandleConnectLink(const char *pLink);
|
2019-04-10 06:56:20 +00:00
|
|
|
void HandleDemoPath(const char *pPath);
|
2020-08-02 11:00:01 +00:00
|
|
|
void HandleMapPath(const char *pPath);
|
2018-12-13 18:57:32 +00:00
|
|
|
|
2022-01-31 02:11:47 +00:00
|
|
|
virtual void InitChecksum();
|
|
|
|
virtual int HandleChecksum(int Conn, CUuid Uuid, CUnpacker *pUnpacker);
|
|
|
|
|
2016-04-29 22:34:12 +00:00
|
|
|
// gfx
|
2022-05-17 20:13:44 +00:00
|
|
|
void SwitchWindowScreen(int Index) override;
|
|
|
|
void SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing) override;
|
|
|
|
void ToggleWindowVSync() override;
|
|
|
|
void LoadFont() override;
|
|
|
|
void Notify(const char *pTitle, const char *pMessage) override;
|
2020-11-19 15:15:07 +00:00
|
|
|
void BenchmarkQuit(int Seconds, const char *pFilename);
|
2016-04-29 22:34:12 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void UpdateAndSwap() override;
|
2022-04-02 11:37:59 +00:00
|
|
|
|
2011-02-13 05:35:13 +00:00
|
|
|
// DDRace
|
2011-04-09 06:41:31 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void GenerateTimeoutSeed() override;
|
2022-06-01 10:09:22 +00:00
|
|
|
void GenerateTimeoutCodes(const NETADDR *pAddrs, int NumAddrs);
|
2016-10-02 09:31:11 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
int GetCurrentRaceTime() override;
|
2019-03-25 19:02:50 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
const char *GetCurrentMap() const override;
|
|
|
|
const char *GetCurrentMapPath() const override;
|
|
|
|
SHA256_DIGEST GetCurrentMapSha256() const override;
|
|
|
|
unsigned GetCurrentMapCrc() const override;
|
2017-09-09 21:10:42 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void RaceRecord_Start(const char *pFilename) override;
|
|
|
|
void RaceRecord_Stop() override;
|
|
|
|
bool RaceRecord_IsRecording() override;
|
2014-08-13 14:35:15 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void DemoSliceBegin() override;
|
|
|
|
void DemoSliceEnd() override;
|
|
|
|
void DemoSlice(const char *pDstPath, CLIENTFUNC_FILTER pfnFilter, void *pUser) override;
|
2022-03-14 04:56:44 +00:00
|
|
|
virtual void SaveReplay(int Length, const char *pFilename = "");
|
2014-09-19 22:36:22 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
bool EditorHasUnsavedData() const override { return m_pEditor->HasUnsavedData(); }
|
2015-07-22 20:16:49 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
IFriends *Foes() override { return &m_Foes; }
|
2019-04-11 22:46:54 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void GetSmoothTick(int *pSmoothTick, float *pSmoothIntraTick, float MixAmount) override;
|
2020-10-02 13:43:52 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
SWarning *GetCurWarning() override;
|
|
|
|
CChecksumData *ChecksumData() override { return &m_Checksum.m_Data; }
|
|
|
|
bool InfoTaskRunning() override { return m_pDDNetInfoTask != nullptr; }
|
2022-05-15 19:59:17 +00:00
|
|
|
int UdpConnectivity(int NetType) override;
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
2019-05-24 22:24:13 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
#endif
|