From 8a74e7495ce5ad39de4f5c25121a84d35df90c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 15:08:48 +0300 Subject: CMPlugin to receive a reference to PLUGININFOEX --- protocols/MinecraftDynmap/src/main.cpp | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'protocols/MinecraftDynmap/src/main.cpp') diff --git a/protocols/MinecraftDynmap/src/main.cpp b/protocols/MinecraftDynmap/src/main.cpp index c50d2766c6..37987fa53a 100644 --- a/protocols/MinecraftDynmap/src/main.cpp +++ b/protocols/MinecraftDynmap/src/main.cpp @@ -22,13 +22,13 @@ along with this program. If not, see . #include "stdafx.h" +CMPlugin g_plugin; CLIST_INTERFACE* pcli; int &hLangpack(g_plugin.m_hLang); std::string g_strUserAgent; -DWORD g_mirandaVersion; -PLUGININFOEX pluginInfo = { +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -41,16 +41,15 @@ PLUGININFOEX pluginInfo = { { 0x40da5ebd, 0x4f2d, 0x4bea, 0x84, 0x1c, 0xea, 0xb7, 0x7b, 0xee, 0x6f, 0x4f } }; -///////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; - -///////////////////////////////////////////////////////////////////////////// +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("MinecraftDynmap", pluginInfoEx) +{ + SetUniqueId("Nick"); +} -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - g_mirandaVersion = mirandaVersion; - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -65,22 +64,17 @@ static HANDLE g_hEvents[1]; extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); InitIcons(); // Init native User-Agent { + MFileVersion w; + Miranda_GetFileVersion(&w); std::stringstream agent; - agent << "Miranda NG/"; - agent << ((g_mirandaVersion >> 24) & 0xFF); - agent << "."; - agent << ((g_mirandaVersion >> 16) & 0xFF); - agent << "."; - agent << ((g_mirandaVersion >> 8) & 0xFF); - agent << "."; - agent << ((g_mirandaVersion ) & 0xFF); + agent << "Miranda NG/" << w[0] << "." << w[1] << "." << w[2] << "." << w[3]; #ifdef _WIN64 agent << " Minecraft Dynmap Protocol x64/"; #else -- cgit v1.2.3