geforkt von SteamWar/BungeeCore
Add Scanner hostnames, Geyser, xAeroMiniMap, Axiom support
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
0fd86300ac
Commit
49238463a5
@ -29,7 +29,9 @@ import de.steamwar.network.packets.NetworkPacket;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.connection.Connection;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
@ -69,31 +71,40 @@ public class PluginMessage extends BasicListener {
|
||||
FabricModSender fabricModSender = new FabricModSender();
|
||||
WorldDownloader wdl = new WorldDownloader();
|
||||
|
||||
knownBrands.add("vanilla");
|
||||
knownBrands.add("fabric");
|
||||
knownBrands.add("forge"); //Forge registers all channels the server registers
|
||||
knownBrands.add("optifine");
|
||||
knownBrands.addAll(Arrays.asList("vanilla", "fabric", "forge", "optifine", "Geyser"));
|
||||
|
||||
knownChannels.add("fabric:container/open");
|
||||
knownChannels.add("fabric:registry/sync/direct");
|
||||
knownChannels.add("fabric-screen-handler-api-v1:open_screen");
|
||||
knownChannels.addAll(Arrays.asList(
|
||||
"fabric:container/open", "fabric:registry/sync/direct", "fabric:registry/sync",
|
||||
"fabric-screen-handler-api-v1:open_screen",
|
||||
|
||||
knownChannels.add(FML.CHANNEL);
|
||||
knownChannels.add("fml:loginwrapper");
|
||||
knownChannels.add("fml:handshake");
|
||||
knownChannels.add("fml:play");
|
||||
knownChannels.add("forge:tier_sorting");
|
||||
knownChannels.add("forge:split");
|
||||
knownChannels.add("forge:login");
|
||||
knownChannels.add("forge:handshake");
|
||||
FML.CHANNEL, "fml:loginwrapper", "fml:handshake", "fml:play", "forge:tier_sorting", "forge:split",
|
||||
"forge:login", "forge:handshake",
|
||||
|
||||
knownChannels.add(ApolloManager.PLUGIN_MESSAGE_CHANNEL);
|
||||
ApolloManager.PLUGIN_MESSAGE_CHANNEL,
|
||||
|
||||
knownChannels.add("Replay|Restrict");
|
||||
knownChannels.add("replaymod:restrict");
|
||||
knownChannels.add("WDL|CONTROL");
|
||||
knownChannels.add("wdl:control");
|
||||
knownChannels.add("worldedit:cui");
|
||||
"floodgate:skin", "floodgate:form", "floodgate:transfer", "floodgate:packet",
|
||||
|
||||
"Replay|Restrict", "replaymod:restrict",
|
||||
"WDL|CONTROL", "wdl:control",
|
||||
"tpshud:handshake", "tpshud:tps", //https://github.com/mooziii/tpshud-fabric/tree/main
|
||||
"xaerominimap:main"
|
||||
));
|
||||
|
||||
registerBiDirPassthrough("worldedit:cui");
|
||||
|
||||
registerPassthroughToClient(
|
||||
"axiom:enable", "axiom:initialize_hotbars", "axiom:set_editor_views",
|
||||
"axiom:response_chunk_data", "axiom:register_world_properties", "axiom:set_world_property",
|
||||
"axiom:ack_world_properties", "axiom:restrictions", "axiom:marker_data", "axiom:marker_nbt_response",
|
||||
"axiom:custom_blocks", "axiom:editor_warning", "axiom:blueprint_manifest"
|
||||
);
|
||||
registerBiDirPassthrough("axiom:handle_big_payload");
|
||||
registerPassthroughToServer(
|
||||
"axiom:hello", "axiom:set_gamemode", "axiom:set_fly_speed", "axiom:set_world_time",
|
||||
"axiom:set_world_property", "axiom:set_block", "axiom:set_hotbar_slot", "axiom:switch_active_hotbar",
|
||||
"axiom:teleport", "axiom:set_editor_views", "axiom:request_chunk_data", "axiom:spawn_entity",
|
||||
"axiom:manipulate_entity", "axiom:delete_entity", "axiom:marker_nbt_request"
|
||||
);
|
||||
|
||||
register("REGISTER", false, directional(this::serverRegistersChannel, this::clientRegistersChannel));
|
||||
register("minecraft:register", false, directional(this::serverRegistersChannel, this::clientRegistersChannel));
|
||||
@ -105,8 +116,7 @@ public class PluginMessage extends BasicListener {
|
||||
|
||||
register("sw:bridge", false, directional(onlySWSource(async(event -> NetworkPacket.handle(new ServerMetaInfo(((Server) event.getSender()).getInfo()), event.getData()))), UNKNOWN));
|
||||
register("sw:hotkeys", false, directional(UNKNOWN, PASS_THROUGH));
|
||||
register("worldedit:cui", false, PASS_THROUGH);
|
||||
register("fabricmodsender:mods", true, directional(UNKNOWN, fabricModSender::handlePluginMessage));
|
||||
register("fabricmodsender:mods", true, directional(UNKNOWN, async(fabricModSender::handlePluginMessage)));
|
||||
|
||||
register("WDL|REQUEST", false, DROP);
|
||||
register("wdl:request", false, DROP);
|
||||
@ -119,6 +129,7 @@ public class PluginMessage extends BasicListener {
|
||||
register(FML.CHANNEL, true, directional(UNKNOWN, async(fml::handlePluginMessage)));
|
||||
|
||||
//vanilla does not register any channels (sends only one minecraft:brand vanilla, nothing else (potential spoofed client detection))
|
||||
//Forge interestingly registers all channels the server registers
|
||||
//meteor https://github.com/MeteorDevelopment/meteor-client/blob/master/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/ServerSpoof.java https://github.com/MeteorDevelopment/meteor-client/blob/master/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/DiscordPresence.java
|
||||
//feather:client https://github.com/Koupah/Feather-Client-API/blob/main/src/club/koupah/feather/handler/FeatherHandler.java
|
||||
//litematica/malilib https://github.com/maruohon/litematica/issues/75 https://github.com/maruohon/malilib/blob/liteloader_1.12.2/src/main/java/malilib/network/message/ConfigLockPacketHandler.java#L65
|
||||
@ -135,6 +146,27 @@ public class PluginMessage extends BasicListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void registerPassthroughToClient(String... channels) {
|
||||
for(String channel : channels) {
|
||||
knownChannels.add(channel);
|
||||
register(channel, false, directional(PASS_THROUGH, UNKNOWN));
|
||||
}
|
||||
}
|
||||
|
||||
private void registerPassthroughToServer(String... channels) {
|
||||
for(String channel : channels) {
|
||||
knownChannels.add(channel);
|
||||
register(channel, false, directional(UNKNOWN, PASS_THROUGH));
|
||||
}
|
||||
}
|
||||
|
||||
private void registerBiDirPassthrough(String... channels) {
|
||||
for(String channel : channels) {
|
||||
knownChannels.add(channel);
|
||||
register(channel, false, PASS_THROUGH);
|
||||
}
|
||||
}
|
||||
|
||||
private void register(String channel, boolean clientSideRegister, Parser handler) {
|
||||
handlers.put(channel, handler);
|
||||
if(clientSideRegister)
|
||||
@ -147,6 +179,8 @@ public class PluginMessage extends BasicListener {
|
||||
for(String channel : new String(event.getData()).split("\0")) {
|
||||
if(channel.equals(ApolloManager.PLUGIN_MESSAGE_CHANNEL))
|
||||
lunar.sendRestrictions(player);
|
||||
else if(channel.equals("xaerominimap:main"))
|
||||
player.sendMessage(ChatMessageType.SYSTEM, new TextComponent("§n§o§m§i§n§i§m§a§p")); // https://www.curseforge.com/minecraft/mc-mods/xaeros-minimap
|
||||
|
||||
if(!knownChannels.contains(channel))
|
||||
BungeeCore.get().getLogger().log(Level.WARNING, () -> player.getName() + " registered unknown channel " + channel);
|
||||
|
@ -37,6 +37,9 @@ public class Hostname extends BasicListener {
|
||||
public Hostname() {
|
||||
knownHostnames.add("steamwar.de");
|
||||
knownHostnames.add("78.31.71.136");
|
||||
knownHostnames.add("@mat:matdoes.dev"); //https://github.com/mat-1/matscan
|
||||
knownHostnames.add("wtf.mynx.lol"); //https://discord.com/invite/serverseeker
|
||||
knownHostnames.add("127.0.0.1"); // Geyser
|
||||
|
||||
knownExtraData.add("");
|
||||
knownExtraData.add("\0FML\0");
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren