Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / services / routing / model / chatQueue.js
index f951f43..1f7e42d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eac=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','paused','online','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy'];(function(_0x3b2147,_0x3ffcd9){var _0x7a0b6a=function(_0x4b01ed){while(--_0x4b01ed){_0x3b2147['push'](_0x3b2147['shift']());}};_0x7a0b6a(++_0x3ffcd9);}(_0x0eac,0x13c));var _0xc0ea=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x0eac[_0x3c4dad];return _0x1a4f49;};'use strict';var _=require('lodash');var md5=require(_0xc0ea('0x0'));var util=require('util');var Redis=require(_0xc0ea('0x1'));var config=require('../../../config/environment');config[_0xc0ea('0x2')]=_[_0xc0ea('0x3')](config[_0xc0ea('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xc0ea('0x4'))(new Redis(config[_0xc0ea('0x2')]));function ChatQueue(_0x4c846a){this['id']=_0x4c846a['id']||0x0;this['name']=_0x4c846a[_0xc0ea('0x5')]||'';this[_0xc0ea('0x6')]=_0x4c846a[_0xc0ea('0x6')]||0xa;this['strategy']=_0x4c846a[_0xc0ea('0x7')]||_0xc0ea('0x8');this['Agents']=_0x4c846a[_0xc0ea('0x9')];this[_0xc0ea('0xa')]={};this[_0xc0ea('0xb')]=0x0;this['md5']='';this[_0xc0ea('0xc')]();this[_0xc0ea('0xd')]();}ChatQueue[_0xc0ea('0xe')][_0xc0ea('0xc')]=function(){var _0x43e0b9=this[_0xc0ea('0xa')]['_rr'];this['mapAgentsId']=_[_0xc0ea('0xf')](this[_0xc0ea('0x9')],'id');this[_0xc0ea('0xa')]['_rr']=_0x43e0b9;};ChatQueue['prototype']['updateRealtime']=function(){this[_0xc0ea('0x10')]=0x0;this[_0xc0ea('0x11')]=0x0;for(var _0x4f4467=0x0;_0x4f4467<this[_0xc0ea('0x9')]['length'];_0x4f4467+=0x1){if(this[_0xc0ea('0x9')][_0x4f4467][_0xc0ea('0x12')]){this['loggedIn']+=0x1;}if(this[_0xc0ea('0x9')][_0x4f4467][_0xc0ea('0x13')]){this[_0xc0ea('0x11')]+=0x1;}}this[_0xc0ea('0x14')]=this[_0xc0ea('0x10')]-this['paused'];this[_0xc0ea('0x14')]=this['available']>=0x0?this[_0xc0ea('0x14')]:0x0;var _0xe73bfa={'id':this['id'],'available':this[_0xc0ea('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xc0ea('0x5')],'paused':this[_0xc0ea('0x11')],'waiting':this[_0xc0ea('0xb')]};var _0x5f0637=md5(JSON[_0xc0ea('0x15')](_0xe73bfa));if(this[_0xc0ea('0x0')]!==_0x5f0637){this['md5']=_0x5f0637;io['to'](util[_0xc0ea('0x16')](_0xc0ea('0x17'),_0xe73bfa['name']))[_0xc0ea('0x18')](_0xc0ea('0x19'),_0xe73bfa);}};module[_0xc0ea('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0xe68c=['timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','online','chatPause','available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name'];(function(_0x14079c,_0x5337b4){var _0xcd69c1=function(_0x4fe8c7){while(--_0x4fe8c7){_0x14079c['push'](_0x14079c['shift']());}};_0xcd69c1(++_0x5337b4);}(_0xe68c,0x123));var _0xce68=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0xe68c[_0x403f5f];return _0x15b1cd;};'use strict';var _=require(_0xce68('0x0'));var md5=require(_0xce68('0x1'));var util=require(_0xce68('0x2'));var Redis=require(_0xce68('0x3'));var config=require(_0xce68('0x4'));config['redis']=_[_0xce68('0x5')](config['redis'],{'host':_0xce68('0x6'),'port':0x18eb});var io=require(_0xce68('0x7'))(new Redis(config['redis']));function ChatQueue(_0x54badc){this['id']=_0x54badc['id']||0x0;this['name']=_0x54badc[_0xce68('0x8')]||'';this[_0xce68('0x9')]=_0x54badc['timeout']||0xa;this[_0xce68('0xa')]=_0x54badc[_0xce68('0xa')]||_0xce68('0xb');this['Agents']=_0x54badc[_0xce68('0xc')];this['mapAgentsId']={};this[_0xce68('0xd')]=0x0;this[_0xce68('0x1')]='';this[_0xce68('0xe')]();this[_0xce68('0xf')]();}ChatQueue[_0xce68('0x10')][_0xce68('0xe')]=function(){var _0x28f0ae=this[_0xce68('0x11')][_0xce68('0x12')];this['mapAgentsId']=_[_0xce68('0x13')](this[_0xce68('0xc')],'id');this['mapAgentsId'][_0xce68('0x12')]=_0x28f0ae;};ChatQueue[_0xce68('0x10')]['updateRealtime']=function(){this[_0xce68('0x14')]=0x0;this[_0xce68('0x15')]=0x0;for(var _0x1ff6ed=0x0;_0x1ff6ed<this[_0xce68('0xc')]['length'];_0x1ff6ed+=0x1){if(this['Agents'][_0x1ff6ed][_0xce68('0x16')]){this['loggedIn']+=0x1;}if(this[_0xce68('0xc')][_0x1ff6ed][_0xce68('0x17')]){this[_0xce68('0x15')]+=0x1;}}this[_0xce68('0x18')]=this['loggedIn']-this['paused'];this[_0xce68('0x18')]=this[_0xce68('0x18')]>=0x0?this[_0xce68('0x18')]:0x0;var _0x11397f={'id':this['id'],'available':this[_0xce68('0x18')],'loggedIn':this[_0xce68('0x14')],'name':this[_0xce68('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x2d15d4=md5(JSON[_0xce68('0x19')](_0x11397f));if(this[_0xce68('0x1')]!==_0x2d15d4){this[_0xce68('0x1')]=_0x2d15d4;io['to'](util[_0xce68('0x1a')](_0xce68('0x1b'),_0x11397f['name']))[_0xce68('0x1c')]('chat_queue:save',_0x11397f);}};module[_0xce68('0x1d')]=ChatQueue;
\ No newline at end of file