-
Notifications
You must be signed in to change notification settings - Fork 192
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
Comments
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); |
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 |
So there's no fix @devsnek ? :( |
@mew351 make your app match the elevation of the discord process |
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. |
@framerate please keep me informed, and make sure you're on the latest version (and also whats your game 😄) |
@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 :) |
For me, I was getting my problem until I removed a date from my code:
I removed the |
DIGS Answer Solved for me.
|
same problem, I can't try TheDIGS solution cause I haven't |
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);
The text was updated successfully, but these errors were encountered: