Misc fixes regarding the last few commits

This commit is contained in:
ME1312 2020-08-21 18:33:09 -04:00
parent fa77eeeab0
commit e9c0075144
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
5 changed files with 20 additions and 6 deletions

View File

@ -65,10 +65,15 @@ public class PacketDisconnectPlayer implements PacketObjectIn<Integer>, PacketOb
} else {
local.disconnect();
}
client.sendPacket(new PacketDisconnectPlayer(2, tracker));
client.sendPacket(new PacketDisconnectPlayer(0, tracker));
} else if ((remote = plugin.api.getGlobalPlayer(id)) != null) {
client.sendPacket(new PacketDisconnectPlayer(2, tracker));
if (remote.getProxy().getSubData()[0] != null) {
((SubDataClient) remote.getProxy().getSubData()[0]).sendPacket(new PacketExDisconnectPlayer(remote.getUniqueId(), (data.contains(0x0002)?data.getRawString(0x0002):null), r -> {
client.sendPacket(new PacketDisconnectPlayer(r.getInt(0x0001), tracker));
}));
} else {
client.sendPacket(new PacketDisconnectPlayer(4, tracker));
}
} else {
client.sendPacket(new PacketDisconnectPlayer(3, tracker));
}

View File

@ -38,6 +38,7 @@ import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ListenerInfo;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.*;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.connection.InitialHandler;
@ -853,7 +854,8 @@ public final class SubProxy extends BungeeCord implements Listener {
Logger.get("SubServers").info(e.getConnection().getName() + " connected, but already had a database entry");
RemotePlayer player = rPlayers.get(e.getConnection().getUniqueId());
if (player.getProxy() == null || player.getProxy().isMaster()) {
getPlayer(player.getUniqueId()).disconnect(new TextComponent(getTranslation("already_connected_proxy")));
ProxiedPlayer p = getPlayer(player.getUniqueId());
if (p != null) p.disconnect(new TextComponent(getTranslation("already_connected_proxy")));
} else if (player.getProxy().getSubData()[0] != null) {
((SubDataClient) player.getProxy().getSubData()[0]).sendPacket(new PacketExDisconnectPlayer(player.getUniqueId(), getTranslation("already_connected_proxy")));
}

View File

@ -902,6 +902,11 @@ public class SubCommand {
"In such cases, you would want to update a single server first",
"to rebuild the cache and then update the rest in bulk.",
"",
"Lastly, this command can also be used to change the template of a subserver.",
"Changing a template in this way will overwrite settings in servers.yml as if",
"the template had the Update-Settings build option enabled because,",
"most of the time, it wouldn't work otherwise.",
"",
"Examples:",
" /update Server2",
" /update Server2 1.14.4",

View File

@ -37,6 +37,7 @@ import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ListenerInfo;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.*;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.connection.InitialHandler;
@ -377,7 +378,8 @@ public final class ExProxy extends BungeeCord implements Listener {
Logger.get("SubServers").info(e.getConnection().getName() + " connected, but already had a database entry");
RemotePlayer player = rPlayers.get(e.getConnection().getUniqueId());
if (player.getProxy() != null && player.getProxy().equalsIgnoreCase(api.getName())) {
getPlayer(player.getUniqueId()).disconnect(new TextComponent(getTranslation("already_connected_proxy")));
ProxiedPlayer p = getPlayer(player.getUniqueId());
if (p != null) p.disconnect(new TextComponent(getTranslation("already_connected_proxy")));
} else {
((SubDataClient) api.getSubDataNetwork()[0]).sendPacket(new PacketDisconnectPlayer(player.getUniqueId(), getTranslation("already_connected_proxy")));
}

View File

@ -56,7 +56,7 @@ public class PacketExDisconnectPlayer implements PacketObjectIn<Integer>, Packet
} else {
local.disconnect();
}
client.sendPacket(new PacketExDisconnectPlayer(2, tracker));
client.sendPacket(new PacketExDisconnectPlayer(0, tracker));
} else {
client.sendPacket(new PacketExDisconnectPlayer(3, tracker));
}