Commit 938eccee authored by Jens-Christian Fischer's avatar Jens-Christian Fischer
Browse files

Consistent naming of Viusals channel

parent 8388f0d6
......@@ -12,7 +12,7 @@ defmodule Grains.UserSocket do
channel "presence:*", Grains.PresenceChannel
channel "osc", Grains.OscChannel
channel "visual", Grains.VisualsChannel
channel "visuals:*", Grains.VisualsChannel
## Transports
transport :websocket, Phoenix.Transports.WebSocket
......
......@@ -101,7 +101,7 @@ room.join().receive("ok", resp => {
})
.receive("error", reason => console.log("presence join failed", reason))
let visuals = socket.channel("visuals", {});
let visuals = socket.channel("visuals:data", {});
visuals.on("velocity", state => {
console.log("velocity: ", state);
......@@ -111,7 +111,7 @@ visuals.on("acceleratoin", state => {
console.log("acceleration: ", state);
});
visual.join().receive("ok", resp => {
visuals.join().receive("ok", resp => {
console.log("visual joined");
})
.receive("error", reason => console.log("visual join failed", reason))
......
......@@ -177,6 +177,8 @@ let PresenceSketch = {
addBoids(joins) {
if !(PresenceSketch.p5) { return; };
_.each(joins, function(val, name) {
if (name) {
......@@ -189,6 +191,7 @@ let PresenceSketch = {
removeBoids(leaves) {
if !(PresenceSketch.p5) { return; };
_.each(leaves, function(val, name) {
delete PresenceSketch.boids[name];
});
......@@ -198,6 +201,7 @@ let PresenceSketch = {
syncBoids(currentActive) {
if !(PresenceSketch.p5) { return; };
console.log("sync");
_.each(currentActive, function(p) {
console.log(p.user);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment