Closed paaulhier closed 2 months ago
Please add your code that causes this issue.
@Subscribe(order = PostOrder.LAST)
public EventTask onPlayerJoin(PlayerChooseInitialServerEvent event) {
Player player = event.getPlayer();
return EventTask.async(() -> {
if (!player.hasPermission(configuration.requiredPermission())) {
return;
}
player.getVirtualHost().filter(
inetSocketAddress -> inetSocketAddress.getHostName().equalsIgnoreCase(configuration.forcedHost())
).flatMap(inetSocketAddress -> proxyServer.getServer(
configuration.serverName()
)).ifPresent(event::setInitialServer);
});
}
Why would u do that async? And why not just use the config options the bridge has?
I could remove the async stuff, yes But i don't want to make my plugins too much depending on cloudnet, so i dont want use the bridge options.
I dont get how that makes your plugin dependent on the bridge. You just have to configure the bridge in the config file, nothing inside your plugin.
Nevertheless I will take a look at the problem using the event
I've just tested using this snippet and got it working without any problems.
Maybe its because the server i want to redirect the player to isn't a CloudService?
Might be. Thats not offically supported. But I think you could solve that by just removing the @NonNull
annotation from the constructor. As the setter itself allows null values, so it should be fine
Stacktrace
Actions to reproduce
Ich verändere den Server im PlayerChooseInitialServerEvent mit order LAST
CloudNet version
[19.04 20:48:09.721] INFO: [19.04 20:48:09.721] INFO: CloudNet Blizzard 4.0.0-RC10 887ad7cf [19.04 20:48:09.722] INFO: Discord: https://discord.cloudnetservice.eu/ [19.04 20:48:09.722] INFO: [19.04 20:48:09.722] INFO: ClusterId: 338a2783--460c--26596ae6001d [19.04 20:48:09.723] INFO: NodeId: Node-1 [19.04 20:48:09.723] INFO: Head-NodeId: Node-1 [19.04 20:48:09.724] INFO: CPU usage: (P/S) .62/13.13/100% [19.04 20:48:09.724] INFO: Node services memory allocation (U/R/M): 4352/4352/31488 MB [19.04 20:48:09.725] INFO: Threads: 26 [19.04 20:48:09.725] INFO: Heap usage: 52/256MB [19.04 20:48:09.725] INFO: JVM: Private Build 21 (OpenJDK 64-Bit Server VM 21.0.1+12-Ubuntu-222.04) [19.04 20:48:09.726] INFO: Update Repo: CloudNetService/launchermeta, Update Branch: beta [19.04 20:48:09.726] INFO:
Other
No response
Issue uniqueness