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_SERVER_SERVER_H
|
|
|
|
#define ENGINE_SERVER_SERVER_H
|
|
|
|
|
2016-09-05 09:38:11 +00:00
|
|
|
#include <engine/engine.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <engine/server.h>
|
|
|
|
|
2010-07-29 05:21:18 +00:00
|
|
|
#include <engine/map.h>
|
2010-09-13 04:49:01 +00:00
|
|
|
#include <engine/shared/demo.h>
|
2010-07-29 05:21:18 +00:00
|
|
|
#include <engine/shared/protocol.h>
|
|
|
|
#include <engine/shared/snapshot.h>
|
|
|
|
#include <engine/shared/network.h>
|
|
|
|
#include <engine/server/register.h>
|
|
|
|
#include <engine/shared/console.h>
|
2010-10-16 20:28:54 +00:00
|
|
|
#include <base/math.h>
|
2011-08-13 00:11:06 +00:00
|
|
|
#include <engine/shared/econ.h>
|
2016-05-02 21:36:21 +00:00
|
|
|
#include <engine/shared/fifo.h>
|
2011-12-31 22:00:00 +00:00
|
|
|
#include <engine/shared/netban.h>
|
2017-05-21 23:07:13 +00:00
|
|
|
#include <engine/shared/uuid_manager.h>
|
2010-10-16 20:28:54 +00:00
|
|
|
|
2018-03-06 17:41:18 +00:00
|
|
|
#include <base/tl/array.h>
|
|
|
|
|
2017-03-02 15:16:29 +00:00
|
|
|
#include "authmanager.h"
|
2018-03-14 01:35:31 +00:00
|
|
|
#include "name_ban.h"
|
2017-03-02 15:16:29 +00:00
|
|
|
|
2015-11-23 21:49:18 +00:00
|
|
|
#if defined (CONF_SQL)
|
2015-12-17 21:04:38 +00:00
|
|
|
#include "sql_connector.h"
|
|
|
|
#include "sql_server.h"
|
2015-11-23 21:49:18 +00:00
|
|
|
#endif
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CSnapIDPool
|
|
|
|
{
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
MAX_IDS = 16*1024,
|
|
|
|
};
|
|
|
|
|
|
|
|
class CID
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
short m_Next;
|
|
|
|
short m_State; // 0 = free, 1 = alloced, 2 = timed
|
|
|
|
int m_Timeout;
|
|
|
|
};
|
|
|
|
|
|
|
|
CID m_aIDs[MAX_IDS];
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_FirstFree;
|
|
|
|
int m_FirstTimed;
|
|
|
|
int m_LastTimed;
|
|
|
|
int m_Usage;
|
|
|
|
int m_InUsage;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
|
|
|
public:
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
CSnapIDPool();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void Reset();
|
|
|
|
void RemoveFirstTimeout();
|
|
|
|
int NewID();
|
|
|
|
void TimeoutIDs();
|
2011-02-12 10:40:36 +00:00
|
|
|
void FreeID(int ID);
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
|
2011-12-29 22:36:53 +00:00
|
|
|
|
|
|
|
class CServerBan : public CNetBan
|
|
|
|
{
|
|
|
|
class CServer *m_pServer;
|
|
|
|
|
|
|
|
template<class T> int BanExt(T *pBanPool, const typename T::CDataType *pData, int Seconds, const char *pReason);
|
|
|
|
|
|
|
|
public:
|
|
|
|
class CServer *Server() const { return m_pServer; }
|
|
|
|
|
2017-03-21 10:24:44 +00:00
|
|
|
void InitServerBan(class IConsole *pConsole, class IStorage *pStorage, class CServer *pServer);
|
2011-12-29 22:36:53 +00:00
|
|
|
|
2012-08-16 22:03:53 +00:00
|
|
|
virtual int BanAddr(const NETADDR *pAddr, int Seconds, const char *pReason);
|
|
|
|
virtual int BanRange(const CNetRange *pRange, int Seconds, const char *pReason);
|
2011-12-29 22:36:53 +00:00
|
|
|
|
|
|
|
static void ConBanExt(class IConsole::IResult *pResult, void *pUser);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CServer : public IServer
|
|
|
|
{
|
|
|
|
class IGameServer *m_pGameServer;
|
|
|
|
class IConsole *m_pConsole;
|
|
|
|
class IStorage *m_pStorage;
|
2015-11-23 21:49:18 +00:00
|
|
|
|
2017-12-20 15:56:34 +00:00
|
|
|
#if defined(CONF_SQL)
|
2017-03-21 10:24:44 +00:00
|
|
|
CSqlServer *m_apSqlReadServers[MAX_SQLSERVERS];
|
|
|
|
CSqlServer *m_apSqlWriteServers[MAX_SQLSERVERS];
|
2015-11-23 21:49:18 +00:00
|
|
|
#endif
|
|
|
|
|
2017-12-20 15:56:34 +00:00
|
|
|
#if defined(CONF_FAMILY_UNIX)
|
|
|
|
UNIXSOCKETADDR m_ConnLoggingDestAddr;
|
|
|
|
bool m_ConnLoggingSocketCreated;
|
|
|
|
UNIXSOCKET m_ConnLoggingSocket;
|
|
|
|
#endif
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
public:
|
|
|
|
class IGameServer *GameServer() { return m_pGameServer; }
|
|
|
|
class IConsole *Console() { return m_pConsole; }
|
|
|
|
class IStorage *Storage() { return m_pStorage; }
|
|
|
|
|
2011-07-05 19:54:10 +00:00
|
|
|
enum
|
|
|
|
{
|
2011-07-14 20:07:21 +00:00
|
|
|
MAX_RCONCMD_SEND=16,
|
2011-07-05 19:54:10 +00:00
|
|
|
};
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CClient
|
|
|
|
{
|
|
|
|
public:
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
STATE_EMPTY = 0,
|
|
|
|
STATE_AUTH,
|
|
|
|
STATE_CONNECTING,
|
|
|
|
STATE_READY,
|
|
|
|
STATE_INGAME,
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
SNAPRATE_INIT=0,
|
|
|
|
SNAPRATE_FULL,
|
2016-09-05 09:38:11 +00:00
|
|
|
SNAPRATE_RECOVER,
|
|
|
|
|
|
|
|
DNSBL_STATE_NONE=0,
|
|
|
|
DNSBL_STATE_PENDING,
|
|
|
|
DNSBL_STATE_BLACKLISTED,
|
|
|
|
DNSBL_STATE_WHITELISTED,
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CInput
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int m_aData[MAX_INPUT_SIZE];
|
|
|
|
int m_GameTick; // the tick that was chosen for the input
|
|
|
|
};
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// connection state info
|
|
|
|
int m_State;
|
|
|
|
int m_Latency;
|
|
|
|
int m_SnapRate;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2013-08-04 15:50:12 +00:00
|
|
|
float m_Traffic;
|
2013-08-04 02:24:03 +00:00
|
|
|
int64 m_TrafficSince;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_LastAckedSnapshot;
|
|
|
|
int m_LastInputTick;
|
|
|
|
CSnapshotStorage m_Snapshots;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CInput m_LatestInput;
|
|
|
|
CInput m_aInputs[200]; // TODO: handle input better
|
|
|
|
int m_CurrentInput;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
char m_aName[MAX_NAME_LENGTH];
|
2011-03-15 10:23:49 +00:00
|
|
|
char m_aClan[MAX_CLAN_LENGTH];
|
|
|
|
int m_Country;
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_Score;
|
|
|
|
int m_Authed;
|
2017-03-02 15:16:29 +00:00
|
|
|
int m_AuthKey;
|
2010-09-16 11:06:11 +00:00
|
|
|
int m_AuthTries;
|
2016-11-18 14:00:42 +00:00
|
|
|
int m_NextMapChunk;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-07-14 20:07:21 +00:00
|
|
|
const IConsole::CCommandInfo *m_pRconCmdToSend;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void Reset();
|
2013-12-31 05:13:57 +00:00
|
|
|
|
|
|
|
// DDRace
|
|
|
|
|
|
|
|
NETADDR m_Addr;
|
2016-09-05 09:38:11 +00:00
|
|
|
|
|
|
|
// DNSBL
|
|
|
|
int m_DnsblState;
|
2017-11-23 14:47:38 +00:00
|
|
|
std::shared_ptr<CHostLookup> m_pDnsblLookup;
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CClient m_aClients[MAX_CLIENTS];
|
2013-12-31 05:13:57 +00:00
|
|
|
int IdMap[MAX_CLIENTS * VANILLA_MAX_CLIENTS];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
CSnapshotDelta m_SnapshotDelta;
|
|
|
|
CSnapshotBuilder m_SnapshotBuilder;
|
|
|
|
CSnapIDPool m_IDPool;
|
|
|
|
CNetServer m_NetServer;
|
2011-07-30 11:40:01 +00:00
|
|
|
CEcon m_Econ;
|
2016-05-02 21:36:21 +00:00
|
|
|
#if defined(CONF_FAMILY_UNIX)
|
|
|
|
CFifo m_Fifo;
|
|
|
|
#endif
|
2011-12-29 22:36:53 +00:00
|
|
|
CServerBan m_ServerBan;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
IEngineMap *m_pMap;
|
|
|
|
|
|
|
|
int64 m_GameStartTime;
|
|
|
|
//int m_CurrentGameTick;
|
|
|
|
int m_RunServer;
|
2010-05-30 12:01:11 +00:00
|
|
|
int m_MapReload;
|
2015-10-22 15:27:30 +00:00
|
|
|
bool m_ReloadedWhenEmpty;
|
2011-02-12 10:40:36 +00:00
|
|
|
int m_RconClientID;
|
2011-07-05 19:54:10 +00:00
|
|
|
int m_RconAuthLevel;
|
2011-07-30 11:40:01 +00:00
|
|
|
int m_PrintCBIndex;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
int64 m_Lastheartbeat;
|
|
|
|
//static NETADDR4 master_server;
|
|
|
|
|
|
|
|
char m_aCurrentMap[64];
|
2011-04-02 09:55:37 +00:00
|
|
|
unsigned m_CurrentMapCrc;
|
2010-05-29 07:25:38 +00:00
|
|
|
unsigned char *m_pCurrentMapData;
|
2014-11-23 20:24:20 +00:00
|
|
|
unsigned int m_CurrentMapSize;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2014-09-26 00:05:22 +00:00
|
|
|
CDemoRecorder m_aDemoRecorder[MAX_CLIENTS+1];
|
2010-05-29 07:25:38 +00:00
|
|
|
CRegister m_Register;
|
2017-03-02 15:16:29 +00:00
|
|
|
CAuthManager m_AuthManager;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2013-07-30 23:31:53 +00:00
|
|
|
int m_RconRestrict;
|
|
|
|
|
2016-01-22 15:02:40 +00:00
|
|
|
bool m_ServerInfoHighLoad;
|
|
|
|
int64 m_ServerInfoFirstRequest;
|
|
|
|
int m_ServerInfoNumRequests;
|
|
|
|
|
2017-10-13 00:25:50 +00:00
|
|
|
char m_aErrorShutdownReason[128];
|
|
|
|
|
2018-03-06 17:41:18 +00:00
|
|
|
array<CNameBan> m_aNameBans;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CServer();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
int TrySetClientName(int ClientID, const char *pName);
|
|
|
|
|
|
|
|
virtual void SetClientName(int ClientID, const char *pName);
|
2011-03-15 10:23:49 +00:00
|
|
|
virtual void SetClientClan(int ClientID, char const *pClan);
|
|
|
|
virtual void SetClientCountry(int ClientID, int Country);
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual void SetClientScore(int ClientID, int Score);
|
|
|
|
|
|
|
|
void Kick(int ClientID, const char *pReason);
|
|
|
|
|
2011-07-22 21:17:16 +00:00
|
|
|
void DemoRecorder_HandleAutoStart();
|
2012-01-08 23:49:20 +00:00
|
|
|
bool DemoRecorder_IsRecording();
|
2011-07-22 21:17:16 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//int Tick()
|
|
|
|
int64 TickStartTime(int Tick);
|
|
|
|
//int TickSpeed()
|
|
|
|
|
|
|
|
int Init();
|
|
|
|
|
2011-12-31 11:11:48 +00:00
|
|
|
void SetRconCID(int ClientID);
|
2017-06-08 19:58:41 +00:00
|
|
|
int GetAuthedState(int ClientID);
|
2018-01-28 02:13:05 +00:00
|
|
|
const char *GetAuthName(int ClientID);
|
2017-09-12 12:58:44 +00:00
|
|
|
void GetMapInfo(char *pMapName, int MapNameSize, int *pMapSize, int *pMapCrc);
|
2010-05-29 07:25:38 +00:00
|
|
|
int GetClientInfo(int ClientID, CClientInfo *pInfo);
|
2011-03-28 18:11:28 +00:00
|
|
|
void GetClientAddr(int ClientID, char *pAddrStr, int Size);
|
2011-02-12 10:40:36 +00:00
|
|
|
const char *ClientName(int ClientID);
|
2011-03-15 10:23:49 +00:00
|
|
|
const char *ClientClan(int ClientID);
|
|
|
|
int ClientCountry(int ClientID);
|
2010-05-29 07:25:38 +00:00
|
|
|
bool ClientIngame(int ClientID);
|
2011-12-04 15:51:33 +00:00
|
|
|
int MaxClients() const;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2011-02-12 10:40:36 +00:00
|
|
|
virtual int SendMsg(CMsgPacker *pMsg, int Flags, int ClientID);
|
2010-05-29 07:25:38 +00:00
|
|
|
int SendMsgEx(CMsgPacker *pMsg, int Flags, int ClientID, bool System);
|
|
|
|
|
|
|
|
void DoSnapshot();
|
|
|
|
|
2011-02-12 10:40:36 +00:00
|
|
|
static int NewClientCallback(int ClientID, void *pUser);
|
2015-08-23 15:01:01 +00:00
|
|
|
static int NewClientNoAuthCallback(int ClientID, bool Reset, void *pUser);
|
2011-02-12 10:40:36 +00:00
|
|
|
static int DelClientCallback(int ClientID, const char *pReason, void *pUser);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2015-08-23 15:51:28 +00:00
|
|
|
static int ClientRejoinCallback(int ClientID, void *pUser);
|
|
|
|
|
2017-07-24 19:43:55 +00:00
|
|
|
void SendRconType(int ClientID, bool UsernameReq);
|
2011-02-12 10:40:36 +00:00
|
|
|
void SendMap(int ClientID);
|
2016-11-18 14:00:42 +00:00
|
|
|
void SendMapData(int ClientID, int Chunk);
|
2011-03-15 08:58:57 +00:00
|
|
|
void SendConnectionReady(int ClientID);
|
2011-02-12 10:40:36 +00:00
|
|
|
void SendRconLine(int ClientID, const char *pLine);
|
2014-12-20 15:35:47 +00:00
|
|
|
static void SendRconLineAuthed(const char *pLine, void *pUser, bool Highlighted = false);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-07-14 20:07:21 +00:00
|
|
|
void SendRconCmdAdd(const IConsole::CCommandInfo *pCommandInfo, int ClientID);
|
|
|
|
void SendRconCmdRem(const IConsole::CCommandInfo *pCommandInfo, int ClientID);
|
|
|
|
void UpdateClientRconCommands();
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void ProcessClientPacket(CNetChunk *pPacket);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2017-03-29 10:56:13 +00:00
|
|
|
void SendServerInfo(const NETADDR *pAddr, int Token, int Type, bool SendClients);
|
|
|
|
void SendServerInfoConnless(const NETADDR *pAddr, int Token, int Type);
|
2010-05-29 07:25:38 +00:00
|
|
|
void UpdateServerInfo();
|
|
|
|
|
|
|
|
void PumpNetwork();
|
|
|
|
|
2010-09-03 19:28:31 +00:00
|
|
|
char *GetMapName();
|
2010-05-29 07:25:38 +00:00
|
|
|
int LoadMap(const char *pMapName);
|
|
|
|
|
2014-09-26 00:05:22 +00:00
|
|
|
void SaveDemo(int ClientID, float Time);
|
|
|
|
void StartRecord(int ClientID);
|
|
|
|
void StopRecord(int ClientID);
|
|
|
|
bool IsRecording(int ClientID);
|
|
|
|
|
2010-08-17 22:06:00 +00:00
|
|
|
void InitRegister(CNetServer *pNetServer, IEngineMasterServer *pMasterServer, IConsole *pConsole);
|
2010-05-29 07:25:38 +00:00
|
|
|
int Run();
|
|
|
|
|
2013-07-22 22:15:50 +00:00
|
|
|
static void ConTestingCommands(IConsole::IResult *pResult, void *pUser);
|
2015-06-30 16:46:36 +00:00
|
|
|
static void ConRescue(IConsole::IResult *pResult, void *pUser);
|
2011-08-13 00:11:06 +00:00
|
|
|
static void ConKick(IConsole::IResult *pResult, void *pUser);
|
2011-12-29 22:36:53 +00:00
|
|
|
static void ConStatus(IConsole::IResult *pResult, void *pUser);
|
2011-08-13 00:11:06 +00:00
|
|
|
static void ConShutdown(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConRecord(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConStopRecord(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConMapReload(IConsole::IResult *pResult, void *pUser);
|
2011-12-26 21:07:57 +00:00
|
|
|
static void ConLogout(IConsole::IResult *pResult, void *pUser);
|
2016-09-05 12:05:07 +00:00
|
|
|
static void ConDnsblStatus(IConsole::IResult *pResult, void *pUser);
|
2015-11-23 21:49:18 +00:00
|
|
|
|
2017-03-02 15:16:29 +00:00
|
|
|
static void ConAuthAdd(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConAuthAddHashed(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConAuthUpdate(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConAuthUpdateHashed(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConAuthRemove(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConAuthList(IConsole::IResult *pResult, void *pUser);
|
|
|
|
|
2018-03-06 17:41:18 +00:00
|
|
|
static void ConNameBan(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConNameUnban(IConsole::IResult *pResult, void *pUser);
|
|
|
|
static void ConNameBans(IConsole::IResult *pResult, void *pUser);
|
|
|
|
|
2017-06-07 02:45:42 +00:00
|
|
|
static void StatusImpl(IConsole::IResult *pResult, void *pUser, bool DnsblBlacklistedOnly);
|
|
|
|
|
2015-11-23 21:49:18 +00:00
|
|
|
#if defined (CONF_SQL)
|
|
|
|
// console commands for sqlmasters
|
2015-12-17 21:04:38 +00:00
|
|
|
static void ConAddSqlServer(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConDumpSqlServers(IConsole::IResult *pResult, void *pUserData);
|
2015-11-25 17:23:23 +00:00
|
|
|
|
|
|
|
static void CreateTablesThread(void *pData);
|
2015-11-23 21:49:18 +00:00
|
|
|
#endif
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
static void ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2010-06-03 12:48:32 +00:00
|
|
|
static void ConchainMaxclientsperipUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2015-10-23 00:33:10 +00:00
|
|
|
static void ConchainCommandAccessUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2011-07-30 11:40:01 +00:00
|
|
|
static void ConchainConsoleOutputLevelUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2015-10-26 23:33:26 +00:00
|
|
|
|
2017-03-02 15:16:29 +00:00
|
|
|
void LogoutClient(int ClientID, const char *pReason);
|
|
|
|
void LogoutKey(int Key, const char *pReason);
|
2015-10-26 23:33:26 +00:00
|
|
|
|
2018-02-26 17:01:02 +00:00
|
|
|
void ConchainRconPasswordChangeGeneric(int Level, const char *pCurrent, IConsole::IResult *pResult);
|
2014-09-16 19:14:31 +00:00
|
|
|
static void ConchainRconPasswordChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
|
|
|
static void ConchainRconModPasswordChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2015-10-23 00:33:10 +00:00
|
|
|
static void ConchainRconHelperPasswordChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2011-01-06 03:46:10 +00:00
|
|
|
|
2017-12-20 15:56:34 +00:00
|
|
|
#if defined(CONF_FAMILY_UNIX)
|
|
|
|
static void ConchainConnLoggingServerChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
|
|
|
#endif
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void RegisterCommands();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual int SnapNewID();
|
|
|
|
virtual void SnapFreeID(int ID);
|
2011-02-12 10:40:36 +00:00
|
|
|
virtual void *SnapNewItem(int Type, int ID, int Size);
|
2010-05-29 07:25:38 +00:00
|
|
|
void SnapSetStaticsize(int ItemType, int Size);
|
2011-04-09 06:41:31 +00:00
|
|
|
|
|
|
|
// DDRace
|
|
|
|
|
|
|
|
void GetClientAddr(int ClientID, NETADDR *pAddr);
|
|
|
|
int m_aPrevStates[MAX_CLIENTS];
|
2017-06-06 03:51:12 +00:00
|
|
|
const char *GetAnnouncementLine(char const *FileName);
|
2010-12-07 17:44:23 +00:00
|
|
|
unsigned m_AnnouncementLastLine;
|
2013-07-30 23:31:53 +00:00
|
|
|
void RestrictRconOutput(int ClientID) { m_RconRestrict = ClientID; }
|
2013-12-31 05:13:57 +00:00
|
|
|
|
|
|
|
virtual int* GetIdMap(int ClientID);
|
2015-11-23 21:49:18 +00:00
|
|
|
|
2016-09-05 09:38:11 +00:00
|
|
|
void InitDnsbl(int ClientID);
|
|
|
|
bool DnsblWhite(int ClientID)
|
|
|
|
{
|
|
|
|
return m_aClients[ClientID].m_DnsblState == CClient::DNSBL_STATE_NONE ||
|
|
|
|
m_aClients[ClientID].m_DnsblState == CClient::DNSBL_STATE_WHITELISTED;
|
|
|
|
}
|
2017-03-06 17:02:19 +00:00
|
|
|
|
|
|
|
void AuthRemoveKey(int KeySlot);
|
2017-06-06 03:51:12 +00:00
|
|
|
bool ClientPrevIngame(int ClientID) { return m_aPrevStates[ClientID] == CClient::STATE_INGAME; };
|
|
|
|
const char *GetNetErrorString(int ClientID) { return m_NetServer.ErrorString(ClientID); };
|
|
|
|
void ResetNetErrorString(int ClientID) { m_NetServer.ResetErrorString(ClientID); };
|
|
|
|
bool SetTimedOut(int ClientID, int OrigID);
|
|
|
|
void SetTimeoutProtected(int ClientID) { m_NetServer.SetTimeoutProtected(ClientID); };
|
2017-10-13 00:25:50 +00:00
|
|
|
|
|
|
|
bool ErrorShutdown() const { return m_aErrorShutdownReason[0] != 0; }
|
|
|
|
void SetErrorShutdown(const char *pReason);
|
2017-12-20 15:56:34 +00:00
|
|
|
|
|
|
|
#ifdef CONF_FAMILY_UNIX
|
|
|
|
enum CONN_LOGGING_CMD
|
|
|
|
{
|
|
|
|
OPEN_SESSION=1,
|
|
|
|
CLOSE_SESSION=2,
|
|
|
|
};
|
|
|
|
|
|
|
|
void SendConnLoggingCommand(CONN_LOGGING_CMD cmd, const NETADDR *pAddr);
|
|
|
|
#endif
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|