Exemplo n.º 1
0
 private static CommandSender getSender(String sender) {
   if (sender != null) {
     GSPlayer p = PlayerManager.getPlayer(sender);
     return (p == null ? ProxyServer.getInstance().getConsole() : p.getProxiedPlayer());
   }
   return null;
 }
Exemplo n.º 2
0
  public static GSPlayer getSimilarPlayer(String player) {
    for (GSPlayer p : onlinePlayers.values()) {
      if ((p.getProxiedPlayer() != null
              && p.getProxiedPlayer().getDisplayName() != null
              && p.getProxiedPlayer()
                  .getDisplayName()
                  .toLowerCase()
                  .startsWith(player.toLowerCase()))
          || p.getName().toLowerCase().startsWith(player.toLowerCase())
          || (p.getUuid() != null && p.getUuid().equals(player))) {
        return p;
      }
    }

    return null;
  }
Exemplo n.º 3
0
  public static List<GSPlayer> getPlayersByIP(String ip) {
    List<GSPlayer> matchingPlayers = new ArrayList<GSPlayer>();
    if (ip == null) {
      Exception exception = new Exception("test");
      exception.printStackTrace();
      geSuit.instance.getLogger().severe("getPlayersByIP() ip is null");
      return null;
    }

    for (GSPlayer p : onlinePlayers.values()) {
      if (p.getProxiedPlayer().getAddress().getHostString().equalsIgnoreCase(ip)) {
        matchingPlayers.add(p);
      }
    }

    return matchingPlayers;
  }
Exemplo n.º 4
0
 public static void sendMessageToTarget(GSPlayer target, String message) {
   sendMessageToTarget(target.getProxiedPlayer(), message);
 }