Mstrodl / elcord

Discord Rich Presence / Gamebridge support for Emacs!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[spacemacs] Elcord in an infinite loop of connecting and disconnecting

SillyIngenuity opened this issue · comments

commented

@SillyIngenuity I know this will happen if Discord is logged out or something because it disconnects when unauthorized. Maybe you can give more details about what's happening with Discord while this is happening? On the same subject, I'd like to see some of Discord's logs which should show if you hit ctrl-shift-i and enter the console tab. You'll probably want to reload (ctrl-r) so there isn't a ton of unnecessary information to sift through :)

image
image
image
image
image

^^ Logs after refreshing discord and launching emacs

The first time, discord was already opened when I was installing elcord on spacemacs. Restarting didn't help.

commented

@SillyIngenuity You're running the win32 version of emacs right? it's not in WSL or something strange like that?

image
I am fairly certain it is the win64 version but I don't know how to formally check.

commented

@SillyIngenuity Looks like it, sorry... I'm not really sure why it's not working for you and I don't use Windows. Just a thought: what happens if you run powershell -NoProfile -ExecutionPolicy Bypass -Command stdpipe.ps1 . discord-ipc-0 in the elcord directory? Does it error out? It's possible that's causing issues for you. Also I guess make sure you have a working C# compiler?

image
image
spacemacs has installed the elcord package in this dir C:\Users\Jason Si\AppData\Roaming\.emacs.d\elpa\27.1\develop\elcord-20210524.1611
and I ran the command in this dir but there was an error.
I don't have a C# compiler but I can install one and try again.

Also, if you meant running that command like this:
image
it opens power shell for a brief second and it closes; nothing happens.

commented

@SillyIngenuity Try .\stdpipe.ps1? (in the aforementioned command)

image
It doesn't seem to do anything. You can input commands thereafter though.

That means it ran successfully (stdpipe is just a way to get emacs talking to a named pipe on Windows).
@SillyIngenuity So to be clear, you're using the browser version of Discord? I don't know that I've ever tried that but I can test (also on Windows).

commented

@Zulu-Inuoe Browser version is unsupported (impossible to support). They are using the desktop version.

Should I try installing a C# compilier as previously suggested?

commented

@SillyIngenuity Certainly worth a shot... Sorry I can't be more help, I'm a Linux user (:

@SillyIngenuity Hm. I have never run emacs this way. Can you give me some information on how you're running this? I can try and diagnose. And I don't believe a C# compiler is necessary or will help - it looks like you were able to successfully run stdpipe.ps1 already

@Zulu-Inuoe I'm running a daemon server and then just create an instance of it. If I run emacs normally, same error occurs...
emacs --daemon
emacsclient --create-frame

For reference, I am using spacemacs, maybe elcord doesn't work on spacemacs?

commented

Also noteworthy, @Zulu-Inuoe I made a Windows branch but unfortunately I'm not sure how to get emacs to keep the handle from CreateFile... Maybe you have a clever idea? I was thinking if I opened a buffer it might still keep the handle, but this doesn't appear to be the case. TL;DR: You can actually write to named pipes using CreateFile and normal FS operations; win32 api is wacky.

@Mstrodl That's pretty clever. I'd tried going down a similar approach by opening a process pointed at the file path of the pipe and that didn't work either. I hadn't considered using a buffer. I'll play around with that idea this weekend.

Per this issue @SillyIngenuity I can't reproduce right now. I am also running emacs 27.1 on Windows 10 x64.
I don't see Spacemacs affecting this in any way.
When I run emacs --daemon on the command-line, the process just starts and exits. Yours seems to stay open.
Can you replicate the infinite connect/reconnect on runemacs ?

I may also have other things in my init.el that might be affecting this. I'll try with a vanilla setup to see if it behaves any differently.

commented

@SillyIngenuity If you have a working C# compiler and still have this issue, please feel free to reopen it