mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 09:11:32 +01:00
commit
736d08a2bc
@ -368,6 +368,7 @@ public class Client {
|
|||||||
logger.info("---------[ Silent Client Stopping ]--------------");
|
logger.info("---------[ Silent Client Stopping ]--------------");
|
||||||
logger.info("STOPPING > silent-socket");
|
logger.info("STOPPING > silent-socket");
|
||||||
Players.unregister();
|
Players.unregister();
|
||||||
|
skillIssue.sendDetections();
|
||||||
logger.info("-------------------------------------------------");
|
logger.info("-------------------------------------------------");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,18 +1,52 @@
|
|||||||
package net.silentclient.client.skillissue;
|
package net.silentclient.client.skillissue;
|
||||||
|
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.event.EventManager;
|
||||||
|
import net.silentclient.client.event.EventTarget;
|
||||||
|
import net.silentclient.client.event.impl.ClientTickEvent;
|
||||||
import net.silentclient.client.skillissue.detections.Detection;
|
import net.silentclient.client.skillissue.detections.Detection;
|
||||||
import net.silentclient.client.skillissue.detections.Reach;
|
import net.silentclient.client.skillissue.detections.Reach;
|
||||||
|
import net.silentclient.client.utils.Requests;
|
||||||
|
import net.silentclient.client.utils.TimerUtils;
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class SkillIssue {
|
public class SkillIssue {
|
||||||
public static final String VERSION = "1.0.0-beta.1";
|
public static final String VERSION = "1.0.0-beta.1";
|
||||||
private final ArrayList<Detection> detections = new ArrayList<>();
|
private final ArrayList<Detection> detections = new ArrayList<>();
|
||||||
|
private TimerUtils timer;
|
||||||
|
|
||||||
public SkillIssue() {
|
public SkillIssue() {
|
||||||
|
EventManager.register(this);
|
||||||
Client.logger.info(String.format("[SkillIssue]: Initialising (v%s)", VERSION));
|
Client.logger.info(String.format("[SkillIssue]: Initialising (v%s)", VERSION));
|
||||||
detections.add(new Reach(this));
|
detections.add(new Reach(this));
|
||||||
|
timer = new TimerUtils();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventTarget
|
||||||
|
public void tickEvent(ClientTickEvent event) {
|
||||||
|
if(timer.delay(30000)) {
|
||||||
|
timer.reset();
|
||||||
|
(new Thread(this::sendDetections)).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendDetections() {
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
for(Detection detection : detections) {
|
||||||
|
for(String detectReason : detection.getDetections()) {
|
||||||
|
jsonArray.put(new JSONObject().put("type", detection.getName().toLowerCase()).put("message", detectReason));
|
||||||
|
}
|
||||||
|
detection.getDetections().clear();
|
||||||
|
}
|
||||||
|
if(jsonArray.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
JSONObject jsonObject = new JSONObject().put("detects", jsonArray);
|
||||||
|
|
||||||
|
Requests.post("https://api.silentclient.net/anticheat/detect", jsonObject.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<Detection> getDetections() {
|
public ArrayList<Detection> getDetections() {
|
||||||
|
@ -3,18 +3,15 @@ package net.silentclient.client.skillissue.detections;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.event.EventManager;
|
import net.silentclient.client.event.EventManager;
|
||||||
import net.silentclient.client.event.EventTarget;
|
|
||||||
import net.silentclient.client.event.impl.ClientTickEvent;
|
|
||||||
import net.silentclient.client.skillissue.SkillIssue;
|
import net.silentclient.client.skillissue.SkillIssue;
|
||||||
import net.silentclient.client.utils.Requests;
|
|
||||||
import org.json.JSONObject;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class Detection {
|
public class Detection {
|
||||||
protected Minecraft mc = Minecraft.getMinecraft();
|
protected Minecraft mc = Minecraft.getMinecraft();
|
||||||
protected SkillIssue skillIssue;
|
protected SkillIssue skillIssue;
|
||||||
protected int detections = 0;
|
|
||||||
protected long lastDetection = 0;
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
protected ArrayList<String> detections = new ArrayList<>();
|
||||||
|
|
||||||
public Detection(SkillIssue skillIssue, String name) {
|
public Detection(SkillIssue skillIssue, String name) {
|
||||||
this.skillIssue = skillIssue;
|
this.skillIssue = skillIssue;
|
||||||
@ -23,24 +20,12 @@ public class Detection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void detect(String data) {
|
public void detect(String data) {
|
||||||
this.detections += 1;
|
this.detections.add(data);
|
||||||
this.lastDetection = System.currentTimeMillis();
|
Client.logger.warn(String.format("[SkillIssue]: %s Detection: %s (vl: %s)", name, data, detections.size()));
|
||||||
Client.logger.warn(String.format("[SkillIssue]: %s Detection: %s (vl: %s)", name, data, detections));
|
|
||||||
(new Thread(() -> {
|
|
||||||
Requests.post("https://api.silentclient.net/anticheat/detect", new JSONObject().put("type", name.toLowerCase()).put("message", data).toString());
|
|
||||||
if(detections >= 10) {
|
|
||||||
Client.getInstance().updateUserInformation();
|
|
||||||
}
|
|
||||||
})).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventTarget
|
public ArrayList<String> getDetections() {
|
||||||
public void updateDetection(ClientTickEvent event) {
|
return detections;
|
||||||
if(lastDetection != 0) {
|
|
||||||
if(System.currentTimeMillis() - lastDetection >= 600000) {
|
|
||||||
lastDetection = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
Loading…
Reference in New Issue
Block a user