Compare commits
5 Commits
16.8
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
|
2a564e4cf7 | ||
|
f02d01d639 | ||
|
36137777ee | ||
b5bd600bdb | |||
7f8a0c35cb |
14
pom.xml
14
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>16.7_beta-1</version>
|
||||
<version>18.0_beta-2025-2</version>
|
||||
<!--version>VERSION_snapshot-0</version-->
|
||||
<!--version>VERSION_beta-0</version-->
|
||||
<!--version>VERSION_dev-0</version-->
|
||||
@ -44,12 +44,6 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>net.kyori</pattern>
|
||||
<shadedPattern>net.t2code.t2codelib.shaded.adventure</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
@ -181,7 +175,7 @@
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.11.3</version>
|
||||
<version>2.11.6</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@ -189,7 +183,7 @@
|
||||
<dependency>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>votingplugin</artifactId>
|
||||
<version>6.12.1</version>
|
||||
<version>6.18.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@ -197,7 +191,7 @@
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-text-minimessage</artifactId>
|
||||
<version>4.18.0-SNAPSHOT</version>
|
||||
<version>4.19.0</version>
|
||||
<scope>compile</scope>
|
||||
</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.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
@ -15,6 +16,10 @@ public class T2CB_PluginMessageProxyCommand implements Listener {
|
||||
@EventHandler
|
||||
public void onPluginmessage(PluginMessageEvent event) {
|
||||
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);
|
||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||
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.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
@ -17,6 +18,10 @@ public class T2CB_API_AutoResponse implements Listener {
|
||||
@EventHandler
|
||||
public void onPluginmessage(PluginMessageEvent event) {
|
||||
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()));
|
||||
event.setCancelled(true);
|
||||
try {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package net.t2code.t2codelib.BUNGEE.api.pluginMessaging.opSecurity;
|
||||
|
||||
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.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
@ -14,6 +15,10 @@ public class T2CB_API_OpSecurity implements Listener {
|
||||
@EventHandler
|
||||
public void onPluginmessage(PluginMessageEvent event) {
|
||||
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);
|
||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||
try {
|
||||
|
@ -57,6 +57,7 @@ public class T2C_McVersion {
|
||||
nms1_20_R4 = nms.contains("1_20_R4");
|
||||
nms1_21_R1 = nms.contains("1_21_R1");
|
||||
nms1_21_R2 = nms.contains("1_21_R2");
|
||||
nms1_22_R1 = nms.contains("1_22_R1");
|
||||
}
|
||||
|
||||
private static String mcVersion;
|
||||
@ -104,6 +105,7 @@ public class T2C_McVersion {
|
||||
private static boolean nms1_20_R4;
|
||||
private static boolean nms1_21_R1;
|
||||
private static boolean nms1_21_R2;
|
||||
private static boolean nms1_22_R1;
|
||||
|
||||
public static String getMcVersion() {
|
||||
return mcVersion;
|
||||
@ -276,6 +278,12 @@ public class T2C_McVersion {
|
||||
public static boolean isNms1_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() {
|
||||
|
@ -63,7 +63,7 @@ public class T2C_NmsVersions {
|
||||
t2CnmsEnum = T2C_NmsEnum.v1_20_R3;
|
||||
} else if (mc.contains("(MC: 1.20.6)")) {
|
||||
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;
|
||||
} else t2CnmsEnum = T2C_NmsEnum.not_support;
|
||||
|
||||
|
@ -8,6 +8,8 @@ import com.velocitypowered.api.event.Subscribe;
|
||||
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
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.VELOCITY.api.commands.T2CV_Cmd;
|
||||
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
|
||||
@ -30,6 +32,12 @@ public class T2CV_PluginMessageProxyCommand {
|
||||
if (event.getIdentifier() != T2CV_Main.bcmd) {
|
||||
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());
|
||||
String channel = 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.proxy.Player;
|
||||
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.messages.T2CV_Send;
|
||||
import net.t2code.t2codelib.VELOCITY.system.T2CV_Main;
|
||||
import net.t2code.t2codelib.util.T2C_Util;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
@ -30,6 +33,12 @@ public class T2CV_API_AutoResponse {
|
||||
if (event.getIdentifier() != T2CV_Main.aresp) {
|
||||
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()));
|
||||
|
||||
try {
|
||||
|
@ -5,8 +5,11 @@ package net.t2code.t2codelib.VELOCITY.api.pluginMessaging.opSecurity;
|
||||
import com.velocitypowered.api.event.Subscribe;
|
||||
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import com.velocitypowered.api.proxy.ServerConnection;
|
||||
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.util.T2C_Util;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.io.*;
|
||||
@ -27,6 +30,11 @@ public class T2CV_API_OpSecurity {
|
||||
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()));
|
||||
try {
|
||||
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.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import com.velocitypowered.api.proxy.ServerConnection;
|
||||
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.util.T2C_Util;
|
||||
import net.t2code.t2codelib.VELOCITY.api.messages.T2CV_Send;
|
||||
@ -93,6 +95,12 @@ public class T2CV_Players {
|
||||
if (event.getIdentifier() != T2CV_Main.bonlp) {
|
||||
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()));
|
||||
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user