aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/arikia/dev/drpc/callbacks
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/arikia/dev/drpc/callbacks')
-rw-r--r--src/main/java/net/arikia/dev/drpc/callbacks/DisconnectedCallback.java21
-rw-r--r--src/main/java/net/arikia/dev/drpc/callbacks/ErroredCallback.java21
-rw-r--r--src/main/java/net/arikia/dev/drpc/callbacks/JoinGameCallback.java20
-rw-r--r--src/main/java/net/arikia/dev/drpc/callbacks/JoinRequestCallback.java22
-rw-r--r--src/main/java/net/arikia/dev/drpc/callbacks/ReadyCallback.java23
-rw-r--r--src/main/java/net/arikia/dev/drpc/callbacks/SpectateGameCallback.java20
6 files changed, 127 insertions, 0 deletions
diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/DisconnectedCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/DisconnectedCallback.java
new file mode 100644
index 00000000..ccc11a24
--- /dev/null
+++ b/src/main/java/net/arikia/dev/drpc/callbacks/DisconnectedCallback.java
@@ -0,0 +1,21 @@
+package net.arikia.dev.drpc.callbacks;
+
+import com.sun.jna.Callback;
+
+/**
+ * @author Nicolas "Vatuu" Adamoglou
+ * @version 1.5.1
+ * <p>
+ * Interface to be implemented in classes that will be registered as "DisconnectedCallback" Event Handler.
+ * @see net.arikia.dev.drpc.DiscordEventHandlers
+ **/
+public interface DisconnectedCallback extends Callback {
+
+ /**
+ * Method called when disconnected.
+ *
+ * @param errorCode Error code returned on disconnection.
+ * @param message Message containing details about the disconnection.
+ */
+ void apply(int errorCode, String message);
+}
diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/ErroredCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/ErroredCallback.java
new file mode 100644
index 00000000..f5d736d7
--- /dev/null
+++ b/src/main/java/net/arikia/dev/drpc/callbacks/ErroredCallback.java
@@ -0,0 +1,21 @@
+package net.arikia.dev.drpc.callbacks;
+
+import com.sun.jna.Callback;
+
+/**
+ * @author Nicolas "Vatuu" Adamoglou
+ * @version 1.5.1
+ * <p>
+ * Interface to be implemented in classes that will be registered as "ErroredCallback" Event Handler.
+ * @see net.arikia.dev.drpc.DiscordEventHandlers
+ **/
+public interface ErroredCallback extends Callback {
+
+ /**
+ * Method called when a error occurs.
+ *
+ * @param errorCode Error code returned.
+ * @param message Message containing details about the error.
+ */
+ void apply(int errorCode, String message);
+}
diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/JoinGameCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/JoinGameCallback.java
new file mode 100644
index 00000000..c4e865db
--- /dev/null
+++ b/src/main/java/net/arikia/dev/drpc/callbacks/JoinGameCallback.java
@@ -0,0 +1,20 @@
+package net.arikia.dev.drpc.callbacks;
+
+import com.sun.jna.Callback;
+
+/**
+ * @author Nicolas "Vatuu" Adamoglou
+ * @version 1.5.1
+ * <p>
+ * Interface to be implemented in classes that will be registered as "JoinGameCallback" Event Handler.
+ * @see net.arikia.dev.drpc.DiscordEventHandlers
+ **/
+public interface JoinGameCallback extends Callback {
+
+ /**
+ * Method called when joining a game.
+ *
+ * @param joinSecret Unique String containing information needed to let the player join.
+ */
+ void apply(String joinSecret);
+}
diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/JoinRequestCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/JoinRequestCallback.java
new file mode 100644
index 00000000..ddcc9614
--- /dev/null
+++ b/src/main/java/net/arikia/dev/drpc/callbacks/JoinRequestCallback.java
@@ -0,0 +1,22 @@
+package net.arikia.dev.drpc.callbacks;
+
+import com.sun.jna.Callback;
+import net.arikia.dev.drpc.DiscordUser;
+
+/**
+ * @author Nicolas "Vatuu" Adamoglou
+ * @version 1.5.1
+ * <p>
+ * Interface to be implemented in classes that will be registered as "JoinRequestCallback" Event Handler.
+ * @see net.arikia.dev.drpc.DiscordEventHandlers
+ **/
+public interface JoinRequestCallback extends Callback {
+
+ /**
+ * Method called when another player requests to join a game.
+ *
+ * @param request Object containing all required information about the user requesting to join.
+ * @see DiscordUser
+ */
+ void apply(DiscordUser request);
+}
diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/ReadyCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/ReadyCallback.java
new file mode 100644
index 00000000..292ce2fd
--- /dev/null
+++ b/src/main/java/net/arikia/dev/drpc/callbacks/ReadyCallback.java
@@ -0,0 +1,23 @@
+package net.arikia.dev.drpc.callbacks;
+
+import com.sun.jna.Callback;
+import net.arikia.dev.drpc.DiscordUser;
+
+/**
+ * @author Nicolas "Vatuu" Adamoglou
+ * @version 1.5.1
+ * <p>
+ * Interface to be implemented in classes that will be registered as "ReadyCallback" Event Handler.
+ * @see net.arikia.dev.drpc.DiscordEventHandlers
+ **/
+public interface ReadyCallback extends Callback {
+
+ /**
+ * Method called when the connection to Discord has been established.
+ *
+ * @param user Object containing all required information about the user executing the app.
+ * @see DiscordUser
+ **/
+ void apply(DiscordUser user);
+}
+
diff --git a/src/main/java/net/arikia/dev/drpc/callbacks/SpectateGameCallback.java b/src/main/java/net/arikia/dev/drpc/callbacks/SpectateGameCallback.java
new file mode 100644
index 00000000..28af7329
--- /dev/null
+++ b/src/main/java/net/arikia/dev/drpc/callbacks/SpectateGameCallback.java
@@ -0,0 +1,20 @@
+package net.arikia.dev.drpc.callbacks;
+
+import com.sun.jna.Callback;
+
+/**
+ * @author Nicolas "Vatuu" Adamoglou
+ * @version 1.5.1
+ * <p>
+ * Interface to be implemented in classes that will be registered as "SpectateGameCallback" Event Handler.
+ * @see net.arikia.dev.drpc.DiscordEventHandlers
+ **/
+public interface SpectateGameCallback extends Callback {
+
+ /**
+ * Method called when joining a game.
+ *
+ * @param spectateSecret Unique String containing information needed to let the player spectate.
+ */
+ void apply(String spectateSecret);
+}