This callback code is bullshit

This commit is contained in:
Garry Newman 2016-09-29 15:25:11 +01:00
parent 503e0529c0
commit 3a9c1962a1

View File

@ -135,6 +135,11 @@ public Client( uint appId )
Username = native.friends.GetPersonaName(); Username = native.friends.GetPersonaName();
SteamId = native.user.GetSteamID(); SteamId = native.user.GetSteamID();
BetaName = native.apps.GetCurrentBetaName(); BetaName = native.apps.GetCurrentBetaName();
//
// Run update, first call does some initialization
//
Update();
} }
public void Dispose() public void Dispose()
@ -183,10 +188,15 @@ public bool Valid
internal Action InstallCallback( int type, Delegate action ) internal Action InstallCallback( int type, Delegate action )
{ {
var ptr = Marshal.GetFunctionPointerForDelegate( action ); var del = Marshal.GetFunctionPointerForDelegate( action );
Valve.Steamworks.SteamAPI.RegisterCallback( ptr, type );
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;
} }
} }
} }