Phantom Network

Get network information without waiting and sending

Phantom has abstracted the entire bungeecord network for ease of use when getting servers and players within them

//Get the network instance
Network net = Phantom.getBungeeNetwork();

//Get the server instance of THIS server
NetworkedServer thisServer = net.getLocalServer();

//Get a remote server by name
NetworkedServer grushServer = net.getRemoteServer("glacialrush");

//Get all players on the entire network
net.getPlayers();

//Get all the networked servers
for(NetworkedServer i : net.getServers())
{
    if(i.isRemote())
    {
        //This networked server is remote
        //This server is not the current server (local)

        //Get the name of this server
        i.getName();

        //Get the players on this server
        i.getPlayers();

        //Send a player on the local server to this remote server
        i.sendPlayer(Player);
    }

    else
    {
        //The server i is equal to the local server THIS ONE
    }
}

results matching ""

    No results matching ""