From 13f394b9a759c85be2b294c452a8836d5bc24a39 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 23 Mar 2013 11:24:37 +1100 Subject: [PATCH] Send the players real IP for use in Spigot servers. --- proxy/src/main/java/net/md_5/bungee/ServerConnector.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index b797a407..e7d16e01 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ package net.md_5.bungee; import com.google.common.base.Preconditions; +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; import io.netty.channel.Channel; import java.util.Queue; import lombok.RequiredArgsConstructor; @@ -45,6 +47,13 @@ public class ServerConnector extends PacketHandler public void connected(Channel channel) throws Exception { this.ch = channel; + + ByteArrayDataOutput out = ByteStreams.newDataOutput(); + out.writeUTF( "Login" ); + out.writeUTF( user.getAddress().getAddress().getHostAddress() ); + out.writeInt( user.getAddress().getPort() ); + channel.write( new PacketFAPluginMessage( "BungeeCord", out.toByteArray() ) ); + channel.write( user.handshake ); channel.write( PacketCDClientStatus.CLIENT_LOGIN ); }