The famous websocket arrival...

0 favourites
  • 11 posts
From the Asset Store
Helping streamers give their viewers more excitement.
  • Hi all "constructeurs" in here, i am an avid fan and user of Construct2 and after the newest beta 116 websocket was introduced. The problem i need some kind of tutorial to learn how to use this new feature and what server and eventually a capx file so i can sniff out whats going on.

    So if someone kind soul feels the power to do such a tutorial i would be in deep gratitude.

    Best regards

    Dennis

    Denmark

  • Agreed, simple tutorial about how to get started with the new websocket feature would be nice, it could be simple as sending text to websocket server and displaying that text in-game (from server).

  • Same questions here.

    Is it possible to use an existing php websocket server ?

    If no, do you have any link to create a simple one ? A tutorial not the php manual.

    Thanks !

  • Bump, would be lovely to get some sort of example. As far I see this could be used to make some sort of turn based games, for example something like Tic Tac Toe.

    My upcoming game would benefit from this alot, if indeed I could use web socket to create turn based games.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As these bits are still in Beta, most likely they are still working on it. I would figure that you will see tutorials on these when they have the next stable release (non-beta) that has these features fully implmented. Just a possibility.

  • I've been working with it

    I'm using it instead of the zackowack one simply because of how it works.

    unlike zackowack socket the new websocket plugin uses true websocket type protocol.

    but be forewarned it will NOT work with node and socket.io from what I have been able to figure out.

    I'm using a Custom C# server that I've been developing to work with the true websocket protocol that the new one uses.

    I like this new one for the simple fact I can use C# (since its *true* webscokets protocol) and send JSON data back and forth via rex's hash table plugin.

  • briermay: The manual entry for websockets seems to indicate that node.js with a websocket support should do the trick.

    Can you give more informations on your experiment and what makes you say it's not working ?

    Perhaps even file a bug report to notify Ashley there might be an issue.

  • I simply loaded an empty new project added the websocket and tried to connect to my node server I was running when I was using zakos plugin and watched the console (i had it in debugging mode) and it never even showed the connect.

    True websockets use a different protocol:

    example of websocket address: ws://host:port/service

    socket.io simply uses ip and port

    everything I can find on node and socket.io you need to use the socket.io client script as socket.io on node implements its own structure hence the emit events system.

    I fought with it for 4 hours and ended up just using a C# back-end server

  • briermay: The manual entry states Node.js websocket server.

    Zack0's plugin has nothing to do with the current websocket plugin (it is/was a thrid-part plugin).

    According to this article you may install/use the node websocket server (several versions linked in the article).

    Would you mind having another go at it with a websocket module on your node.js server to make sure there's definitely an issue ?

  • you would need to do a lot of "hacks" to get that to work as it expects JSON coming in and it sends JSON to the client. hence that if you read that it requires a "front end" script that the new websockets plugin doesn't supply.

    the websocket plugin as is has no JSON support

    I guess if you wanted to you could use rex's hash table to read the JSON and process the out going messages to JSON by hand but it looks funky.

    that setup with node expects stuff coming in to look like this

    {"Type":0,"Name":"Briermay"}

    most novice users will find the new websocket plugin useless as its just a bare-bones wrapper around the websocket protocol and would be better off to stick with the socket.io version for now.

  • Hello! I would like to know how web socket works? and I have tried using AJAX function to send mysql data over which apparently it doesnt work .

    i am using 127.0.0.1/savaData.php but this link doesnt work .

    I dont wish to use a host company like (e.g example.com)

    Thank you :D

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