This commit is contained in:
JustArchi
2019-04-04 17:56:38 +02:00
parent 1c917b4095
commit 44c5bf4ad5
5 changed files with 8 additions and 4 deletions

View File

@@ -67,7 +67,6 @@ namespace ArchiSteamFarm {
private string FilePath;
private bool ReadOnly;
// This constructor is used when creating new database
private BotDatabase([NotNull] string filePath) {
if (string.IsNullOrEmpty(filePath)) {
throw new ArgumentNullException(nameof(filePath));
@@ -76,7 +75,7 @@ namespace ArchiSteamFarm {
FilePath = filePath;
}
// This constructor is used only by deserializer
[JsonConstructor]
private BotDatabase() { }
public void Dispose() => FileSemaphore.Dispose();

View File

@@ -49,7 +49,6 @@ namespace ArchiSteamFarm {
private string FilePath;
// This constructor is used when creating new database
private GlobalDatabase([NotNull] string filePath) : this() {
if (string.IsNullOrEmpty(filePath)) {
throw new ArgumentNullException(nameof(filePath));
@@ -58,7 +57,7 @@ namespace ArchiSteamFarm {
FilePath = filePath;
}
// This constructor is used only by deserializer
[JsonConstructor]
private GlobalDatabase() => ServerListProvider.ServerListUpdated += OnServerListUpdated;
public void Dispose() {

View File

@@ -63,6 +63,7 @@ namespace ArchiSteamFarm {
[JsonProperty(PropertyName = "device_id")]
private string DeviceID;
[JsonConstructor]
private MobileAuthenticator() { }
internal void CorrectDeviceID(string deviceID) {

View File

@@ -559,6 +559,7 @@ namespace ArchiSteamFarm {
return skippedSetsThisRound.Count > 0;
}
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
private sealed class ListedUser {
internal readonly HashSet<Steam.Asset.EType> MatchableTypes = new HashSet<Steam.Asset.EType>();
@@ -685,6 +686,9 @@ namespace ArchiSteamFarm {
}
}
}
[JsonConstructor]
private ListedUser() { }
}
}
}

View File

@@ -45,6 +45,7 @@ namespace ArchiSteamFarm.SteamKit2 {
ProtocolTypes = protocolTypes;
}
[JsonConstructor]
private ServerRecordEndPoint() { }
public bool Equals(ServerRecordEndPoint other) => (other != null) && (ReferenceEquals(other, this) || ((Host == other.Host) && (Port == other.Port) && (ProtocolTypes == other.ProtocolTypes)));