BungeeBridge help

Discussion in 'BungeeCord Plugin Development' started by TheRandomGamer, Jun 17, 2015.

  1. Hi,
    I want to have all the players on a whole bungee network available in an int in just Bukkit,
    So i found Bungee bridge (http://www.spigotmc.org/resources/bungeebridge.5820/) wich can do that,
    but I dont know how to get the response from the PacketGetOnlineGlobal packet.
    Does anyone wanna help me please?
     
  2. You want to cast all palyers to ints? Please elaborate on what you are trying to do please, do you mean getting the number of online players?
     
  3. I want the number of all online players (on the bungeenetwork) in an int
     
  4. Please post your code
     
  5. Well, I have no code, cause i dont know how to cast the answer of BungeeBridge
     
  6. Look at the packet example:
    Code (Text):
    PacketIsPlayerOnline packet = new PacketIsPlayerOnline("dommi2212");
    Object obj = packet.send();
    IsOnlineResult isOnline = (IsOnlineResult) obj;

    if(isOnline == IsOnlineResult.ONLINE) {
      System.out.println("Yeah! Dommi is online!");
    }
    Now we want to use the packet:
    new PacketGetPlayersGlobal();
    of which the callback is a List<UUID>

    If we adapt the example code:
    Code (Text):
    PacketGetPlayersGlobal packet = new PacketGetPlayersGlobal();
    List<UUID> players = packet.send();
    Integer size = players.size();
     
  7. Thank man! , hope this works
     
  8. Well, i get an incompatible type error
     
  9. Try:
    Code (Text):
    Object players = packet.send();
    Integer players = ((List<UUID>)players).size();
     
  10. Ok, ill try that thanks man
     
  11. That works, thanks for the help