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'; var handToDisable = 'none';
function update() { function update() {
// print('disabled in update:::'+handToDisable)
if (handToDisable !== 0) { if (handToDisable !== 0) {
leftController.update(); leftController.update();
} }
@ -1228,14 +1227,17 @@ function update() {
Messages.subscribe('Hifi-Beam-Disabler'); Messages.subscribe('Hifi-Beam-Disabler');
handleBeamDisablerMessages = function(channel, message, sender) { handleBeamDisablerMessages = function(channel, message, sender) {
print('GOT MESSAGE:::'+message)
handToDisable = message; if (sender === MyAvatar.sessionUUID) {
if (message === 'left') { handToDisable = message;
handToDisable = 1; if (message === 'left') {
} handToDisable = 1;
if (message === 'right') { }
handToDisable = 0; if (message === 'right') {
handToDisable = 0;
}
} }
} }
Messages.messageReceived.connect(handleBeamDisablerMessages); Messages.messageReceived.connect(handleBeamDisablerMessages);