using System.Threading.Tasks; using Barotrauma.Networking; namespace Barotrauma; public static partial class EosInterface { public enum GetEgsSelfIdTokenError { EosNotInitialized, NotLoggedIn, InvalidToken, UnhandledErrorCondition } public enum VerifyEgsIdTokenResult { Verified, Failed } /// /// Represents an Epic Games ID Token, used to authenticate an Epic Account ID. /// This is distinct from , which represents an EOS ID Token. /// public abstract class EgsIdToken { public abstract EpicAccountId AccountId { get; } public static Option Parse(string str) => Core.LoadedImplementation.IsInitialized() ? Core.LoadedImplementation.ParseEgsIdToken(str) : Option.None; public static Result FromEpicAccountId(EpicAccountId accountId) => Core.LoadedImplementation.IsInitialized() ? Core.LoadedImplementation.GetEgsIdTokenForEpicAccountId(accountId) : Result.Failure(GetEgsSelfIdTokenError.EosNotInitialized); public abstract override string ToString(); public abstract Task Verify(AccountId accountId); } internal abstract partial class Implementation { public abstract Option ParseEgsIdToken(string str); public abstract Result GetEgsIdTokenForEpicAccountId( EpicAccountId accountId); } }