[Maintenance PR for Legacy Gamedevs] Add party privacy enum (#306)

* Add party privacy enum

* Add party privacy enum

* Possible unreal working

* Cast to int
This commit is contained in:
Mason Sciotti
2020-09-21 14:51:48 -07:00
committed by GitHub
parent e4c0c569ec
commit 963aa9f3e5
7 changed files with 37 additions and 1 deletions

View File

@ -56,6 +56,7 @@ public class DiscordRpc
public IntPtr partyId; /* max 128 bytes */
public int partySize;
public int partyMax;
public int partyPrivacy;
public IntPtr matchSecret; /* max 128 bytes */
public IntPtr joinSecret; /* max 128 bytes */
public IntPtr spectateSecret; /* max 128 bytes */
@ -78,6 +79,12 @@ public class DiscordRpc
Ignore = 2
}
public enum PartyPrivacy
{
Private = 0,
Public = 1
}
public static void Initialize(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId)
{
Callbacks = handlers;
@ -137,6 +144,7 @@ public class DiscordRpc
public string partyId; /* max 128 bytes */
public int partySize;
public int partyMax;
public PartyPrivacy partyPrivacy;
public string matchSecret; /* max 128 bytes */
public string joinSecret; /* max 128 bytes */
public string spectateSecret; /* max 128 bytes */
@ -164,6 +172,7 @@ public class DiscordRpc
_presence.partyId = StrToPtr(partyId);
_presence.partySize = partySize;
_presence.partyMax = partyMax;
_presence.partyPrivacy = (int)partyPrivacy;
_presence.matchSecret = StrToPtr(matchSecret);
_presence.joinSecret = StrToPtr(joinSecret);
_presence.spectateSecret = StrToPtr(spectateSecret);