Slight hotfixes that were published with that update you saw.
This commit is contained in:
183
obf/config-windows.json
Normal file
183
obf/config-windows.json
Normal file
@@ -0,0 +1,183 @@
|
||||
{
|
||||
"Settings": {
|
||||
"Input": "C:/Users/chase/Documents/Sentinel/build/libs/Sentinel-0.2.5.jar",
|
||||
"Output": "C:\\Users\\chase\\Documents\\Sentinel\\build\\libs\\Sentinel-0.2.5-beta-reobf.jar",
|
||||
"Libraries": [
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/gson-2.10.1.jar",
|
||||
"C:\\Users\\chase\\Documents\\Sentinel\\build\\libraries\\ProtocolLib-5.1.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-api-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventu re-key-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-logger-slf4j-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-minimessage-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-serializer-gson-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-serializer-json-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-serializer-legacy-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-serializer-plain-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/annotations-24.1.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/bungeecord-chat-1.20-R0.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/checker-qual-3.33.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/error_prone_annotations-2.18.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/examination-api-1.3.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/examination-string-1.3.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/failureaccess-1.0.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/fastutil-8.5.6.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/gson-2.10.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/guava-32.1.2-jre.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/j2objc-annotations-2.8.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/javax.inject-1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/joml-1.10.5.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/json-simple-1.1.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/jsr305-3.0.2.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/org.eclipse.sisu.inject-0.9.0.M2.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/PDK-1.3.4.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/plexus-interpolation-1.26.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/plexus-utils-3.5.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/snakeyaml-2.2.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/spigot-api-1.20.2-R0.1-SNAPSHOT.jar"
|
||||
],
|
||||
"Exclusions": [
|
||||
"com/google/gson/",
|
||||
"io/github/itzispyder/"
|
||||
],
|
||||
"GenerateRemap": true,
|
||||
"RemapOutput": "mappings.json",
|
||||
"ParallelProcessing": true,
|
||||
"CustomDictionary": [],
|
||||
"DictionaryStartIndex": 0,
|
||||
"CorruptOutput": false,
|
||||
"FileRemovePrefix": [],
|
||||
"FileRemoveSuffix": []
|
||||
},
|
||||
"AntiDebug": {
|
||||
"Enabled": true,
|
||||
"SourceDebug": true,
|
||||
"LineDebug": true,
|
||||
"RenameSourceDebug": true,
|
||||
"SourceNames": [
|
||||
"protected-by-redactor.java",
|
||||
"COPYRIGHT_SENTINEL_ANTINUKE_2024"
|
||||
]
|
||||
},
|
||||
"Shrinking": {
|
||||
"Enabled": true,
|
||||
"RemoveInnerClass": true,
|
||||
"RemoveUnusedLabel": true,
|
||||
"RemoveNOP": false,
|
||||
"Exclusions": []
|
||||
},
|
||||
"KotlinOptimizer": {
|
||||
"Enabled": false,
|
||||
"RemoveMetadata": true,
|
||||
"RemoveIntrinsics": true,
|
||||
"IntrinsicsRemoval": [
|
||||
"checkExpressionValueIsNotNull",
|
||||
"checkNotNullExpressionValue",
|
||||
"checkReturnedValueIsNotNull",
|
||||
"checkFieldIsNotNull",
|
||||
"checkParameterIsNotNull",
|
||||
"checkNotNullParameter"
|
||||
],
|
||||
"IntrinsicsExclusions": [],
|
||||
"MetadataExclusions": []
|
||||
},
|
||||
"StringEncrypt": {
|
||||
"Enabled": true,
|
||||
"Intensity": 4,
|
||||
"Exclusions": [
|
||||
"io/github/thetrouper/sentinel/data/config/",
|
||||
"io/github/thetrouper/sentinel/data/cmdblocks/"
|
||||
]
|
||||
},
|
||||
"NumberEncrypt": {
|
||||
"Enabled": true,
|
||||
"FloatingPoint": true,
|
||||
"Intensity": 2,
|
||||
"Exclusions": [
|
||||
"io/github/thetrouper/sentinel/data/config/",
|
||||
"io/github/thetrouper/sentinel/data/cmdblocks/"
|
||||
]
|
||||
},
|
||||
"ScrambleTransformer": {
|
||||
"Enabled": true,
|
||||
"Intensity": 1,
|
||||
"RandomName": true,
|
||||
"RedirectGetStatic": true,
|
||||
"RedirectSetStatic": true,
|
||||
"RedirectGetValue": true,
|
||||
"RedirectSetField": true,
|
||||
"GenerateOuterClass": false,
|
||||
"ExcludedClasses": [],
|
||||
"ExcludedFieldName": [],
|
||||
"NativeDownCalls": true,
|
||||
"NativeUpCalls": false
|
||||
},
|
||||
"NativeCandidate": {
|
||||
"Enabled": false,
|
||||
"NativeAnnotation": "Lnet/spartanb312/example/Native;",
|
||||
"UpCallLimit": 0,
|
||||
"Exclusions": []
|
||||
},
|
||||
"LocalVariableRename": {
|
||||
"Enabled": true,
|
||||
"Dictionary": "Alphabet",
|
||||
"ThisReference": false
|
||||
},
|
||||
"MethodRename": {
|
||||
"Enabled": true,
|
||||
"Dictionary": "Alphabet",
|
||||
"HeavyOverloads": true,
|
||||
"RandomKeywordPrefix": true,
|
||||
"Prefix": "INEL_",
|
||||
"Exclusion": [
|
||||
"io/github/thetrouper/sentinel/data/config/",
|
||||
"io/github/thetrouper/sentinel/data/cmdblocks/"
|
||||
],
|
||||
"ExcludedName": []
|
||||
},
|
||||
"FieldRename": {
|
||||
"Enabled": true,
|
||||
"Dictionary": "Alphabet",
|
||||
"RandomKeywordPrefix": true,
|
||||
"Prefix": "SENT_",
|
||||
"Exclusion": [
|
||||
"io/github/thetrouper/sentinel/data/config/",
|
||||
"io/github/thetrouper/sentinel/data/cmdblocks/"
|
||||
],
|
||||
"ExcludedName": []
|
||||
},
|
||||
"ClassRename": {
|
||||
"Enabled": true,
|
||||
"Dictionary": "Alphabet",
|
||||
"Parent": "sentinel/",
|
||||
"Prefix": "SENTINEL_",
|
||||
"CorruptedName": false,
|
||||
"CorruptedNameExclusions": [],
|
||||
"ManifestReplace": [
|
||||
"Main-Class"
|
||||
],
|
||||
"PluginMainReplace": false,
|
||||
"BungeeMainReplace": false,
|
||||
"Exclusion": [
|
||||
"io/github/thetrouper/sentinel/Sentinel",
|
||||
"io/github/thetrouper/sentinel/data/config/",
|
||||
"io/github/thetrouper/sentinel/data/cmdblocks/"
|
||||
],
|
||||
"MixinSupport": false,
|
||||
"MixinDictionary": "Alphabet",
|
||||
"MixinPackage": "net/spartanb312/client/mixins/",
|
||||
"TargetMixinPackage": "net/spartanb312/obf/mixins/",
|
||||
"MixinFile": "mixins.example.json",
|
||||
"RefmapFile": "mixins.example.refmap.json"
|
||||
},
|
||||
"ShuffleMembers": {
|
||||
"Enabled": true,
|
||||
"Methods": true,
|
||||
"Fields": true,
|
||||
"Annotations": false
|
||||
},
|
||||
"Watermark": {
|
||||
"Enabled": false,
|
||||
"Watermark Message": "COPYRIGHT_C_SENTINEL_2024"
|
||||
}
|
||||
}
|
||||
@@ -1,40 +1,40 @@
|
||||
{
|
||||
"Settings": {
|
||||
"Input": "C:/Users/chase/Documents/Sentinel/build/libs/Sentinel-0.2.5.jar",
|
||||
"Output": "C:\\Users\\chase\\Documents\\Sentinel\\build\\libs\\Sentinel-0.2.5-beta-reobf.jar",
|
||||
"Input": "/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libs/Sentinel-0.2.6.jar",
|
||||
"Output": "/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libs/Sentinel-0.2.6-beta-reobf.jar",
|
||||
"Libraries": [
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/gson-2.10.1.jar",
|
||||
"C:\\Users\\chase\\Documents\\Sentinel\\build\\libraries\\ProtocolLib-5.1.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-api-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventu re-key-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-logger-slf4j-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-minimessage-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-serializer-gson-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-serializer-json-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-serializer-legacy-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/adventure-text-serializer-plain-4.15.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/annotations-24.1.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/bungeecord-chat-1.20-R0.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/checker-qual-3.33.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/error_prone_annotations-2.18.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/examination-api-1.3.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/examination-string-1.3.0.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/failureaccess-1.0.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/fastutil-8.5.6.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/gson-2.10.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/guava-32.1.2-jre.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/j2objc-annotations-2.8.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/javax.inject-1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/joml-1.10.5.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/json-simple-1.1.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/jsr305-3.0.2.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/org.eclipse.sisu.inject-0.9.0.M2.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/PDK-1.3.4.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/plexus-interpolation-1.26.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/plexus-utils-3.5.1.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/snakeyaml-2.2.jar",
|
||||
"C:/Users/chase/Documents/Sentinel/build/libraries/spigot-api-1.20.2-R0.1-SNAPSHOT.jar"
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/gson-2.10.1.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/ProtocolLib-5.1.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/adventure-api-4.15.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/adventure-key-4.15.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/adventure-text-logger-slf4j-4.15.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/adventure-text-minimessage-4.15.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/adventure-text-serializer-gson-4.15.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/adventure-text-serializer-json-4.15.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/adventure-text-serializer-legacy-4.15.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/adventure-text-serializer-plain-4.15.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/annotations-24.1.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/bungeecord-chat-1.20-R0.1.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/checker-qual-3.33.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/error_prone_annotations-2.18.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/examination-api-1.3.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/examination-string-1.3.0.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/failureaccess-1.0.1.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/fastutil-8.5.6.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/gson-2.10.1.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/guava-32.1.2-jre.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/j2objc-annotations-2.8.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/javax.inject-1.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/joml-1.10.5.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/json-simple-1.1.1.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/jsr305-3.0.2.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/org.eclipse.sisu.inject-0.9.0.M2.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/PDK-1.3.4.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/plexus-interpolation-1.26.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/plexus-utils-3.5.1.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/snakeyaml-2.2.jar",
|
||||
"/run/media/trouper/1TB drive/IJ/IdeaProjects/Sentinel/build/libraries/spigot-api-1.20.2-R0.1-SNAPSHOT.jar"
|
||||
],
|
||||
"Exclusions": [
|
||||
"com/google/gson/",
|
||||
@@ -83,7 +83,7 @@
|
||||
},
|
||||
"StringEncrypt": {
|
||||
"Enabled": true,
|
||||
"Intensity": 4,
|
||||
"Intensity": 6,
|
||||
"Exclusions": [
|
||||
"io/github/thetrouper/sentinel/data/config/",
|
||||
"io/github/thetrouper/sentinel/data/cmdblocks/"
|
||||
@@ -107,7 +107,10 @@
|
||||
"RedirectGetValue": true,
|
||||
"RedirectSetField": true,
|
||||
"GenerateOuterClass": false,
|
||||
"ExcludedClasses": [],
|
||||
"ExcludedClasses": [
|
||||
"io/github/thetrouper/sentinel/data/config/",
|
||||
"io/github/thetrouper/sentinel/data/cmdblocks/"
|
||||
],
|
||||
"ExcludedFieldName": [],
|
||||
"NativeDownCalls": true,
|
||||
"NativeUpCalls": false
|
||||
@@ -152,7 +155,11 @@
|
||||
"Parent": "sentinel/",
|
||||
"Prefix": "SENTINEL_",
|
||||
"CorruptedName": false,
|
||||
"CorruptedNameExclusions": [],
|
||||
"CorruptedNameExclusions": [
|
||||
"io/github/thetrouper/sentinel/data/config/",
|
||||
"io/github/thetrouper/sentinel/data/cmdblocks/",
|
||||
"io/github/thetrouper/sentinel/Sentinel"
|
||||
],
|
||||
"ManifestReplace": [
|
||||
"Main-Class"
|
||||
],
|
||||
|
||||
3839
obf/mappings.json
3839
obf/mappings.json
File diff suppressed because it is too large
Load Diff
@@ -22,14 +22,39 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
@CommandRegistry(value = "sentinel",permission = @Permission("sentinel.staff"),printStackTrace = true)
|
||||
@CommandRegistry(value = "sentinel",printStackTrace = true)
|
||||
public class SentinelCommand implements CustomCommand {
|
||||
public static boolean debugMode;
|
||||
public static List<UUID> autoWhitelist = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void dispatchCommand(CommandSender commandSender, Args args) {
|
||||
Player p = (Player) commandSender;
|
||||
Sentinel instance = Sentinel.getInstance();
|
||||
if (Load.lite) {
|
||||
commandSender.sendMessage(Text.color("""
|
||||
&8]=-&f Welcome to &d&lSentinel &7|&f Anti-Nuke &8-=[
|
||||
&7The plugin is currently loaded in &clite&7 mode.
|
||||
|
||||
&fIf you have just &apurchased&f the plugin:
|
||||
&8- &7Join the &b&ndiscord&r&7 and open a ticket.
|
||||
&8- &7https://discord.gg/Xh6BAzNtxY
|
||||
&8- &7You will then receive a license key.
|
||||
&fIf you have &cnot&f purchased the plugin:
|
||||
&8- &7Then purchase it :D
|
||||
&8- &7It wont do anything in this state!
|
||||
&8- &7(Its only 5$)
|
||||
&fIf you are reading this from a decompiler:
|
||||
&8- &7Please stop trying to crack the plugin and purchase it!
|
||||
&8- &7Your time spent trying trying to bypass my DRM could be spent at a minimum wage job.
|
||||
&8- &7There you will make 7$ an hour! (As oppose to 5$ for multiple hours of cracking)
|
||||
&fWoah! You read quite far!
|
||||
&8- &7Want the plugin for cheaper, &nor even for free&r&7?
|
||||
&8- &7DM &b@obvwolf&7 on discord and lets make a deal!
|
||||
"""));
|
||||
return;
|
||||
}
|
||||
Player p = (Player) commandSender;
|
||||
if (!p.hasPermission("sentinel.staff")) return;
|
||||
switch (args.get(0).toString()) {
|
||||
case "commandblock", "cb" -> handleCommandBlock(p,args);
|
||||
case "reload" -> {
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
package io.github.thetrouper.sentinel.events;
|
||||
|
||||
import io.github.itzispyder.pdk.events.CustomListener;
|
||||
import io.github.thetrouper.sentinel.server.functions.Load;
|
||||
import io.github.thetrouper.sentinel.server.util.Text;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
public class MiscEvents implements CustomListener {
|
||||
public class MiscEvents implements CustomListener {
|
||||
@EventHandler
|
||||
private void onJoin(PlayerJoinEvent e) {
|
||||
if (!e.getPlayer().getUniqueId().toString().equals("049460f7-21cb-42f5-8059-d42752bf406f")) return;
|
||||
e.getPlayer().sendMessage(Text.prefix("Welcome, obvWolf. This server uses Sentinel."));
|
||||
if (Load.lite) {
|
||||
e.getPlayer().sendMessage(Text.prefix("Welcome, obvWolf. This server has downloaded Sentinel. They have not verified their license yet."));
|
||||
}
|
||||
e.getPlayer().sendMessage(Text.prefix("Welcome, obvWolf. This server is protected by Sentinel."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package io.github.thetrouper.sentinel.server.functions;
|
||||
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.Gson;
|
||||
import io.github.thetrouper.sentinel.server.util.MathUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@@ -7,12 +9,27 @@ import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
public class Authenticator {
|
||||
|
||||
public static String authorize(String licenseKey, String serverID) {
|
||||
Map<String,List<String>> licenses = getLicenseList();
|
||||
|
||||
if (licenses.containsKey(licenseKey)) {
|
||||
List<String> allowedIDs = licenses.get(licenseKey);
|
||||
if (allowedIDs.contains(serverID)) {
|
||||
return "AUTHORIZED";
|
||||
} else if (allowedIDs.contains("minehut")) {
|
||||
return "MINEHUT";
|
||||
} else {
|
||||
return "INVALID-ID";
|
||||
}
|
||||
}
|
||||
|
||||
return "UNREGISTERED";
|
||||
}
|
||||
|
||||
public static String getServerID() {
|
||||
try {
|
||||
return MathUtils.SHA512(getPublicIPAddress());
|
||||
@@ -21,71 +38,36 @@ public class Authenticator {
|
||||
}
|
||||
}
|
||||
|
||||
public static String authorize(String licenseKey, String serverID) {
|
||||
String authStatus = "";
|
||||
|
||||
public static Map<String, List<String>> getLicenseList() {
|
||||
try {
|
||||
URL url = new URL("https://trouper.me/auth/sentinel");
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||
List<String> lines = readLines(reader);
|
||||
String urlString = "http://api.trouper.me:8080/sentinel";
|
||||
URL url = new URL(urlString);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
|
||||
for (String line : lines) {
|
||||
if (line.contains("data-key")) {
|
||||
String key = extractValue(line, "data-key");
|
||||
String allowedIDs = extractValue(line, "data-allowed");
|
||||
String[] allowedArr = allowedIDs.split(":");
|
||||
|
||||
if (key.equals(licenseKey)) {
|
||||
if (Arrays.asList(allowedArr).contains(serverID)) {
|
||||
authStatus = "AUTHORIZED";
|
||||
return authStatus;
|
||||
} else {
|
||||
if (Arrays.asList(allowedArr).contains("minehut")) {
|
||||
authStatus = "MINEHUT";
|
||||
return authStatus;
|
||||
}
|
||||
authStatus = "INVALID-ID";
|
||||
return authStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
int responseCode = conn.getResponseCode();
|
||||
if (responseCode != HttpURLConnection.HTTP_OK) {
|
||||
throw new IOException("Failed to get response from server, response code: " + responseCode);
|
||||
}
|
||||
|
||||
if (authStatus.isBlank()) {
|
||||
authStatus = "UNREGISTERED";
|
||||
return authStatus;
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||
String inputLine;
|
||||
StringBuilder content = new StringBuilder();
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
content.append(inputLine);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
in.close();
|
||||
conn.disconnect();
|
||||
|
||||
return authStatus;
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
|
||||
public static List<String> readLines(BufferedReader reader) {
|
||||
try {
|
||||
List<String> lines = new ArrayList<>();
|
||||
String line = reader.readLine();
|
||||
while (line != null) {
|
||||
lines.add(line);
|
||||
line = reader.readLine();
|
||||
}
|
||||
reader.close();
|
||||
return lines;
|
||||
return gson.fromJson(content.toString(), new TypeToken<HashMap<String, List<String>>>() {}.getType());
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public static String extractValue(String line, String attribute) {
|
||||
int start = line.indexOf(attribute + "=\"") + attribute.length() + 2;
|
||||
int end = line.indexOf("\"", start);
|
||||
return line.substring(start, end);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String getPublicIPAddress() throws IOException {
|
||||
String apiUrl = "http://checkip.amazonaws.com";
|
||||
|
||||
|
||||
@@ -8,18 +8,19 @@ import io.github.thetrouper.sentinel.server.util.ServerUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class Load {
|
||||
|
||||
public void load(String license, String serverID) {
|
||||
String authstatus = "ERROR";
|
||||
String authStatus = "ERROR";
|
||||
try {
|
||||
authStatus = Authenticator.authorize(license, serverID);
|
||||
authstatus = Auth.authorize(license, serverID);
|
||||
String IP = Authenticator.getPublicIPAddress();
|
||||
Sentinel.IP = Authenticator.getPublicIPAddress();
|
||||
Sentinel.log.info("Auth Requested...");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Sentinel.log.info("WTFFFF ARE YOU DOING MAN??????");
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
liteStart();
|
||||
}
|
||||
switch (authStatus) {
|
||||
case "AUTHORIZED" -> {
|
||||
@@ -37,28 +38,54 @@ public class Load {
|
||||
this.startup();
|
||||
} else {
|
||||
Sentinel. log.info("Dynamic IP Failure. Webhook Error possible? Please contact obvWolf to fix this.");
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
liteStart();
|
||||
}
|
||||
}
|
||||
case "INVALID-ID" -> {
|
||||
Sentinel.log.info("Authentication Failure, You have not whitelisted this server ID yet.");
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
liteStart();
|
||||
}
|
||||
case "UNREGISTERED" -> {
|
||||
Sentinel.log.warning("Authentication Failure, YOU SHALL NOT PASS! License: %s Server ID: %s".formatted(license,serverID));
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
liteStart();
|
||||
}
|
||||
case "ERROR" -> {
|
||||
Sentinel.log.warning("Hmmmmmm thats not right... License: %s Server ID: %s\nPlease report the above stacktrace.".formatted(license,serverID));
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
liteStart();
|
||||
}
|
||||
default -> {
|
||||
Sentinel.log.warning("Achievement unlocked: How did we get here? License: %s Server ID: %s\nPlease report the above stacktrace.".formatted(license,serverID));
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
liteStart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean lite = false;
|
||||
|
||||
public void liteStart() {
|
||||
lite = true;
|
||||
|
||||
Telemetry.initTelemetryHook();
|
||||
if (!Telemetry.sendLiteLog()) {
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
return;
|
||||
}
|
||||
|
||||
new SentinelCommand().register();
|
||||
|
||||
Sentinel.log.info("""
|
||||
Finished!
|
||||
____ __ ___ \s
|
||||
/\\ _`\\ /\\ \\__ __ /\\_ \\ \s
|
||||
\\ \\,\\L\\_\\ __ ___\\ \\ ,_\\/\\_\\ ___ __\\//\\ \\ \s
|
||||
\\/_\\__ \\ /'__`\\/' _ `\\ \\ \\/\\/\\ \\ /' _ `\\ /'__`\\\\ \\ \\ \s
|
||||
/\\ \\L\\ \\/\\ __//\\ \\/\\ \\ \\ \\_\\ \\ \\/\\ \\/\\ \\/\\ __/ \\_\\ \\_\s
|
||||
\\ `\\____\\ \\____\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\_\\ \\____\\/\\____\\
|
||||
\\/_____/\\/____/\\/_/\\/_/\\/__/ \\/_/\\/_/\\/_/\\/____/\\/____/
|
||||
]==-- Enabled Lite mode. Go verify your purchase. --==[
|
||||
""");
|
||||
}
|
||||
|
||||
public void startup() {
|
||||
Sentinel.log.info("\n]======----- Loading Sentinel! -----======[");
|
||||
|
||||
|
||||
@@ -41,6 +41,27 @@ public class Telemetry {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean sendLiteLog() {
|
||||
try {
|
||||
DiscordWebhook.create()
|
||||
.username("Sentinel Anti-Nuke | Telemetry")
|
||||
.avatar("https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/3lwit5nt.png")
|
||||
.addEmbed(DiscordEmbed.create()
|
||||
.author(new DiscordEmbed.Author("Server Startup Log","https://builtbybit.com/resources/sentinel-anti-nuke.30130/",null))
|
||||
.title("A server has started up in lite mode")
|
||||
.desc("Server " + Sentinel.serverID + "\n" +
|
||||
Emojis.rightSort + " License: ||" + Sentinel.license + "||\n" +
|
||||
Emojis.rightSort + " IP: ||" + Sentinel.IP + "||")
|
||||
.color(0x440044)
|
||||
.build()
|
||||
).send(webhook);
|
||||
return true;
|
||||
} catch (Exception ex) {
|
||||
Sentinel.log.info("Failed to initialize lite mode!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendShutdownLog() {
|
||||
try {
|
||||
DiscordWebhook.create()
|
||||
|
||||
Reference in New Issue
Block a user