diff --git a/package.json b/package.json index deb54ab5..eee51c96 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "name": "gun" -, "version": "0.0.1u" +, "version": "0.0.1v" , "author": "Mark Nadal" , "description": "Graph engine." , "engines": { @@ -8,7 +8,7 @@ , "dependencies": { "mime": "~>1.2.11", "theory": "~>0.2.6", - "coalesce": "~>0.1.9bq", + "coalesce": "~>0.1.9br", "aws-sdk": "~>2.0.0", "fakeredis": "~>0.1.3", "redis": "~>0.10.1", diff --git a/shots.js b/shots.js index 49b9ff57..9be60550 100644 --- a/shots.js +++ b/shots.js @@ -168,19 +168,7 @@ module.exports = require('theory') if(!m || !m.how){ return } if(m.where && m.where.mid){ console.log("servers chats:", m); - if(opt.src && opt.src.send){ - m.what.count += 1; - if(22 < m.what.count){ return } - opt.src.send(m); - } - return; } - (function(){ - if(opt.src && opt.src.send){ - var m = {count: 1, how:{gun: 9}}; - opt.src.send(m); - } - })(); var where = a.text.is(m.where)? m.where : m.where.at; if(m.how.gun === 3){ shot.shell(m.what._['%']||where, function(g,e){ @@ -195,6 +183,7 @@ module.exports = require('theory') return; } if(!where){ return } + if(m.where store.add(m); shot.shell(where, function(g,e){ var done = function(){ @@ -213,6 +202,12 @@ module.exports = require('theory') done.end = function(){}; shot.spray.transform(g, m, done, e); }); + if(m.where && !m.where.mid && opt.src.send){ + var who = m.who, env = m.where; + m.who = {}; m.where.at = null; + opt.src.send(m); + m.who = who; m.where.at = (env||{}).at; + } } shot.pump = function(fn){ shot.pump.action = fn || shot.pump.action; diff --git a/test/tests.js b/test/tests.js index 074a09ec..f2fab525 100644 --- a/test/tests.js +++ b/test/tests.js @@ -98,10 +98,13 @@ module.exports=require('theory') console.log('graph', g()); var p = g('packageson'); var val = p('version'); - console.log(val); + var ran = p('random'); + console.log(val, ran); val = a.num.is(val)? (val + 1) : 0; - console.log(val); + ran = a.text.r(); + console.log(val, 'and total randomness ---->', ran); p('version',val); + p('random',ran); a.time.wait(function(){ shot.shell('gunjs.herokuapp.com/tests/package.json',function(gg){ var pp = gg('packageson');