@@ -8,8 +8,12 @@ var util = require('util'),
88 alarm = new require ( './lib/alarm' ) . Alarm ( ) ,
99 player = new require ( './lib/player' ) . Player ( ) ,
1010 nextAlarm = alarm . getNext ( ) ,
11- logHistory = [ ] ,
12- verifyAwakeTimer , canVerifyAwake ;
11+ logHistory = [ ]
12+ /*config = {
13+ plugins: ['verify']
14+ },
15+ plugins = {},*/
16+ /*verifyAwakeTimer, canVerifyAwake*/ ;
1317
1418function log ( text ) {
1519 socketServer . sockets . emit ( 'log' , text ) ;
@@ -22,11 +26,11 @@ function soundAlarm() {
2226 player . play ( 'sound/alarm.wav' , { repeat : true } ) ;
2327}
2428
25- function verifyAwake ( ) {
29+ /* function verifyAwake() {
2630 canVerifyAwake = false;
2731 clearTimeout(verifyAwakeTimer);
2832 log('Initiating awake verification');
29-
33+ socketServer.sockets.emit('canVerifyAwakeIn', 60000);
3034 verifyAwakeTimer = setTimeout(function () {
3135 socketServer.sockets.emit('verifyAwake');
3236 canVerifyAwake = true;
@@ -43,7 +47,7 @@ function verifiedAwake() {
4347 clearTimeout(verifyAwakeTimer);
4448 log('Awake verified');
4549 }
46- }
50+ }*/
4751
4852function parseTime ( string ) {
4953 var time = string . split ( ':' ) ;
@@ -88,7 +92,7 @@ socketServer.sockets.on('connection', function (socket) {
8892 socket . emit ( 'init' , {
8993 time : nextAlarm ? nextAlarm . format ( 'HH:MM' ) : null ,
9094 triggered : player . playing ( ) ,
91- canVerifyAwake : canVerifyAwake ,
95+ // canVerifyAwake: canVerifyAwake,
9296 logHistory : logHistory
9397 } ) ;
9498
@@ -104,13 +108,13 @@ socketServer.sockets.on('connection', function (socket) {
104108 log ( 'Stopped' ) ;
105109 socketServer . sockets . emit ( 'stop' ) ;
106110 player . stop ( ) ;
107- verifyAwake ( ) ;
111+ // verifyAwake();
108112 }
109113 } ) ;
110114
111- socket . on ( 'awake' , function ( data ) {
115+ /* socket.on('awake', function (data) {
112116 verifiedAwake();
113- } ) ;
117+ });*/
114118
115119 /*socket.emit('news', { hello: 'world' });
116120 socket.on('my other event', function (data) {
0 commit comments