示例#1
0
文件: server.js 项目: HarryYC/WebGame
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);    

});
示例#2
0
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);
    
});
示例#3
0
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
    });

});