diff options
author | George Hazan <george.hazan@gmail.com> | 2024-12-15 15:50:25 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-12-15 15:50:25 +0300 |
commit | 4bbe001b15dec9cacd882ee55fe54f85c56a147f (patch) | |
tree | f181de7f9180492ac67a4a724697aad48eb6edb7 /protocols/Steam/src/main.cpp | |
parent | d2c72c9bf3492fd40960c2f0935c9c675795d28a (diff) |
Steam: service calls switched to static handlers
Diffstat (limited to 'protocols/Steam/src/main.cpp')
-rw-r--r-- | protocols/Steam/src/main.cpp | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/protocols/Steam/src/main.cpp b/protocols/Steam/src/main.cpp index be3991d116..a39ce0aef5 100644 --- a/protocols/Steam/src/main.cpp +++ b/protocols/Steam/src/main.cpp @@ -32,15 +32,42 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC /////////////////////////////////////////////////////////////////////////////////////////
+void CMPlugin::InitSteamServices()
+{
+ // services from steammessages_auth.steamclient.proto
+ services["Authentication"] = &authentication__descriptor;
+ services["AuthenticationSupport"] = &authentication_support__descriptor;
+
+ // services from steammessages_chat.steamclient.proto
+ services["Chat"] = &chat__descriptor;
+ services["ChatRoom"] = &chat_room__descriptor;
+ services["ChatRoomClient"] = &chat_room_client__descriptor;
+
+ // services from steammessages_friendmessages.steamclient.proto
+ services["FriendMessages"] = &friend_messages__descriptor;
+ services["FriendMessagesClient"] = &friend_messages_client__descriptor;
+
+ // static service handlers
+ serviceHandlers[PollAuthSessionStatus] = ServiceResponseHandler(&CSteamProto::OnPollSession);
+ serviceHandlers[GetPasswordRSAPublicKey] = ServiceResponseHandler(&CSteamProto::OnGotRsaKey);
+ serviceHandlers[BeginAuthSessionViaCredentials] = ServiceResponseHandler(&CSteamProto::OnBeginSession);
+ serviceHandlers[UpdateAuthSessionWithSteamGuardCode] = ServiceResponseHandler(&CSteamProto::OnGotConfirmationCode);
+
+ serviceHandlers[FriendSendMessage] = ServiceResponseHandler(&CSteamProto::OnMessageSent);
+}
+
int CMPlugin::Load()
{
+ InitSteamServices();
+
+ // extra statuses
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "gaming");
+ hExtraXStatus = ExtraIcon_RegisterIcolib("steam_game", LPGEN("Steam game"), iconName);
- // extra statuses
HookEvent(ME_SKIN_ICONSCHANGED, OnReloadIcons);
- hExtraXStatus = ExtraIcon_RegisterIcolib("steam_game", LPGEN("Steam game"), iconName);
+ // menus
CSteamProto::InitMenus();
return 0;
}
|