SpikeHD / rsRPC

Rust implementation of the Discord RPC server
MIT License
17 stars 2 forks source link

VSCode Discord integration can't connect to rsRPC #3

Open maicol07 opened 2 weeks ago

maicol07 commented 2 weeks ago

Hi, The Discord Integration VSCode extension fails to connect to rsRPC but works with arRPC. It seems to use this library to make IPC requests. Can you fix it? Thanks

SpikeHD commented 2 weeks ago

What OS are you on?

maicol07 commented 2 weeks ago

Windows 11

SpikeHD commented 2 weeks ago

Should be fixed as of 1c7245a5d39f81414b2db4b23ff457090599b76e

image

maicol07 commented 2 weeks ago

I've tried 0.19.0 but VSCode fails to connect to rsRPC

SpikeHD commented 2 weeks ago

What does the log output look like?

maicol07 commented 2 weeks ago

Here is the first one:

[2024-11-11 10:24:05] [IPC] Created IPC socket: \\.\pipe\discord-ipc-0
[2024-11-11 10:24:05] [Websocket] Server started on port 6463
[2024-11-11 10:24:05] [RPC Server] Starting client connector on port 1337...
[2024-11-11 10:24:05] [RPC Server] Starting IPC connector...
[2024-11-11 10:24:05] [RPC Server] Starting process server...
[2024-11-11 10:24:05] [RPC Server] Starting websocket connector...
[2024-11-11 10:24:05] [RPC Server] Done! Watching for activity...
[2024-11-11 10:24:05] [Websocket] Polling for events...
[2024-11-11 10:24:06] [Process Scanner] Process scan triggered
[2024-11-11 10:24:08] [IPC] Recieved message: {"v":1,"client_id":"1070048358246387864"}
[2024-11-11 10:24:08] [IPC] Recieved handshake
[2024-11-11 10:24:12] [Process Scanner] Process scan complete
[2024-11-11 10:24:12] [Client Connector] No clients connected, skipping
[2024-11-11 10:24:22] [Process Scanner] Process scan triggered
[2024-11-11 10:24:29] [Process Scanner] Process scan complete
[2024-11-11 10:24:29] [Client Connector] No clients connected, skipping
[2024-11-11 10:24:39] [Process Scanner] Process scan triggered
[2024-11-11 10:24:45] [Process Scanner] Process scan complete
[2024-11-11 10:24:45] [Client Connector] No clients connected, skipping
[2024-11-11 10:24:55] [Process Scanner] Process scan triggered
[2024-11-11 10:25:02] [Process Scanner] Process scan complete
[2024-11-11 10:25:02] [Client Connector] No clients connected, skipping
[2024-11-11 10:25:12] [Process Scanner] Process scan triggered
[2024-11-11 10:25:18] [Process Scanner] Process scan complete
[2024-11-11 10:25:18] [Client Connector] No clients connected, skipping
[2024-11-11 10:25:28] [Process Scanner] Process scan triggered
[2024-11-11 10:25:35] [Process Scanner] Process scan complete
[2024-11-11 10:25:35] [Client Connector] No clients connected, skipping
[2024-11-11 10:25:45] [Process Scanner] Process scan triggered
[2024-11-11 10:25:51] [Process Scanner] Process scan complete
[2024-11-11 10:25:51] [Client Connector] No clients connected, skipping
[2024-11-11 10:26:01] [Process Scanner] Process scan triggered
[2024-11-11 10:26:08] [Process Scanner] Process scan complete
[2024-11-11 10:26:08] [Client Connector] No clients connected, skipping
[2024-11-11 10:26:18] [Process Scanner] Process scan triggered
[2024-11-11 10:26:22] [Client Connector] Client 0 connected
[2024-11-11 10:26:24] [Process Scanner] Process scan complete
[2024-11-11 10:26:24] [Client Connector] Sending payload for activity: DSX
[2024-11-11 10:26:34] [Process Scanner] Process scan triggered
[2024-11-11 10:26:41] [Process Scanner] Process scan complete
[2024-11-11 10:26:41] [Client Connector] No clients connected, skipping
[2024-11-11 10:26:42] [Client Connector] Client 1 connected
[2024-11-11 10:26:51] [Process Scanner] Process scan triggered
[2024-11-11 10:26:57] [Process Scanner] Process scan complete
[2024-11-11 10:26:57] [Client Connector] Already sent payload for activity: DSX
[2024-11-11 10:27:07] [Process Scanner] Process scan triggered
[2024-11-11 10:27:14] [Process Scanner] Process scan complete
[2024-11-11 10:27:14] [Client Connector] Already sent payload for activity: DSX
[2024-11-11 10:27:24] [Process Scanner] Process scan triggered
[2024-11-11 10:27:30] [Process Scanner] Process scan complete
[2024-11-11 10:27:30] [Client Connector] Already sent payload for activity: DSX
[2024-11-11 10:27:40] [Process Scanner] Process scan triggered
[2024-11-11 10:27:43] [IPC] Error reading packet type: failed to fill whole buffer
[2024-11-11 10:27:43] [IPC] Error: È in corso la chiusura della pipe. (os error 232)
[2024-11-11 10:27:47] [Process Scanner] Process scan complete
[2024-11-11 10:27:47] [Client Connector] Already sent payload for activity: DSX
[2024-11-11 10:27:57] [Process Scanner] Process scan triggered

