mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-30 05:00:46 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51abdfb899 | ||
|
|
658d6129a7 | ||
|
|
55c1674309 | ||
|
|
9efae3edae | ||
|
|
d1e047edf8 | ||
|
|
8742ace3d7 |
@@ -177,6 +177,44 @@ namespace ArchiSteamFarm {
|
||||
|
||||
*/
|
||||
|
||||
// TODO: Remove me once https://github.com/SteamRE/SteamKit/issues/305 is fixed
|
||||
internal void LogOnWithoutMachineID(SteamUser.LogOnDetails details) {
|
||||
ClientMsgProtobuf<CMsgClientLogon> logon = new ClientMsgProtobuf<CMsgClientLogon>(EMsg.ClientLogon);
|
||||
|
||||
SteamID steamId = new SteamID(details.AccountID, details.AccountInstance, Client.ConnectedUniverse, EAccountType.Individual);
|
||||
|
||||
if (details.LoginID != null) {
|
||||
logon.Body.obfustucated_private_ip = details.LoginID.Value;
|
||||
}
|
||||
|
||||
logon.ProtoHeader.client_sessionid = 0;
|
||||
logon.ProtoHeader.steamid = steamId.ConvertToUInt64();
|
||||
|
||||
logon.Body.account_name = details.Username;
|
||||
logon.Body.password = details.Password;
|
||||
logon.Body.should_remember_password = details.ShouldRememberPassword;
|
||||
|
||||
logon.Body.protocol_version = MsgClientLogon.CurrentProtocol;
|
||||
logon.Body.client_os_type = (uint) details.ClientOSType;
|
||||
logon.Body.client_language = details.ClientLanguage;
|
||||
logon.Body.cell_id = details.CellID;
|
||||
|
||||
logon.Body.steam2_ticket_request = details.RequestSteam2Ticket;
|
||||
|
||||
logon.Body.client_package_version = 1771;
|
||||
|
||||
logon.Body.auth_code = details.AuthCode;
|
||||
logon.Body.two_factor_code = details.TwoFactorCode;
|
||||
|
||||
logon.Body.login_key = details.LoginKey;
|
||||
|
||||
logon.Body.sha_sentryfile = details.SentryFileHash;
|
||||
logon.Body.eresult_sentryfile = (int) (details.SentryFileHash != null ? EResult.OK : EResult.FileNotFound);
|
||||
|
||||
|
||||
Client.Send(logon);
|
||||
}
|
||||
|
||||
internal void PlayGame(string gameName) {
|
||||
if (!Client.IsConnected) {
|
||||
return;
|
||||
|
||||
@@ -133,7 +133,6 @@
|
||||
<Compile Include="InMemoryServerListProvider.cs" />
|
||||
<Compile Include="MobileAuthenticator.cs" />
|
||||
<Compile Include="Runtime.cs" />
|
||||
<Compile Include="ObsoleteSteamGuardAccount.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SharedInfo.cs" />
|
||||
|
||||
@@ -152,15 +152,6 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Converter code will be removed soon
|
||||
if (BotDatabase.SteamGuardAccount != null) {
|
||||
Logging.LogGenericWarning("Converting old ASF 2FA V2.0 format into new ASF 2FA V2.1 format...", botName);
|
||||
BotDatabase.MobileAuthenticator = MobileAuthenticator.LoadFromSteamGuardAccount(BotDatabase.SteamGuardAccount);
|
||||
Logging.LogGenericInfo("Done! If you didn't make a copy of your revocation code yet, then it's a good moment to do so: " + BotDatabase.SteamGuardAccount.RevocationCode, botName);
|
||||
Logging.LogGenericWarning("ASF will not keep this code anymore!", botName);
|
||||
BotDatabase.SteamGuardAccount = null;
|
||||
}
|
||||
|
||||
if (BotDatabase.MobileAuthenticator != null) {
|
||||
BotDatabase.MobileAuthenticator.Init(this);
|
||||
} else {
|
||||
@@ -1530,7 +1521,7 @@ namespace ArchiSteamFarm {
|
||||
TwoFactorCode = await BotDatabase.MobileAuthenticator.GenerateToken().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
SteamUser.LogOn(new SteamUser.LogOnDetails {
|
||||
SteamUser.LogOnDetails logOnDetails = new SteamUser.LogOnDetails {
|
||||
Username = BotConfig.SteamLogin,
|
||||
Password = BotConfig.SteamPassword,
|
||||
AuthCode = AuthCode,
|
||||
@@ -1540,7 +1531,14 @@ namespace ArchiSteamFarm {
|
||||
TwoFactorCode = TwoFactorCode,
|
||||
SentryFileHash = sentryHash,
|
||||
ShouldRememberPassword = true
|
||||
});
|
||||
};
|
||||
|
||||
try {
|
||||
SteamUser.LogOn(logOnDetails);
|
||||
} catch {
|
||||
// TODO: Remove me once https://github.com/SteamRE/SteamKit/issues/305 is fixed
|
||||
ArchiHandler.LogOnWithoutMachineID(logOnDetails);
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnDisconnected(SteamClient.DisconnectedCallback callback) {
|
||||
|
||||
@@ -64,24 +64,6 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Converter code will be removed soon
|
||||
[JsonProperty]
|
||||
private ObsoleteSteamGuardAccount _SteamGuardAccount;
|
||||
|
||||
internal ObsoleteSteamGuardAccount SteamGuardAccount {
|
||||
get {
|
||||
return _SteamGuardAccount;
|
||||
}
|
||||
set {
|
||||
if (_SteamGuardAccount == value) {
|
||||
return;
|
||||
}
|
||||
|
||||
_SteamGuardAccount = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private readonly object FileLock = new object();
|
||||
|
||||
private string FilePath;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -33,6 +34,8 @@ using HtmlAgilityPack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
|
||||
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
|
||||
internal sealed class MobileAuthenticator {
|
||||
internal sealed class Confirmation {
|
||||
internal readonly uint ID;
|
||||
@@ -57,30 +60,19 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal bool HasDeviceID => !string.IsNullOrEmpty(DeviceID);
|
||||
|
||||
#pragma warning disable 649
|
||||
[JsonProperty(PropertyName = "shared_secret", Required = Required.DisallowNull)]
|
||||
private string SharedSecret;
|
||||
|
||||
[JsonProperty(PropertyName = "identity_secret", Required = Required.DisallowNull)]
|
||||
private string IdentitySecret;
|
||||
#pragma warning restore 649
|
||||
|
||||
[JsonProperty(PropertyName = "device_id")]
|
||||
private string DeviceID;
|
||||
|
||||
private Bot Bot;
|
||||
|
||||
internal static MobileAuthenticator LoadFromSteamGuardAccount(ObsoleteSteamGuardAccount sga) {
|
||||
if (sga != null) {
|
||||
return new MobileAuthenticator {
|
||||
SharedSecret = sga.SharedSecret,
|
||||
IdentitySecret = sga.IdentitySecret,
|
||||
DeviceID = sga.DeviceID
|
||||
};
|
||||
}
|
||||
|
||||
Logging.LogNullError(nameof(sga));
|
||||
return null;
|
||||
}
|
||||
|
||||
private MobileAuthenticator() {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
// TODO: This will be completely removed soon
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")]
|
||||
public class ObsoleteSteamGuardAccount {
|
||||
[JsonProperty("shared_secret")]
|
||||
public string SharedSecret { get; set; }
|
||||
|
||||
[JsonProperty("serial_number")]
|
||||
public string SerialNumber { get; set; }
|
||||
|
||||
[JsonProperty("revocation_code")]
|
||||
public string RevocationCode { get; set; }
|
||||
|
||||
[JsonProperty("uri")]
|
||||
public string URI { get; set; }
|
||||
|
||||
[JsonProperty("server_time")]
|
||||
public long ServerTime { get; set; }
|
||||
|
||||
[JsonProperty("account_name")]
|
||||
public string AccountName { get; set; }
|
||||
|
||||
[JsonProperty("token_gid")]
|
||||
public string TokenGID { get; set; }
|
||||
|
||||
[JsonProperty("identity_secret")]
|
||||
public string IdentitySecret { get; set; }
|
||||
|
||||
[JsonProperty("secret_1")]
|
||||
public string Secret1 { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
[JsonProperty("device_id")]
|
||||
public string DeviceID { get; set; }
|
||||
|
||||
[JsonProperty("fully_enrolled")]
|
||||
public bool FullyEnrolled { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class SharedInfo {
|
||||
internal const string Version = "2.1.2.4";
|
||||
internal const string Version = "2.1.2.5";
|
||||
internal const string Copyright = "Copyright © ArchiSteamFarm 2015-2016";
|
||||
|
||||
internal const string GithubRepo = "JustArchi/ArchiSteamFarm";
|
||||
|
||||
8
cc.sh
8
cc.sh
@@ -2,6 +2,7 @@
|
||||
set -eu
|
||||
|
||||
BUILD="Release"
|
||||
AOT=0
|
||||
CLEAN=0
|
||||
|
||||
MONO_ARGS=("--aot" "--llvm" "--server" "-O=all")
|
||||
@@ -10,7 +11,7 @@ BINARIES=("ArchiSteamFarm/bin/Release/ArchiSteamFarm.exe")
|
||||
SOLUTION="ArchiSteamFarm.sln"
|
||||
|
||||
PRINT_USAGE() {
|
||||
echo "Usage: $0 [--clean] [debug/release]"
|
||||
echo "Usage: $0 [--clean] [--aot] [debug/release]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -18,6 +19,7 @@ for ARG in "$@"; do
|
||||
case "$ARG" in
|
||||
release|Release) BUILD="Release" ;;
|
||||
debug|Debug) BUILD="Debug" ;;
|
||||
--aot) AOT=1 ;;
|
||||
--clean) CLEAN=1 ;;
|
||||
*) PRINT_USAGE
|
||||
esac
|
||||
@@ -51,8 +53,8 @@ if [[ ! -f "${BINARIES[0]}" ]]; then
|
||||
echo "ERROR: ${BINARIES[0]} binary could not be found!"
|
||||
fi
|
||||
|
||||
# If it's release build, use Mono AOT for output binaries
|
||||
if [[ "$BUILD" = "Release" ]]; then
|
||||
# Use Mono AOT for output binaries if needed
|
||||
if [[ "$AOT" -eq 1 && "$BUILD" = "Release" ]]; then
|
||||
for BINARY in "${BINARIES[@]}"; do
|
||||
if [[ ! -f "$BINARY" ]]; then
|
||||
continue
|
||||
|
||||
16
run.sh
16
run.sh
@@ -2,11 +2,12 @@
|
||||
set -eu
|
||||
|
||||
BUILD="Release"
|
||||
UNTIL_CLEAN_EXIT=0
|
||||
|
||||
MONO_ARGS=("--llvm" "--server" "-O=all")
|
||||
|
||||
PRINT_USAGE() {
|
||||
echo "Usage: $0 [debug/release]"
|
||||
echo "Usage: $0 [--until-clean-exit] [debug/release]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -14,6 +15,7 @@ for ARG in "$@"; do
|
||||
case "$ARG" in
|
||||
release|Release) BUILD="Release" ;;
|
||||
debug|Debug) BUILD="Debug" ;;
|
||||
--until-clean-exit) UNTIL_CLEAN_EXIT=1 ;;
|
||||
*) PRINT_USAGE
|
||||
esac
|
||||
done
|
||||
@@ -31,4 +33,14 @@ if [[ ! -f "$BINARY" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mono "${MONO_ARGS[@]}" "$BINARY"
|
||||
if [[ "$UNTIL_CLEAN_EXIT" -eq 0 ]]; then
|
||||
mono "${MONO_ARGS[@]}" "$BINARY"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
while [[ -f "$BINARY" ]]; do
|
||||
if mono "${MONO_ARGS[@]}" "$BINARY"; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user