From 3a9c1962a11b4aa44b8ed1e2bf65b87cef819b6e Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 29 Sep 2016 15:25:11 +0100 Subject: [PATCH] This callback code is bullshit --- Facepunch.Steamworks/Client.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index e23ee1a..9bc66e3 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -135,6 +135,11 @@ namespace Facepunch.Steamworks Username = native.friends.GetPersonaName(); SteamId = native.user.GetSteamID(); BetaName = native.apps.GetCurrentBetaName(); + + // + // Run update, first call does some initialization + // + Update(); } public void Dispose() @@ -183,10 +188,15 @@ namespace Facepunch.Steamworks internal Action InstallCallback( int type, Delegate action ) { - var ptr = Marshal.GetFunctionPointerForDelegate( action ); - Valve.Steamworks.SteamAPI.RegisterCallback( ptr, type ); + var del = Marshal.GetFunctionPointerForDelegate( action ); - return () => Valve.Steamworks.SteamAPI.UnregisterCallback( ptr ); + // var ptr = Marshal.GetFunctionPointerForDelegate( action ); + // Valve.Steamworks.SteamAPI.RegisterCallback( del, type ); + + // Valve.Steamworks.SteamAPI.UnregisterCallback( del ); + + //return () => Valve.Steamworks.SteamAPI.UnregisterCallback( ptr ); + return null; } } }