summaryrefslogtreecommitdiff
path: root/protocols/MinecraftDynmap
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MinecraftDynmap')
-rw-r--r--protocols/MinecraftDynmap/src/main.cpp46
-rw-r--r--protocols/MinecraftDynmap/src/stdafx.h1
2 files changed, 26 insertions, 21 deletions
diff --git a/protocols/MinecraftDynmap/src/main.cpp b/protocols/MinecraftDynmap/src/main.cpp
index 04505be56e..525a037711 100644
--- a/protocols/MinecraftDynmap/src/main.cpp
+++ b/protocols/MinecraftDynmap/src/main.cpp
@@ -71,19 +71,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCO
/////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char *proto_name,const wchar_t *username)
-{
- MinecraftDynmapProto *proto = new MinecraftDynmapProto(proto_name, username);
- g_Instances.insert(proto);
- return proto;
-}
-
-static int protoUninit(PROTO_INTERFACE* proto)
-{
- g_Instances.remove((MinecraftDynmapProto*)proto);
- return EXIT_SUCCESS;
-}
-
static HANDLE g_hEvents[1];
extern "C" int __declspec(dllexport) Load(void)
@@ -91,14 +78,6 @@ extern "C" int __declspec(dllexport) Load(void)
mir_getLP(&pluginInfo);
pcli = Clist_GetInterface();
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = "MinecraftDynmap";
- pd.type = PROTOTYPE_PROTOCOL;
- pd.fnInit = protoInit;
- pd.fnUninit = protoUninit;
- Proto_RegisterModule(&pd);
-
InitIcons();
// Init native User-Agent
@@ -134,3 +113,28 @@ extern "C" int __declspec(dllexport) Unload(void)
return 0;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
+{
+ MinecraftDynmapProto *proto = new MinecraftDynmapProto(proto_name, username);
+ g_Instances.insert(proto);
+ return proto;
+}
+
+static int protoUninit(PROTO_INTERFACE* proto)
+{
+ g_Instances.remove((MinecraftDynmapProto*)proto);
+ return EXIT_SUCCESS;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase("MinecraftDynmap")
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, protoInit, protoUninit);
+ }
+}
+ g_plugin;
diff --git a/protocols/MinecraftDynmap/src/stdafx.h b/protocols/MinecraftDynmap/src/stdafx.h
index 634b6a7be2..0e784465e6 100644
--- a/protocols/MinecraftDynmap/src/stdafx.h
+++ b/protocols/MinecraftDynmap/src/stdafx.h
@@ -57,6 +57,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_message.h>
#include <m_json.h>
#include <m_http.h>
+#include <m_plugin.h>
#include "version.h"