Search in sources :

Example 1 with PacketOutUpdateServerInfo

use of de.dytanic.cloudnet.api.network.packet.out.PacketOutUpdateServerInfo in project CloudNet by Dytanic.

the class CloudServer method updateDisable.

public void updateDisable() {
    List<String> list = new CopyOnWriteArrayList<>();
    for (Player all : Bukkit.getOnlinePlayers()) list.add(all.getName());
    ServerInfo serverInfo = new ServerInfo(CloudAPI.getInstance().getServiceId(), hostAdress, port, false, list, memory, motd, Bukkit.getOnlinePlayers().size(), maxPlayers, serverState, serverConfig, template);
    CloudAPI.getInstance().getNetworkConnection().sendPacketSynchronized(new PacketOutUpdateServerInfo(serverInfo));
}
Also used : OfflinePlayer(de.dytanic.cloudnet.lib.player.OfflinePlayer) Player(org.bukkit.entity.Player) CloudPlayer(de.dytanic.cloudnet.lib.player.CloudPlayer) PacketOutUpdateServerInfo(de.dytanic.cloudnet.api.network.packet.out.PacketOutUpdateServerInfo) ServerInfo(de.dytanic.cloudnet.lib.server.info.ServerInfo) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) PacketOutUpdateServerInfo(de.dytanic.cloudnet.api.network.packet.out.PacketOutUpdateServerInfo)

Aggregations

PacketOutUpdateServerInfo (de.dytanic.cloudnet.api.network.packet.out.PacketOutUpdateServerInfo)1 CloudPlayer (de.dytanic.cloudnet.lib.player.CloudPlayer)1 OfflinePlayer (de.dytanic.cloudnet.lib.player.OfflinePlayer)1 ServerInfo (de.dytanic.cloudnet.lib.server.info.ServerInfo)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 Player (org.bukkit.entity.Player)1