summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_login.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-12-13 21:13:10 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-12-13 21:13:10 +0300
commit55d05a0c6c4abd0eb722b4bbf836ec6dcad1765b (patch)
treeab3a4b73b1f5e853bb612268731e0a1f91a4ccd2 /protocols/Steam/src/steam_login.cpp
parentc122cbe23c5246f33901c6fc8a813f74830b978b (diff)
suddenly CMsgClientLogon is not needed at all
Diffstat (limited to 'protocols/Steam/src/steam_login.cpp')
-rw-r--r--protocols/Steam/src/steam_login.cpp54
1 files changed, 12 insertions, 42 deletions
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp
index d607657485..80aefdb68d 100644
--- a/protocols/Steam/src/steam_login.cpp
+++ b/protocols/Steam/src/steam_login.cpp
@@ -267,42 +267,18 @@ void CSteamProto::OnPollSession(const uint8_t *buf, size_t cbLen)
m_szAccessToken = reply->access_token;
m_szRefreshToken = reply->refresh_token;
- // sending logon packet
- ptrA szAccountName(getUStringA(DBKEY_ACCOUNT_NAME)), szPassword(getUStringA("Password"));
- T2Utf szMachineName(m_wszDeviceName);
-
- MBinBuffer machineId(getBlob(DBKEY_MACHINE_ID));
- if (!machineId.length()) {
- uint8_t random[100], hashOut[20];
- Utils_GetRandom(random, sizeof(random));
- mir_sha1_hash(random, sizeof(random), hashOut);
-
- db_set_blob(0, m_szModuleName, DBKEY_MACHINE_ID, hashOut, sizeof(hashOut));
- machineId.append(hashOut, sizeof(hashOut));
- }
+ OnLoggedIn();
+}
+
+void CSteamProto::OnLoggedIn()
+{
+ m_impl.m_heartBeat.Start(10000);
+
+ // go to online now
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_CONNECTING, m_iStatus = m_iDesiredStatus);
- CMsgIPAddress privateIp;
- privateIp.ip_case = CMSG_IPADDRESS__IP_V4;
- privateIp.v4 = 0;
-
- CMsgClientLogon request;
- request.access_token = reply->access_token;
- request.account_name = szAccountName;
- request.password = szPassword;
- request.machine_name = szMachineName;
- request.client_language = "english";
- request.client_os_type = 16; request.has_client_os_type = true;
- request.should_remember_password = false; request.has_should_remember_password = true;
- request.obfuscated_private_ip = &privateIp;
- request.protocol_version = STEAM_PROTOCOL_VERSION; request.has_protocol_version = true;
- request.client_package_version = 1771; request.has_client_package_version = true;
- request.supports_rate_limit_response = request.has_supports_rate_limit_response = true;
- request.steamguard_dont_remember_computer = false; request.has_steamguard_dont_remember_computer = true;
- request.chat_mode = 2; request.has_chat_mode = true;
- request.cell_id = 7; request.has_cell_id = true;
- request.machine_id.data = machineId.data();
- request.machine_id.len = machineId.length();
- WSSend(EMsg::ClientLogon, request);
+ // load contact list
+ SendRequest(new GetFriendListRequest(m_szAccessToken, m_iSteamId, "friend,ignoredfriend,requestrecipient"), &CSteamProto::OnGotFriendList);
}
void CSteamProto::OnClientLogon(const uint8_t *buf, size_t cbLen)
@@ -313,11 +289,5 @@ void CSteamProto::OnClientLogon(const uint8_t *buf, size_t cbLen)
return;
}
- m_impl.m_heartBeat.Start(1000);
-
- // go to online now
- ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_CONNECTING, m_iStatus = m_iDesiredStatus);
-
- // load contact list
- SendRequest(new GetFriendListRequest(m_szAccessToken, m_iSteamId, "friend,ignoredfriend,requestrecipient"), &CSteamProto::OnGotFriendList);
+ OnLoggedIn();
}