Skip to content

Commit d16228b

Browse files
committed
Steam talks more crap than I thought
1 parent 99dbca1 commit d16228b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ArchiSteamFarm/ArchiWebHandler.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ internal ArchiWebHandler(Bot bot) {
116116

117117
internal void OnDisconnected() => Ready = false;
118118

119-
internal async Task<bool> Init(SteamClient steamClient, string webAPIUserNonce, string parentalPin) {
120-
if ((steamClient == null) || string.IsNullOrEmpty(webAPIUserNonce)) {
121-
Logging.LogNullError(nameof(steamClient) + " || " + nameof(webAPIUserNonce), Bot.BotName);
119+
internal async Task<bool> Init(ulong steamID, EUniverse universe, string webAPIUserNonce, string parentalPin) {
120+
if ((steamID == 0) || (universe == EUniverse.Invalid) || string.IsNullOrEmpty(webAPIUserNonce)) {
121+
Logging.LogNullError(nameof(steamID) + " || " + nameof(universe) + " || " + nameof(webAPIUserNonce), Bot.BotName);
122122
return false;
123123
}
124124

125-
SteamID = steamClient.SteamID;
125+
SteamID = steamID;
126126

127127
string sessionID = Convert.ToBase64String(Encoding.UTF8.GetBytes(SteamID.ToString()));
128128

@@ -131,7 +131,7 @@ internal async Task<bool> Init(SteamClient steamClient, string webAPIUserNonce,
131131

132132
// RSA encrypt it with the public key for the universe we're on
133133
byte[] cryptedSessionKey;
134-
using (RSACrypto rsa = new RSACrypto(KeyDictionary.GetPublicKey(steamClient.ConnectedUniverse))) {
134+
using (RSACrypto rsa = new RSACrypto(KeyDictionary.GetPublicKey(universe))) {
135135
cryptedSessionKey = rsa.Encrypt(sessionKey);
136136
}
137137

ArchiSteamFarm/Bot.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ internal async Task<bool> RefreshSession() {
324324
return false;
325325
}
326326

327-
if (await ArchiWebHandler.Init(SteamClient, callback.Nonce, BotConfig.SteamParentalPIN).ConfigureAwait(false)) {
327+
if (await ArchiWebHandler.Init(SteamClient.SteamID, SteamClient.ConnectedUniverse, callback.Nonce, BotConfig.SteamParentalPIN).ConfigureAwait(false)) {
328328
return true;
329329
}
330330

@@ -1784,7 +1784,7 @@ private async void OnLoggedOn(SteamUser.LoggedOnCallback callback) {
17841784
}
17851785
}
17861786

1787-
if (!await ArchiWebHandler.Init(SteamClient, callback.WebAPIUserNonce, BotConfig.SteamParentalPIN).ConfigureAwait(false)) {
1787+
if (!await ArchiWebHandler.Init(callback.ClientSteamID, SteamClient.ConnectedUniverse, callback.WebAPIUserNonce, BotConfig.SteamParentalPIN).ConfigureAwait(false)) {
17881788
if (!await RefreshSession().ConfigureAwait(false)) {
17891789
return;
17901790
}

0 commit comments

Comments
 (0)