Package com.sk89q.skmcl.session

Examples of com.sk89q.skmcl.session.Identity


        Persistence.commitAndForget(profile);
        getProfiles().notifyUpdate();

        LoginController loginDialog = new LoginController(owner, this);
        loginDialog.setVisible(true);
        Identity identity = loginDialog.getIdentity();

        if (identity != null) {
            LaunchWorker task = new LaunchWorker(profile, identity);
            ListenableFuture<LaunchedProcess> future = executor.submit(task);
            SwingHelper.addErrorDialogCallback(future, owner);
View Full Code Here


            throws IOException, UpdateRequiredException {
        if (!getJarPath().exists()) {
            throw new UpdateRequiredException("Not yet installed");
        }

        Identity identity = context.getIdentity();
        ObjectMapper mapper = new ObjectMapper();
        final File extractDir = createExtractDir();
        JavaProcessBuilder builder = new JavaProcessBuilder();
        ReleaseManifest manifest = mapper.readValue(
                getManifestPath(), ReleaseManifest.class);
        String clientToken = identity.getClientToken();

        // Add libraries to classpath or extract the libraries as necessary
        for (Library library : manifest.getLibraries()) {
            File path = new File(getLibrariesDir(), library.getPath(context.getEnvironment()));

            if (path.exists()) {
                Extract extract = library.getExtract();
                if (extract != null) {
                    ZipExtract zipExtract = new ZipExtract(
                            new FileResource(path), extractDir);
                    zipExtract.setExclude(extract.getExclude());
                    zipExtract.run();
                } else {
                    builder.classPath(path);
                }
            }
        }

        // Add arguments for the .jar
        String[] args = manifest.getMinecraftArguments().split(" +");
        for (String arg : args) {
            arg = arg.replace("${version_name}", manifest.getId());
            arg = arg.replace("${game_directory}", getProfile().getContentDir().getAbsolutePath());
            arg = arg.replace("${game_assets}", getAssetsDir().getAbsolutePath());
            arg = arg.replace("${auth_player_name}", identity.getName());
            arg = arg.replace("${auth_username}", identity.getName());
            arg = arg.replace("${auth_access_token}", identity.getAccessToken());
            arg = arg.replace("${auth_session}", clientToken);
            builder.getArgs().add(arg);
        }

        // Mac OS X arguments
View Full Code Here

TOP

Related Classes of com.sk89q.skmcl.session.Identity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.