Files
Nebula-Auth/SteamLibForked/Core/Models/SteamId.cs
T
achiez 8ff960189e 1.5.6 Bug fixes and code clean-ups
- Update: Added "Copy Password" to Mafile context menu (if available)
- Update: "Save Password" now pre-fills the current password in the "Login Again" dialog when encryption is enabled
- Fix: Prevented overlapping confirmation cycles in AutoConfirmer
- Fix: Added a Snackbar notification when a confirmation cycle is skipped due to a too frequent timer interval
- Fix: Fixed a rare bug where the previous proxy was used instead of the current one during session refresh
- Fix: Corrected "Session Permanently Expired" message showing on unrelated errors (e.g. network issues)
- UI-Fix: Fixed visual glitch where proxy input appeared non-empty when switching to a mafile-specific proxy
- Cleanup: Refactored and cleaned up codebase, improved styling and formatting via ReSharper
2025-05-02 23:29:24 +03:00

77 lines
1.9 KiB
C#

using SteamLib.Utility;
namespace SteamLib.Core.Models;
public readonly struct SteamId : IEquatable<SteamId> //TODO: validation in parse methods (in siblings also)
{
public SteamId64 Steam64 { get; }
public SteamId2 Steam2 { get; }
public SteamId3 Steam3 { get; }
public SteamId(SteamId64 steam64, char type = 'U', short universe = 0)
{
Steam64 = steam64;
Steam2 = steam64.ToSteam2(universe);
Steam3 = steam64.ToSteam3(type);
}
public SteamId(SteamId2 steam2, char type = 'U')
{
Steam2 = steam2;
Steam64 = steam2.ToSteam64();
Steam3 = steam2.ToSteam3(type);
}
public SteamId(SteamId3 steam3, byte universe = 0)
{
Steam3 = steam3;
Steam64 = steam3.ToSteam64();
Steam2 = steam3.ToSteam2(universe);
}
public static SteamId FromSteam64(long steam64, char type = 'U', short universe = 0)
{
return new SteamId(new SteamId64(steam64), type, universe);
}
public override string ToString()
{
return Steam64.ToString();
}
public static bool TryParse(string input, out SteamId result)
{
return SteamIdParser.TryParse(input, out result);
}
/// <exception cref="FormatException"></exception>
public static SteamId Parse(string input)
{
return SteamIdParser.Parse(input);
}
public static bool operator ==(SteamId left, SteamId right)
{
return left.Equals(right);
}
public static bool operator !=(SteamId left, SteamId right)
{
return !left.Equals(right);
}
public bool Equals(SteamId other)
{
return Steam64.Equals(other.Steam64);
}
public override bool Equals(object? obj)
{
return obj is SteamId other && Equals(other);
}
public override int GetHashCode()
{
return Steam64.GetHashCode();
}
}