[Multiplayer]Another room leaving issue

Get help using Construct 2

Post » Mon Apr 21, 2014 6:00 am

@Ashley
I'm still working on my lobby/new-room scenario/tutorial and have discovered an issue. If I Send a message (in Reliable mode) that triggers the room-switching to occur, and immediately follow it with a 'Leave room' action, this will trigger an error in the host console log:
Too many errors (10) sending data on 'u' to 'BHT', kicking; last error was for sending 7-char string:
DOMException {message: "Failed to execute 'send' on 'RTCDataChannel': Could not send data", name: "NetworkError", code: 19, stack: "Error: Failed to execute 'send' on 'RTCDataChannel…43:8)↵ at http://localhost:50003/c2mp.js:148:9", INDEX_SIZE_ERR: 1…}
c2mp-peer.js:446

If I add a slight delay after the Send and before the Leave, then everything is fine. I'm guessing this is related to the 'reliable' mechanism needing to confirm the communications, which is an asynchronous task, but since the room is left before the Send has finished, the error is reported.

My question then; is there a way to detect when any pending sends have completed such that I can then call the Leave action to cleanly perform this task?

Thanks.
(r167.2)
ImageImageImage
B
71
S
21
G
231
Posts: 3,695
Reputation: 129,366

Post » Thu Apr 24, 2014 1:02 pm

bump
ImageImageImage
B
71
S
21
G
231
Posts: 3,695
Reputation: 129,366

Post » Thu Apr 24, 2014 3:28 pm

bump
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,826


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 54 guests