Skip to content
This repository was archived by the owner on Apr 9, 2023. It is now read-only.

Commit bee429f

Browse files
author
Vatuu
committed
Updated to DLL Version 3.1.0.
- Exposed the UpdateHandler method. - You can now update the callbacks registered in the handler after the initialization.
1 parent 9e5104f commit bee429f

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

discord-rpc.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.5.1" level="project" />
1515
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
1616
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
17-
<orderEntry type="library" name="Maven: com.github.Vatuu:discord-rpc-binaries:3.0.0" level="project" />
17+
<orderEntry type="library" name="Maven: com.github.Vatuu:discord-rpc-binaries:3.1.0" level="project" />
1818
</component>
1919
</module>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>net.arikia.dev</groupId>
55
<artifactId>discord-rpc</artifactId>
66
<name>DiscordRPC</name>
7-
<version>1.3</version>
7+
<version>1.4</version>
88
<packaging>jar</packaging>
99

1010
<properties>
@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>com.github.Vatuu</groupId>
4242
<artifactId>discord-rpc-binaries</artifactId>
43-
<version>3.0.0</version>
43+
<version>3.1.0</version>
4444
<scope>compile</scope>
4545
</dependency>
4646
</dependencies>

src/main/java/net/arikia/dev/drpc/DiscordRPC.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public final class DiscordRPC{
2121
static { loadDLL(); }
2222

2323
//DLL-Version for Update Check.
24-
private static final String DLL_VERSION = "3.0.0";
24+
private static final String DLL_VERSION = "3.1.0";
2525

2626
/**
2727
* Method to initialize the Discord-RPC.
@@ -67,6 +67,15 @@ public static void discordRegisterSteam(String applicationId, String steamId){
6767
DLL.INSTANCE.Discord_RegisterSteamGame(applicationId, steamId);
6868
}
6969

70+
/**
71+
* Method to update the registered EventHandlers, after the initialization was
72+
* already called.
73+
* @param handlers DiscordEventHandler object with updated callbacks.
74+
*/
75+
public static void discordUpdateEventHandlers(DiscordEventHandlers handlers){
76+
DLL.INSTANCE.Discord_UpdateHandlers(handlers);
77+
}
78+
7079
/**
7180
* Method to shutdown the Discord-RPC from within the application.
7281
*/
@@ -146,6 +155,7 @@ private interface DLL extends Library{
146155
void Discord_Initialize(String applicationId, DiscordEventHandlers handlers, int autoRegister, String optionalSteamId);
147156
void Discord_Register(String applicationId, String command);
148157
void Discord_RegisterSteamGame(String applicationId, String steamId);
158+
void Discord_UpdateHandlers(DiscordEventHandlers handlers);
149159
void Discord_Shutdown();
150160
void Discord_RunCallbacks();
151161
void Discord_UpdatePresence(DiscordRichPresence presence);

0 commit comments

Comments
 (0)