ddnet/src/engine/shared/econ.h

55 lines
1.1 KiB
C
Raw Normal View History

2011-07-30 11:40:01 +00:00
#ifndef ENGINE_SHARED_ECON_H
#define ENGINE_SHARED_ECON_H
#include "network.h"
#include <engine/console.h>
2011-07-30 11:40:01 +00:00
class CEcon
{
enum
{
MAX_AUTH_TRIES = 3,
};
2011-07-30 11:40:01 +00:00
class CClient
{
public:
enum
{
STATE_EMPTY = 0,
2011-07-30 11:40:01 +00:00
STATE_CONNECTED,
STATE_AUTHED,
};
int m_State;
int64 m_TimeConnected;
int m_AuthTries;
2011-07-30 11:40:01 +00:00
};
CClient m_aClients[NET_MAX_CONSOLE_CLIENTS];
IConsole *m_pConsole;
CNetConsole m_NetConsole;
bool m_Ready;
int m_PrintCBIndex;
2011-12-30 18:12:31 +00:00
int m_UserClientID;
2011-07-30 11:40:01 +00:00
static void SendLineCB(const char *pLine, void *pUserData, bool Highlighted);
2011-07-30 11:40:01 +00:00
static void ConchainEconOutputLevelUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
2011-12-30 18:12:31 +00:00
static void ConLogout(IConsole::IResult *pResult, void *pUserData);
2011-07-30 11:40:01 +00:00
static int NewClientCallback(int ClientID, void *pUser);
static int DelClientCallback(int ClientID, const char *pReason, void *pUser);
public:
IConsole *Console() { return m_pConsole; }
2011-12-29 22:36:53 +00:00
void Init(IConsole *pConsole, class CNetBan *pNetBan);
2011-07-30 11:40:01 +00:00
void Update();
void Send(int ClientID, const char *pLine);
void Shutdown();
2011-07-30 11:40:01 +00:00
};
#endif