How do I send data to C2 websocket ?

Get help using Construct 2

Post » Thu Nov 19, 2015 12:14 pm

i have a tcpip server, i did my connection with handshake code 101
C2 websocket is connected now
and now, how i send data from the server to the client ?
B
3
Posts: 7
Reputation: 189

Post » Sun Nov 22, 2015 8:15 pm

I tried to do that same thing and failed, because the C2 requires there to be a browser on the server to serve as the host "peer", since C2 Multiplayer is P2P architecture.

So, long story short, it won't work. We are using AJAX now, until I have time to program a WebSocket plugin with a programmable API.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Tue Nov 24, 2015 1:15 pm

yeah, im doing the same... just forget about multiplayer object and Websocket object... im using asp.net website with ajax, its not the best way but its the only one really working with C2.
B
3
Posts: 7
Reputation: 189

Post » Tue Nov 24, 2015 4:38 pm

Well, eventually, I will build a Websocket plugin for Construct, assuming @Ashley or someone else doesn't beat me to it. Perhaps, I will make it an open source project on Github...
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Tue Nov 24, 2015 4:59 pm

There is already a WebSocket plugin in Construct 2: https://www.scirra.com/manual/153/websocket

Use the "Send text" action to send data to the server. To send data from the server to the client, you need to program a WebSocket server yourself.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,782


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, jorgmaquoi and 15 guests