0 Favourites

WebSocket

  • Just wondering if anyone has played with the new websocket plugin?

    Does it work out the box or do i need a backend to use it?

    Sorry for noob questions and thanks for replies in advance.

    P.S. I have searched the forums but found nothing

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • As I read in last release comments, you need to create your websocket server or to use one.

    I tried to find one but it's not succesful :/

  • It will be most useful if you write your own backend, unless you can find a useful WebSocket server that is already being run by someone else that does something you want.

  • Ashley How hard would it be to deploy a websocket server for C2 on a service like Appfog (I don't know anything about node.js and websockets for the moment)

    "With the help of Nodester, we are adding WebSocket support and Node 0.8 support within the coming months."

  • Ashley

    Does new Websocket plugin works with C++ websocket server?

    Regards

  • Anyone knows if C++ server works with C2?

  • Since WebSocket is a standardised protocol, it should be able to talk to any up-to-date WebSocket server, such as one written in C++, or a Node.js version, and so on.

  • I can confirm the following:

    1: the new websocket plug does NOT work with socket.io socket.io on node which is what the zackowack plugin is based on is not a *true* websockets protocol.

    2: it does work with a C# websocket server (I'm running one I've been developing now)

    3: if the C++ follows the proper standards and protocols it should work as well.

    I honestly prefer it over the socket.io I'm developing my server in C# for the simple fact that I can compile and test it on windows 8 and toss it on one of my Ubuntu servers and it will run without modifications as Linux can run native .Net applications via mono.

  • Hi everyone, just a quick correction to the Websocket Plugin.

    It currently does not pass the protocol when creating the Websocket object.

    To fix it, edit the file "\Program Files\Construct 2\exporters\html5\plugins\websocket\runtime.js" on line 109

    and change:

    this.ws = new WebSocket(url_);

    to:

    this.ws = new WebSocket(url_, requireProtocol_);

    and it works like a charm. Hope this helps someone. :)

    EDIT: Remember to restart Construct 2 for the fix to take effect.

  • DragonDrumstick - oops, you're right, fixed for the next build. In future it's best to make a full post in the Bugs forum, because I will definitely find it there, instead of coming across a bug by chance in the 'How do I' forum!

  • Ashley

    I am faced with a websocket problem, too;

    When I try to connect the websocket-server, an error comes up:

    "Assertion failure: Calling expvalue.set_string without string type"

    and connection failed.

    But the websocket-server have no problems, since I can connect to it with a HTML page.

    My websocket connection action is as follows:

    URL: "ws//:xxxx.xxxx.xxxx.xxxx"(my ip address)

    Protocol(optional):"10000"

    Can you help me with it? My C2 version is r125

    Thank you in advance!

  • rexrainbow

    I am faced with a websocket problem, too;

    When I try to connect the websocket-server, an error comes up:

    "Assertion failure: Calling expvalue.set_string without string type"

    and connection failed.

    But the websocket-server have no problems, since I can connect to it with a HTML page.

    My websocket connection action is as follows:

    URL: "ws//:xxxx.xxxx.xxxx.xxxx"(my ip address)

    Protocol(optional):"10000"

    Can you help me with it? My C2 version is r125

    Thank you in advance!

  • MelonGuns - please post a full bug report in the bugs forum, otherwise it's hard to fix it.

  • Ashley

    Ok, the exception is as follows:

    ----------------------------------------------------------------------------------

    Assertion failure: Calling expvalue.set_string without string type

    Stack trace:

    assert2@http://localhost:50000/preview_prelude.js:12

    ExpValue.prototype.set_string@http://localhost:50000/expressions.js:778

    Exps.prototype.ErrorMsg@http://localhost:50000/C2WebSocket_plugin.js:172

    ExpNode.prototype.eval_object_behavior_exp@http://localhost:50000/expressions.js:319

    ExpNode.prototype.eval_and@http://localhost:50000/expressions.js:550

    Parameter.prototype.get_exp@http://localhost:50000/eveng.js:1464

    Action.prototype.run_object@http://localhost:50000/eveng.js:1277

    EventBlock.prototype.run_actions_and_subevents@http://localhost:50000/eveng.js:694

    EventBlock.prototype.run@http://localhost:50000/eveng.js:662

    Runtime.prototype.executeSingleTrigger@http://localhost:50000/preview.js:3186

    Runtime.prototype.triggerOnSheetForTypeName@http://localhost:50000/preview.js:3105

    Runtime.prototype.triggerOnSheet@http://localhost:50000/preview.js:3038

    Runtime.prototype.trigger@http://localhost:50000/preview.js:3002

    @http://localhost:50000/C2WebSocket_plugin.js:134

    ----------------------------------------------------------------------------------

    Do you have any idea?

    My ws server is 127.0.0.1:8080

    So My ws connect to phrase is :

    URL :"ws://127.0.0.1"

    protocol: "8080"

  • MelonGuns: How to report bugs (in the Bugs forums)

    Thank you.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 12,952
Casaubon's avatar
Casaubon
Topic
19 10,108
Whiteclaws's avatar
Whiteclaws

You do not have permission to view this topic