F3Name icon indicating copy to clipboard operation
F3Name copied to clipboard

Server brand is exposed for a second after joining/switching servers

Open ghost opened this issue 3 years ago • 3 comments

Using F3Name on bungeecord, with update-time: 20. Players can see my backend server brand right after joining for a moment, can this be blocked? Thanks

ghost avatar Mar 11 '21 13:03 ghost

it could possibly be related, but this listener seems to be useless, you are cancelling the plugin send then sending another plugin message with the same data? https://github.com/prettydude/F3Name/blob/master/src/main/java/ua/coolboy/f3name/bungee/BungeeEventListener.java#L54

ghost avatar Mar 11 '21 13:03 ghost

should be doing: e.setCancelled(true); ProxiedPlayer player = (ProxiedPlayer) e.getReceiver(); ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); DefinedPacket.writeString("server f3 name here", brand); player.sendData(e.getTag(), DefinedPacket.toArray(brand)); brand.release();

ghost avatar Mar 11 '21 14:03 ghost

Using F3Name on bungeecord, with update-time: 20. Players can see my backend server brand right after joining for a moment, can this be blocked? Thanks

This is probably a small delay between joining and when https://github.com/prettydude/F3Name/blob/master/src/main/java/ua/coolboy/f3name/bungee/BungeeEventListener.java#L30 gets send. Also, if Bungee detects plugin on connected server, it'll be used to determine the player group, and then applied on the next server brand refresh.

it could possibly be related, but this listener seems to be useless, you are cancelling the plugin send then sending another plugin message with the same data? https://github.com/prettydude/F3Name/blob/master/src/main/java/ua/coolboy/f3name/bungee/BungeeEventListener.java#L54

BungeeCord injects it's own "BungeeCord ->" into server brand at that stage, so simple cancelling and re-sending the same data from Bungee fixes that behavior.

zubiden avatar Mar 11 '21 18:03 zubiden