Skip to content

Commit

Permalink
Added verbose listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
terminalsin committed Apr 8, 2021
1 parent 622d09d commit 93bdfab
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/ac/artemis/anticheat/api/ArtemisAPI.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package ac.artemis.anticheat.api;

import ac.artemis.anticheat.api.listener.VerboseListener;
import cc.ghast.packet.nms.ProtocolVersion;

import java.util.UUID;

public interface ArtemisAPI {
ProtocolVersion getVersion(UUID uuid);

void addVerboseListener(VerboseListener verboseListener);

void removeVerboseListener(VerboseListener verboseListener);

void clearVerboseListeners();
}
38 changes: 38 additions & 0 deletions src/main/java/ac/artemis/anticheat/api/alert/Alert.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package ac.artemis.anticheat.api.alert;

import ac.artemis.anticheat.api.check.CheckInfo;

import java.util.UUID;

public interface Alert {
/**
* Returns the severity of the alert. An alert can either be a verbose or a violation.
* @return Severity of alert
*/
Severity getSeverity();

/**
* UUID of the player that has flagged
* @return The UUID
*/
UUID getUuid();

/**
* Information about the check in question
* @return Information about the checkinformation
*/
CheckInfo getCheck();

/**
* Violation digit
* @return Integer representing the above
*/
int count();

/**
* Value that corresponds to a Minecraft chat message
* @return Minecraft chat message value
*/
String toMinecraftMessage();

}
6 changes: 6 additions & 0 deletions src/main/java/ac/artemis/anticheat/api/alert/Severity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package ac.artemis.anticheat.api.alert;

public enum Severity {
VERBOSE,
VIOLATION;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package ac.artemis.anticheat.api.listener;

import ac.artemis.anticheat.api.alert.Alert;

public interface VerboseListener {
/**
* Will listen to every kind of verbose. This can be constructed as a Player,
* a discord or whatnot.
* @param alert Alert that has to be received
*/
void receive(Alert alert);
}

0 comments on commit 93bdfab

Please sign in to comment.