From a905c9c3f92fd54f37a5466649ac378db69e7cb0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Mar 2018 14:29:31 +0300 Subject: all protocols rewritten to CMPluginBase --- protocols/Steam/src/main.cpp | 22 +++++++++++++--------- protocols/Steam/src/stdafx.h | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'protocols/Steam') diff --git a/protocols/Steam/src/main.cpp b/protocols/Steam/src/main.cpp index eefe4967c6..57632115d9 100644 --- a/protocols/Steam/src/main.cpp +++ b/protocols/Steam/src/main.cpp @@ -31,20 +31,12 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) return &pluginInfo; } -extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST}; +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); - PROTOCOLDESCRIPTOR pd = { 0 }; - pd.cbSize = sizeof(pd); - pd.szName = "STEAM"; - pd.type = PROTOTYPE_PROTOCOL; - pd.fnInit = (pfnInitProto)CSteamProto::InitAccount; - pd.fnUninit = (pfnUninitProto)CSteamProto::UninitAccount; - Proto_RegisterModule(&pd); - char iconName[100]; mir_snprintf(iconName, "%s_%s", MODULE, "gaming"); @@ -60,3 +52,15 @@ extern "C" int __declspec(dllexport) Unload(void) { return 0; } + +///////////////////////////////////////////////////////////////////////////////////////// + +struct CMPlugin : public CMPluginBase +{ + CMPlugin() : + CMPluginBase("STEAM") + { + RegisterProtocol(PROTOTYPE_PROTOCOL, (pfnInitProto)CSteamProto::InitAccount, (pfnUninitProto)CSteamProto::UninitAccount); + } +} + g_plugin; diff --git a/protocols/Steam/src/stdafx.h b/protocols/Steam/src/stdafx.h index 8e1320dd22..744cbb7f6d 100644 --- a/protocols/Steam/src/stdafx.h +++ b/protocols/Steam/src/stdafx.h @@ -35,6 +35,7 @@ #include #include #include +#include #include "resource.h" #include "version.h" -- cgit v1.2.3