diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-20 15:08:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-20 15:08:48 +0300 |
commit | 8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch) | |
tree | 03e5b4870f09a3163306740c2eebee47bc15b042 /protocols/MinecraftDynmap/src | |
parent | c5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff) |
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'protocols/MinecraftDynmap/src')
-rw-r--r-- | protocols/MinecraftDynmap/src/main.cpp | 32 | ||||
-rw-r--r-- | protocols/MinecraftDynmap/src/proto.h | 6 | ||||
-rw-r--r-- | protocols/MinecraftDynmap/src/stdafx.h | 1 |
3 files changed, 14 insertions, 25 deletions
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 <http://www.gnu.org/licenses/>. #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<MinecraftDynmapProto>("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 diff --git a/protocols/MinecraftDynmap/src/proto.h b/protocols/MinecraftDynmap/src/proto.h index 00e7803932..b6d7bc9273 100644 --- a/protocols/MinecraftDynmap/src/proto.h +++ b/protocols/MinecraftDynmap/src/proto.h @@ -129,9 +129,5 @@ public: struct CMPlugin : public ACCPROTOPLUGIN<MinecraftDynmapProto> { - CMPlugin() : - ACCPROTOPLUGIN<MinecraftDynmapProto>("MinecraftDynmap") - { - SetUniqueId("Nick"); - } + CMPlugin(); }; diff --git a/protocols/MinecraftDynmap/src/stdafx.h b/protocols/MinecraftDynmap/src/stdafx.h index d47e51733c..cfc8d05529 100644 --- a/protocols/MinecraftDynmap/src/stdafx.h +++ b/protocols/MinecraftDynmap/src/stdafx.h @@ -71,4 +71,3 @@ class MinecraftDynmapProto; #include "resource.h" extern std::string g_strUserAgent; -extern DWORD g_mirandaVersion; |