@Override
    public Object createWebSocket(ServletUpgradeRequest request, ServletUpgradeResponse response) {
        String pathInfo = request.getRequestPath();
        System.out.println("web socket: " + pathInfo);

        EventWebSocket socket = null;
        if (EVENT_GAME.matcher(pathInfo).matches()) {
            final int gameId = Integer.parseInt(pathInfo.split("/")[2]);
            final String userName = pathInfo.split("/")[3];
            Game game = serverStatus.getGame(gameId);
            if (game != null && game.containsPlayer(userName)) {
                socket = new EventWebSocket(game, userName);
                System.out.println(socket);
                game.addSocketForUser(socket, userName);
            }
        }
        return socket;
    }