var cmn=require("../$common.js"), fs=require("fs"), Naampje=require("naampje").name; var conns=[]; var uniqid=(function(){ var id=0; return function(){return id++;}; })(); module.exports=function(app,io,moddir){ var ioNsp=io.of("/poke"); app.get("/poke",function(req,res){ res.sendFile(moddir+"/poke.html"); }); ioNsp.on("connection",function(socket){ var id=uniqid(); var nick=Naampje(); var status=""; socket.emit("reset",null); socket.emit("self",{id:id,nick:nick}); conns.forEach(function(c){ socket.emit("connection add",{id:c.id,nick:c.nick}); socket.emit("status",{id:c.id,status:c.status}); }); ioNsp.emit("connection add",{id:id,nick:nick}); conns.push({id:id,nick:nick,status:"",socket:socket}); socket.on("disconnect",function(){ for(var i=0;i