Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / services / routing / model / openchannelQueue.js
index 5645edc..32b5597 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e9d=['emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','openchannelPause','available','stringify','openchannel:queue:%s'];(function(_0x45977c,_0x7eaed0){var _0x399413=function(_0x41cc76){while(--_0x41cc76){_0x45977c['push'](_0x45977c['shift']());}};_0x399413(++_0x7eaed0);}(_0x8e9d,0x8e));var _0xd8e9=function(_0x40f12e,_0x26102d){_0x40f12e=_0x40f12e-0x0;var _0xda42af=_0x8e9d[_0x40f12e];return _0xda42af;};'use strict';var _=require(_0xd8e9('0x0'));var md5=require(_0xd8e9('0x1'));var util=require(_0xd8e9('0x2'));var Redis=require(_0xd8e9('0x3'));var config=require(_0xd8e9('0x4'));config[_0xd8e9('0x5')]=_[_0xd8e9('0x6')](config[_0xd8e9('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd8e9('0x5')]));function OpenchannelQueue(_0x19f93e){this['id']=_0x19f93e['id']||0x0;this[_0xd8e9('0x7')]=_0x19f93e[_0xd8e9('0x7')]||'';this[_0xd8e9('0x8')]=_0x19f93e['timeout']||0xa;this[_0xd8e9('0x9')]=_0x19f93e[_0xd8e9('0x9')]||_0xd8e9('0xa');this[_0xd8e9('0xb')]=_0x19f93e[_0xd8e9('0xb')];this[_0xd8e9('0xc')]={};this[_0xd8e9('0xd')]=0x0;this[_0xd8e9('0x1')]='';this[_0xd8e9('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0xd8e9('0xf')][_0xd8e9('0xe')]=function(){var _0x183362=this['mapAgentsId'][_0xd8e9('0x10')];this[_0xd8e9('0xc')]=_[_0xd8e9('0x11')](this[_0xd8e9('0xb')],'id');this[_0xd8e9('0xc')][_0xd8e9('0x10')]=_0x183362;};OpenchannelQueue['prototype'][_0xd8e9('0x12')]=function(){this[_0xd8e9('0x13')]=0x0;this[_0xd8e9('0x14')]=0x0;for(var _0x1034d6=0x0;_0x1034d6<this[_0xd8e9('0xb')][_0xd8e9('0x15')];_0x1034d6+=0x1){if(this[_0xd8e9('0xb')][_0x1034d6]['online']){this[_0xd8e9('0x13')]+=0x1;}if(this[_0xd8e9('0xb')][_0x1034d6][_0xd8e9('0x16')]){this[_0xd8e9('0x14')]+=0x1;}}this[_0xd8e9('0x17')]=this['loggedIn']-this['paused'];this[_0xd8e9('0x17')]=this[_0xd8e9('0x17')]>=0x0?this[_0xd8e9('0x17')]:0x0;var _0x3415cf={'id':this['id'],'available':this[_0xd8e9('0x17')],'loggedIn':this[_0xd8e9('0x13')],'name':this['name'],'paused':this[_0xd8e9('0x14')],'waiting':this[_0xd8e9('0xd')]};var _0x1e60fc=md5(JSON[_0xd8e9('0x18')](_0x3415cf));if(this['md5']!==_0x1e60fc){this['md5']=_0x1e60fc;io['to'](util['format'](_0xd8e9('0x19'),_0x3415cf[_0xd8e9('0x7')]))[_0xd8e9('0x1a')]('openchannel_queue:save',_0x3415cf);}};module[_0xd8e9('0x1b')]=OpenchannelQueue;
\ No newline at end of file
+var _0x5dcc=['openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','updateRouting','prototype','map','updateRealtime','paused','length','online','loggedIn','openchannelPause','available','waiting','stringify','format','openchannel:queue:%s','emit'];(function(_0xf7d47e,_0x7222c8){var _0x31733c=function(_0x1efa27){while(--_0x1efa27){_0xf7d47e['push'](_0xf7d47e['shift']());}};_0x31733c(++_0x7222c8);}(_0x5dcc,0x7a));var _0xc5dc=function(_0x5d56df,_0x5830d0){_0x5d56df=_0x5d56df-0x0;var _0x1fed50=_0x5dcc[_0x5d56df];return _0x1fed50;};'use strict';var _=require(_0xc5dc('0x0'));var md5=require(_0xc5dc('0x1'));var util=require('util');var Redis=require(_0xc5dc('0x2'));var config=require(_0xc5dc('0x3'));config['redis']=_[_0xc5dc('0x4')](config[_0xc5dc('0x5')],{'host':_0xc5dc('0x6'),'port':0x18eb});var io=require(_0xc5dc('0x7'))(new Redis(config[_0xc5dc('0x5')]));function OpenchannelQueue(_0x559323){this['id']=_0x559323['id']||0x0;this[_0xc5dc('0x8')]=_0x559323[_0xc5dc('0x8')]||'';this[_0xc5dc('0x9')]=_0x559323[_0xc5dc('0x9')]||0xa;this['strategy']=_0x559323['strategy']||_0xc5dc('0xa');this[_0xc5dc('0xb')]=_0x559323[_0xc5dc('0xb')];this[_0xc5dc('0xc')]={};this['waiting']=0x0;this[_0xc5dc('0x1')]='';this[_0xc5dc('0xd')]();this['updateRealtime']();}OpenchannelQueue[_0xc5dc('0xe')][_0xc5dc('0xd')]=function(){var _0x52d35d=this[_0xc5dc('0xc')]['_rr'];this['mapAgentsId']=_[_0xc5dc('0xf')](this[_0xc5dc('0xb')],'id');this[_0xc5dc('0xc')]['_rr']=_0x52d35d;};OpenchannelQueue[_0xc5dc('0xe')][_0xc5dc('0x10')]=function(){this['loggedIn']=0x0;this[_0xc5dc('0x11')]=0x0;for(var _0x36239b=0x0;_0x36239b<this['Agents'][_0xc5dc('0x12')];_0x36239b+=0x1){if(this[_0xc5dc('0xb')][_0x36239b][_0xc5dc('0x13')]){this[_0xc5dc('0x14')]+=0x1;}if(this[_0xc5dc('0xb')][_0x36239b][_0xc5dc('0x15')]){this['paused']+=0x1;}}this[_0xc5dc('0x16')]=this[_0xc5dc('0x14')]-this['paused'];this[_0xc5dc('0x16')]=this[_0xc5dc('0x16')]>=0x0?this[_0xc5dc('0x16')]:0x0;var _0x56d926={'id':this['id'],'available':this[_0xc5dc('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xc5dc('0x8')],'paused':this[_0xc5dc('0x11')],'waiting':this[_0xc5dc('0x17')]};var _0x4c7470=md5(JSON[_0xc5dc('0x18')](_0x56d926));if(this[_0xc5dc('0x1')]!==_0x4c7470){this[_0xc5dc('0x1')]=_0x4c7470;io['to'](util[_0xc5dc('0x19')](_0xc5dc('0x1a'),_0x56d926[_0xc5dc('0x8')]))[_0xc5dc('0x1b')](_0xc5dc('0x1c'),_0x56d926);}};module[_0xc5dc('0x1d')]=OpenchannelQueue;
\ No newline at end of file