summaryrefslogtreecommitdiff
path: root/protocols/Steam/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r--protocols/Steam/src/steam_login.cpp54
-rw-r--r--protocols/Steam/src/steam_proto.h2
-rw-r--r--protocols/Steam/src/steam_server.cpp2
3 files changed, 15 insertions, 43 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();
}
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index 49befe2800..5b61ae97f5 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -147,6 +147,8 @@ class CSteamProto : public PROTO<CSteamProto>
void Login();
void Logout();
+ void OnLoggedIn();
+
static INT_PTR CALLBACK EnterTotpCode(void *param);
static INT_PTR CALLBACK EnterEmailCode(void *param);
diff --git a/protocols/Steam/src/steam_server.cpp b/protocols/Steam/src/steam_server.cpp
index d940e42ddd..323f3e3c33 100644
--- a/protocols/Steam/src/steam_server.cpp
+++ b/protocols/Steam/src/steam_server.cpp
@@ -20,6 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void CSteamProto::SendHeartBeat()
{
CMsgClientHeartBeat packet;
- packet.has_send_reply = packet.send_reply = true;
+ packet.has_send_reply = true; packet.send_reply = false;
WSSend(EMsg::ClientHeartBeat, packet);
}