コード例 #1
0
 @Override
 public void removePlayer(Connection.Unsafe connection, String player) {
   PlayerListItem pli = new PlayerListItem();
   PlayerListItem.Item item = new PlayerListItem.Item();
   item.setDisplayName(player);
   item.setUsername(player);
   item.setPing(9999);
   pli.setItems(new PlayerListItem.Item[] {item});
   pli.setAction(PlayerListItem.Action.REMOVE_PLAYER);
   connection.sendPacket(pli);
 }
コード例 #2
0
 @Override
 public void createOrUpdatePlayer(Connection.Unsafe connection, String player, int ping) {
   PlayerListItem pli = new PlayerListItem();
   PlayerListItem.Item item = new PlayerListItem.Item();
   item.setDisplayName(player);
   item.setUsername(player);
   item.setPing(ping);
   pli.setItems(new PlayerListItem.Item[] {item});
   pli.setAction(PlayerListItem.Action.ADD_PLAYER);
   connection.sendPacket(pli);
 }