Skip to content
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

connection timeout #14

Closed
Hundeklemmen opened this issue Dec 4, 2017 · 10 comments
Closed

connection timeout #14

Hundeklemmen opened this issue Dec 4, 2017 · 10 comments

Comments

@Hundeklemmen
Copy link

at setTimeout (C:\Users\xande\Desktop\program\node_modules\discord-rpc\src\Client.js:109)
Code:

const rpc = new DiscordRPC.Client({ transport: 'ipc' });
const startTimestamp = new Date();
var login = store.get('logininfomation');
socket.emit('DiscordUpateRequest', login.ID, socket.io.engine.id);
console.log("Discord connecting");
rpc.on('ready', () => {
console.log("Connected to discord");
var login = store.get('logininfomation');
if(login){
socket.emit('DiscordUpateRequest', login.ID, socket.io.engine.id);
}
setInterval(() => {
var login = store.get('logininfomation');
socket.emit('DiscordUpateRequest', login.ID, socket.io.engine.id);
}, 5000);
});
async function updateActivity(Data, amount) {
console.log("Updating discord status");
if (!rpc) return;
rpc.setActivity({
details: @+Data.username+ | ++Data.likes,
state: Together with +amount+ other,
startTimestamp,
largeImageKey: "logo",
largeImageText: "McDivision",
instance: false,
});
const startTimestamp = new Date();
}
rpc.login("386928094856085516").catch(console.error);

@Pierce01
Copy link

Pierce01 commented Dec 6, 2017

having the same issue

https://maxie.is-serious.business/47b296.png

const DiscordRPC = require('discord-rpc');
const ClientId = '388095943624359946';
DiscordRPC.register(ClientId);

const rpc = new DiscordRPC.Client({ transport: 'ipc' });

async function setActivity() {
  if (!rpc || !mainWindow) 
    return;

    rpc.setActivity({
      details: `Rich Presence for the UnderCards Client`,
      state: 'Searching',
      startTimestamp,
      largeImageKey: 'cards_logo',
      largeImageText: 'UnderCards',
      smallImageKey: 'maxie',
      smallImageText: 'Beta Testing stuff',
      instance: false,
    });
  }
  
  rpc.on('ready', () => {
    setActivity();
  
    // activity can only be set every 15 seconds
    setInterval(() => {
      setActivity();
    }, 15e3);
  });

  
rpc.login(ClientId).catch(console.error);

@devsnek
Copy link
Member

devsnek commented Dec 19, 2017

it looks like this issue actually comes from windows named pipes and elevated permissions, technically an implementation bug on discord's side, i'll close this

@devsnek devsnek closed this as completed Dec 19, 2017
@outpoints
Copy link

So there's no fix @devsnek ? :(

@devsnek
Copy link
Member

devsnek commented Dec 27, 2017

@mew351 make your app match the elevation of the discord process

@framerate
Copy link
Contributor

We experienced this too, live on a convention floor showing our game. It happened all day on Windows on day 1 and appeared to start happening on day 2 on linux as well.

I'm going to be looking into it more this week but it appears to stretch beyond just Windows (but it definitely shows up almost 100% of the time in Windows).

We had to remove discord integration entirely for the time being, which is a major bummer! Hopefully I can come up with a better solution and report back.

@devsnek
Copy link
Member

devsnek commented Jan 17, 2018

@framerate please keep me informed, and make sure you're on the latest version (and also whats your game 😄)

@framerate
Copy link
Contributor

@devsnek http://doomtroopergame.com :)

I'll definitely keep you updated if I find anything. My game is 100% javascript so this is a key library for me here :)

@TheDIGS
Copy link

TheDIGS commented Apr 13, 2021

For me, I was getting my problem until I removed a date from my code:

client.setActivity({ largeImageKey: 'logo', largeImageText: 'large image text', details: 'subscribe and like', state: 'or i die', startTimestamp: new Date(), buttons: [ { label: 'Hello!', url: 'https://github.com/thedigs', }, ], });

I removed the startTimestamp: new Date(), and the problem disappeared!

@Sam-Neale
Copy link

DIGS Answer Solved for me.

For me, I was getting my problem until I removed a date from my code:

client.setActivity({ largeImageKey: 'logo', largeImageText: 'large image text', details: 'subscribe and like', state: 'or i die', startTimestamp: new Date(), buttons: [ { label: 'Hello!', url: 'https://github.com/thedigs', }, ], });

I removed the startTimestamp: new Date(), and the problem disappeared!

@fhodun
Copy link

fhodun commented Jun 28, 2021

same problem, I can't try TheDIGS solution cause I haven't startTimestamp in my code

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

8 participants