eurecaServer.onConnect(function (conn){ console.log('New Client id=%s ', conn.id, conn.remoteAddress); var remote = eurecaServer.getClient(conn.id); clients[conn.id] = {id:conn.id, remote:remote} remote.setId(conn.id); //console.log(clients[Object.keys(clients)[0]].id); });
eurecaServer.onConnect(function (conn) { console.log('New Client id=%s ', conn.id, conn.remoteAddress); //the getClient method provide a proxy allowing us to call remote client functions var remote = eurecaServer.getClient(conn.id); //register the client clients[conn.id] = {id:conn.id, remote:remote, playerType: nextPlayerType, configured: false} //call setId (defined in the client side) remote.setId(conn.id); });
eurecaServer.onConnect(function(conn) { console.log('New Client id=%s ', conn.id, conn.remoteAddress); //the getClient method provide a proxy allowing us to call remote client functions var remote = eurecaServer.getClient(conn.id); //register the client clients[conn.id] = { id: conn.id, remote: remote }; //here we call setId (defined in the client side) remote.setInfo({ id: conn.id, powerups: updatedPowers }); });