Skip to content

Invalid permissions response error and networking thing #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
magnemint opened this issue Jun 20, 2024 · 2 comments
Open

Invalid permissions response error and networking thing #86

magnemint opened this issue Jun 20, 2024 · 2 comments

Comments

@magnemint
Copy link

hi i get this error

[ERROR] ResponseError { code: InvalidPermissions, message: "Not authenticated or invalid scope" }
[ERROR] ResponseError { code: UnknownError, message: "Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc." }
[ERROR] Failed to configure networking: ResponseError { code: UnknownError, message: "Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc." }

with this code

ublic class Main {
    static File file = null;
    static String path = "lib/rpc_lib/x86_64/discord_game_sdk.dll";

    public static void main(String[] args) {
        file = new File(path);
        Core.init(file);
        try(CreateParams params = new CreateParams()) {
            params.setClientID(1252977240413700137L);
            params.setFlags(CreateParams.getDefaultFlags());

            // Create the Core
            try (Core core = new Core(params))
            {
                try(Activity activity = new Activity())
                {
                    activity.setDetails("Running an example");
                    activity.setState("and having fun");

                    // Setting a start time causes an "elapsed" field to appear
                    activity.timestamps().setStart(Instant.now());

                    // We are in a party with 10 out of 100 people.
                    activity.party().size().setMaxSize(100);
                    activity.party().size().setCurrentSize(10);

                    // Make a "cool" image show up
                    activity.assets().setLargeImage("test");

                    // Setting a join secret and a party ID causes an "Ask to Join" button to appear
                    activity.party().setID("Party!");
                    activity.secrets().setJoinSecret("Join!");

                    // Finally, update the current activity to our activity
                    core.activityManager().updateActivity(activity);
                }

                while(true)
                {
                    core.runCallbacks();
                    try
                    {
                        // Sleep a bit to save CPU
                        Thread.sleep(16);
                    }
                    catch(InterruptedException e)
                    {
                        e.printStackTrace();
                    }
                }
            }
        }
    }
}

ive configured the discord application on the developer portal and i get a networking error i dont know where it came from please help

@magnemint
Copy link
Author

i would just like to say that i looked at other issues and got the rich presence (my goal) to work but i still get the responseerrors and I would like to suppress them because yes so if anyone could please help i would appreciate it

@JnCrMx
Copy link
Owner

JnCrMx commented Jun 27, 2024

Hi,

this is probably because networking is no longer supported, but the library still attempts to initialize it.

It will be fixed in the next update (which is the rewrite in pure Java and does not contain networking support anymore).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants