Skip to content

Commit e0e67eb

Browse files
committed
This should fix timeouts when connecting to a section server
1 parent 4e34013 commit e0e67eb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/com/jaimemartz/playerbalancer/listener/ServerConnectListener.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@ public void onConnect(ServerConnectEvent event) {
2929
ServerSection section = getSection(player, target);
3030

3131
if (section != null) {
32+
if (target.equals(section.getServer())) {
33+
event.setCancelled(true);
34+
}
35+
3236
new ConnectionIntent(plugin, player, section) {
3337
@Override
3438
public void connect(ServerInfo server, Callback<Boolean> callback) {
3539
if (plugin.getSectionManager().isReiterative(section)) {
3640
ServerAssignRegistry.assignTarget(player, section, server);
3741
}
3842

43+
event.setCancelled(false);
3944
event.setTarget(server);
4045
callback.done(true, null);
4146
}

src/main/resources/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ features {
114114
reiterative-sections=[]
115115

116116
# When true, section servers will show the sum of the players on all servers on that section
117-
# Important: This will make bungeecord think that your bungeecord has more players than it really does
117+
# Important: This will make some plugins think that your bungeecord has more players than it really does
118118
show-players: true
119119
}
120120

0 commit comments

Comments
 (0)