mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 14:38:47 +00:00
Add uptime to debug report, up reach magic values.
This commit is contained in:
1 parent
df74de3fd1
commit
c6818c11f7
3 files changed
+15
-8
No files matched your search
@@ -51,10 +51,12 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
private static final int PROJECT_ID = 38723;
|
private static final int PROJECT_ID = 38723;
|
||||||
private static PacketManager packetManager;
|
private static PacketManager packetManager;
|
||||||
private static boolean protocolLib = false;
|
private static boolean protocolLib = false;
|
||||||
|
private static Long loadTime;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
plugin = this;
|
plugin = this;
|
||||||
|
loadTime = System.currentTimeMillis();
|
||||||
manager = new AnticheatManager(this, getLogger());
|
manager = new AnticheatManager(this, getLogger());
|
||||||
eventList.add(new PlayerListener());
|
eventList.add(new PlayerListener());
|
||||||
eventList.add(new BlockListener());
|
eventList.add(new BlockListener());
|
||||||
@@ -238,4 +240,8 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
public void setVerbose(boolean b) {
|
public void setVerbose(boolean b) {
|
||||||
verbose = b;
|
verbose = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getLoadTime() {
|
||||||
|
return loadTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -35,11 +35,11 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PastebinReport {
|
public class PastebinReport {
|
||||||
|
private static final String DATE = new SimpleDateFormat("yyyy-MM-dd kk:mm Z").format(new Date());
|
||||||
|
private static final String API_KEY = "6eeace09c2742f8463b9db9b0c467605";
|
||||||
|
|
||||||
private StringBuilder report = new StringBuilder();
|
private StringBuilder report = new StringBuilder();
|
||||||
private String url = "";
|
private String url = "";
|
||||||
private Date date = new Date();
|
|
||||||
private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd kk:mm Z");
|
|
||||||
|
|
||||||
|
|
||||||
public PastebinReport(CommandSender cs) {
|
public PastebinReport(CommandSender cs) {
|
||||||
Player player = null;
|
Player player = null;
|
||||||
@@ -87,7 +87,7 @@ public class PastebinReport {
|
|||||||
append("------------ WARNING! ------------");
|
append("------------ WARNING! ------------");
|
||||||
append("This report was run with NoCheatPlus enabled. Results may be inaccurate." + '\n');
|
append("This report was run with NoCheatPlus enabled. Results may be inaccurate." + '\n');
|
||||||
}
|
}
|
||||||
append("------------ AntiCheat Report - " + format.format(date) + " ------------");
|
append("------------ AntiCheat Report - " + DATE + " ------------");
|
||||||
appendSystemInfo();
|
appendSystemInfo();
|
||||||
append("------------Last 30 logs------------");
|
append("------------Last 30 logs------------");
|
||||||
appendLogs();
|
appendLogs();
|
||||||
@@ -125,6 +125,7 @@ public class PastebinReport {
|
|||||||
append("Online Mode: " + String.valueOf(Bukkit.getOnlineMode()).toUpperCase());
|
append("Online Mode: " + String.valueOf(Bukkit.getOnlineMode()).toUpperCase());
|
||||||
append("Players: " + Bukkit.getOnlinePlayers().length + "/" + Bukkit.getMaxPlayers());
|
append("Players: " + Bukkit.getOnlinePlayers().length + "/" + Bukkit.getMaxPlayers());
|
||||||
append("Plugin Count: " + Bukkit.getPluginManager().getPlugins().length);
|
append("Plugin Count: " + Bukkit.getPluginManager().getPlugins().length);
|
||||||
|
append("Plugin Uptime: " + ((System.currentTimeMillis() - AntiCheat.getPlugin().getLoadTime()) / 1000) / 60 + " minutes");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void appendMagicDiff() {
|
private void appendMagicDiff() {
|
||||||
@@ -180,7 +181,7 @@ public class PastebinReport {
|
|||||||
conn.setDoOutput(true);
|
conn.setDoOutput(true);
|
||||||
OutputStream out = conn.getOutputStream();
|
OutputStream out = conn.getOutputStream();
|
||||||
|
|
||||||
out.write(("api_option=paste" + "&api_dev_key=" + URLEncoder.encode("c0616def494dcb5b7632304f8c52c0f1", "utf-8") + "&api_paste_code=" + URLEncoder.encode(report.toString(), "utf-8") + "&api_paste_private=" + URLEncoder.encode("1", "utf-8") + "&api_paste_name=" + URLEncoder.encode("", "utf-8") + "&api_paste_expire_date=" + URLEncoder.encode("1M", "utf-8") + "&api_paste_format=" + URLEncoder.encode("text", "utf-8") + "&api_user_key=" + URLEncoder.encode("", "utf-8")).getBytes());
|
out.write(("api_option=paste" + "&api_dev_key=" + URLEncoder.encode(API_KEY, "utf-8") + "&api_paste_code=" + URLEncoder.encode(report.toString(), "utf-8") + "&api_paste_private=" + URLEncoder.encode("1", "utf-8") + "&api_paste_name=" + URLEncoder.encode("", "utf-8") + "&api_paste_expire_date=" + URLEncoder.encode("1M", "utf-8") + "&api_paste_format=" + URLEncoder.encode("text", "utf-8") + "&api_user_key=" + URLEncoder.encode("", "utf-8")).getBytes());
|
||||||
out.flush();
|
out.flush();
|
||||||
out.close();
|
out.close();
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ DROP_TIME_MIN: 800
|
|||||||
DROPPED_ITEM_TIME: 100
|
DROPPED_ITEM_TIME: 100
|
||||||
EAT_TIME_MIN: 1000
|
EAT_TIME_MIN: 1000
|
||||||
ENTERED_EXITED_TIME: 1000
|
ENTERED_EXITED_TIME: 1000
|
||||||
ENTITY_MAX_DISTANCE: 5.5
|
ENTITY_MAX_DISTANCE: 5.9
|
||||||
ENTITY_MAX_DISTANCE_CREATIVE: 6.0
|
ENTITY_MAX_DISTANCE_CREATIVE: 6.5
|
||||||
EXIT_FLY_TIME: 2000
|
EXIT_FLY_TIME: 2000
|
||||||
EXPLOSION_DAMAGE_TIME: 5000
|
EXPLOSION_DAMAGE_TIME: 5000
|
||||||
FASTBREAK_LIMIT: 2
|
FASTBREAK_LIMIT: 2
|
||||||
@@ -85,4 +85,4 @@ Y_MAXVIOLATIONS: 1
|
|||||||
Y_MAXVIOTIME: 5000
|
Y_MAXVIOTIME: 5000
|
||||||
Y_SPEED_MAX: 0.5
|
Y_SPEED_MAX: 0.5
|
||||||
Y_TIME: 1000
|
Y_TIME: 1000
|
||||||
VERSION: 0.3
|
VERSION: 0.4
|
||||||
Reference in new issue
Block a user