Search in sources :

Example 1 with NetworkHandler

use of de.dytanic.cloudnet.api.handlers.NetworkHandler in project CloudNet by Dytanic.

the class PacketInLoginPlayer method handleInput.

@Override
public void handleInput(Document data, PacketSender packetSender) {
    if (CloudAPI.getInstance() != null) {
        CloudPlayer cloudPlayer = data.getObject("player", CloudPlayer.TYPE);
        CloudAPI.getInstance().getNetworkHandlerProvider().iterator(new Runnabled<NetworkHandler>() {

            @Override
            public void run(NetworkHandler obj) {
                obj.onPlayerLoginNetwork(cloudPlayer);
            }
        });
    }
}
Also used : CloudPlayer(de.dytanic.cloudnet.lib.player.CloudPlayer) NetworkHandler(de.dytanic.cloudnet.api.handlers.NetworkHandler)

Example 2 with NetworkHandler

use of de.dytanic.cloudnet.api.handlers.NetworkHandler 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);
            }
        });
    }
}
Also used : NetworkHandler(de.dytanic.cloudnet.api.handlers.NetworkHandler) CloudNetwork(de.dytanic.cloudnet.lib.CloudNetwork)

Aggregations

NetworkHandler (de.dytanic.cloudnet.api.handlers.NetworkHandler)2 CloudNetwork (de.dytanic.cloudnet.lib.CloudNetwork)1 CloudPlayer (de.dytanic.cloudnet.lib.player.CloudPlayer)1