Skip to content
Permalink
Browse files

Rich presence and filters

  • Loading branch information...
makitsune committed Mar 15, 2019
1 parent b892326 commit c02cb4d46c98f83e07616cab74002e96d4de1258
@@ -0,0 +1,9 @@
// thanks Brad!
// https://github.com/highfidelity/hifi/tree/master/scripts/tutorials/entity_edit_filters

function filter(properties, filterType, originalProperties) {

}

filter.rejectAll = true;
filter;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
npm i
@@ -0,0 +1,46 @@
// function WS(url) {
// this.ws = new WebSocket(url);
// var interval = undefined;

// function reconnect() {
// console.log("Reconnecting...");
// this.ws = new WebSocket(url);
// Script.clearInterval(ws);
// }

// this.ws.onclose = reconnect;
// this.ws.onerror = reconnect;

// return this.ws;
// }

var ws = new WebSocket("ws://127.0.0.1:9876");
var interval = undefined;

function updatePresence() {
ws.send(JSON.stringify({
place: location.placename,
people: AvatarManager.getAvatarIdentifiers().length
}));
}

ws.onopen = function() {
//console.log("Joined!");
interval = Script.setInterval(function() {
updatePresence();
}, 1000*60);
updatePresence();
}

function hostChanged(hostname) {
Script.setTimeout(function() {
updatePresence();
}, 1000*5);
}

location.hostChanged.connect(hostChanged);

Script.scriptEnding.connect(function() {
Script.clearInterval(interval);
location.hostChanged.disconnect(hostChanged);
});
@@ -0,0 +1 @@
node app.js

0 comments on commit c02cb4d

Please sign in to comment.
You can’t perform that action at this time.