Eidenz / XSOverlay-BetterDiscord

Get your discord notifications in VR through XSOverlay!
16 stars 2 forks source link

Latest Discord Update killed it #3

Open EiskaffeeVRC opened 1 year ago

EiskaffeeVRC commented 1 year ago

It wont even load now that a new discord update nuked it

Eidenz commented 1 year ago

Yup, I'm aware of the issue. However, the big problem is that the new update won't allow importing external libs, which this plugin needs to do.

I've been discussing with a BD dev to see if there is any way to fix it. For now, we will have to wait.

furrz commented 1 year ago

Hi, I made a dumb temporary workaround for people who really want this to work. It requires running a separate nodeJS process as a middleman.

Update: It only partially fixes it - the plugin still doesn't seem to be correctly intercepting notifications either? :/

Make a folder to run this express server in:

const app = require("express")();
const dgram = require('dgram');

app.get('/dgram', function (req, res) {
    const server = dgram.createSocket('udp4');
    server.send(decodeURIComponent(req.query.data), 42069, '127.0.0.1', () => {
        server.close();
    });
});

app.listen(42070, function () {
    console.log("Hosting!");
});

Then, in the plugin JS, remove the dgram requirement, and replace sendToXSOverlay with this:

       function sendToXSOverlay (data) {
            fetch("https://127.0.0.1:42070/dgram?data=" + encodeURIComponent(data))
                .then(d => {})
                .catch(e => console.error(e));

        }

(Might also have to remove auto-update stuff or bump up the version number for BD to not immediately overwrite this? Unsure.)

Eidenz commented 1 year ago

When it comes to running an external server to get your notifications in VR, I'd recommend switching to a non-plugin solution completely. This one works great and pretty much forwards your PC notifications (Discord included) to XSOverlay: https://booth.pm/en/items/3237164 (that's just an example, you can probably find english alternatives that allow app-specific notifications)

The purpose of the plugin was to get your Discord notification without needing any software/server running in the background. Until we find a true fix, I would recommend this instead of running a "DIY" express server on top of a semi-broken plugin.

ghost commented 1 year ago

https://github.com/hideki0403/JustNotification Repo Link if you wish to skip distribution per Booth