コード例 #1
0
 @Override
 public String getServer(ProxiedPlayer player) {
   ListenerInfo listener = player.getPendingConnection().getListener();
   if (listener.isForceDefault()) {
     return listener.getDefaultServer();
   }
   String forced =
       listener.getForcedHosts().get(player.getPendingConnection().getVirtualHost().getHostName());
   String server = (forced == null) ? data.get(key(player)) : forced;
   return (server != null) ? server : listener.getDefaultServer();
 }
コード例 #2
0
 private String key(ProxiedPlayer player) {
   InetSocketAddress host = player.getPendingConnection().getVirtualHost();
   return player.getName() + ";" + host.getHostString() + ":" + host.getPort();
 }