diff --git a/Facepunch.Steamworks.Test/ClientTest.cs b/Facepunch.Steamworks.Test/ClientTest.cs index f8e2ab6..c83105a 100644 --- a/Facepunch.Steamworks.Test/ClientTest.cs +++ b/Facepunch.Steamworks.Test/ClientTest.cs @@ -59,23 +59,6 @@ namespace Facepunch.Steamworks.Test } } - [TestMethod] - public void AuthSessionTicket() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var ticket = client.Auth.GetAuthSessionTicket(); - - Assert.IsTrue( ticket != null ); - Assert.IsTrue( ticket.Handle != 0 ); - Assert.IsTrue( ticket.Data.Length > 0 ); - - ticket.Cancel(); - - Assert.IsTrue( ticket.Handle == 0 ); - } - } - [TestMethod] public void Update() { diff --git a/Facepunch.Steamworks/Client/Auth.cs b/Facepunch.Steamworks/Client/Auth.cs deleted file mode 100644 index d807ae9..0000000 --- a/Facepunch.Steamworks/Client/Auth.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks -{ - public partial class Client : IDisposable - { - Auth _auth; - - public Auth Auth - { - get - { - if ( _auth == null ) - _auth = new Auth{ client = this }; - - return _auth; - } - } - } - - public class Auth - { - internal Client client; - - public class Ticket : IDisposable - { - internal Client client; - - public byte[] Data; - public uint Handle; - - /// - /// Cancels a ticket. - /// You should cancel your ticket when you close the game or leave a server. - /// - public void Cancel() - { - if ( client.IsValid && Handle != 0 ) - { - client.native.user.CancelAuthTicket( Handle ); - Handle = 0; - Data = null; - } - } - - public void Dispose() - { - Cancel(); - } - } - - /// - /// Which you can send to a server to authenticate that you are who you say you are. - /// - public unsafe Ticket GetAuthSessionTicket() - { - var data = new byte[1024]; - - fixed ( byte* b = data ) - { - uint ticketLength = 0; - uint ticket = client.native.user.GetAuthSessionTicket( (IntPtr) b, data.Length, out ticketLength ); - - if ( ticket == 0 ) - return null; - - return new Ticket() - { - client = client, - Data = data.Take( (int)ticketLength ).ToArray(), - Handle = ticket - }; - } - } - - - } -}