Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
fix nasty bug
Browse files Browse the repository at this point in the history
  • Loading branch information
foxt committed Sep 22, 2021
1 parent 5c0b398 commit 326c8c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ cp ../node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Conten
cp ../node_modules/systray/traybin/tray_darwin_release mac/notifier
cp -r ../rblxRP.app ./
mv mac/* ./rblxRP.app/Contents/MacOS/
rm -rf mac
rm -rf mac

zip -9r rblxrp-X.X.X-darwin.zip rblxRP.app
zip -9r rblxrp-X.X.X-win.zip win
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rblxrp",
"version": "3.1.0",
"version": "3.1.1",
"description": " Discord Rich Presence for Roblox",
"main": "build/index.js",
"bin": "build/index.js",
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {URL} from "url";
import {notify} from "node-notifier";
import {dirname, join} from "path";
import fetch from "node-fetch";
import { existsSync, fstat, unlinkSync, writeFileSync } from "fs";
import { existsSync, fstat, mkdirSync, unlinkSync, writeFileSync } from "fs";
import { server } from "./webserver";
import { homedir } from "os";

Expand All @@ -27,6 +27,8 @@ function openURL(url) {

function updateStudioPlugin() {
if (config.studioPresence) {
if (!existsSync(join(homedir(),"Documents","Roblox"))) mkdirSync(join(homedir(),"Documents","Roblox"));
if (!existsSync(join(homedir(),"Documents","Roblox","Plugins"))) mkdirSync(join(homedir(),"Documents","Roblox","Plugins"));
writeFileSync(join(homedir(),"Documents","Roblox","Plugins","rblxRPPlugin.lua"), `local a="http://127.0.0.1:5816/"local b=game:GetService("StudioService")local c=game:GetService("ServerStorage")local d=game:GetService("HttpService")local e=game:GetService("Selection")local f=""local g=false;function debugLog(h)if c:FindFirstChild("rblxrpdebug")then print("[rblxRP] "..h)end end;while wait(5)do local i,j=pcall(function()debugLog("pinging..."..a.."pingState")d:PostAsync(a.."pingState","")debugLog("pong")local k=d:UrlEncode(game.GameId or 0)local l=d:UrlEncode(game.Name or"Place1")local m=d:UrlEncode("Working on a game")if b.ActiveScript~=nil then m=d:UrlEncode(b.ActiveScript.Name)end;local n=a.."reportState/"..k.."/"..l.."/"..m;debugLog(n)if n==f and not g then return end;g=true;debugLog("posting..."..n)d:PostAsync(n,"")debugLog("posted state "..n)g=false;f=n end)if not i then debugLog("failed "..j)end end;e.SelectionChanged:Connect(function()if not g then debugLog("forcing next state update")end;g=true end)`)
} else {
unlinkSync(join(homedir(),"Documents","Roblox","Plugins","rblxRPPlugin.lua"))
Expand Down

0 comments on commit 326c8c9

Please sign in to comment.