-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
401 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
src/main/java/com/tangykiwi/kiwiclient/util/DiscordRP.java
This file was deleted.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
src/main/java/com/tangykiwi/kiwiclient/util/discord/DiscordEventHandlers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.tangykiwi.kiwiclient.util.discord; | ||
|
||
import com.sun.jna.Structure; | ||
import com.tangykiwi.kiwiclient.util.discord.callbacks.*; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class DiscordEventHandlers extends Structure { | ||
public DisconnectedCallback disconnected; | ||
public JoinRequestCallback joinRequest; | ||
public SpectateGameCallback spectateGame; | ||
public ReadyCallback ready; | ||
public ErroredCallback errored; | ||
public JoinGameCallback joinGame; | ||
|
||
protected List<String> getFieldOrder() { | ||
return Arrays.asList("ready", "disconnected", "errored", "joinGame", "spectateGame", "joinRequest"); | ||
} | ||
|
||
public static class Builder { | ||
private final DiscordEventHandlers handlers; | ||
|
||
public Builder() { | ||
this.handlers = new DiscordEventHandlers(); | ||
} | ||
|
||
public DiscordEventHandlers build() { | ||
return this.handlers; | ||
} | ||
|
||
public Builder disconnected(final DisconnectedCallback disconnected) { | ||
this.handlers.disconnected = disconnected; | ||
return this; | ||
} | ||
|
||
public Builder errored(final ErroredCallback errored) { | ||
this.handlers.errored = errored; | ||
return this; | ||
} | ||
|
||
public Builder ready(final ReadyCallback ready) { | ||
this.handlers.ready = ready; | ||
return this; | ||
} | ||
|
||
public Builder joinRequest(final JoinRequestCallback joinRequest) { | ||
this.handlers.joinRequest = joinRequest; | ||
return this; | ||
} | ||
|
||
public Builder joinGame(final JoinGameCallback joinGame) { | ||
this.handlers.joinGame = joinGame; | ||
return this; | ||
} | ||
|
||
public Builder spectateGame(final SpectateGameCallback spectateGame) { | ||
this.handlers.spectateGame = spectateGame; | ||
return this; | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/tangykiwi/kiwiclient/util/discord/DiscordRPC.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.tangykiwi.kiwiclient.util.discord; | ||
|
||
import com.sun.jna.Library; | ||
import com.sun.jna.Native; | ||
|
||
public interface DiscordRPC extends Library { | ||
DiscordRPC INSTANCE = Native.loadLibrary("discord-rpc", DiscordRPC.class); | ||
|
||
void Discord_UpdateHandlers(final DiscordEventHandlers p0); | ||
|
||
void Discord_UpdatePresence(final DiscordRichPresence p0); | ||
|
||
void Discord_Respond(final String p0, final int p1); | ||
|
||
void Discord_Register(final String p0, final String p1); | ||
|
||
void Discord_Shutdown(); | ||
|
||
void Discord_UpdateConnection(); | ||
|
||
void Discord_RegisterSteamGame(final String p0, final String p1); | ||
|
||
void Discord_RunCallbacks(); | ||
|
||
void Discord_Initialize(final String p0, final DiscordEventHandlers p1, final boolean p2, final String p3); | ||
|
||
void Discord_ClearPresence(); | ||
} |
Oops, something went wrong.