Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / services / routing / model / chatQueue.js
index d212f3f..19a6d3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cdf=['Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','chatPause','paused','available','waiting','format','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x4397fc,_0x39f107){var _0x35fd95=function(_0x278fbb){while(--_0x278fbb){_0x4397fc['push'](_0x4397fc['shift']());}};_0x35fd95(++_0x39f107);}(_0x9cdf,0x16d));var _0xf9cd=function(_0x1a01ef,_0x359307){_0x1a01ef=_0x1a01ef-0x0;var _0x3144ec=_0x9cdf[_0x1a01ef];return _0x3144ec;};'use strict';var _=require(_0xf9cd('0x0'));var md5=require(_0xf9cd('0x1'));var util=require('util');var Redis=require(_0xf9cd('0x2'));var config=require(_0xf9cd('0x3'));config[_0xf9cd('0x4')]=_[_0xf9cd('0x5')](config['redis'],{'host':_0xf9cd('0x6'),'port':0x18eb});var io=require(_0xf9cd('0x7'))(new Redis(config[_0xf9cd('0x4')]));function ChatQueue(_0x1b62b9){this['id']=_0x1b62b9['id']||0x0;this[_0xf9cd('0x8')]=_0x1b62b9[_0xf9cd('0x8')]||'';this[_0xf9cd('0x9')]=_0x1b62b9['timeout']||0xa;this['strategy']=_0x1b62b9[_0xf9cd('0xa')]||_0xf9cd('0xb');this[_0xf9cd('0xc')]=_0x1b62b9[_0xf9cd('0xc')];this[_0xf9cd('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0xf9cd('0xe')]();this['updateRealtime']();}ChatQueue[_0xf9cd('0xf')]['updateRouting']=function(){var _0x19d1eb=this[_0xf9cd('0xd')][_0xf9cd('0x10')];this[_0xf9cd('0xd')]=_[_0xf9cd('0x11')](this[_0xf9cd('0xc')],'id');this[_0xf9cd('0xd')][_0xf9cd('0x10')]=_0x19d1eb;};ChatQueue[_0xf9cd('0xf')][_0xf9cd('0x12')]=function(){this[_0xf9cd('0x13')]=0x0;this['paused']=0x0;for(var _0x389e71=0x0;_0x389e71<this[_0xf9cd('0xc')][_0xf9cd('0x14')];_0x389e71+=0x1){if(this[_0xf9cd('0xc')][_0x389e71]['online']){this['loggedIn']+=0x1;}if(this[_0xf9cd('0xc')][_0x389e71][_0xf9cd('0x15')]){this[_0xf9cd('0x16')]+=0x1;}}this[_0xf9cd('0x17')]=this[_0xf9cd('0x13')]-this['paused'];this['available']=this[_0xf9cd('0x17')]>=0x0?this[_0xf9cd('0x17')]:0x0;var _0x1948d5={'id':this['id'],'available':this[_0xf9cd('0x17')],'loggedIn':this[_0xf9cd('0x13')],'name':this[_0xf9cd('0x8')],'paused':this[_0xf9cd('0x16')],'waiting':this[_0xf9cd('0x18')]};var _0x54ed99=md5(JSON['stringify'](_0x1948d5));if(this[_0xf9cd('0x1')]!==_0x54ed99){this[_0xf9cd('0x1')]=_0x54ed99;io['to'](util[_0xf9cd('0x19')]('chat:queue:%s',_0x1948d5['name']))[_0xf9cd('0x1a')](_0xf9cd('0x1b'),_0x1948d5);}};module[_0xf9cd('0x1c')]=ChatQueue;
\ No newline at end of file
+var _0x6f3d=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','loggedIn','paused','length','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f3d,0x157));var _0xd6f3=function(_0x1830ce,_0x305798){_0x1830ce=_0x1830ce-0x0;var _0x2bce9f=_0x6f3d[_0x1830ce];return _0x2bce9f;};'use strict';var _=require(_0xd6f3('0x0'));var md5=require(_0xd6f3('0x1'));var util=require(_0xd6f3('0x2'));var Redis=require(_0xd6f3('0x3'));var config=require(_0xd6f3('0x4'));config[_0xd6f3('0x5')]=_[_0xd6f3('0x6')](config['redis'],{'host':_0xd6f3('0x7'),'port':0x18eb});var io=require(_0xd6f3('0x8'))(new Redis(config[_0xd6f3('0x5')]));function ChatQueue(_0x5cb5f7){this['id']=_0x5cb5f7['id']||0x0;this[_0xd6f3('0x9')]=_0x5cb5f7[_0xd6f3('0x9')]||'';this[_0xd6f3('0xa')]=_0x5cb5f7[_0xd6f3('0xa')]||0xa;this[_0xd6f3('0xb')]=_0x5cb5f7[_0xd6f3('0xb')]||_0xd6f3('0xc');this[_0xd6f3('0xd')]=_0x5cb5f7[_0xd6f3('0xd')];this['mapAgentsId']={};this[_0xd6f3('0xe')]=0x0;this['md5']='';this[_0xd6f3('0xf')]();this[_0xd6f3('0x10')]();}ChatQueue['prototype'][_0xd6f3('0xf')]=function(){var _0x1c25ef=this[_0xd6f3('0x11')][_0xd6f3('0x12')];this[_0xd6f3('0x11')]=_[_0xd6f3('0x13')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x1c25ef;};ChatQueue['prototype']['updateRealtime']=function(){this[_0xd6f3('0x14')]=0x0;this[_0xd6f3('0x15')]=0x0;for(var _0x1b030b=0x0;_0x1b030b<this[_0xd6f3('0xd')][_0xd6f3('0x16')];_0x1b030b+=0x1){if(this[_0xd6f3('0xd')][_0x1b030b]['online']){this[_0xd6f3('0x14')]+=0x1;}if(this['Agents'][_0x1b030b][_0xd6f3('0x17')]){this[_0xd6f3('0x15')]+=0x1;}}this[_0xd6f3('0x18')]=this[_0xd6f3('0x14')]-this['paused'];this[_0xd6f3('0x18')]=this[_0xd6f3('0x18')]>=0x0?this['available']:0x0;var _0x590235={'id':this['id'],'available':this[_0xd6f3('0x18')],'loggedIn':this[_0xd6f3('0x14')],'name':this[_0xd6f3('0x9')],'paused':this['paused'],'waiting':this[_0xd6f3('0xe')]};var _0x39330c=md5(JSON[_0xd6f3('0x19')](_0x590235));if(this[_0xd6f3('0x1')]!==_0x39330c){this['md5']=_0x39330c;io['to'](util['format'](_0xd6f3('0x1a'),_0x590235['name']))[_0xd6f3('0x1b')](_0xd6f3('0x1c'),_0x590235);}};module['exports']=ChatQueue;
\ No newline at end of file