diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-03 20:41:19 +0200 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-03 20:41:19 +0200 |
commit | 386d58b5862d8b76925c6523721594887606e82a (patch) | |
tree | ef073e7a843f4b75a4008d4b7383f7cdf08ceee5 /source/cWebAdmin.h | |
parent | Visual Studio 2010 solution and project files (diff) | |
download | cuberite-386d58b5862d8b76925c6523721594887606e82a.tar cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.gz cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.bz2 cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.lz cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.xz cuberite-386d58b5862d8b76925c6523721594887606e82a.tar.zst cuberite-386d58b5862d8b76925c6523721594887606e82a.zip |
Diffstat (limited to 'source/cWebAdmin.h')
-rw-r--r-- | source/cWebAdmin.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/source/cWebAdmin.h b/source/cWebAdmin.h new file mode 100644 index 000000000..e58eab24e --- /dev/null +++ b/source/cWebAdmin.h @@ -0,0 +1,60 @@ +#pragma once
+
+#include <list>
+#include "../WebServer/WebServer.h"
+#include "cSocket.h"
+
+class cStringMap;
+//tolua_begin
+struct HTTPRequest
+{
+ std::string Method;
+ std::string Path;
+ cStringMap* Params;
+ std::string Username;
+};
+//tolua_end
+
+struct lua_State;
+class cEvent;
+class cIniFile;
+class cWebPlugin;
+class cWebAdmin
+{
+public:
+ cWebAdmin( int a_Port = 8080 );
+ ~cWebAdmin();
+
+ bool Init( int a_Port );
+
+ void AddPlugin( cWebPlugin* a_Plugin );
+ void RemovePlugin( cWebPlugin* a_Plugin );
+
+ typedef std::list< cWebPlugin* > PluginList;
+ PluginList GetPlugins() { return m_Plugins; }
+
+ static void Request_Handler(webserver::http_request* r);
+
+ void RemovePlugin( lua_State* L );
+private:
+
+#ifdef _WIN32
+ static DWORD WINAPI ListenThread(LPVOID lpParam);
+#else
+ static void *ListenThread( void *lpParam );
+#endif
+
+ std::string GetTemplate();
+
+ int m_Port;
+
+ bool m_bConnected;
+ cSocket m_ListenSocket;
+
+ cIniFile* m_IniFile;
+ PluginList m_Plugins;
+
+ cEvent* m_Event;
+
+ webserver* m_WebServer;
+};
\ No newline at end of file |