Yet-another Multiplayer Demo

  • Will this method work for mobile devices as well, or is it a completely different process for multiplayer on android/ios devices?

  • The method by rexraibow will work on mobile, but it depends on the browser.

    @velojet - I will look into your plugin and let you know.

  • A question rexrainbow about nodejs server:

    Is it possible to log what's happening on the server, like player names room id's, how many players are online etc.

  • A question rexrainbow about nodejs server:

    Is it possible to log what's happening on the server, like player names room id's, how many players are online etc.

    Node is Javascript, so in your server side code just do:

    console.log("whatever you want to log here")

    and it will be printed to the console whenever called.

  • "XMLHttpRequest cannot load (.../socket.io) Credentials flag is true, but Access-Control-Allow-Credentials is not "true"."

    Any idea?

    EDIT: Tried to put everything together(same host) and got a Failed to load resource: the server responded with a status of 404 (Not found)... /socket.io/ ...

    EDIT2: If anyone managed to get bottleneck working on his own server, please gimme some tips or even a how to.

    Forget this, decided to build up my on chat using zackmod and its done by now.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It looks like you have to figure out how to install socket.io library properly. Just try to do everything step by step: 1) first instal nodejs and test it with basic examples from officail page 2)than socket.io and test it 3) setup bottleneck plugin and test it with examples by rexrainbow.

    I suggest to try it locally first. Note, that you have to change channels url's for bottleneck and lobby plugin like this "localhost:8099/game" and "localhost:8099/lobby". May be you have to change the port to something differrent.

    I'm using this plugin a lot for my multiplayer prototypes testing and I must say it is brilliant and very easy to use, though it has some issues.

  • xoros, thank you for all your help, but I want to use my own server code.

    After trying lobby, game, changing ports, changing plugin, changing server... decided to build my own. It is already done now, got 3 hours or less on it, it is working great on preview, but imagine yourself that still I am getting some errors when trying it on dropbox.

  • breackzin

    I could not help you, sorry.

    It will take me a lot of time since I had not made server side programming a long time.

  • Finally solved everything! thx Rex

  • Hi Rex.

    I have tried both the official websocket and Zacks socketio plugin, and neither work (neither try and make any connection, nor send any data, nor repsond to any message).

    Do you have a general purpose socket.io plugin which you use? I looked at your list of plugins, and you only seem to have lobby, bottleneck and chat plugins, not one I can use.

    I have a very simple test node.js app:

    var io = require("socket.io").listen(8080);

    io.sockets.on('connection', function (socket) {

        console.log("connected");

        socket.emit('balls', { ball:42 });

        socket.on('daub', function (data) {

          console.log(data);

        });

    });

    And if I hit it with a simple js page:

    <html>

    <head>

    </head>

    <body>

    <script src="socket-io/socket.io.js"></script>

    <script>

    var socket = io.connect('http://localhost:8080');

    socket.on('balls', function (data) {

        console.log(data);

        socket.emit('daub', { my: 'data' });

    });

    </script>

    </body>

    </html>

    It works perfectly. But i have yet to find any socketio or web socket plugin which will work (or even connect), e.g. this doesnt:

    System=>On start of layout: Socket - Connect to "ws://localhost" (set to 8080 in dialogue)

    does not make, or attempt to make, any connection to node server.

  • nutmix

    The bottleneck and lobby are not general purpose socket.io plugin. They are made for my game server.

  • rexrainbow, I will be looking your server again this October, trying to understand what is so wrong with my own.

    Could you tell me what yours "console.log('app listening on http://' + addr.address + ':' + addr.port);" show to you in your logs?

    My server works on foreman and I manage to keep my previews connected on it locally, but once I produce the server package and push it to heroku, It logs "app listening on http://0.0.0.0:30801" and I can not manage to connect on it.

    Also, some "code=H12 desc="Request timeout"" appears on my logs.

  • I wanted to test bottleneck but it looks like all links to p1ay.allalla.com are dead now.

    Is there another source somwhere?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)