MinnDevelopment / java-discord-rpc

Java bindings for https://github.com/discordapp/discord-rpc (using JNA)
Apache License 2.0
132 stars 38 forks source link

Error in LSRegisterURL: -10811 #33

Closed ScuroNeko closed 5 years ago

ScuroNeko commented 5 years ago

I use follow code

import club.minnced.discord.rpc.*;

public class Main {
    public static void main(String[] args) {
        DiscordRPC lib = DiscordRPC.INSTANCE;
        String applicationId = "";
        String steamId = "";
        DiscordEventHandlers handlers = new DiscordEventHandlers();
        handlers.ready = (user) -> System.out.println("Ready!");
        lib.Discord_Initialize(applicationId, handlers, true, steamId);
        DiscordRichPresence presence = new DiscordRichPresence();
        presence.startTimestamp = System.currentTimeMillis() / 1000; // epoch second
        presence.details = "Testing RPC";
        lib.Discord_UpdatePresence(presence);
        new Thread(() -> {
            while (!Thread.currentThread().isInterrupted()) {
                lib.Discord_RunCallbacks();
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException ignored) {}
            }
        }, "RPC-Callback-Handler").start();
    }
}

and i get error in log Error in LSRegisterURL: -10811

MinnDevelopment commented 5 years ago

This is a duplicate of https://github.com/discordapp/discord-rpc/issues/170