Skip to content

Commit

Permalink
2.4.2
Browse files Browse the repository at this point in the history
tweaks for game lobby invite stuff
  • Loading branch information
CorySanin authored Jul 14, 2019
1 parent 721203c commit f9435fc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "music-kitten",
"version": "2.4.1",
"version": "2.4.2",
"description": "Use your own soundtrack in Counter-Strike: Global Offensive",
"main": "main.js",
"scripts": {
Expand Down
12 changes: 5 additions & 7 deletions richpresence.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ function setDiscordToggle(toggle){
}

function updateInfo(data, appyToExisting){
if(appyToExisting){
for(let key in data){
state[key] = data[key]
}
if(!appyToExisting){
state = {}
}
else{
state = data
for(let key in data){
state[key] = data[key]
}
}

Expand All @@ -38,7 +36,7 @@ function setActivity(){

rpc.on('ready', () => {
rpc.subscribe('GAME_JOIN', function(payload){
shell.openExternal(payload.secret)
shell.openExternal('steam://joinlobby/730/' + payload.secret)
})

setActivity()
Expand Down
21 changes: 13 additions & 8 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,19 @@ function getAuth(){
}

ipc.on('inviteUrl', function(event, partyId){
richpresence(MENURPC, false)
if(partyId.includes('joinlobby')){
richpresence({
partyId: btoa(partyId),
partySize: 1,
partyMax: 5,
joinSecret: partyId
}, true)
let includesLobbyId = partyId.includes('joinlobby')
richpresence(MENURPC, includesLobbyId)
if(includesLobbyId){
let split = partyId.split('/')
if(split.length >= 6){
let lobbyId = split[4]
richpresence({
partyId: btoa(lobbyId),
partySize: 1,
partyMax: 5,
joinSecret: [lobbyId, split[5]].join('/')
}, true)
}
}
})

Expand Down

0 comments on commit f9435fc

Please sign in to comment.