summaryrefslogtreecommitdiffstats
path: root/source/WebAdmin.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-24 00:09:57 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-24 00:09:57 +0200
commitecfe6ab65bd1fc2c7f5733fe6ef4e6ddaac44a26 (patch)
tree898e37fe747f0fdcefeb88f833557fd45db3347c /source/WebAdmin.h
parentSource files cleanup: ChunkDataSerializer is Protocol-related (diff)
downloadcuberite-ecfe6ab65bd1fc2c7f5733fe6ef4e6ddaac44a26.tar
cuberite-ecfe6ab65bd1fc2c7f5733fe6ef4e6ddaac44a26.tar.gz
cuberite-ecfe6ab65bd1fc2c7f5733fe6ef4e6ddaac44a26.tar.bz2
cuberite-ecfe6ab65bd1fc2c7f5733fe6ef4e6ddaac44a26.tar.lz
cuberite-ecfe6ab65bd1fc2c7f5733fe6ef4e6ddaac44a26.tar.xz
cuberite-ecfe6ab65bd1fc2c7f5733fe6ef4e6ddaac44a26.tar.zst
cuberite-ecfe6ab65bd1fc2c7f5733fe6ef4e6ddaac44a26.zip
Diffstat (limited to 'source/WebAdmin.h')
-rw-r--r--source/WebAdmin.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/source/WebAdmin.h b/source/WebAdmin.h
new file mode 100644
index 000000000..f50de3f64
--- /dev/null
+++ b/source/WebAdmin.h
@@ -0,0 +1,67 @@
+#pragma once
+
+#include "../WebServer/WebServer.h"
+#include "OSSupport/Socket.h"
+
+class cStringMap;
+
+struct HTTPFormData //tolua_export
+{ //tolua_export
+ std::string Name; //tolua_export
+ std::string Value; //tolua_export
+ std::string Type; //tolua_export
+};//tolua_export
+
+struct HTTPRequest //tolua_export
+{ //tolua_export
+ typedef std::map< std::string, std::string > StringStringMap;
+ typedef std::map< std::string, HTTPFormData > FormDataMap;
+ std::string Method; //tolua_export
+ std::string Path; //tolua_export
+ StringStringMap Params; // >> EXPORTED IN MANUALBINDINGS <<
+ StringStringMap PostParams; // >> EXPORTED IN MANUALBINDINGS <<
+ std::string Username; //tolua_export
+ FormDataMap FormData; // >> EXPORTED IN MANUALBINDINGS <<
+}; //tolua_export
+
+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);
+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