Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / chatMessage / chatMessage.rpc.js
index 5c37e08..e6072ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf70b=['raw','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options'];(function(_0x330e8c,_0x469ba5){var _0x150a9b=function(_0xe9731e){while(--_0xe9731e){_0x330e8c['push'](_0x330e8c['shift']());}};_0x150a9b(++_0x469ba5);}(_0xf70b,0x64));var _0xbf70=function(_0x17e773,_0x5908aa){_0x17e773=_0x17e773-0x0;var _0x9c7640=_0xf70b[_0x17e773];return _0x9c7640;};'use strict';var _=require(_0xbf70('0x0'));var util=require(_0xbf70('0x1'));var moment=require('moment');var BPromise=require(_0xbf70('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf70('0x3'))['db'];var utils=require(_0xbf70('0x4'));var logger=require(_0xbf70('0x5'))(_0xbf70('0x6'));var config=require(_0xbf70('0x7'));var jayson=require(_0xbf70('0x8'));var client=jayson['client'][_0xbf70('0x9')]({'port':0x232a});config['redis']=_[_0xbf70('0xa')](config[_0xbf70('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf70('0xc'))(new Redis(config[_0xbf70('0xb')]));require(_0xbf70('0xd'))[_0xbf70('0xe')](socket);function respondWithRpcPromise(_0x877a5b,_0x319854,_0x56ca5c){return new BPromise(function(_0x36913f,_0xfc711c){return client[_0xbf70('0xf')](_0x877a5b,_0x56ca5c)[_0xbf70('0x10')](function(_0x1bbaed){logger[_0xbf70('0x11')](_0xbf70('0x12'),_0x319854,_0xbf70('0x13'));logger[_0xbf70('0x14')](_0xbf70('0x15'),_0x319854,'request\x20sent',JSON[_0xbf70('0x16')](_0x1bbaed));if(_0x1bbaed[_0xbf70('0x17')]){if(_0x1bbaed['error']['code']===0x1f4){logger[_0xbf70('0x17')](_0xbf70('0x12'),_0x319854,_0x1bbaed['error']['message']);return _0xfc711c(_0x1bbaed[_0xbf70('0x17')][_0xbf70('0x18')]);}logger['error'](_0xbf70('0x12'),_0x319854,_0x1bbaed[_0xbf70('0x17')][_0xbf70('0x18')]);return _0x36913f(_0x1bbaed['error'][_0xbf70('0x18')]);}else{logger[_0xbf70('0x11')](_0xbf70('0x12'),_0x319854,_0xbf70('0x13'));_0x36913f(_0x1bbaed[_0xbf70('0x19')]['message']);}})[_0xbf70('0x1a')](function(_0x547b25){logger[_0xbf70('0x17')](_0xbf70('0x12'),_0x319854,_0x547b25);_0xfc711c(_0x547b25);});});}exports[_0xbf70('0x1b')]=function(_0x2ac7c8){var _0x265523=this;return new Promise(function(_0x29376d,_0x363027){return db[_0xbf70('0x1c')][_0xbf70('0x1d')](_0x2ac7c8[_0xbf70('0x1e')],{'raw':_0x2ac7c8[_0xbf70('0x1f')]?_0x2ac7c8['options'][_0xbf70('0x20')]===undefined?!![]:![]:!![]})[_0xbf70('0x10')](function(_0x3470cc){logger[_0xbf70('0x11')](_0xbf70('0x1b'),_0x2ac7c8);logger[_0xbf70('0x14')](_0xbf70('0x1b'),_0x2ac7c8,JSON[_0xbf70('0x16')](_0x3470cc));_0x29376d(_0x3470cc);})[_0xbf70('0x1a')](function(_0x44ca2b){logger[_0xbf70('0x17')]('CreateChatMessage',_0x44ca2b[_0xbf70('0x18')],_0x2ac7c8);_0x363027(_0x265523[_0xbf70('0x17')](0x1f4,_0x44ca2b[_0xbf70('0x18')]));});});};
\ No newline at end of file
+var _0x9fd6=['redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','ChatMessage','options','raw','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost'];(function(_0x28e55e,_0x8a4870){var _0x3a4591=function(_0x263305){while(--_0x263305){_0x28e55e['push'](_0x28e55e['shift']());}};_0x3a4591(++_0x8a4870);}(_0x9fd6,0xe0));var _0x69fd=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9fd6[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x69fd('0x0'));var util=require('util');var moment=require(_0x69fd('0x1'));var BPromise=require(_0x69fd('0x2'));var rs=require(_0x69fd('0x3'));var fs=require('fs');var Redis=require(_0x69fd('0x4'));var db=require(_0x69fd('0x5'))['db'];var utils=require(_0x69fd('0x6'));var logger=require(_0x69fd('0x7'))(_0x69fd('0x8'));var config=require('../../config/environment');var jayson=require(_0x69fd('0x9'));var client=jayson[_0x69fd('0xa')][_0x69fd('0xb')]({'port':0x232a});config['redis']=_[_0x69fd('0xc')](config['redis'],{'host':_0x69fd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x69fd('0xe')]));require(_0x69fd('0xf'))[_0x69fd('0x10')](socket);function respondWithRpcPromise(_0x20ccb2,_0x3d99d8,_0xc20df8){return new BPromise(function(_0x1e9b4b,_0x2666f5){return client[_0x69fd('0x11')](_0x20ccb2,_0xc20df8)[_0x69fd('0x12')](function(_0x3859a3){logger[_0x69fd('0x13')](_0x69fd('0x14'),_0x3d99d8,_0x69fd('0x15'));logger[_0x69fd('0x16')](_0x69fd('0x17'),_0x3d99d8,_0x69fd('0x15'),JSON[_0x69fd('0x18')](_0x3859a3));if(_0x3859a3[_0x69fd('0x19')]){if(_0x3859a3[_0x69fd('0x19')][_0x69fd('0x1a')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3d99d8,_0x3859a3[_0x69fd('0x19')][_0x69fd('0x1b')]);return _0x2666f5(_0x3859a3['error'][_0x69fd('0x1b')]);}logger[_0x69fd('0x19')](_0x69fd('0x14'),_0x3d99d8,_0x3859a3[_0x69fd('0x19')][_0x69fd('0x1b')]);return _0x1e9b4b(_0x3859a3[_0x69fd('0x19')][_0x69fd('0x1b')]);}else{logger[_0x69fd('0x13')](_0x69fd('0x14'),_0x3d99d8,'request\x20sent');_0x1e9b4b(_0x3859a3[_0x69fd('0x1c')][_0x69fd('0x1b')]);}})['catch'](function(_0x418339){logger[_0x69fd('0x19')](_0x69fd('0x14'),_0x3d99d8,_0x418339);_0x2666f5(_0x418339);});});}exports[_0x69fd('0x1d')]=function(_0x2fa47d){var _0x3c17f6=this;return new Promise(function(_0x18d80b,_0x9800d9){return db[_0x69fd('0x1e')]['create'](_0x2fa47d['body'],{'raw':_0x2fa47d['options']?_0x2fa47d[_0x69fd('0x1f')][_0x69fd('0x20')]===undefined?!![]:![]:!![]})[_0x69fd('0x12')](function(_0x3433ee){logger['info'](_0x69fd('0x1d'),_0x2fa47d);logger[_0x69fd('0x16')]('CreateChatMessage',_0x2fa47d,JSON['stringify'](_0x3433ee));_0x18d80b(_0x3433ee);})[_0x69fd('0x21')](function(_0x6927c1){logger[_0x69fd('0x19')](_0x69fd('0x1d'),_0x6927c1[_0x69fd('0x1b')],_0x2fa47d);_0x9800d9(_0x3c17f6[_0x69fd('0x19')](0x1f4,_0x6927c1[_0x69fd('0x1b')]));});});};
\ No newline at end of file