xezno / SharpPresence

Warning: as of April 30 2019, Discord-RPC is deprecated and therefore using this library is not recommended. Please consider using the Discord GameSDK instead, which has a native C# integration and is much easier to use.
https://discordapp.com/developers/docs/game-sdk/sdk-starter-guide
6 stars 1 forks source link
discord discord-rpc game rich-presence-bindings wrapper

SharpPresence

Discord RPC / Rich Presence bindings/wrapper for C#

Usage

Using SharpPresence is not unlike using the official C SDK. Simply either compile & add reference to the library in your project, or add the file "Discord.cs".

Structures

EventHandlers

RichPresence

JoinRequest

This structure contains:

Functions

Initialize(...)

This function takes the form of Discord.Initialize(string, EventHandlers). It is simply a wrapper for Discord_Initialize(...) and handles references, among other details. Currently it does not support the optionalSteamId parameter, however it can easily be modified to allow for customizability.

UpdatePresence(...)

This function takes the form of Discord.UpdatePresence(RichPresence). It handles pointers and memory allocation to wrap Discord_UpdatePresence(...) very nicely and help to make code much more readable.

Shutdown()

Does nothing special. Simply wraps the function Discord_Shutdown() within the OOP-focused layout.

UpdateConnection()

Does nothing special. Simply wraps the function Discord_UpdateConnection() within the OOP-focused layout.

RunCallbacks()

Does nothing special. Simply wraps the function Discord_RunCallbacks() within the OOP-focused layout.

Respond()

Does nothing special. Simply wraps the function Discord_Respond() within the OOP-focused layout.

Enumerations

Reply

The three states recieved from a game after a join request has been sent.