EFTGCA-VertxBackend/src/main/java/com/mscarceller/mcawebchatvx/WebChatServer.java
private void deleteClient (String roomName, String userId){
        JsonObject usersInRoom = getUsersInRoomJsonObject(roomName);
        try {
            System.out.println("Deleting client: " + usersInRoom.getJsonObject(userId).getString("vertxId"));
            vertx.undeploy(usersInRoom.getJsonObject(userId).getString("vertxId"), res -> {
                if (res.succeeded()) {
                    System.out.println("Undeployed ok");
                } else {
                    System.err.println("Undeploy failed!");
                }
            });
        } catch (java.lang.NullPointerException e) {
            System.err.println("Client has already been deleted");
        }
        usersInRoom.remove(userId);
        webChatClients.put(roomName, usersInRoom.toString());
    }
//Remove the verticle and unregister the handler
Remove the verticle and unregister the handler
Remove the verticle and unregister the handler
private void deleteClient (String roomName, String userId){
        JsonObject usersInRoom = getUsersInRoomJsonObject(roomName);
        try {
            System.out.println("Deleting client: " + usersInRoom.getJsonObject(userId).getString("vertxId"));
            vertx.undeploy(usersInRoom.getJsonObject(userId).getString("vertxId"), res -> {
                if (res.succeeded()) {
                    System.out.println("Undeployed ok");
                } else {
                    System.err.println("Undeploy failed!");
                }
            });
        } catch (java.lang.NullPointerException e) {
            System.err.println("Client has already been deleted");
        }
        usersInRoom.remove(userId);
        webChatClients.put(roomName, usersInRoom.toString());
    }
private void deleteClient ( String roomName , String userId ) { JsonObject usersInRoom = getUsersInRoomJsonObject ( roomName ) ; try { System . out . println ( "Deleting client: " + usersInRoom . getJsonObject ( userId ) . getString ( "vertxId" ) ) ; vertx . undeploy ( usersInRoom . getJsonObject ( userId ) . getString ( "vertxId" ) , res -> { if ( res . succeeded ( ) ) { System . out . println ( "Undeployed ok" ) ; } else { System . err . println ( "Undeploy failed!" ) ; } } ) ; } catch ( java . lang . NullPointerException e ) { System . err . println ( "Client has already been deleted" ) ; } usersInRoom . remove ( userId ) ; webChatClients . put ( roomName , usersInRoom . toString ( ) ) ; }
Remove the verticle and unregister the handler
Remove the verticle and unregister the handler