Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / services / routing / model / openchannelQueue.js
1 'use strict';const a1362_0x5eec=['1603kDMtHZ','format','prototype','md5','length','openchannel:queue:%s','available','mapAgentsId','_rr','Agents','updateRealtime','util','331uGIBPA','77755wXYyxL','28264vApkrK','49LyWfVG','openchannel_queue:save','575940tfvDyW','lodash','loggedIn','stringify','updateRouting','paused','4XhFhVY','map','strategy','1JvcbqE','@rediscache','waiting','timeout','emit','2277vyLMWK','59481acrcuQ','name','170309SAnDQt'];const a1362_0x8b13=function(_0xbdc09e,_0x5a261b){_0xbdc09e=_0xbdc09e-0x9e;let _0x5eec6e=a1362_0x5eec[_0xbdc09e];return _0x5eec6e;};const a1362_0x15cbb1=a1362_0x8b13;(function(_0x4c2fe0,_0x3fb7f2){const _0x43e07f=a1362_0x8b13;while(!![]){try{const _0x526290=parseInt(_0x43e07f(0xbc))+-parseInt(_0x43e07f(0xbd))*parseInt(_0x43e07f(0xae))+-parseInt(_0x43e07f(0xa2))*-parseInt(_0x43e07f(0xbb))+-parseInt(_0x43e07f(0xaa))*-parseInt(_0x43e07f(0xba))+-parseInt(_0x43e07f(0xad))*-parseInt(_0x43e07f(0xa5))+-parseInt(_0x43e07f(0xbf))+parseInt(_0x43e07f(0xab));if(_0x526290===_0x3fb7f2)break;else _0x4c2fe0['push'](_0x4c2fe0['shift']());}catch(_0x424612){_0x4c2fe0['push'](_0x4c2fe0['shift']());}}}(a1362_0x5eec,0xa3272));const _=require(a1362_0x15cbb1(0xc0)),md5=require('md5'),util=require(a1362_0x15cbb1(0xb9)),{getSocket}=require(a1362_0x15cbb1(0xa6)),io=getSocket();function OpenchannelQueue(_0x5e6292){const _0xa8d54a=a1362_0x15cbb1;this['id']=_0x5e6292['id']||0x0,this['name']=_0x5e6292[_0xa8d54a(0xac)]||'',this['timeout']=_0x5e6292[_0xa8d54a(0xa8)]||0xa,this['strategy']=_0x5e6292[_0xa8d54a(0xa4)]||'beepall',this['Agents']=_0x5e6292[_0xa8d54a(0xb7)],this[_0xa8d54a(0xb5)]={},this[_0xa8d54a(0xa7)]=0x0,this[_0xa8d54a(0xb1)]='',this[_0xa8d54a(0xa0)](),this[_0xa8d54a(0xb8)]();}OpenchannelQueue[a1362_0x15cbb1(0xb0)][a1362_0x15cbb1(0xa0)]=function(){const _0x1a4ac1=a1362_0x15cbb1,_0x5198da=this[_0x1a4ac1(0xb5)]['_rr'];this[_0x1a4ac1(0xb5)]=_[_0x1a4ac1(0xa3)](this[_0x1a4ac1(0xb7)],'id'),this['mapAgentsId'][_0x1a4ac1(0xb6)]=_0x5198da;},OpenchannelQueue['prototype']['updateRealtime']=function(){const _0x421edc=a1362_0x15cbb1;this[_0x421edc(0x9e)]=0x0,this['paused']=0x0;for(let _0x54599f=0x0;_0x54599f<this[_0x421edc(0xb7)][_0x421edc(0xb2)];_0x54599f+=0x1){this[_0x421edc(0xb7)][_0x54599f]['online']&&(this[_0x421edc(0x9e)]+=0x1),this[_0x421edc(0xb7)][_0x54599f]['openchannelPause']&&(this['paused']+=0x1);}this[_0x421edc(0xb4)]=this[_0x421edc(0x9e)]-this[_0x421edc(0xa1)],this[_0x421edc(0xb4)]=this['available']>=0x0?this['available']:0x0;const _0x489a3d={'id':this['id'],'available':this[_0x421edc(0xb4)],'loggedIn':this[_0x421edc(0x9e)],'name':this[_0x421edc(0xac)],'paused':this[_0x421edc(0xa1)],'waiting':this['waiting']},_0x58e8f8=md5(JSON[_0x421edc(0x9f)](_0x489a3d));this[_0x421edc(0xb1)]!==_0x58e8f8&&(this[_0x421edc(0xb1)]=_0x58e8f8,io['to'](util[_0x421edc(0xaf)](_0x421edc(0xb3),_0x489a3d['name']))[_0x421edc(0xa9)](_0x421edc(0xbe),_0x489a3d));},module['exports']=OpenchannelQueue;