File tree 1 file changed +18
-0
lines changed
proxy/src/main/java/com/velocitypowered/proxy/connection/backend
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -301,6 +301,21 @@ private void processForwardToServer(ByteBufDataInput in) {
301
301
}
302
302
}
303
303
304
+ private void processGetPlayerServer (ByteBufDataInput in ) {
305
+ proxy .getPlayer (in .readUTF ()).ifPresent (player -> {
306
+ player .getCurrentServer ().ifPresent (server -> {
307
+ ByteBuf buf = Unpooled .buffer ();
308
+ ByteBufDataOutput out = new ByteBufDataOutput (buf );
309
+
310
+ out .writeUTF ("GetPlayerServer" );
311
+ out .writeUTF (player .getUsername ());
312
+ out .writeUTF (server .getServerInfo ().getName ());
313
+
314
+ sendResponseOnConnection (buf );
315
+ });
316
+ });
317
+ }
318
+
304
319
static String getBungeeCordChannel (ProtocolVersion version ) {
305
320
return version .noLessThan (ProtocolVersion .MINECRAFT_1_13 ) ? MODERN_CHANNEL .getId ()
306
321
: LEGACY_CHANNEL .getId ();
@@ -331,6 +346,9 @@ boolean process(PluginMessagePacket message) {
331
346
ByteBufDataInput in = new ByteBufDataInput (message .content ());
332
347
String subChannel = in .readUTF ();
333
348
switch (subChannel ) {
349
+ case "GetPlayerServer" :
350
+ this .processGetPlayerServer (in );
351
+ break ;
334
352
case "ForwardToPlayer" :
335
353
this .processForwardToPlayer (in );
336
354
break ;
You can’t perform that action at this time.
0 commit comments