r5sdk/r5dev/engine/sv_rcon.h
Amos a5da2e81bf RCON improvements (see description)
** SERVER **
* Close redundant connections if max sockets have been reached.
* Ban if client keeps spamming without authing first (ignoring message).
* Check for whitelisted address before issuing bans (whitelisted address in ConVar 'sv_rcon_whitelist_address' will never get banned or get its connection terminated.
* Transmit SQVM and DevMsg logs over the wire to the net console.

** NETCON **
* IPv6 support.
* Close connection properly after FIN request.
* Prompt user to reconnect after connection has been terminated instead of closing the application.
* Add proper quit command.

** SDKLAUNCHER **
* Rename to 'launcher.exe' to describe its purpose better. Our logo gets printed nice and large on the console during startup.

** SDK **
* Cleanup.
2022-02-08 16:32:00 +01:00

37 lines
1.1 KiB
C++

#pragma once
#include "tier1/NetAdr2.h"
#include "tier2/socketcreator.h"
#include "common/igameserverdata.h"
constexpr char s_pszNoAuthMessage[] = "This server is password protected for console access. Must send 'PASS <password>' command.\n\r";
constexpr char s_pszWrongPwMessage[] = "Password incorrect.\n\r";
constexpr char s_pszBannedMessage[] = "Go away.\n\r";
class CRConServer
{
public:
void Init(void);
void Think(void);
void RunFrame(void);
void Recv(void);
void Send(const char* pszBuf);
void Auth(CConnectedNetConsoleData* pData);
void HandleInputChars(const char* pszIn, int nRecvLen, CConnectedNetConsoleData* pData);
void Execute(CConnectedNetConsoleData* pData);
bool CheckForBan(CConnectedNetConsoleData* pData);
void CloseConnection(void);
void CloseNonAuthConnection(void);
private:
bool m_bInitialized = false;
int m_nConnIndex = 0;
CNetAdr2* m_pAdr2 = new CNetAdr2();
CSocketCreator* m_pSocket = new CSocketCreator();
std::vector<std::string> m_vBannedAddress;
};
extern CRConServer* g_pRConServer;