DDraceNetwork Docs
econ.h
Go to the documentation of this file.
1#ifndef ENGINE_SHARED_ECON_H
2#define ENGINE_SHARED_ECON_H
3
4#include "network.h"
5
6#include <engine/console.h>
7
8class CConfig;
9class CNetBan;
10class ColorRGBA;
11
12class CEcon
13{
14 enum
15 {
17 };
18
19 class CClient
20 {
21 public:
22 enum
23 {
27 };
28
32 };
34
38
39 bool m_Ready;
42
43 static void SendLineCB(const char *pLine, void *pUserData, ColorRGBA PrintColor = {1, 1, 1, 1});
44 static void ConLogout(IConsole::IResult *pResult, void *pUserData);
45
46 static int NewClientCallback(int ClientId, void *pUser);
47 static int DelClientCallback(int ClientId, const char *pReason, void *pUser);
48
49public:
50 CEcon();
52
53 void Init(CConfig *pConfig, IConsole *pConsole, CNetBan *pNetBan);
54 void Update();
55 void Send(int ClientId, const char *pLine);
56 void Shutdown();
57};
58
59#endif
Definition: config.h:23
Definition: econ.h:20
int64_t m_TimeConnected
Definition: econ.h:30
int m_AuthTries
Definition: econ.h:31
@ STATE_CONNECTED
Definition: econ.h:25
@ STATE_AUTHED
Definition: econ.h:26
@ STATE_EMPTY
Definition: econ.h:24
int m_State
Definition: econ.h:29
Definition: econ.h:13
void Update()
Definition: econ.cpp:99
bool m_Ready
Definition: econ.h:39
int m_PrintCBIndex
Definition: econ.h:40
void Send(int ClientId, const char *pLine)
Definition: econ.cpp:156
int m_UserClientId
Definition: econ.h:41
CClient m_aClients[NET_MAX_CONSOLE_CLIENTS]
Definition: econ.h:33
IConsole * Console()
Definition: econ.h:51
CConfig * m_pConfig
Definition: econ.h:35
@ MAX_AUTH_TRIES
Definition: econ.h:16
static void ConLogout(IConsole::IResult *pResult, void *pUserData)
Definition: econ.cpp:44
IConsole * m_pConsole
Definition: econ.h:36
CNetConsole m_NetConsole
Definition: econ.h:37
static void SendLineCB(const char *pLine, void *pUserData, ColorRGBA PrintColor={1, 1, 1, 1})
CEcon()
Definition: econ.cpp:7
void Shutdown()
Definition: econ.cpp:173
static int NewClientCallback(int ClientId, void *pUser)
Definition: econ.cpp:12
static int DelClientCallback(int ClientId, const char *pReason, void *pUser)
Definition: econ.cpp:30
void Init(CConfig *pConfig, IConsole *pConsole, CNetBan *pNetBan)
Definition: econ.cpp:52
Definition: netban.h:27
Definition: network.h:472
Definition: color.h:210
Definition: console.h:45
Definition: console.h:18
@ NET_MAX_CONSOLE_CLIENTS
Definition: network.h:63