Not receiving messages with multiplayer

0 favourites
  • 11 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I've been having some troubles getting multiplayer working. So far I've gotten the client and server connecting to the same room, but sending messages is not working. When the user presses a button it saves data from 2 objects into a dictionary then sends that as a message. However, the server is not getting that message. I have confirmed that they are connected to the same room, the message tag is the same, etc. Even when I use on any message received, there is no result. I have also confirmed that the client (should be) sending messages. I say should be because I'm not sure how to tell if the data is actually being sent, only that the event block is firing.

    This first image is what happens when the user clicks the button

    And here is what happens on the server when the message is received.

    SEE BELOW ... The only thing I can think of is that I'm running the client on Chrome, while the server is a node webkit application. But the fact that they are connecting doesn't support that theory.

    Any and all input is appreciated, I'm new to this plugin.

    EDIT: Just tested it with both client and server on node webkit. Same results.

    EDIT2: Ashley does the plugin somehow prevent 2 projects from communicating in the same game/room? I don't see that being right, but just a thought.

  • I've had the same problem. AS of the current build I have been unable to send direct peer messages. I can send to the host by leaving it blank. But once I put in another peer, they just never get it.

  • jayderyu hmmm..... even with leaving it blank to send it to the host its not working

  • It's not clear from your events whether it's running in host or peer mode. In peer mode 'broadcast message' cannot be used. I'd also recommend making both the host and the peer in the same project, otherwise 'Sync object' will not work. As ever, a minimal .capx is essential to be able to help.

  • Ashley The first image is from the client project, and second is from the server. The reason I'm not building them in the same project is because it's a dedicated server. I don't want players to have all the server side stuff, and I don't want the server to have all the client stuff, also syncing objects is unneccessary for this.

    I've also tried using Send Message to Peer "", and still it is not receiving anything. Same result with sending it to Multiplayer.HostID, messages just aren't being received.

    As for capxs, the screenshots are pretty much all I have. But here they are anyways

  • If tried you samples and successfully sent and received the REGISTER communication. I added some Broswer.Log messages to watch each step.

  • blackhornet What kind of changes did you make? Just adding logs? Also were you running the server in Chrome? Because I'm wanting to run it with node webkit but I'm starting to think that's the problem since the examples work in the browser.

  • You are right. I just ran as-is, which was Chrome. Nodewebkit doesn't produce the same results.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Does it work correctly using both the server and peer in the same version of Chrome?

    Node-webkit is a version or two behind Chrome so it may be incompatible with the current version of Chrome's DataChannels. WebRTC is still under development.

  • Ashley yep it works correctly with both in Chrome. I can work with this for now, but is the problem only with nw? Because I need to do some stuff with files on the computer but that won't really work with Chrome unless theres some workaround (a database + php + what not would work but thats above my skill level).

  • Yes, I guess it's just because node-webkit is a little behind, so it should be fixed when node-webkit is next updated.

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