Upload folder via GUI - src
This commit is contained in:
@@ -53,6 +53,14 @@ public class StatusAPI extends Plugin implements Runnable {
|
||||
// Kontostand pro Spieler (UUID -> Balance), wird von StatusAPIBridge gepusht
|
||||
public static final ConcurrentHashMap<UUID, Double> playerBalances = new ConcurrentHashMap<>();
|
||||
|
||||
// Debug-Modus (aus verify.properties)
|
||||
public static boolean DEBUG = false;
|
||||
|
||||
/** Gibt eine Info-Meldung nur im Debug-Modus aus */
|
||||
public static void debugLog(Plugin plugin, String message) {
|
||||
if (DEBUG) plugin.getLogger().info(message);
|
||||
}
|
||||
|
||||
private volatile Thread thread;
|
||||
private volatile ServerSocket serverSocket;
|
||||
private volatile boolean shuttingDown = false;
|
||||
@@ -83,6 +91,9 @@ public class StatusAPI extends Plugin implements Runnable {
|
||||
port = 9191;
|
||||
}
|
||||
|
||||
// Debug-Modus
|
||||
DEBUG = verifyProperties != null && Boolean.parseBoolean(verifyProperties.getProperty("debug", "false"));
|
||||
|
||||
moduleManager = new ModuleManager();
|
||||
|
||||
// Module in korrekter Reihenfolge registrieren
|
||||
@@ -192,8 +203,9 @@ public class StatusAPI extends Plugin implements Runnable {
|
||||
File file = new File(getDataFolder(), "verify.properties");
|
||||
verifyProperties = new Properties();
|
||||
if (file.exists()) {
|
||||
try (FileInputStream fis = new FileInputStream(file)) {
|
||||
verifyProperties.load(fis);
|
||||
try (java.io.InputStreamReader reader = new java.io.InputStreamReader(
|
||||
new FileInputStream(file), StandardCharsets.UTF_8)) {
|
||||
verifyProperties.load(reader);
|
||||
}
|
||||
} else {
|
||||
getLogger().warning("verify.properties nicht gefunden.");
|
||||
|
||||
@@ -121,7 +121,7 @@ public class AntiBotModule implements Module, Listener {
|
||||
ensureSecurityLogFile();
|
||||
|
||||
if (!enabled) {
|
||||
this.plugin.getLogger().info("[AntiBotModule] deaktiviert via " + CONFIG_FILE_NAME);
|
||||
StatusAPI.debugLog(this.plugin, "[AntiBotModule] deaktiviert via " + CONFIG_FILE_NAME);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class AntiBotModule implements Module, Listener {
|
||||
ProxyServer.getInstance().getPluginManager().registerCommand(this.plugin, new AntiBotCommand());
|
||||
ProxyServer.getInstance().getScheduler().schedule(this.plugin, this::tick, 1, 1, TimeUnit.SECONDS);
|
||||
|
||||
this.plugin.getLogger().info("[AntiBotModule] aktiviert. maxCps=" + maxCps
|
||||
this.plugin.getLogger().fine("[AntiBotModule] aktiviert. maxCps=" + maxCps
|
||||
+ ", attackStartCps=" + attackStartCps + ", ip/min=" + ipConnectionsPerMinute);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
package net.viper.status.modules.broadcast;
|
||||
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.viper.status.module.Module;
|
||||
|
||||
@@ -57,7 +65,7 @@ public class BroadcastModule implements Module, Listener {
|
||||
loadConfig();
|
||||
if (!enabled) return;
|
||||
try { plugin.getProxy().getPluginManager().registerListener(plugin, this); } catch (Throwable ignored) {}
|
||||
plugin.getLogger().info("[BroadcastModule] aktiviert. Format: " + format);
|
||||
plugin.getLogger().fine("[BroadcastModule] aktiviert. Format: " + format);
|
||||
loadSchedules();
|
||||
plugin.getProxy().getScheduler().schedule(plugin, this::processScheduled, 1, 1, TimeUnit.SECONDS);
|
||||
}
|
||||
@@ -142,7 +150,7 @@ public class BroadcastModule implements Module, Listener {
|
||||
for (ProxiedPlayer p : plugin.getProxy().getPlayers()) {
|
||||
try { p.sendMessage(components); sent++; } catch (Throwable ignored) {}
|
||||
}
|
||||
plugin.getLogger().info("[BroadcastModule] Broadcast gesendet (Empfänger=" + sent + "): " + message);
|
||||
StatusAPI.debugLog(plugin, "[BroadcastModule] Broadcast gesendet (Empfänger=" + sent + "): " + message);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -279,7 +287,7 @@ public class BroadcastModule implements Module, Listener {
|
||||
}
|
||||
}
|
||||
scheduledByClientId.putAll(loaded);
|
||||
plugin.getLogger().info("[BroadcastModule] " + loaded.size() + " geplante Broadcasts aus Datei wiederhergestellt.");
|
||||
plugin.getLogger().fine("[BroadcastModule] geplante Broadcasts wiederhergestellt.");
|
||||
}
|
||||
|
||||
public boolean scheduleBroadcast(long timestampMillis, String sourceName, String message, String type,
|
||||
@@ -311,7 +319,7 @@ public class BroadcastModule implements Module, Listener {
|
||||
prefix, prefixColor, bracketColor, messageColor, recur);
|
||||
scheduledByClientId.put(id, sb);
|
||||
saveSchedules();
|
||||
plugin.getLogger().info("[BroadcastModule] Neue geplante Nachricht registriert: " + id
|
||||
StatusAPI.debugLog(plugin, "[BroadcastModule] Neue geplante Nachricht registriert: " + id
|
||||
+ " @ " + dateFormat.format(new Date(timestampMillis)));
|
||||
return true;
|
||||
}
|
||||
@@ -319,7 +327,7 @@ public class BroadcastModule implements Module, Listener {
|
||||
public boolean cancelScheduled(String clientScheduleId) {
|
||||
if (clientScheduleId == null || clientScheduleId.trim().isEmpty()) return false;
|
||||
ScheduledBroadcast removed = scheduledByClientId.remove(clientScheduleId);
|
||||
if (removed != null) { plugin.getLogger().info("[BroadcastModule] Schedule abgebrochen: " + clientScheduleId); saveSchedules(); return true; }
|
||||
if (removed != null) { StatusAPI.debugLog(plugin, "[BroadcastModule] Schedule abgebrochen: " + clientScheduleId); saveSchedules(); return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -332,7 +340,7 @@ public class BroadcastModule implements Module, Listener {
|
||||
for (Map.Entry<String, ScheduledBroadcast> entry : scheduledByClientId.entrySet()) {
|
||||
ScheduledBroadcast sb = entry.getValue();
|
||||
if (sb.nextRunMillis <= now) {
|
||||
plugin.getLogger().info("[BroadcastModule] ⏰ Sende geplante Nachricht (ID: " + entry.getKey() + ")");
|
||||
StatusAPI.debugLog(plugin, "[BroadcastModule] ⏰ Sende geplante Nachricht (ID: " + entry.getKey() + ")");
|
||||
handleBroadcast(sb.sourceName, sb.message, sb.type, "", sb.prefix, sb.prefixColor, sb.bracketColor, sb.messageColor);
|
||||
if (!"none".equalsIgnoreCase(sb.recur)) {
|
||||
long next = computeNextMillis(sb.nextRunMillis, sb.recur);
|
||||
|
||||
@@ -103,7 +103,7 @@ public class ChatConfig {
|
||||
config = new Configuration();
|
||||
}
|
||||
parseConfig();
|
||||
plugin.getLogger().info("[ChatModule] " + channels.size() + " Kanäle geladen.");
|
||||
plugin.getLogger().fine("[ChatModule] " + channels.size() + " Kanäle geladen.");
|
||||
}
|
||||
|
||||
private void parseConfig() {
|
||||
@@ -392,7 +392,7 @@ public class ChatConfig {
|
||||
try (java.io.FileWriter fw = new java.io.FileWriter(filterFile)) {
|
||||
fw.write("# StatusAPI - Wort-Blacklist\n# words:\n# - beispielwort\nwords:\n");
|
||||
}
|
||||
plugin.getLogger().info("[ChatModule] filter.yml erstellt.");
|
||||
plugin.getLogger().fine("[ChatModule] filter.yml erstellt.");
|
||||
} catch (IOException e) { plugin.getLogger().warning("[ChatModule] Konnte filter.yml nicht erstellen: " + e.getMessage()); }
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ChatModule implements Module, Listener {
|
||||
// ChatLogger
|
||||
if (config.isChatlogEnabled()) {
|
||||
chatLogger = new ChatLogger(plugin.getDataFolder(), logger, config.getChatlogRetentionDays());
|
||||
logger.info("[ChatModule] Chat-Log aktiviert (" + config.getChatlogRetentionDays() + " Tage Aufbewahrung).");
|
||||
logger.fine("[ChatModule] Chat-Log aktiviert (" + config.getChatlogRetentionDays() + " Tage Aufbewahrung).");
|
||||
}
|
||||
|
||||
// ReportManager
|
||||
@@ -144,7 +144,7 @@ public class ChatModule implements Module, Listener {
|
||||
ProxyServer.getInstance().getPluginManager().registerListener(plugin, this);
|
||||
registerCommands();
|
||||
|
||||
logger.info("[ChatModule] Aktiviert – " + config.getChannels().size() + " Kanäle geladen.");
|
||||
logger.fine("[ChatModule] Aktiviert – " + config.getChannels().size() + " Kanäle geladen.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -62,7 +62,7 @@ public class CommandBlockerModule implements Module, Listener {
|
||||
}
|
||||
});
|
||||
|
||||
this.plugin.getLogger().info("[CommandBlocker] aktiviert (" + blocked.size() + " Commands).");
|
||||
this.plugin.getLogger().fine("[CommandBlocker] aktiviert (" + blocked.size() + " Commands).");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class CustomCommandModule implements Module, Listener {
|
||||
// Hier casten wir 'Plugin' zu 'StatusAPI', da wir wissen, dass es das ist
|
||||
this.plugin = (StatusAPI) plugin;
|
||||
|
||||
this.plugin.getLogger().info("Lade CustomCommandModule...");
|
||||
this.plugin.getLogger().fine("Lade CustomCommandModule...");
|
||||
reloadConfig();
|
||||
if (this.config == null) {
|
||||
this.config = new Configuration();
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.viper.status.modules.economy;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
|
||||
import java.sql.*;
|
||||
@@ -23,6 +24,9 @@ public class EconomyDatabase {
|
||||
this.log = plugin.getLogger();
|
||||
|
||||
HikariConfig cfg = new HikariConfig();
|
||||
// HikariCP Startup-Logs unterdrücken
|
||||
java.util.logging.Logger.getLogger("com.zaxxer.hikari").setLevel(java.util.logging.Level.WARNING);
|
||||
java.util.logging.Logger.getLogger("com.zaxxer.hikari.HikariDataSource").setLevel(java.util.logging.Level.WARNING);
|
||||
cfg.setJdbcUrl("jdbc:mysql://" + host + ":" + port + "/" + database
|
||||
+ "?useSSL=false&autoReconnect=true&characterEncoding=UTF-8&useUnicode=true");
|
||||
cfg.setUsername(user);
|
||||
@@ -67,7 +71,7 @@ public class EconomyDatabase {
|
||||
" `updated` BIGINT NOT NULL" +
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;")) {
|
||||
ps.executeUpdate();
|
||||
log.info("[Economy] MySQL verbunden – Tabellen bereit.");
|
||||
if (StatusAPI.DEBUG) log.info("[Economy] MySQL verbunden – Tabellen bereit.");
|
||||
} catch (SQLException e) {
|
||||
log.severe("[Economy] Tabellen-Setup (bc_player_names) fehlgeschlagen: " + e.getMessage());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.viper.status.modules.economy;
|
||||
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
|
||||
import java.util.UUID;
|
||||
@@ -64,7 +65,7 @@ public class EconomyManager {
|
||||
UUID uuid = UUID.fromString(formatted);
|
||||
// Für künftige Lookups speichern
|
||||
db.saveNameMapping(uuid, name);
|
||||
plugin.getLogger().info("[Economy] Mojang-Lookup: " + name + " → " + uuid);
|
||||
StatusAPI.debugLog(plugin, "[Economy] Mojang-Lookup: " + name + " → " + uuid);
|
||||
return uuid;
|
||||
} catch (Exception e) {
|
||||
plugin.getLogger().warning("[Economy] Mojang-Lookup fehlgeschlagen für " + name + ": " + e.getMessage());
|
||||
|
||||
@@ -57,14 +57,14 @@ public class EconomyModule implements Module {
|
||||
plugin.getProxy().getPluginManager().registerCommand(plugin, new PayCommand(plugin, manager));
|
||||
plugin.getProxy().getPluginManager().registerCommand(plugin, new EcoAdminCommand(plugin, manager));
|
||||
|
||||
plugin.getLogger().info("[Economy] EconomyModule aktiviert (start-balance: " + startBal + ").");
|
||||
StatusAPI.debugLog(plugin, "[Economy] EconomyModule aktiviert (start-balance: " + startBal + ").");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable(Plugin plugin) {
|
||||
if (database != null) {
|
||||
database.close();
|
||||
plugin.getLogger().info("[Economy] MySQL-Verbindung geschlossen.");
|
||||
StatusAPI.debugLog(plugin, "[Economy] MySQL-Verbindung geschlossen.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,30 @@
|
||||
package net.viper.status.modules.forum;
|
||||
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Command;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
import net.viper.status.module.Module;
|
||||
|
||||
@@ -46,7 +59,7 @@ public class ForumBridgeModule implements Module, Listener {
|
||||
public void onEnable(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
loadConfig(plugin);
|
||||
if (!enabled) { plugin.getLogger().info("ForumBridgeModule ist deaktiviert."); return; }
|
||||
if (!enabled) { StatusAPI.debugLog(plugin, "ForumBridgeModule ist deaktiviert."); return; }
|
||||
|
||||
storage = new ForumNotifStorage(plugin.getDataFolder(), plugin.getLogger());
|
||||
storage.load();
|
||||
@@ -60,12 +73,12 @@ public class ForumBridgeModule implements Module, Listener {
|
||||
}, 10, 10, TimeUnit.MINUTES);
|
||||
|
||||
plugin.getProxy().getScheduler().schedule(plugin, () -> storage.purgeOld(30), 1, 24, TimeUnit.HOURS);
|
||||
plugin.getLogger().info("ForumBridgeModule aktiviert.");
|
||||
plugin.getLogger().fine("ForumBridgeModule aktiviert.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable(Plugin plugin) {
|
||||
if (storage != null) { storage.save(); plugin.getLogger().info("Forum-Benachrichtigungen gespeichert."); }
|
||||
if (storage != null) { storage.save(); StatusAPI.debugLog(plugin, "Forum-Benachrichtigungen gespeichert."); }
|
||||
}
|
||||
|
||||
private void loadConfig(Plugin plugin) {
|
||||
|
||||
@@ -1,18 +1,32 @@
|
||||
package net.viper.status.modules.serverswitcher;
|
||||
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.event.TabCompleteEvent;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Command;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
import net.viper.status.module.Module;
|
||||
|
||||
@@ -57,7 +71,7 @@ public class ServerSwitcherModule implements Module {
|
||||
loadConfig();
|
||||
|
||||
if (!enabled) {
|
||||
plugin.getLogger().info("[ServerSwitcherModule] Deaktiviert.");
|
||||
StatusAPI.debugLog(plugin, "[ServerSwitcherModule] Deaktiviert.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -67,7 +81,7 @@ public class ServerSwitcherModule implements Module {
|
||||
ProxyServer.getInstance().getPluginManager().registerListener(plugin,
|
||||
new GoTabListener());
|
||||
|
||||
plugin.getLogger().info("[ServerSwitcherModule] Aktiviert. Command: /" + commandName
|
||||
plugin.getLogger().fine("[ServerSwitcherModule] Aktiviert. Command: /" + commandName
|
||||
+ " | Aliases: " + aliases + " | Permission: " + permission);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,16 @@
|
||||
package net.viper.status.modules.verify;
|
||||
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Command;
|
||||
import net.viper.status.StatusAPI;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.viper.status.module.Module;
|
||||
|
||||
@@ -38,7 +44,7 @@ public class VerifyModule implements Module {
|
||||
public void onEnable(Plugin plugin) {
|
||||
loadConfig(plugin);
|
||||
ProxyServer.getInstance().getPluginManager().registerCommand(plugin, new VerifyCommand());
|
||||
plugin.getLogger().info("VerifyModule aktiviert. " + serverConfigs.size() + " Server-Konfigurationen geladen.");
|
||||
plugin.getLogger().fine("VerifyModule aktiviert. " + serverConfigs.size() + " Server-Konfigurationen geladen.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,7 +62,7 @@ public class VerifyModule implements Module {
|
||||
if (in == null) { plugin.getLogger().warning("Standard-config '" + fileName + "' nicht in JAR."); return; }
|
||||
byte[] buffer = new byte[1024]; int length;
|
||||
while ((length = in.read(buffer)) > 0) out.write(buffer, 0, length);
|
||||
plugin.getLogger().info("Konfigurationsdatei '" + fileName + "' erstellt.");
|
||||
StatusAPI.debugLog(plugin, "Konfigurationsdatei '" + fileName + "' erstellt.");
|
||||
} catch (Exception e) { plugin.getLogger().severe("Fehler beim Erstellen der Config: " + e.getMessage()); return; }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: StatusAPI
|
||||
main: net.viper.status.StatusAPI
|
||||
version: 4.1.1
|
||||
version: 4.1.0
|
||||
author: M_Viper
|
||||
description: StatusAPI für BungeeCord inkl. Update-Checker, Modul-System und ChatModule
|
||||
# Mindestanforderung: Minecraft 1.20 / BungeeCord mit PlayerChatEvent-Unterstützung
|
||||
|
||||
Reference in New Issue
Block a user