private void processRequest(Packet packet) throws IOException {
        
        Packet out = null;
        
        if(packet == null) {
            out = Packet.getIncorrectCommandPacket();
        } else {
            String code = packet.getCode();
            
            if(code.equals(Packet.PACKET_CODES.REGISTRATION_CMD)) {
                out = register(packet);
                
            } else if(code.equals(Packet.PACKET_CODES.LOGIN_CMD)) {
                out = login(packet);
                
            } else if(code.equals(Packet.PACKET_CODES.LOGOUT_CMD)) {
                out = logout(packet);
                
            } else if(code.equals(Packet.PACKET_CODES.GET_USER_STATISTIC_CMD)) {
                out = getStatistic(packet);
                
            } else if(code.equals(Packet.PACKET_CODES.GET_GAME_LIST_CMD)) {
                out = getGameList(packet);
                
            } else if(code.equals(Packet.PACKET_CODES.NEW_GAME_CMD)) {
                out = createNewGame(packet);
                
            } else if(code.equals(Packet.PACKET_CODES.JOIN_TO_GAME_CMD)) {
                out = joinToGame(packet);
                
            } else {
                out = Packet.getIncorrectCommandPacket();
            }
        }
        
        sendToClient(out);        
    }