use of de.dytanic.cloudnet.lib.CloudNetwork in project CloudNet by Dytanic.
the class CloudNet method updateNetwork.
public void updateNetwork() {
CloudNetwork cloudNetwork = networkManager.newCloudNetwork();
networkManager.sendAll(new PacketOutCloudNetwork(cloudNetwork));
}
use of de.dytanic.cloudnet.lib.CloudNetwork in project CloudNet by Dytanic.
the class NetworkManager method newCloudNetwork.
public CloudNetwork newCloudNetwork() {
CloudNetwork cloudNetwork = new CloudNetwork();
cloudNetwork.setOnlineCount(getOnlineCount());
cloudNetwork.setMessages(messageConfig.load());
cloudNetwork.setModules(moduleProperties);
// cloudNetwork.setNotifySystem(CloudNet.getInstance().getConfig().isNotifyService());
cloudNetwork.setWebPort(CloudNet.getInstance().getConfig().getWebServerConfig().getPort());
// cloudNetwork.setDevServices(CloudNet.getInstance().getConfig().isCloudDevServices());
Collection<WrapperInfo> wrappers = new LinkedList<>();
for (Wrapper wrapper : CloudNet.getInstance().getWrappers().values()) if (wrapper.getWrapperInfo() != null)
wrappers.add(wrapper.getWrapperInfo());
cloudNetwork.setWrappers(wrappers);
cloudNetwork.setServerGroups(MapWrapper.transform(CloudNet.getInstance().getServerGroups(), new Catcher<String, String>() {
@Override
public String doCatch(String key) {
return key;
}
}, new Catcher<SimpleServerGroup, ServerGroup>() {
@Override
public SimpleServerGroup doCatch(ServerGroup key) {
return key.toSimple();
}
}));
// cloudNetwork.setPermissionPool(permissionPool);
cloudNetwork.setProxyGroups(CloudNet.getInstance().getProxyGroups());
cloudNetwork.setModules(moduleProperties);
return cloudNetwork;
}
use of de.dytanic.cloudnet.lib.CloudNetwork in project CloudNet by Dytanic.
the class PacketInCloudNetwork method handleInput.
@Override
public void handleInput(Document data, PacketSender packetSender) {
if (CloudAPI.getInstance() != null) {
CloudNetwork cloudNetwork = data.getObject("cloudnetwork", NetworkUtils.cloudnet().getType());
CloudAPI.getInstance().setCloudNetwork(cloudNetwork);
CloudAPI.getInstance().getNetworkHandlerProvider().iterator(new Runnabled<NetworkHandler>() {
@Override
public void run(NetworkHandler obj) {
obj.onCloudNetworkUpdate(cloudNetwork);
}
});
}
}
Aggregations