move to 18.0
Development version moved to 18.0. 17.0 Integrated
This commit is contained in:
parent
36137777ee
commit
f02d01d639
pom.xml
src/main/java/net/t2code/t2codelib
BUNGEE/api/pluginMessaging
VELOCITY/api
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>17.0_beta-2025-1</version>
|
||||
<version>18.0_beta-2025-2</version>
|
||||
<!--version>VERSION_snapshot-0</version-->
|
||||
<!--version>VERSION_beta-0</version-->
|
||||
<!--version>VERSION_dev-0</version-->
|
||||
|
@ -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 {
|
||||
|
8
src/main/java/net/t2code/t2codelib/VELOCITY/api/pluginMessaging/T2CV_PluginMessageProxyCommand.java
8
src/main/java/net/t2code/t2codelib/VELOCITY/api/pluginMessaging/T2CV_PluginMessageProxyCommand.java
@ -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 {
|
||||
|
8
src/main/java/net/t2code/t2codelib/VELOCITY/api/pluginMessaging/opSecurity/T2CV_API_OpSecurity.java
8
src/main/java/net/t2code/t2codelib/VELOCITY/api/pluginMessaging/opSecurity/T2CV_API_OpSecurity.java
@ -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