Fixed SteamFriends events not being hooked

This commit is contained in:
Garry Newman 2020-02-25 19:03:56 +00:00
parent 4d98ea3d51
commit 5d9e4b5c0b

View File

@ -19,11 +19,13 @@ namespace Steamworks
SetInterface( server, new ISteamFriends( server ) ); SetInterface( server, new ISteamFriends( server ) );
richPresence = new Dictionary<string, string>(); richPresence = new Dictionary<string, string>();
InstallEvents();
} }
static Dictionary<string, string> richPresence; static Dictionary<string, string> richPresence;
internal static void InstallEvents() internal void InstallEvents()
{ {
Dispatch.Install<PersonaStateChange_t>( x => OnPersonaStateChange?.Invoke( new Friend( x.SteamID ) ) ); Dispatch.Install<PersonaStateChange_t>( x => OnPersonaStateChange?.Invoke( new Friend( x.SteamID ) ) );
Dispatch.Install<GameRichPresenceJoinRequested_t>( x => OnGameRichPresenceJoinRequested?.Invoke( new Friend( x.SteamIDFriend), x.ConnectUTF8() ) ); Dispatch.Install<GameRichPresenceJoinRequested_t>( x => OnGameRichPresenceJoinRequested?.Invoke( new Friend( x.SteamIDFriend), x.ConnectUTF8() ) );