refactored

This commit is contained in:
coderaiser 2012-11-02 11:47:26 -04:00
parent 610967cc12
commit c034e23807

View file

@ -10,6 +10,7 @@
io = main.require('socket.io'),
update = main.srvrequire('update'),
exec = main.child_process.exec,
Util = main.util,
ClientFuncs = [],
OnMessageFuncs = [],
@ -50,18 +51,16 @@
return function(pCommand) {
console.log(pCommand);
if( pCommand.indexOf('cloudcmd') === 0 ){
pCommand = pCommand.replace('cloudcmd', '');
if( Util.isContainStr(pCommand, 'cloudcmd') ){
pCommand = Util.removeStr(pCommand, 'cloudcmd');
if(pCommand.indexOf(' ') === 0){
pCommand = pCommand.replace(' ','');
if( Util.isContainStr(pCommand, ' ') ){
pCommand = Util.removeStr(pCommand, ' ');
if(pCommand.indexOf('update') === 0){
if(update)
update.get();
}
if( Util.isContainStr(pCommand, 'update') && update )
update.get();
if(pCommand.indexOf('exit') === 0)
if( Util.strCmp(pCommand, 'exit') )
pCommand = 'kill -9 ' + process.pid;
}
else {