protect beam disabler from others

This commit is contained in:
James B. Pollack 2015-11-24 13:35:53 -08:00
parent 50c1786e9b
commit be7d52a773

View file

@ -1216,7 +1216,6 @@ Controller.enableMapping(MAPPING_NAME);
var handToDisable = 'none';
function update() {
// print('disabled in update:::'+handToDisable)
if (handToDisable !== 0) {
leftController.update();
}
@ -1228,7 +1227,8 @@ function update() {
Messages.subscribe('Hifi-Beam-Disabler');
handleBeamDisablerMessages = function(channel, message, sender) {
print('GOT MESSAGE:::'+message)
if (sender === MyAvatar.sessionUUID) {
handToDisable = message;
if (message === 'left') {
handToDisable = 1;
@ -1238,6 +1238,8 @@ handleBeamDisablerMessages = function(channel, message, sender) {
}
}
}
Messages.messageReceived.connect(handleBeamDisablerMessages);
function cleanup() {