Source:
private void processNewClient(NetClient client) { client.connected(entityManager, entitySerializer, eventSerializer, eventLibrary); ServerConnectListManager serverConnectListManager = ServerConnectListManager.getInstance(); serverConnectListManager.loadLists(); Path blacklistPath = ServerConnectListManager.getInstance().getBlacklistPath(); Path whitelistPath = ServerConnectListManager.getInstance().getWhitelistPath(); try { Set blacklistedIDs = new Gson().fromJson(Files.newBufferedReader(blacklistPath), Set.class); Set whitelistedIDs = new Gson().fromJson(Files.newBufferedReader(whitelistPath), Set.class); System.out.println("BLIDS: " + blacklistedIDs); System.out.println("WLIDS: " + whitelistedIDs); if (blacklistedIDs != null) { if (blacklistedIDs.contains(client.getId())) { System.out.println("BLID: " + client.getId()); forceDisconnect(client); return; } } if (whitelistedIDs != null) { if (!whitelistedIDs.contains(client.getId())) { System.out.println("WLID: " + client.getId()); forceDisconnect(client); return; } } System.out.println("ID: " + client.getId()); } catch (IOException e) { e.printStackTrace(); } client.send(NetData.NetMessage.newBuilder().setJoinComplete( NetData.JoinCompleteMessage.newBuilder().setClientId(client.getEntity().getComponent(NetworkComponent.class).getNetworkId())).build()); clientList.add(client); netClientList.add(client); clientPlayerLookup.put(client.getEntity(), client); connectClient(client); logger.info("New client entity: {}", client.getEntity()); for (EntityRef netEntity : entityManager.getEntitiesWith(NetworkComponent.class)) { NetworkComponent netComp = netEntity.getComponent(NetworkComponent.class); if (netComp.getNetworkId() != NULL_NET_ID) { switch (netComp.replicateMode) { case OWNER: if (client.equals(getOwner(netEntity))) { client.setNetInitial(netComp.getNetworkId()); } break; default: client.setNetInitial(netComp.getNetworkId()); break; } } } }

Target:
private void processNewClient(NetClient client) { ServerConnectListManager serverConnectListManager = context.get(ServerConnectListManager.class); if (!serverConnectListManager.isClientAllowedToConnect(client.getId())) { String errorMessage = serverConnectListManager.getErrorMessage(client.getId()); client.send(NetData.NetMessage.newBuilder().setServerInfo(getServerInfoMessage(errorMessage)).build()); forceDisconnect(client); kicked = false; return; } client.connected(entityManager, entitySerializer, eventSerializer, eventLibrary); client.send(NetData.NetMessage.newBuilder().setJoinComplete( NetData.JoinCompleteMessage.newBuilder().setClientId(client.getEntity().getComponent(NetworkComponent.class).getNetworkId())).build()); clientList.add(client); netClientList.add(client); clientPlayerLookup.put(client.getEntity(), client); connectClient(client); logger.info("New client entity: {}", client.getEntity()); for (EntityRef netEntity : entityManager.getEntitiesWith(NetworkComponent.class)) { NetworkComponent netComp = netEntity.getComponent(NetworkComponent.class); if (netComp.getNetworkId() != NULL_NET_ID) { switch (netComp.replicateMode) { case OWNER: if (client.equals(getOwner(netEntity))) { client.setNetInitial(netComp.getNetworkId()); } break; default: client.setNetInitial(netComp.getNetworkId()); break; } } } }