I've noticed that when I closed DSX it closed the IPC pipe. Then I have restarted rsRPC:

[2024-11-11 10:28:14] [IPC] Created IPC socket: \\.\pipe\discord-ipc-0
[2024-11-11 10:28:14] [Websocket] Server started on port 6463
[2024-11-11 10:28:14] [RPC Server] Starting client connector on port 1337...
[2024-11-11 10:28:14] [RPC Server] Starting IPC connector...
[2024-11-11 10:28:14] [RPC Server] Starting process server...
[2024-11-11 10:28:14] [RPC Server] Starting websocket connector...
[2024-11-11 10:28:14] [RPC Server] Done! Watching for activity...
[2024-11-11 10:28:14] [Websocket] Polling for events...
[2024-11-11 10:28:14] [Process Scanner] Process scan triggered
[2024-11-11 10:28:17] [IPC] Recieved message: {"v":1,"client_id":"810516608442695700"}
[2024-11-11 10:28:17] [IPC] Recieved handshake
[2024-11-11 10:28:17] [IPC] Recieved message: {"cmd":"SET_ACTIVITY","args":{"pid":11688,"activity":{"details":"Not in a file!","instance":true,"assets":{"large_image":"https://raw.githubusercontent.com/LeonardSSH/vscord/main/assets/icons/idle-vscode.png","small_image":"https://raw.githubusercontent.com/LeonardSSH/vscord/main/assets/icons/idle.png","small_text":"Snoozin..."},"timestamps":{"start":1731317297840}}},"nonce":"3196ae3d-81ad-4a88-bc94-207a5ce7fe0d"}
[2024-11-11 10:28:17] [Client Connector] No clients connected, skipping
[2024-11-11 10:28:17] [IPC] Recieved message: {"cmd":"SET_ACTIVITY","args":{"pid":11688,"activity":{"details":"Not in a file!","instance":true,"assets":{"large_image":"https://raw.githubusercontent.com/LeonardSSH/vscord/main/assets/icons/idle-vscode.png","small_image":"https://raw.githubusercontent.com/LeonardSSH/vscord/main/assets/icons/idle.png","small_text":"Snoozin..."},"timestamps":{"start":1731317297840}}},"nonce":"c5e7ec5f-8c39-4cca-8c43-08d24c8d212b"}
[2024-11-11 10:28:17] [Client Connector] No clients connected, skipping
[2024-11-11 10:28:21] [Process Scanner] Process scan complete
[2024-11-11 10:28:21] [Client Connector] No clients connected, skipping
[2024-11-11 10:28:31] [Process Scanner] Process scan triggered
[2024-11-11 10:28:37] [Process Scanner] Process scan complete
[2024-11-11 10:28:37] [Client Connector] No clients connected, skipping
[2024-11-11 10:28:38] [Client Connector] Client 0 connected
[2024-11-11 10:28:47] [Process Scanner] Process scan triggered
[2024-11-11 10:28:54] [Process Scanner] Process scan complete
[2024-11-11 10:29:04] [Process Scanner] Process scan triggered
[2024-11-11 10:29:10] [Process Scanner] Process scan complete
[2024-11-11 10:29:20] [Process Scanner] Process scan triggered
[2024-11-11 10:29:27] [Process Scanner] Process scan complete
[2024-11-11 10:29:37] [Process Scanner] Process scan triggered
[2024-11-11 10:29:43] [Process Scanner] Process scan complete

Here VSCode can connect but I can't see it in Discord (I don't know why although shelteRPC sees it). If I know reopen DSX it seems to see it:

[2024-11-11 10:32:28] [Process Scanner] Process scan complete
[2024-11-11 10:32:28] [Client Connector] Sending payload for activity: DSX
[2024-11-11 10:32:38] [Process Scanner] Process scan triggered