3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Implement BungeeCord IPOther message. Fixes #361

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-24 10:40:45 -04:00
Ursprung d9b137fc4d
Commit 01158b08a7

Datei anzeigen

@ -197,6 +197,20 @@ class BungeeCordMessageResponder {
}); });
} }
private void processIpOther(ByteBufDataInput in) {
proxy.getPlayer(in.readUTF()).ifPresent(player -> {
ByteBuf buf = Unpooled.buffer();
ByteBufDataOutput out = new ByteBufDataOutput(buf);
out.writeUTF("IPOther");
out.writeUTF(player.getUsername());
out.writeUTF(player.getRemoteAddress().getHostString());
out.writeInt(player.getRemoteAddress().getPort());
sendResponseOnConnection(buf);
});
}
private void processServerIp(ByteBufDataInput in) { private void processServerIp(ByteBufDataInput in) {
proxy.getServer(in.readUTF()).ifPresent(info -> { proxy.getServer(in.readUTF()).ifPresent(info -> {
ByteBuf buf = Unpooled.buffer(); ByteBuf buf = Unpooled.buffer();
@ -341,6 +355,9 @@ class BungeeCordMessageResponder {
case "UUIDOther": case "UUIDOther":
this.processUuidOther(in); this.processUuidOther(in);
break; break;
case "IPOther":
this.processIpOther(in);
break;
case "ServerIP": case "ServerIP":
this.processServerIp(in); this.processServerIp(in);
break; break;