mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-25 06:14:31 +00:00
ffcc7405a7
- Introduced `Filename` property in `Mafile` for better file management. - Refactored `Storage` methods to support `Filename` and simplify `.mafile` handling. - Enhanced `ProxyManagerView` with new controls for protocol and credentials display. - Implemented `HintBox` control for displaying errors and tips in UI. - Updated `MainWindow` with improved UI elements and event handling. - Improved command execution checks in `MainVM` for better UX. - Added localization strings for new features like proxy display options. - General code cleanups and formatting improvements.
33 lines
871 B
C#
33 lines
871 B
C#
using ProtoBuf;
|
|
using SteamLib.ProtoCore.Enums;
|
|
using SteamLib.ProtoCore.Interfaces;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace SteamLib.ProtoCore;
|
|
|
|
public static class ProtoHelpers
|
|
{
|
|
public static byte[] ProtoToBytes(IProtoMsg obj)
|
|
{
|
|
using var stream = new MemoryStream();
|
|
Serializer.Serialize(stream, obj);
|
|
return stream.ToArray();
|
|
}
|
|
|
|
[return: NotNullIfNotNull("obj")]
|
|
public static string? ProtoToString(IProtoMsg? obj)
|
|
{
|
|
return obj == null ? null : Convert.ToBase64String(ProtoToBytes(obj));
|
|
}
|
|
|
|
public static EResult GetEResult(HttpResponseMessage response)
|
|
{
|
|
if (response.Headers.TryGetValues("x-eresult", out var val))
|
|
{
|
|
var eResultInt = Convert.ToInt32(val.Single());
|
|
return (EResult)eResultInt;
|
|
}
|
|
|
|
return EResult.Invalid;
|
|
}
|
|
} |