Compare commits
8 Commits
2f7f8e3bee
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
|
2a564e4cf7 | ||
|
f02d01d639 | ||
|
36137777ee | ||
b5bd600bdb | |||
7f8a0c35cb | |||
5f2c2cacbe | |||
6ea2335bc2 | |||
7b574ffa02 |
14
pom.xml
14
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>16.7_dev-27</version>
|
<version>18.0_beta-2025-2</version>
|
||||||
<!--version>VERSION_snapshot-0</version-->
|
<!--version>VERSION_snapshot-0</version-->
|
||||||
<!--version>VERSION_beta-0</version-->
|
<!--version>VERSION_beta-0</version-->
|
||||||
<!--version>VERSION_dev-0</version-->
|
<!--version>VERSION_dev-0</version-->
|
||||||
@@ -44,12 +44,6 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<relocations>
|
|
||||||
<relocation>
|
|
||||||
<pattern>net.kyori</pattern>
|
|
||||||
<shadedPattern>net.t2code.t2codelib.shaded.adventure</shadedPattern>
|
|
||||||
</relocation>
|
|
||||||
</relocations>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
@@ -181,7 +175,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
<artifactId>placeholderapi</artifactId>
|
<artifactId>placeholderapi</artifactId>
|
||||||
<version>2.11.3</version>
|
<version>2.11.6</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -189,7 +183,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.bencodez</groupId>
|
<groupId>com.bencodez</groupId>
|
||||||
<artifactId>votingplugin</artifactId>
|
<artifactId>votingplugin</artifactId>
|
||||||
<version>6.12.1</version>
|
<version>6.18.3</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -197,7 +191,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-text-minimessage</artifactId>
|
<artifactId>adventure-text-minimessage</artifactId>
|
||||||
<version>4.18.0-SNAPSHOT</version>
|
<version>4.19.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@@ -2,6 +2,7 @@ package net.t2code.t2codelib.BUNGEE.api.pluginMessaging;
|
|||||||
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.connection.Server;
|
||||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||||
import net.md_5.bungee.api.plugin.Listener;
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
@@ -15,6 +16,10 @@ public class T2CB_PluginMessageProxyCommand implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPluginmessage(PluginMessageEvent event) {
|
public void onPluginmessage(PluginMessageEvent event) {
|
||||||
if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_ProxyCommand())) {
|
if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_ProxyCommand())) {
|
||||||
|
if (!(event.getSender() instanceof Server)) {
|
||||||
|
ProxyServer.getInstance().getConsole().sendMessage(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ("+ event.getSender().toString() +")!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
try {
|
try {
|
||||||
|
@@ -2,6 +2,7 @@ package net.t2code.t2codelib.BUNGEE.api.pluginMessaging.autoResponse;
|
|||||||
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.connection.Server;
|
||||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||||
import net.md_5.bungee.api.plugin.Listener;
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
@@ -17,6 +18,10 @@ public class T2CB_API_AutoResponse implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPluginmessage(PluginMessageEvent event) {
|
public void onPluginmessage(PluginMessageEvent event) {
|
||||||
if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_AutoResponse())) {
|
if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_AutoResponse())) {
|
||||||
|
if (!(event.getSender() instanceof Server)) {
|
||||||
|
ProxyServer.getInstance().getConsole().sendMessage(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ("+ event.getSender().toString() +")!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
try {
|
try {
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package net.t2code.t2codelib.BUNGEE.api.pluginMessaging.opSecurity;
|
package net.t2code.t2codelib.BUNGEE.api.pluginMessaging.opSecurity;
|
||||||
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.connection.Server;
|
||||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||||
import net.md_5.bungee.api.plugin.Listener;
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
@@ -14,6 +15,10 @@ public class T2CB_API_OpSecurity implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPluginmessage(PluginMessageEvent event) {
|
public void onPluginmessage(PluginMessageEvent event) {
|
||||||
if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_OPSecurity())) {
|
if (event.getTag().equalsIgnoreCase(T2C_Util.getPluginChannel_OPSecurity())) {
|
||||||
|
if (!(event.getSender() instanceof Server)) {
|
||||||
|
ProxyServer.getInstance().getConsole().sendMessage(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ("+ event.getSender().toString() +")!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
try {
|
try {
|
||||||
|
@@ -57,6 +57,7 @@ public class T2C_McVersion {
|
|||||||
nms1_20_R4 = nms.contains("1_20_R4");
|
nms1_20_R4 = nms.contains("1_20_R4");
|
||||||
nms1_21_R1 = nms.contains("1_21_R1");
|
nms1_21_R1 = nms.contains("1_21_R1");
|
||||||
nms1_21_R2 = nms.contains("1_21_R2");
|
nms1_21_R2 = nms.contains("1_21_R2");
|
||||||
|
nms1_22_R1 = nms.contains("1_22_R1");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String mcVersion;
|
private static String mcVersion;
|
||||||
@@ -104,6 +105,7 @@ public class T2C_McVersion {
|
|||||||
private static boolean nms1_20_R4;
|
private static boolean nms1_20_R4;
|
||||||
private static boolean nms1_21_R1;
|
private static boolean nms1_21_R1;
|
||||||
private static boolean nms1_21_R2;
|
private static boolean nms1_21_R2;
|
||||||
|
private static boolean nms1_22_R1;
|
||||||
|
|
||||||
public static String getMcVersion() {
|
public static String getMcVersion() {
|
||||||
return mcVersion;
|
return mcVersion;
|
||||||
@@ -276,6 +278,12 @@ public class T2C_McVersion {
|
|||||||
public static boolean isNms1_21_R1() {
|
public static boolean isNms1_21_R1() {
|
||||||
return nms1_21_R1;
|
return nms1_21_R1;
|
||||||
}
|
}
|
||||||
|
public static boolean isNms1_21_R2() {
|
||||||
|
return nms1_21_R2;
|
||||||
|
}
|
||||||
|
public static boolean isNms1_22_R1() {
|
||||||
|
return nms1_22_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean minMc1_8() {
|
public static boolean minMc1_8() {
|
||||||
|
@@ -63,7 +63,7 @@ public class T2C_NmsVersions {
|
|||||||
t2CnmsEnum = T2C_NmsEnum.v1_20_R3;
|
t2CnmsEnum = T2C_NmsEnum.v1_20_R3;
|
||||||
} else if (mc.contains("(MC: 1.20.6)")) {
|
} else if (mc.contains("(MC: 1.20.6)")) {
|
||||||
t2CnmsEnum = T2C_NmsEnum.v1_20_R4;
|
t2CnmsEnum = T2C_NmsEnum.v1_20_R4;
|
||||||
} else if (mc.contains("(MC: 1.21)")) {
|
} else if (mc.contains("(MC: 1.21)")|| mc.contains("(MC: 1.21.1)")) {
|
||||||
t2CnmsEnum = T2C_NmsEnum.v1_21_R1;
|
t2CnmsEnum = T2C_NmsEnum.v1_21_R1;
|
||||||
} else t2CnmsEnum = T2C_NmsEnum.not_support;
|
} else t2CnmsEnum = T2C_NmsEnum.not_support;
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@ public class T2C_ConfigWriter {
|
|||||||
private static FileConfiguration config;
|
private static FileConfiguration config;
|
||||||
|
|
||||||
public static void createConfig(String prefix, File configFile, T2C_ConfigItem[] values, boolean isReload, String... header) {
|
public static void createConfig(String prefix, File configFile, T2C_ConfigItem[] values, boolean isReload, String... header) {
|
||||||
|
long long_ = System.currentTimeMillis();
|
||||||
boolean exist = configFile.exists();
|
boolean exist = configFile.exists();
|
||||||
if (!exist) {
|
if (!exist) {
|
||||||
configFile.getParentFile().mkdir();
|
configFile.getParentFile().mkdir();
|
||||||
@@ -62,21 +63,20 @@ public class T2C_ConfigWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Copy default values if they are missing
|
// Copy default values if they are missing
|
||||||
config.options().copyDefaults(true);
|
config.options().copyDefaults(true);
|
||||||
|
|
||||||
T2C_YmlWriter.saveConfigWithComments(configFile, config, comments, false,header);
|
T2C_YmlWriter.saveConfigWithComments(configFile, config, comments, false, header);
|
||||||
readConfig(prefix, configFile, config, values, isReload);
|
readConfig(prefix, configFile, config, values, isReload, long_);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void readConfig(String prefix, File configFile, FileConfiguration config, T2C_ConfigItem[] values, boolean isReload) {
|
private static void readConfig(String prefix, File configFile, FileConfiguration config, T2C_ConfigItem[] values, boolean isReload, long long_) {
|
||||||
for (T2C_ConfigItem value : values) {
|
for (T2C_ConfigItem value : values) {
|
||||||
value.setValue(config.get(value.getPath()));
|
value.setValue(config.get(value.getPath()));
|
||||||
}
|
}
|
||||||
T2C_Send.sendStartTextCenter(prefix, "§2" + configFile.getName() + " were successfully created / updated.", isReload);
|
T2C_Send.sendStartTextCenter(prefix, "§2Load successfully: §7" + configFile.getPath() + "/" + config.getName().replace("/","")+" §7- §e"+ (System.currentTimeMillis() - long_) + "ms", isReload);
|
||||||
|
// T2C_Send.sendStartTextCenter(prefix, "§2Has been successfully created / updated §7- §e" + (System.currentTimeMillis() - long_) + "ms", isReload);
|
||||||
|
//T2C_Send.sendStartTextCenter(prefix, "", isReload);
|
||||||
//T2C_Send.sendStartTextCenter(Util.getPrefix(), "§2opWhitelist.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms",isReload);
|
//T2C_Send.sendStartTextCenter(Util.getPrefix(), "§2opWhitelist.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms",isReload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@ import java.io.File;
|
|||||||
|
|
||||||
public class ConvertT2ClibConfig {
|
public class ConvertT2ClibConfig {
|
||||||
|
|
||||||
private static YamlConfiguration yamlConfiguration;
|
private static YamlConfiguration yamlConfiguration;
|
||||||
|
|
||||||
|
|
||||||
public static void convert() {
|
public static void convert() {
|
||||||
@@ -18,7 +18,7 @@ public class ConvertT2ClibConfig {
|
|||||||
yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
|
|
||||||
if (yamlConfiguration.contains("plugin.updateCheck.onJoin")) return;
|
if (yamlConfiguration.contains("proxy.serverUUID")) return;
|
||||||
|
|
||||||
set("Plugin.UpdateCheck.OnJoin", T2C_LibConfig.VALUES.updateCheckOnJoin);
|
set("Plugin.UpdateCheck.OnJoin", T2C_LibConfig.VALUES.updateCheckOnJoin);
|
||||||
set("Plugin.UpdateCheck.TimeInterval", T2C_LibConfig.VALUES.updateCheckTimeInterval);
|
set("Plugin.UpdateCheck.TimeInterval", T2C_LibConfig.VALUES.updateCheckTimeInterval);
|
||||||
@@ -29,12 +29,12 @@ public class ConvertT2ClibConfig {
|
|||||||
set("Plugin.Not recommended to disable.developerTool", T2C_LibConfig.VALUES.developerTool);
|
set("Plugin.Not recommended to disable.developerTool", T2C_LibConfig.VALUES.developerTool);
|
||||||
set("BungeeCord.Enable", T2C_LibConfig.VALUES.proxy);
|
set("BungeeCord.Enable", T2C_LibConfig.VALUES.proxy);
|
||||||
set("Player.Inventories.CloseByServerStop", T2C_LibConfig.VALUES.inventoriesCloseByServerStop);
|
set("Player.Inventories.CloseByServerStop", T2C_LibConfig.VALUES.inventoriesCloseByServerStop);
|
||||||
set("Command.PermToggle.PermissionSetCommand", T2C_LibConfig.VALUES.updateCheckOnJoin);
|
set("Command.PermToggle.PermissionSetCommand", T2C_LibConfig.VALUES.commandPermToggleCommand);
|
||||||
|
config.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void set(String path, T2C_ConfigItem item){
|
private static void set(String path, T2C_ConfigItem item) {
|
||||||
if (yamlConfiguration.contains(path)){
|
if (yamlConfiguration.contains(path)) {
|
||||||
item.setValue(yamlConfiguration.get(path));
|
item.setValue(yamlConfiguration.get(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -133,6 +133,7 @@ public class T2C_LibConfig {
|
|||||||
|
|
||||||
public static void set(boolean isReload) {
|
public static void set(boolean isReload) {
|
||||||
long long_ = System.currentTimeMillis();
|
long long_ = System.currentTimeMillis();
|
||||||
|
ConvertT2ClibConfig.convert();
|
||||||
T2C_ConfigWriter.createConfig(T2C_Util.getPrefix(), new File(T2C_Main.getPath(), "config.yml"), VALUES.values(), isReload, T2C_Util.getConfigLogo());
|
T2C_ConfigWriter.createConfig(T2C_Util.getPrefix(), new File(T2C_Main.getPath(), "config.yml"), VALUES.values(), isReload, T2C_Util.getConfigLogo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,6 +8,8 @@ import com.velocitypowered.api.event.Subscribe;
|
|||||||
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
||||||
import com.velocitypowered.api.proxy.Player;
|
import com.velocitypowered.api.proxy.Player;
|
||||||
import com.velocitypowered.api.proxy.ProxyServer;
|
import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
|
import com.velocitypowered.api.proxy.ServerConnection;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import net.t2code.t2codelib.util.T2C_Util;
|
import net.t2code.t2codelib.util.T2C_Util;
|
||||||
import net.t2code.t2codelib.VELOCITY.api.commands.T2CV_Cmd;
|
import net.t2code.t2codelib.VELOCITY.api.commands.T2CV_Cmd;
|
||||||
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
|
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
|
||||||
@@ -30,6 +32,12 @@ public class T2CV_PluginMessageProxyCommand {
|
|||||||
if (event.getIdentifier() != T2CV_Main.bcmd) {
|
if (event.getIdentifier() != T2CV_Main.bcmd) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(event.getSource() instanceof ServerConnection)) {
|
||||||
|
T2CV_Main.getLogger().info(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ({})!", event.getSource().toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ByteArrayDataInput stream = ByteStreams.newDataInput(event.getData());
|
ByteArrayDataInput stream = ByteStreams.newDataInput(event.getData());
|
||||||
String channel = stream.readUTF();
|
String channel = stream.readUTF();
|
||||||
String input = stream.readUTF();
|
String input = stream.readUTF();
|
||||||
|
@@ -6,9 +6,12 @@ import com.velocitypowered.api.event.Subscribe;
|
|||||||
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
||||||
import com.velocitypowered.api.proxy.Player;
|
import com.velocitypowered.api.proxy.Player;
|
||||||
import com.velocitypowered.api.proxy.ProxyServer;
|
import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
|
import com.velocitypowered.api.proxy.ServerConnection;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import net.t2code.t2codelib.VELOCITY.api.commands.T2CV_Cmd;
|
import net.t2code.t2codelib.VELOCITY.api.commands.T2CV_Cmd;
|
||||||
import net.t2code.t2codelib.VELOCITY.api.messages.T2CV_Send;
|
import net.t2code.t2codelib.VELOCITY.api.messages.T2CV_Send;
|
||||||
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
|
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
|
||||||
|
import net.t2code.t2codelib.util.T2C_Util;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
@@ -30,6 +33,12 @@ public class T2CV_API_AutoResponse {
|
|||||||
if (event.getIdentifier() != T2CV_Main.aresp) {
|
if (event.getIdentifier() != T2CV_Main.aresp) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(event.getSource() instanceof ServerConnection)) {
|
||||||
|
T2CV_Main.getLogger().info(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ({})!", event.getSource().toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -5,8 +5,11 @@ package net.t2code.t2codelib.VELOCITY.api.pluginMessaging.opSecurity;
|
|||||||
import com.velocitypowered.api.event.Subscribe;
|
import com.velocitypowered.api.event.Subscribe;
|
||||||
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
||||||
import com.velocitypowered.api.proxy.ProxyServer;
|
import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
|
import com.velocitypowered.api.proxy.ServerConnection;
|
||||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
|
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
|
||||||
|
import net.t2code.t2codelib.util.T2C_Util;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@@ -27,6 +30,11 @@ public class T2CV_API_OpSecurity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(event.getSource() instanceof ServerConnection)) {
|
||||||
|
T2CV_Main.getLogger().info(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ({})!", event.getSource().toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
try {
|
try {
|
||||||
String channel = stream.readUTF();
|
String channel = stream.readUTF();
|
||||||
|
@@ -10,7 +10,9 @@ import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
|||||||
import com.velocitypowered.api.event.connection.PostLoginEvent;
|
import com.velocitypowered.api.event.connection.PostLoginEvent;
|
||||||
import com.velocitypowered.api.proxy.Player;
|
import com.velocitypowered.api.proxy.Player;
|
||||||
import com.velocitypowered.api.proxy.ProxyServer;
|
import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
|
import com.velocitypowered.api.proxy.ServerConnection;
|
||||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.bungeePlayers.T2C_BngeePlayersEnum;
|
import net.t2code.t2codelib.SPIGOT.api.bungeePlayers.T2C_BngeePlayersEnum;
|
||||||
import net.t2code.t2codelib.util.T2C_Util;
|
import net.t2code.t2codelib.util.T2C_Util;
|
||||||
import net.t2code.t2codelib.VELOCITY.api.messages.T2CV_Send;
|
import net.t2code.t2codelib.VELOCITY.api.messages.T2CV_Send;
|
||||||
@@ -93,6 +95,12 @@ public class T2CV_Players {
|
|||||||
if (event.getIdentifier() != T2CV_Main.bonlp) {
|
if (event.getIdentifier() != T2CV_Main.bonlp) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(event.getSource() instanceof ServerConnection)) {
|
||||||
|
T2CV_Main.getLogger().info(T2C_Util.getPrefix() +" [Security] §cBlocked unauthorized plugin message from a player ({})!", event.getSource().toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user