From 3a46e5764d55dc1f98054044a0c91462c1ba9105 Mon Sep 17 00:00:00 2001 From: William Wallace Date: Wed, 27 Mar 2019 18:21:10 +0000 Subject: [PATCH] cleanup --- Facepunch.Steamworks/Client/ClientAuth.cs | 4 +--- Facepunch.Steamworks/Interfaces/Auth.cs | 6 ++++++ Facepunch.Steamworks/Server/ServerAuth.cs | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Facepunch.Steamworks/Client/ClientAuth.cs b/Facepunch.Steamworks/Client/ClientAuth.cs index 272d27c..5479fde 100644 --- a/Facepunch.Steamworks/Client/ClientAuth.cs +++ b/Facepunch.Steamworks/Client/ClientAuth.cs @@ -7,11 +7,9 @@ internal class ClientAuth : Auth { private Client _client; - public ClientAuth( Client client ) + public ClientAuth( Client client ) : base( client ) { _client = client; - _client.RegisterCallback( OnAuthTicketValidate ); - _client.RegisterCallback( OnGetAuthSessionTicketResponseThing ); } public unsafe override Ticket GetAuthSessionTicket() diff --git a/Facepunch.Steamworks/Interfaces/Auth.cs b/Facepunch.Steamworks/Interfaces/Auth.cs index fffc079..0f10a75 100644 --- a/Facepunch.Steamworks/Interfaces/Auth.cs +++ b/Facepunch.Steamworks/Interfaces/Auth.cs @@ -33,6 +33,12 @@ public enum AuthStatus : int PublisherIssuedBan = SteamNative.AuthSessionResponse.PublisherIssuedBan } + public Auth( BaseSteamworks instance ) + { + instance.RegisterCallback( OnAuthTicketValidate ); + instance.RegisterCallback( OnGetAuthSessionTicketResponseThing ); + } + /// /// This is ran whenever the status of an ongoing session changes /// SteamId, OwnerSteamId, Status diff --git a/Facepunch.Steamworks/Server/ServerAuth.cs b/Facepunch.Steamworks/Server/ServerAuth.cs index 94e47c4..ffe1a50 100644 --- a/Facepunch.Steamworks/Server/ServerAuth.cs +++ b/Facepunch.Steamworks/Server/ServerAuth.cs @@ -7,11 +7,9 @@ internal class ServerAuth : Auth { private Server _server; - public ServerAuth( Server server ) + public ServerAuth( Server server ) : base( server ) { _server = server; - _server.RegisterCallback( OnAuthTicketValidate ); - _server.RegisterCallback( OnGetAuthSessionTicketResponseThing ); } public unsafe override Ticket GetAuthSessionTicket()