Fix Server Recognition

This commit is contained in:
RayzsYT committed 2024-06-19 21:57:34 +02:00
1 parent da58a3b43b
commit 2f8187063e
3 files changed
+4 -4

No files matched your search

@@ -8,6 +8,7 @@ import de.rayzs.pat.api.storage.blacklist.impl.GroupBlacklist;
import de.rayzs.pat.plugin.BukkitLoader;
import de.rayzs.pat.api.communication.impl.*;
import de.rayzs.pat.api.storage.Storage;
import de.rayzs.pat.plugin.logger.Logger;
import de.rayzs.pat.utils.CommunicationPackets;
import de.rayzs.pat.utils.ExpireCache;
import de.rayzs.pat.utils.Reflection;
@@ -154,8 +155,6 @@ public class Communicator {
commandsPacket.setTurnBlacklistToWhitelist(Storage.ConfigSections.Settings.TURN_BLACKLIST_TO_WHITELIST.ENABLED);
commandsPacket.setCommands(commands);
//System.out.println("-> " + commands);
bundle = new CommunicationPackets.PacketBundle(Storage.TOKEN, serverId, commandsPacket, groupsPacket);
clientInfo.sendBytes(CommunicationPackets.convertToBytes(bundle));
}
@@ -178,6 +177,7 @@ public class Communicator {
}
public static void sendFeedback() {
Logger.info("Send data :D");
sendPacket(new CommunicationPackets.FeedbackPacket(Storage.TOKEN, SERVER_ID.toString()));
}
@@ -16,7 +16,7 @@ public class BungeeClientInfo extends ClientInfo {
@Override
public void sendBytes(byte[] bytes) {
ProxyServer.getInstance().getServers().entrySet().stream().filter(entry -> entry.getKey().equals(getName())).forEach(entry -> entry.getValue().sendData(Client.CHANNEL_NAME, bytes));
ProxyServer.getInstance().getServers().entrySet().stream().filter(entry -> entry.getKey().equalsIgnoreCase(getName())).forEach(entry -> entry.getValue().sendData(Client.CHANNEL_NAME, bytes));
}
@Override
@@ -16,7 +16,7 @@ public class VelocityClientInfo extends ClientInfo {
@Override
public void sendBytes(byte[] bytes) {
VelocityLoader.getServer().getAllServers().stream().filter(server -> server.getServerInfo().getName().equals(getName())).forEach(server -> server.sendPluginMessage(VelocityClient.getIdentifier(), bytes));
VelocityLoader.getServer().getAllServers().stream().filter(server -> server.getServerInfo().getName().equalsIgnoreCase(getName())).forEach(server -> server.sendPluginMessage(VelocityClient.getIdentifier(), bytes));
}
@Override