about summary refs log tree commit diff
path: root/src/engine/shared/econ.h
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-07-30 13:40:01 +0200
committeroy <Tom_Adams@web.de>2011-07-30 13:40:01 +0200
commita0a62bcd70d1d8c0874d5ff52e443b5fb417854c (patch)
tree00b0db83ea6bd25970b89bd465fa71d462e3cad2 /src/engine/shared/econ.h
parentb0fdc4095988ed5bd8bda4b94ce35bc506f31653 (diff)
downloadzcatch-a0a62bcd70d1d8c0874d5ff52e443b5fb417854c.tar.gz
zcatch-a0a62bcd70d1d8c0874d5ff52e443b5fb417854c.zip
fixed econ feature and tcp
Diffstat (limited to 'src/engine/shared/econ.h')
-rw-r--r--src/engine/shared/econ.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/engine/shared/econ.h b/src/engine/shared/econ.h
new file mode 100644
index 00000000..33b23ea6
--- /dev/null
+++ b/src/engine/shared/econ.h
@@ -0,0 +1,43 @@
+#ifndef ENGINE_SHARED_ECON_H
+#define ENGINE_SHARED_ECON_H
+
+#include "network.h"
+
+class CEcon
+{
+	class CClient
+	{
+	public:
+		enum
+		{
+			STATE_EMPTY=0,
+			STATE_CONNECTED,
+			STATE_AUTHED,
+		};
+
+		int m_State;
+		int64 m_TimeConnected;
+	};
+	CClient m_aClients[NET_MAX_CONSOLE_CLIENTS];
+
+	IConsole *m_pConsole;
+	CNetConsole m_NetConsole;
+
+	bool m_Ready;
+	int m_PrintCBIndex;
+
+	static void SendLineCB(const char *pLine, void *pUserData);
+	static void ConchainEconOutputLevelUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
+
+	static int NewClientCallback(int ClientID, void *pUser);
+	static int DelClientCallback(int ClientID, const char *pReason, void *pUser);
+
+public:
+	IConsole *Console() { return m_pConsole; }
+
+	void Init(IConsole *pConsole);
+	void Update();
+	void Send(int ClientID, const char *pLine);
+};
+
+#endif