From e93bff1ff07539e7b74d63c96ebea83c47a33bec Mon Sep 17 00:00:00 2001 From: luki39 <55762764+luki-39@users.noreply.github.com> Date: Wed, 23 Feb 2022 17:33:27 +0100 Subject: [PATCH] statut discord --- app/assets/js/discordwrapper.js | 10 +--------- app/assets/js/scripts/landing.js | 12 ++++++------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/app/assets/js/discordwrapper.js b/app/assets/js/discordwrapper.js index 35ebbe7a..07fe1111 100644 --- a/app/assets/js/discordwrapper.js +++ b/app/assets/js/discordwrapper.js @@ -81,12 +81,4 @@ client.login({clientId: "946067255295369248"}).catch(error => { } else { logger.log('Unable to initialize Discord Rich Presence: ' + error.message, error) } -}) - -exports.shutdownRPC = function(){ - if(!client) return - client.clearActivity() - client.destroy() - client = null - activity = null -} \ No newline at end of file +}) \ No newline at end of file diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index 95592c90..067eb163 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -465,7 +465,7 @@ function asyncSystemScan(mcVersion, launchAfter = true){ // Keep reference to Minecraft Process let proc // Is DiscordRPC enabled -let hasRPC = false +//let hasRPC = false // Joined server regex // Change this if your server uses something different. const GAME_JOINED_REGEX = /\[.+\]: Sound engine started/ @@ -655,9 +655,9 @@ function dlAsync(login = true){ const onLoadComplete = () => { toggleLaunchArea(false) - if(hasRPC){ + /*if(hasRPC){ DiscordWrapper.updateDetails('Loading game..') - } + }*/ proc.stdout.on('data', gameStateChange) proc.stdout.removeListener('data', tempListener) proc.stderr.removeListener('data', gameErrorListener) @@ -707,10 +707,10 @@ function dlAsync(login = true){ setLaunchDetails('Done. Enjoy the server!') - // Init Discord Hook + /*// Init Discord Hook const distro = DistroManager.getDistribution() if(distro.discord != null && serv.discord != null){ - DiscordWrapper.initRPC(distro.discord, serv.discord) + //DiscordWrapper.initRPC(distro.discord, serv.discord) hasRPC = true proc.on('close', (code, signal) => { loggerLaunchSuite.log('Shutting down Discord Rich Presence..') @@ -718,7 +718,7 @@ function dlAsync(login = true){ hasRPC = false proc = null }) - } + }*/ } catch(err) {