Vatuu / discord-rpc

Java Wrapper of the Discord-RPC Library for Discord Rich Presence.
MIT License
194 stars 42 forks source link

Joining game with invite doesn't fire any events #27

Closed tylerhasman closed 5 years ago

tylerhasman commented 5 years ago

Here is my handler for it

.setJoinGameEventHandler(new JoinGameCallback() {
 @Override
 public void apply(String secret) {
  WizardGame.instance.getClient().sendMessage(new DiscordJoinGameMessage(secret));
  Gdx.app.log("DiscordJoinGame", "Secret " + secret);
 }
})

This is my initialization code:

String appId = "XXXXXXXXX";

DiscordRPC.discordInitialize(appId, handlers, true);

doDiscordEvents();

DiscordRPC.discordClearPresence();
DiscordRPC.discordUpdatePresence(new DiscordRichPresence());

discordThread = new Thread(new Runnable() {
 @Override
 public void run() {
  while (!Thread.currentThread().isInterrupted()) {
   try {
    DiscordRPC.discordRunCallbacks();
    Gdx.app.log("discordEvents", "Polling...");
    Thread.sleep(2000);
   } catch (InterruptedException e) {}
  }
 }
}, "Discord-Event-Poll");
discordThread.setDaemon(true);
discordThread.start();

Why isn't the event firing?

Vatuu commented 5 years ago

What exactly is doDiscordEvents() doing?

tylerhasman commented 5 years ago

Running call backs

Vatuu commented 5 years ago

Closed, because we know what's wrong.