mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-11-23 07:16:39 +01:00
Added a simple way to identify Geyser players.
Keep in mind that using this to identify players is less secure than using Floodgate
This commit is contained in:
parent
a4ad4a96bb
commit
c5205cc873
2 changed files with 19 additions and 0 deletions
|
@ -95,6 +95,7 @@ public class TranslatorsInit {
|
|||
|
||||
public static void start() {
|
||||
Registry.registerJava(ServerJoinGamePacket.class, new JavaJoinGameTranslator());
|
||||
Registry.registerJava(ServerPluginMessagePacket.class, new JavaPluginMessageTranslator());
|
||||
Registry.registerJava(ServerChatPacket.class, new JavaChatTranslator());
|
||||
Registry.registerJava(ServerTitlePacket.class, new JavaTitleTranslator());
|
||||
Registry.registerJava(ServerUpdateTimePacket.class, new JavaUpdateTimeTranslator());
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package org.geysermc.connector.network.translators.java;
|
||||
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.client.ClientPluginMessagePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.server.ServerPluginMessagePacket;
|
||||
import org.geysermc.connector.GeyserConnector;
|
||||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
import org.geysermc.connector.network.translators.PacketTranslator;
|
||||
|
||||
public class JavaPluginMessageTranslator extends PacketTranslator<ServerPluginMessagePacket> {
|
||||
@Override
|
||||
public void translate(ServerPluginMessagePacket packet, GeyserSession session) {
|
||||
if (packet.getChannel().equals("minecraft:brand")) {
|
||||
session.getDownstream().getSession().send(
|
||||
new ClientPluginMessagePacket(packet.getChannel(), GeyserConnector.NAME.getBytes())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue