Simple message relay

0 favourites
  • 6 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • I have been trying to figure this out for days.

    I do not know what I am doing. Research on the internet is not helping because much information seems to be outdated.

    I need to share a basic data item between two apps. I do not need "chat" I do not need multi-player functions... I just simply need to share a variable between two apps.

    These two apps are super simple and they illustrate how incredibly basic my need is.

    I am trying to use node.js socket.io and the Websocket object.

    I have not been able to get this to work.

    App1:

    https://drive.google.com/file/d/0B1xzGDQ6NDI-ai14cUJVV0l1Z1E/edit?usp=sharing

    App2:

    https://drive.google.com/file/d/0B1xzGDQ6NDI-VWdDejJReVdpd1E/edit?usp=sharing

    Server script:

    https://drive.google.com/file/d/0B1xzGDQ6NDI-TEJjaHVZUFhFMjA/edit?usp=sharing

  • goblynn93

    App2 picture is the same wit App1??.

    Just by a glimpse I think you should convert your WebSocket.MessageText into integer first, I might be wrong (I'm not familiar with websocket) but your variable is a number, the one you receive is string. I think it should be like below:

    Set

    visibility to int(WebSocket.MessageText)

    Let me know how it goes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I updated the links. Sorry about that...

    I will try your suggestion and see how it goes.

  • Set

    visibility to int(WebSocket.MessageText)

    Let me know how it goes.

    Still not working.

    If I knew anything at all about JavaScript and/or node.js this would be a lot easier... Maybe I am just missing something and this whole thing is a lot simpler than I've made it but it seems like passing a couple numbers between two apps is really really complicated.

  • I'm afraid the issue is in the server script.

    You need to create a socket for each app, and maintain some ID to those applications.

    As it is, your server is just reacting to the very first application connecting to it. And that's about it. It's not programmed so it would relay any kind of received message.

    Moreover, I'm afraid the programming of a server-side script is out of the scope of those forums. You'd need to check out around node.js community to get help on how to properly make your server script.

  • Thank you for the response! This is exactly the info I needed. I actually have a node.js expert working on the communication side of the app now and I am focused on the interface. I am good at the interface... not so much the more complex behind the scenes stuff! I didn't even know node.js existed until a few days ago and I don't know JavaScript at all so bringing in another brain who knows this stuff is a good thing I think.

    I did get this working through the Node-Webkit Clipboard and as this app is running on a very controlled situation with no real user I can get away with it. For this app its ok but I plan to make more that have multiple interfaces running at the same time so I need to learn better ways to do this. So I am hoping to learn a bit from my friend the node.js coder and see what he comes up with.

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