open-unlight / node-discord-game

The Discord Game SDK for Electron.js
47 stars 9 forks source link

Linux support? #11

Open sp1ritCS opened 4 years ago

sp1ritCS commented 4 years ago

As there is a native linux binary for the discord sdk, i'm stuck getting it to work with this library.

So, I managed to "run" it by replaceing the sdk folder in the project root with the lib folder provied by discord in their sdk. and move the discord_game_sdk.h with it.

Then I got

node: symbol lookup error: /home/admin/workspace/games/discordSdkTest/node_modules/.pnpm/registry.npmjs.org/discord-game/0.1.1/node_modules/discord-game/build/Release/discord_game.node: undefined symbol: DiscordCreate

when calling Discord.create().

I guessed the Libary wasn't included by default in the build, I decided to run it with the LD_PRELOAD env var set to the binary of the sdk.

Its still crashing at Discord.create() but I just get a POSIX returncode 1, no std out/err messages anymore.

$ LD_PRELOAD=node_modules/discord-game/sdk/x86_64/discord_game_sdk.so pnpm run start
> sdk_test@0.1.0 start /home/admin/workspace/games/discordSdkTest
> pnpm run ts && pnpm run run

> sdk_test@0.1.0 ts /home/admin/workspace/games/discordSdkTest
> tsc

> sdk_test@0.1.0 run /home/admin/workspace/games/discordSdkTest
> node dist/app.js

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sdk_test@0.1.0 run: `node dist/app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the discord_now_playing@0.1.0 run script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/admin/.npm/_logs/2020-06-06T17_55_13_700Z-debug.log
 ERROR  Command failed with exit code 1.
elct9620 commented 4 years ago

I haven't tested it on the Linux, the package is written in the version which not contains Linux support.

elct9620 commented 4 years ago

According to the document, I think the Discord Game SDK changes some create params. It breaks the package.

Currently, I am working on rewrite the Unlight Server and Unity client, this project is not included in our major milestone, it may not be updated frequently.

elct9620 commented 4 years ago

Due to the API changes, our Electron project didn't respond to the status on the Discord. I plan to schedule an update in August after our anniversary events finished.