From be93dec2a48958af7ee573319f6b7c82667721ba Mon Sep 17 00:00:00 2001 From: funkemunky Date: Fri, 10 Jan 2020 13:16:12 -0500 Subject: [PATCH] First commit. - Almost everything. --- pom.xml | 60 ++++++++++ src/main/java/dev/brighten/pl/AntiVPN.java | 72 ++++++++++++ .../brighten/pl/commands/AlertsCommand.java | 19 +++ .../dev/brighten/pl/commands/VpnCommand.java | 17 +++ .../brighten/pl/handlers/AlertsHandler.java | 44 +++++++ .../dev/brighten/pl/handlers/VPNHandler.java | 69 +++++++++++ .../brighten/pl/listeners/JoinListener.java | 18 +++ .../pl/listeners/impl/VPNCheckEvent.java | 23 ++++ .../java/dev/brighten/pl/utils/Config.java | 40 +++++++ .../dev/brighten/pl/utils/JsonReader.java | 32 +++++ .../dev/brighten/pl/utils/StringUtils.java | 27 +++++ src/main/java/dev/brighten/pl/vpn/VPNAPI.java | 109 ++++++++++++++++++ .../java/dev/brighten/pl/vpn/VPNResponse.java | 67 +++++++++++ src/main/resources/config.yml | 51 ++++++++ src/main/resources/plugin.yml | 9 ++ 15 files changed, 657 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/dev/brighten/pl/AntiVPN.java create mode 100644 src/main/java/dev/brighten/pl/commands/AlertsCommand.java create mode 100644 src/main/java/dev/brighten/pl/commands/VpnCommand.java create mode 100644 src/main/java/dev/brighten/pl/handlers/AlertsHandler.java create mode 100644 src/main/java/dev/brighten/pl/handlers/VPNHandler.java create mode 100644 src/main/java/dev/brighten/pl/listeners/JoinListener.java create mode 100644 src/main/java/dev/brighten/pl/listeners/impl/VPNCheckEvent.java create mode 100644 src/main/java/dev/brighten/pl/utils/Config.java create mode 100644 src/main/java/dev/brighten/pl/utils/JsonReader.java create mode 100644 src/main/java/dev/brighten/pl/utils/StringUtils.java create mode 100644 src/main/java/dev/brighten/pl/vpn/VPNAPI.java create mode 100644 src/main/java/dev/brighten/pl/vpn/VPNResponse.java create mode 100644 src/main/resources/config.yml create mode 100644 src/main/resources/plugin.yml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..dc7049a --- /dev/null +++ b/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + dev.brighten.plugin + AntiVPN + 1.0-SNAPSHOT + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + 8 + 8 + -XDignore.symbol.file + + + + + + src/main/resources + true + + + + + + + funkemunky-releases + http://nexus.funkemunky.cc/content/repositories/releases/ + + + + + + cc.funkemunky.utils + lombok + 1.18.0 + provided + + + org.github.spigot + 1.8.8 + 1.8.8 + + + cc.funkemunky.plugins + Atlas + 1.6.6 + provided + + + + + \ No newline at end of file diff --git a/src/main/java/dev/brighten/pl/AntiVPN.java b/src/main/java/dev/brighten/pl/AntiVPN.java new file mode 100644 index 0000000..209a937 --- /dev/null +++ b/src/main/java/dev/brighten/pl/AntiVPN.java @@ -0,0 +1,72 @@ +package dev.brighten.pl; + +import cc.funkemunky.api.Atlas; +import cc.funkemunky.api.utils.MiscUtils; +import dev.brighten.pl.handlers.AlertsHandler; +import dev.brighten.pl.handlers.VPNHandler; +import dev.brighten.pl.vpn.VPNAPI; +import org.bukkit.Bukkit; +import org.bukkit.event.HandlerList; +import org.bukkit.plugin.java.JavaPlugin; + +public class AntiVPN extends JavaPlugin { + + public static AntiVPN INSTANCE; + + public VPNAPI vpnAPI; + + public VPNHandler vpnHandler; + public AlertsHandler alertsHandler; + + public void onEnable() { + INSTANCE = this; + enable(); + } + + public void onDisable() { + disable(); + } + + public void enable() { + print(true, "scanner"); + Atlas.getInstance().initializeScanner(this, true, true); + + print(true, "vpn api and handlers"); + vpnAPI = new VPNAPI(); + vpnHandler = new VPNHandler(); + + print(true, "alerts handler"); + alertsHandler = new AlertsHandler(); + + MiscUtils.printToConsole("&aCompleted startup."); + } + + public void disable() { + print(false, "listeners"); + HandlerList.unregisterAll(this); + + print(false, "tasks"); + Bukkit.getScheduler().cancelTasks(this); + + print("Save", "database"); + AntiVPN.INSTANCE.vpnAPI.database.saveDatabase(); + + print(false, "threads"); + AntiVPN.INSTANCE.vpnAPI.vpnThread.shutdown(); + + print(false, "handlers"); + AntiVPN.INSTANCE.vpnAPI.vpnThread = null; + AntiVPN.INSTANCE.vpnHandler = null; + AntiVPN.INSTANCE.alertsHandler = null; + + MiscUtils.printToConsole("&aCompleted shutdown."); + } + + private void print(boolean enable, String task) { + MiscUtils.printToConsole((enable ? "&7Enabling " : "&7Disabling ") + task + "..."); + } + + private void print(String custom, String task) { + MiscUtils.printToConsole("&7" + custom + "ing " + task + "..."); + } +} diff --git a/src/main/java/dev/brighten/pl/commands/AlertsCommand.java b/src/main/java/dev/brighten/pl/commands/AlertsCommand.java new file mode 100644 index 0000000..8b87c1e --- /dev/null +++ b/src/main/java/dev/brighten/pl/commands/AlertsCommand.java @@ -0,0 +1,19 @@ +package dev.brighten.pl.commands; + +import cc.funkemunky.api.commands.ancmd.Command; +import cc.funkemunky.api.commands.ancmd.CommandAdapter; +import cc.funkemunky.api.utils.Init; +import dev.brighten.pl.AntiVPN; + +@Init(commands = true) +public class AlertsCommand { + + @Command(name = "kaurivpn.alerts", description = "toggle vpn alerts", + display = "alerts", playerOnly = true, permission = {"kauri.alerts", "kauri.command.alerts"}) + public void onCommand(CommandAdapter cmd) { + boolean toggled = AntiVPN.INSTANCE.alertsHandler.toggleAlerts(cmd.getPlayer()); + cmd.getSender().sendMessage(toggled + ? "&aYou are now viewing vpn detection alerts." + : "&cYou are no longer viewing vpn detection alerts."); + } +} diff --git a/src/main/java/dev/brighten/pl/commands/VpnCommand.java b/src/main/java/dev/brighten/pl/commands/VpnCommand.java new file mode 100644 index 0000000..6b1c97c --- /dev/null +++ b/src/main/java/dev/brighten/pl/commands/VpnCommand.java @@ -0,0 +1,17 @@ +package dev.brighten.pl.commands; + +import cc.funkemunky.api.Atlas; +import cc.funkemunky.api.commands.ancmd.Command; +import cc.funkemunky.api.commands.ancmd.CommandAdapter; +import cc.funkemunky.api.utils.Init; + +@Init(commands = true) +public class VpnCommand { + + @Command(name = "kaurivpn", description = "The Kauri AntiVPN main command.", + aliases = {"antivpn", "avpn", "kvpn"}, permission = "kvpn.command") + public void onCommand(CommandAdapter cmd) { + Atlas.getInstance().getCommandManager().runHelpMessage(cmd, + cmd.getSender(), Atlas.getInstance().getCommandManager().getDefaultScheme()); + } +} diff --git a/src/main/java/dev/brighten/pl/handlers/AlertsHandler.java b/src/main/java/dev/brighten/pl/handlers/AlertsHandler.java new file mode 100644 index 0000000..5c8419e --- /dev/null +++ b/src/main/java/dev/brighten/pl/handlers/AlertsHandler.java @@ -0,0 +1,44 @@ +package dev.brighten.pl.handlers; + +import cc.funkemunky.api.utils.JsonMessage; +import dev.brighten.pl.utils.Config; +import dev.brighten.pl.utils.StringUtils; +import dev.brighten.pl.vpn.VPNResponse; +import org.bukkit.Bukkit; +import org.bukkit.OfflinePlayer; +import org.bukkit.craftbukkit.v1_8_R3.util.WeakCollection; +import org.bukkit.entity.Player; + +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; +import java.util.*; + +public class AlertsHandler { + private Set hasAlerts = new HashSet<>(); + + public void sendAlert(UUID uuid, VPNResponse response) { + JsonMessage message = new JsonMessage(); + OfflinePlayer player = Bukkit.getOfflinePlayer(uuid); + message.addText(StringUtils.formatString(Config.alertMessage, response) + .replace("%player%", player.getName())) + .addHoverText(Config.alertHoverMessage.stream() + .map(string -> StringUtils.formatString(string, response) + .replace("%player%", player.getName())).toArray(String[]::new)); + hasAlerts.parallelStream().filter(Objects::nonNull) + .forEach(message::sendToPlayer); + } + + //TODO When updated Atlas releases, add this functionality. + public void sendBungeeAlert(UUID uuid, VPNResponse response) { + //Empty for now. + } + + public boolean toggleAlerts(Player player) { + boolean contains; + + if(contains = hasAlerts.contains(player)) hasAlerts.remove(player); + else hasAlerts.add(player); + + return !contains; + } +} diff --git a/src/main/java/dev/brighten/pl/handlers/VPNHandler.java b/src/main/java/dev/brighten/pl/handlers/VPNHandler.java new file mode 100644 index 0000000..0dea7b2 --- /dev/null +++ b/src/main/java/dev/brighten/pl/handlers/VPNHandler.java @@ -0,0 +1,69 @@ +package dev.brighten.pl.handlers; + +import cc.funkemunky.api.Atlas; +import cc.funkemunky.api.utils.RunUtils; +import cc.funkemunky.api.utils.Tuple; +import dev.brighten.pl.AntiVPN; +import dev.brighten.pl.listeners.impl.VPNCheckEvent; +import dev.brighten.pl.utils.Config; +import dev.brighten.pl.utils.StringUtils; +import dev.brighten.pl.vpn.VPNResponse; +import lombok.val; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; + +import java.util.Queue; +import java.util.UUID; +import java.util.concurrent.ConcurrentLinkedQueue; + +public class VPNHandler { + private Queue> queue = new ConcurrentLinkedQueue<>(); + + public void run() { + + } + + private void runCheck() { + AntiVPN.INSTANCE.vpnAPI.vpnThread.execute(() -> { + Tuple element; + while((element = queue.poll()) != null) { + val response = AntiVPN.INSTANCE.vpnAPI.getResponse(element.two); + if(response != null && response.isSuccess()) { + VPNCheckEvent event = new VPNCheckEvent(response); + if(Config.fireEvent) + RunUtils.task(() -> Bukkit.getPluginManager().callEvent(event), AntiVPN.INSTANCE); + + if(response.isProxy()) { + if(Config.alertStaff) alert(response, element.one); + if(Config.kickPlayers) kick(response, element.one); + } + } + } + runCheck(); + }); + } + + private void alert(VPNResponse response, UUID uuid) { + if(Config.alertBungee) { + AntiVPN.INSTANCE.alertsHandler.sendBungeeAlert(uuid, response); //Empty method until Atlas v1.7 releases. + } else { + AntiVPN.INSTANCE.alertsHandler.sendAlert(uuid, response); + } + } + + private void kick(VPNResponse response, UUID uuid) { + if(Config.kickBungee) { + Atlas.getInstance().getBungeeManager().getBungeeAPI() + .kickPlayer(uuid, StringUtils.formatString(Config.kickMessage, response)); + } else { + Player player = Bukkit.getPlayer(uuid); + + if(player != null) + player.kickPlayer(StringUtils.formatString(Config.kickMessage, response)); + } + } + + public void checkPlayer(Player player) { + queue.add(new Tuple<>(player.getUniqueId(), player.getAddress().getAddress().getHostAddress())); + } +} diff --git a/src/main/java/dev/brighten/pl/listeners/JoinListener.java b/src/main/java/dev/brighten/pl/listeners/JoinListener.java new file mode 100644 index 0000000..21449d4 --- /dev/null +++ b/src/main/java/dev/brighten/pl/listeners/JoinListener.java @@ -0,0 +1,18 @@ +package dev.brighten.pl.listeners; + +import cc.funkemunky.api.utils.Init; +import dev.brighten.pl.AntiVPN; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; + +@Init +public class JoinListener implements Listener { + + @EventHandler(priority = EventPriority.MONITOR) + public void onJoin(PlayerJoinEvent event) { + AntiVPN.INSTANCE.vpnHandler.checkPlayer(event.getPlayer()); + } + +} diff --git a/src/main/java/dev/brighten/pl/listeners/impl/VPNCheckEvent.java b/src/main/java/dev/brighten/pl/listeners/impl/VPNCheckEvent.java new file mode 100644 index 0000000..48e067b --- /dev/null +++ b/src/main/java/dev/brighten/pl/listeners/impl/VPNCheckEvent.java @@ -0,0 +1,23 @@ +package dev.brighten.pl.listeners.impl; + +import dev.brighten.pl.vpn.VPNResponse; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +import java.util.UUID; + +@RequiredArgsConstructor +@Getter +public class VPNCheckEvent extends Event { + private UUID uuid; + private final VPNResponse response; + private static HandlerList handlerList = new HandlerList(); + + public HandlerList getHandlers() { + return handlerList; + } +} diff --git a/src/main/java/dev/brighten/pl/utils/Config.java b/src/main/java/dev/brighten/pl/utils/Config.java new file mode 100644 index 0000000..889ba6a --- /dev/null +++ b/src/main/java/dev/brighten/pl/utils/Config.java @@ -0,0 +1,40 @@ +package dev.brighten.pl.utils; + +import cc.funkemunky.api.utils.ConfigSetting; +import cc.funkemunky.api.utils.Init; + +import java.util.ArrayList; +import java.util.List; + +@Init +public class Config { + @ConfigSetting(name = "license") + public static String license = ""; + + @ConfigSetting(name = "kick-players") + public static boolean kickPlayers = true; + + @ConfigSetting(name = "kick-message") + public static String kickMessage = ""; + + @ConfigSetting(name = "kick-bungee") + public static boolean kickBungee = false; + + @ConfigSetting(name = "alert-staff") + public static boolean alertStaff = true; + + @ConfigSetting(name = "alert-message") + public static String alertMessage = ""; + + @ConfigSetting(name = "alert-hover") + public static List alertHoverMessage = new ArrayList<>(); + + @ConfigSetting(name = "alert-bungee") + public static boolean alertBungee = false; + + @ConfigSetting(name = "hide-ips") + public static boolean hideIps = false; + + @ConfigSetting(name = "fire-event") + public static boolean fireEvent = true; +} diff --git a/src/main/java/dev/brighten/pl/utils/JsonReader.java b/src/main/java/dev/brighten/pl/utils/JsonReader.java new file mode 100644 index 0000000..df61e2d --- /dev/null +++ b/src/main/java/dev/brighten/pl/utils/JsonReader.java @@ -0,0 +1,32 @@ +package dev.brighten.pl.utils; + +import cc.funkemunky.carbon.utils.json.JSONException; +import cc.funkemunky.carbon.utils.json.JSONObject; + +import java.io.*; +import java.net.URL; +import java.nio.charset.Charset; + +public class JsonReader { + + private static String readAll(Reader rd) throws IOException { + StringBuilder sb = new StringBuilder(); + int cp; + while ((cp = rd.read()) != -1) { + sb.append((char) cp); + } + return sb.toString(); + } + + public static JSONObject readJsonFromUrl(String url) throws IOException, JSONException { + InputStream is = new URL(url).openStream(); + try { + BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); + String jsonText = readAll(rd); + JSONObject json = new JSONObject(jsonText); + return json; + } finally { + is.close(); + } + } +} \ No newline at end of file diff --git a/src/main/java/dev/brighten/pl/utils/StringUtils.java b/src/main/java/dev/brighten/pl/utils/StringUtils.java new file mode 100644 index 0000000..031b097 --- /dev/null +++ b/src/main/java/dev/brighten/pl/utils/StringUtils.java @@ -0,0 +1,27 @@ +package dev.brighten.pl.utils; + +import cc.funkemunky.api.utils.Color; +import cc.funkemunky.carbon.utils.json.JSONException; +import dev.brighten.pl.vpn.VPNResponse; +import lombok.val; + +public class StringUtils { + + public static String formatString(String string, VPNResponse response) { + String message = Color.translate(string); + if (response.isSuccess()) { + + try { + val json = response.toJson(); + + for (String key : json.keySet()) { + message = message.replace(key, String.valueOf(json.get(key))); + } + return message; + } catch (JSONException e) { + e.printStackTrace(); + } + } + return message; + } +} diff --git a/src/main/java/dev/brighten/pl/vpn/VPNAPI.java b/src/main/java/dev/brighten/pl/vpn/VPNAPI.java new file mode 100644 index 0000000..87b16ae --- /dev/null +++ b/src/main/java/dev/brighten/pl/vpn/VPNAPI.java @@ -0,0 +1,109 @@ +package dev.brighten.pl.vpn; + +import cc.funkemunky.api.utils.MathUtils; +import cc.funkemunky.api.utils.MiscUtils; +import cc.funkemunky.api.utils.RunUtils; +import cc.funkemunky.carbon.db.Database; +import cc.funkemunky.carbon.db.StructureSet; +import cc.funkemunky.carbon.db.flatfile.FlatfileDatabase; +import cc.funkemunky.carbon.utils.Pair; +import cc.funkemunky.carbon.utils.json.JSONException; +import cc.funkemunky.carbon.utils.json.JSONObject; +import dev.brighten.pl.AntiVPN; +import dev.brighten.pl.utils.Config; +import dev.brighten.pl.utils.JsonReader; +import lombok.val; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; + +import java.io.IOException; +import java.util.Objects; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +public class VPNAPI { + + public Database database; + public ExecutorService vpnThread; + + public VPNAPI() { + MiscUtils.printToConsole("&cLoading VPNHandler&7..."); + MiscUtils.printToConsole("&7Setting up Carbon database &eVPN-Cache&7..."); + database = new FlatfileDatabase("VPN-Cache"); + MiscUtils.printToConsole("&7Registering listener..."); + vpnThread = Executors.newFixedThreadPool(2); + + //Running saveDatabase task. + MiscUtils.printToConsole("&7Running database saving task..."); + RunUtils.taskTimerAsync(database::saveDatabase, AntiVPN.INSTANCE, 0, 20 * 60 * 2); + } + + public VPNResponse getResponse(Player player) { + return getResponse(player.getAddress().getAddress().getHostAddress()); + } + + public void cacheReponse(VPNResponse response) { + if(response.isSuccess()) { + try { + //Removing old value if it contains it. + if(database.contains(response.getIp())) database.remove(response.getIp()); + + val json = response.toJson(); + + + val pairs = json.keySet().stream().map(key -> { + try { + return new Pair<>(key, json.get(key)); + } catch (JSONException e) { + e.printStackTrace(); + } + return null; + }).filter(Objects::nonNull).toArray(Pair[]::new); + + StructureSet set = database.createStructure(response.getIp(), pairs); + + if(MathUtils.getDelta(set.getObjects().size(), pairs.length) > 1) { + MiscUtils.printToConsole("&cThere was an error saving response for IP &f" + + response.getIp() + "&c. &7Removing from database..."); + database.remove(response.getIp()); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + + public VPNResponse getIfCached(String ipAddress) { + if(database.contains(ipAddress)) { + return VPNResponse.fromSet(database.get(ipAddress)); + } else { + return null; + } + } + + public VPNResponse getResponse(String ipAddress) { + try { + + val response = getIfCached(ipAddress); + + if(response != null) return response; + + String url = "https://funkemunky.cc/vpn?license=" + Config.license + "&ip=" + ipAddress; + + JSONObject object = JsonReader.readJsonFromUrl(url); + + if (!object.has("ip")) { + return null; + } + + val toCacheAndReturn = VPNResponse.fromJson(object.toString()); + + cacheReponse(toCacheAndReturn); + + return toCacheAndReturn; + } catch (IOException | JSONException e) { + e.printStackTrace(); + } + return null; + } +} \ No newline at end of file diff --git a/src/main/java/dev/brighten/pl/vpn/VPNResponse.java b/src/main/java/dev/brighten/pl/vpn/VPNResponse.java new file mode 100644 index 0000000..21e5884 --- /dev/null +++ b/src/main/java/dev/brighten/pl/vpn/VPNResponse.java @@ -0,0 +1,67 @@ +package dev.brighten.pl.vpn; + +import cc.funkemunky.carbon.db.StructureSet; +import cc.funkemunky.carbon.utils.json.JSONException; +import cc.funkemunky.carbon.utils.json.JSONObject; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class VPNResponse { + private String ip, countryName, countryCode, method, state, city, isp, timeZone, locationString; + private boolean proxy, usedAdvanced, cached, success; + private double score; + private int queriesLeft; + + public JSONObject toJson() throws JSONException { + JSONObject json = new JSONObject(); + + json.put("ip", ip); + json.put("countryName", countryName); + json.put("countryCode", countryCode); + json.put("state", state); + json.put("city", city); + json.put("method", method); + json.put("isp", isp); + json.put("score", score); + json.put("proxy", proxy); + json.put("success", success); + json.put("timeZone", timeZone); + json.put("success", true); + json.put("queriesLeft", queriesLeft); + json.put("locationString", locationString); + json.put("usedAdvanced", usedAdvanced); + json.put("cached", cached); + + return json; + } + + public static VPNResponse fromJson(String json) throws JSONException { + JSONObject jsonObject = new JSONObject(json); + + return new VPNResponse(jsonObject.getString("ip"), jsonObject.getString("countryName"), + jsonObject.has("method") ? jsonObject.getString("method") : "N/A", + jsonObject.getString("countryCode"), jsonObject.getString("state"), + jsonObject.getString("city"), jsonObject.getString("isp"), + jsonObject.getString("timeZone"), jsonObject.getString("locationString"), + jsonObject.getBoolean("proxy"), jsonObject.getBoolean("usedAdvanced"), + jsonObject.getBoolean("cached"), jsonObject.getBoolean("sucess"), + jsonObject.has("score") ? jsonObject.getDouble("score") : -1, + jsonObject.getInt("queriesLeft")); + } + + public static VPNResponse fromSet(StructureSet set) { + return new VPNResponse(set.getField("ip"), set.getField("countryName"), + set.containsKey("method") ? set.getField("method") : "N/A", + set.getField("countryCode"), set.getField("state"), + set.getField("city"), set.getField("isp"), + set.getField("timeZone"), set.getField("locationString"), + set.getField("proxy"), set.getField("usedAdvanced"), + set.getField("cached"), set.getField("sucess"), + set.containsKey("score") ? set.getDouble("score") : -1, + set.getField("queriesLeft")); + } +} diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml new file mode 100644 index 0000000..3a6ed1b --- /dev/null +++ b/src/main/resources/config.yml @@ -0,0 +1,51 @@ +# +# You will need a license from https://funkemunky.cc/shop to use the AntiVPN to its full potential. +# Your server will have 200 free queries per month. Once that ends, the plugin will no longer query. +# You can also use your Kauri Anticheat license here. +# +license: "" +# +# Enable kicking # +# You can disable the function of removing players from the server. +kick-players: true +# Kick Message # +# The message sent to the player when they are kicked. +kick-message: |- + &r + &6&lKauri AntiVPN + &7You have been kicked for using a VPN. + &r + &f&o%method% +# +# Run Command in Bungee # +# This will allow the command to be run in Bungee. +kick-bungee: false +# +# VPN Use Alerts # +# A great way to find nefarious players quickly (i.e. cheaters) without them knowing what is going on. +alert-staff: true +# +# Alert Message # +# This will be the message sent to staff vpn detection. +# Requires the permission antivpn.alert to view alerts. +alert-message: "&8[&c!&8] &7Found &f%player% &7to be using a VPN." +# Alert Hover # +# The lines here will be shown when hovering on the alert message +# Placeholders: %method%, %ip%, %countryCode%, %countryName%, %score%, %queriesLeft%, %proxy%, %isp%, %timeZone% +alert-hover: + - "&eMethod: &f%method%" + - "&eIP: &f%ip%" + - "&eCountry: &f%countryName%" +# +# Alert Bungee # +# Requires AntiVPN to be on all servers using it and will require Atlas bungee mode to be enabled. +# All configuration for alerts is local. No setup required on Bungee. +alert-bungee: false +# +# Hide IP # +# This will hide the IP from all users. If false, IPs are only shown to users with permission antivpn.showip. +hide-ips: false +# +# Fire Event # +# If disabled, the VPNCheckEvent will no longer be fired. Only disable this if you have no plugins depending on it. +fire-event: true \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..5c0ae04 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,9 @@ +name: KauriVPN +main: dev.brighten.pl.AntiVPN +author: funkemunky +depend: [Atlas] +version: ${project.version} +permissions: + antivpn.showip: + default: false + description: Permission node to show IPs. \ No newline at end of file