Dynamic Event Handler Registration (#135)

- Discord_RegisterHandlers() exported
- C# wrapper updated
- Dynamically sub/unsub to events
- Better mutex locking, for safety!
This commit is contained in:
Mason Sciotti
2018-03-23 10:25:28 -07:00
committed by GitHub
parent 7e5d57e6fd
commit 087282cd4b
5 changed files with 117 additions and 38 deletions

View File

@ -87,6 +87,9 @@ public class DiscordRpc
[DllImport("discord-rpc", EntryPoint = "Discord_Respond", CallingConvention = CallingConvention.Cdecl)]
public static extern void Respond(string userId, Reply reply);
[DllImport("discord-rpc", EntryPoint = "Discord_UpdateHandlers", CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdateHandlers(ref EventHandlers handlers);
public static void UpdatePresence(RichPresence presence)
{
var presencestruct = presence.GetStruct();