BeginAuthSession() public static method

Authenticate ticket from entity steamID to be sure it is valid and isnt reused

Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )

public static BeginAuthSession ( byte pAuthTicket, int cbAuthTicket, CSteamID steamID ) : EBeginAuthSessionResult
pAuthTicket byte
cbAuthTicket int
steamID CSteamID
return EBeginAuthSessionResult
Exemplo n.º 1
0
        public void AuthSession()
        {
            var ticket = SteamUser.GetAuthSessionTicket();

            Assert.AreNotEqual(0, ticket.Handle);
            Assert.AreNotEqual(0, ticket.Data.Length);
            Console.WriteLine($"ticket.Handle: {ticket.Handle}");
            Console.WriteLine($"ticket.Data: { string.Join( "", ticket.Data.Select( x => x.ToString( "x" ) ) ) }");

            var result = SteamUser.BeginAuthSession(ticket.Data, SteamClient.SteamId);

            Console.WriteLine($"result: { result }");
            Assert.AreEqual(result, BeginAuthResult.OK);

            SteamUser.EndAuthSession(SteamClient.SteamId);
        }