/// <summary> /// Called on client from OnClientAuthenticateInternal when a client needs to authenticate /// </summary> /// <param name="conn">Connection of the client.</param> public override async void OnClientAuthenticate(NetworkConnection conn) { ticket = await SteamUser.GetAuthSessionTicketAsync(); if (logger.LogEnabled()) { logger.LogFormat(LogType.Log, "SteamAuthenticator Got ticket!"); } AuthRequestMessage authRequestMessage = new AuthRequestMessage() { steamId = SteamClient.SteamId.Value, ticket = ticket.Data }; NetworkClient.Send(authRequestMessage); }
static async Task Main(string[] args) { await Parser.Default.ParseArguments <SteamOptions, object>(args) .WithParsedAsync <SteamOptions>(async o => { SteamClient.Init(o.AppId); var ticket = await SteamUser.GetAuthSessionTicketAsync(); var hex = new StringBuilder(ticket.Data.Length * 2); foreach (byte b in ticket.Data) { hex.AppendFormat("{0:x2}", b); } Console.WriteLine($"Session ticket = {hex}"); Console.WriteLine($"Press any key to cancel the ticket..."); Console.ReadKey(); SteamClient.Shutdown(); }); }