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

Commit

Permalink
Updated to DLL Version 3.1.0.
Browse files Browse the repository at this point in the history
- Exposed the UpdateHandler method.
    - You can now update the callbacks registered in the
      handler after the initialization.
  • Loading branch information
Vatuu committed Mar 23, 2018
1 parent 9e5104f commit bee429f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion discord-rpc.iml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.5.1" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.github.Vatuu:discord-rpc-binaries:3.0.0" level="project" />
<orderEntry type="library" name="Maven: com.github.Vatuu:discord-rpc-binaries:3.1.0" level="project" />
</component>
</module>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.arikia.dev</groupId>
<artifactId>discord-rpc</artifactId>
<name>DiscordRPC</name>
<version>1.3</version>
<version>1.4</version>
<packaging>jar</packaging>

<properties>
Expand Down Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>com.github.Vatuu</groupId>
<artifactId>discord-rpc-binaries</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/net/arikia/dev/drpc/DiscordRPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class DiscordRPC{
static { loadDLL(); }

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

/**
* Method to initialize the Discord-RPC.
Expand Down Expand Up @@ -67,6 +67,15 @@ public static void discordRegisterSteam(String applicationId, String steamId){
DLL.INSTANCE.Discord_RegisterSteamGame(applicationId, steamId);
}

/**
* Method to update the registered EventHandlers, after the initialization was
* already called.
* @param handlers DiscordEventHandler object with updated callbacks.
*/
public static void discordUpdateEventHandlers(DiscordEventHandlers handlers){
DLL.INSTANCE.Discord_UpdateHandlers(handlers);
}

/**
* Method to shutdown the Discord-RPC from within the application.
*/
Expand Down Expand Up @@ -146,6 +155,7 @@ private interface DLL extends Library{
void Discord_Initialize(String applicationId, DiscordEventHandlers handlers, int autoRegister, String optionalSteamId);
void Discord_Register(String applicationId, String command);
void Discord_RegisterSteamGame(String applicationId, String steamId);
void Discord_UpdateHandlers(DiscordEventHandlers handlers);
void Discord_Shutdown();
void Discord_RunCallbacks();
void Discord_UpdatePresence(DiscordRichPresence presence);
Expand Down

0 comments on commit bee429f

Please sign in to comment.