Not receiving messages with multiplayer

Get help using Construct 2

Post » Thu Apr 03, 2014 1:53 am

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.

Image
This first image is what happens when the user clicks the button
Image
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.
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Thu Apr 03, 2014 2:11 am

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. :|
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Thu Apr 03, 2014 2:13 am

@jayderyu hmmm..... even with leaving it blank to send it to the host its not working :(
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Thu Apr 03, 2014 11:20 am

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.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Post » Thu Apr 03, 2014 1:35 pm

@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
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Thu Apr 03, 2014 2:44 pm

If tried you samples and successfully sent and received the REGISTER communication. I added some Broswer.Log messages to watch each step.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Thu Apr 03, 2014 3:02 pm

@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.
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Thu Apr 03, 2014 3:29 pm

You are right. I just ran as-is, which was Chrome. Nodewebkit doesn't produce the same results.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Thu Apr 03, 2014 5:11 pm

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.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Post » Thu Apr 03, 2014 8:42 pm

@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).
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 35 guests