summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_login.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-12-15 23:08:04 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-12-15 23:08:04 +0300
commit8b123abaabfafc7785cf08c68fefae5e0b528b15 (patch)
tree09bb9a6bf6916a46997a650e36c62a44c73f4a0a /protocols/Steam/src/steam_login.cpp
parent83e4efbbf5f9aca0a46e2687318eb3c9086eb491 (diff)
introducing Steam message descriptors & static message handlers
Diffstat (limited to 'protocols/Steam/src/steam_login.cpp')
-rw-r--r--protocols/Steam/src/steam_login.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp
index 13c6b9f371..30b773b7db 100644
--- a/protocols/Steam/src/steam_login.cpp
+++ b/protocols/Steam/src/steam_login.cpp
@@ -253,18 +253,15 @@ void CSteamProto::OnPollSession(const CAuthenticationPollAuthSessionStatusRespon
WSSend(EMsg::ClientLogon, request);
}
-void CSteamProto::OnClientLogon(const uint8_t *buf, size_t cbLen)
+void CSteamProto::OnClientLogon(const CMsgClientLogonResponse &reply, const CMsgProtoBufHeader &hdr)
{
- proto::MsgClientLogonResponse reply(buf, cbLen);
- if (reply == nullptr || !reply->has_eresult || reply->eresult != (int)EResult::OK) {
+ if (hdr.failed()) {
Logout();
return;
}
- debugLogA("client logged in\n%s", protobuf_c_text_to_string(*reply).c_str());
-
- if (reply->has_heartbeat_seconds)
- m_impl.m_heartBeat.Start(reply->heartbeat_seconds * 1000);
+ if (reply.has_heartbeat_seconds)
+ m_impl.m_heartBeat.Start(reply.heartbeat_seconds * 1000);
// go to online now
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_CONNECTING, m_iStatus = m_iDesiredStatus);
@@ -272,3 +269,9 @@ void CSteamProto::OnClientLogon(const uint8_t *buf, size_t cbLen)
// load contact list
SendRequest(new GetFriendListRequest(m_szAccessToken, m_iSteamId, "friend,ignoredfriend,requestrecipient"), &CSteamProto::OnGotFriendList);
}
+
+void CSteamProto::OnClientLogoff(const CMsgClientLoggedOff &reply, const CMsgProtoBufHeader&)
+{
+ debugLogA("received logout request with error code %d", reply.has_eresult ? reply.eresult : 0);
+ Logout();
+}