Built motion from commit eddce310.|2.6.12
[motion2.git] / server / services / routing / model / openchannelQueue.js
index 97197ee..212ed68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x18ae8a,_0x247fb8){var _0x43886e=function(_0xe2ce6d){while(--_0xe2ce6d){_0x18ae8a['push'](_0x18ae8a['shift']());}};_0x43886e(++_0x247fb8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0x5fc3[_0x2fdf82];return _0x2382f5;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue;
\ No newline at end of file
+var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x2dedd8,_0x3fe19f){var _0x530a6b=function(_0x1a2865){while(--_0x1a2865){_0x2dedd8['push'](_0x2dedd8['shift']());}};_0x530a6b(++_0x3fe19f);}(_0x814b,0x1a2));var _0xb814=function(_0x423e15,_0x12b2b2){_0x423e15=_0x423e15-0x0;var _0x184279=_0x814b[_0x423e15];return _0x184279;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627<this[_0xb814('0xc')][_0xb814('0x16')];_0x2ab627+=0x1){if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x17')]){this[_0xb814('0x14')]+=0x1;}if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x18')]){this[_0xb814('0x15')]+=0x1;}}this[_0xb814('0x19')]=this[_0xb814('0x14')]-this[_0xb814('0x15')];this['available']=this[_0xb814('0x19')]>=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue;
\ No newline at end of file