mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-12-01 06:33:47 +01:00
Misc fixes regarding the last few commits
This commit is contained in:
parent
fa77eeeab0
commit
e9c0075144
@ -65,10 +65,15 @@ public class PacketDisconnectPlayer implements PacketObjectIn<Integer>, PacketOb
|
|||||||
} else {
|
} else {
|
||||||
local.disconnect();
|
local.disconnect();
|
||||||
}
|
}
|
||||||
client.sendPacket(new PacketDisconnectPlayer(2, tracker));
|
client.sendPacket(new PacketDisconnectPlayer(0, tracker));
|
||||||
} else if ((remote = plugin.api.getGlobalPlayer(id)) != null) {
|
} else if ((remote = plugin.api.getGlobalPlayer(id)) != null) {
|
||||||
|
if (remote.getProxy().getSubData()[0] != null) {
|
||||||
client.sendPacket(new PacketDisconnectPlayer(2, tracker));
|
((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 {
|
} else {
|
||||||
client.sendPacket(new PacketDisconnectPlayer(3, tracker));
|
client.sendPacket(new PacketDisconnectPlayer(3, tracker));
|
||||||
}
|
}
|
||||||
|
@ -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.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.config.ListenerInfo;
|
import net.md_5.bungee.api.config.ListenerInfo;
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
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.event.*;
|
||||||
import net.md_5.bungee.api.plugin.Listener;
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
import net.md_5.bungee.connection.InitialHandler;
|
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");
|
Logger.get("SubServers").info(e.getConnection().getName() + " connected, but already had a database entry");
|
||||||
RemotePlayer player = rPlayers.get(e.getConnection().getUniqueId());
|
RemotePlayer player = rPlayers.get(e.getConnection().getUniqueId());
|
||||||
if (player.getProxy() == null || player.getProxy().isMaster()) {
|
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) {
|
} else if (player.getProxy().getSubData()[0] != null) {
|
||||||
((SubDataClient) player.getProxy().getSubData()[0]).sendPacket(new PacketExDisconnectPlayer(player.getUniqueId(), getTranslation("already_connected_proxy")));
|
((SubDataClient) player.getProxy().getSubData()[0]).sendPacket(new PacketExDisconnectPlayer(player.getUniqueId(), getTranslation("already_connected_proxy")));
|
||||||
}
|
}
|
||||||
|
@ -902,6 +902,11 @@ public class SubCommand {
|
|||||||
"In such cases, you would want to update a single server first",
|
"In such cases, you would want to update a single server first",
|
||||||
"to rebuild the cache and then update the rest in bulk.",
|
"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:",
|
"Examples:",
|
||||||
" /update Server2",
|
" /update Server2",
|
||||||
" /update Server2 1.14.4",
|
" /update Server2 1.14.4",
|
||||||
|
@ -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.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.config.ListenerInfo;
|
import net.md_5.bungee.api.config.ListenerInfo;
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
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.event.*;
|
||||||
import net.md_5.bungee.api.plugin.Listener;
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
import net.md_5.bungee.connection.InitialHandler;
|
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");
|
Logger.get("SubServers").info(e.getConnection().getName() + " connected, but already had a database entry");
|
||||||
RemotePlayer player = rPlayers.get(e.getConnection().getUniqueId());
|
RemotePlayer player = rPlayers.get(e.getConnection().getUniqueId());
|
||||||
if (player.getProxy() != null && player.getProxy().equalsIgnoreCase(api.getName())) {
|
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 {
|
} else {
|
||||||
((SubDataClient) api.getSubDataNetwork()[0]).sendPacket(new PacketDisconnectPlayer(player.getUniqueId(), getTranslation("already_connected_proxy")));
|
((SubDataClient) api.getSubDataNetwork()[0]).sendPacket(new PacketDisconnectPlayer(player.getUniqueId(), getTranslation("already_connected_proxy")));
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ public class PacketExDisconnectPlayer implements PacketObjectIn<Integer>, Packet
|
|||||||
} else {
|
} else {
|
||||||
local.disconnect();
|
local.disconnect();
|
||||||
}
|
}
|
||||||
client.sendPacket(new PacketExDisconnectPlayer(2, tracker));
|
client.sendPacket(new PacketExDisconnectPlayer(0, tracker));
|
||||||
} else {
|
} else {
|
||||||
client.sendPacket(new PacketExDisconnectPlayer(3, tracker));
|
client.sendPacket(new PacketExDisconnectPlayer(3, tracker));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user