Correct way to handle websocket ??

Get help using Construct 2

Post » Thu Dec 18, 2014 3:48 pm

Hi :)
I'm following a tutorial series to create a MMO (RPG) for a GM:Studio, I don't quite like the way UI is handle over there so I tried to port the ideia to Construct 2, one of the main things I had to worrie about when using websockets was the buffers get concatnated:

Code: Select all
MESSAGEAMESSAGEBMESSAGEC....


I had to use the first byte of each message to store the message lenght:

Code: Select all
5MESSAGEA7MESSAGEB4MESSAGEC


this way I would know the size and seperate them:

Code: Select all
5MESSAGEA
7MESSAGEB
4MESSAGEC


as Construct 2 uses json strings I don't know if I need to do this anymore, can anyone give me some guidance?!

Thank you
B
11
S
3
G
5
Posts: 19
Reputation: 3,639


Post » Sat Jan 17, 2015 2:07 am

Thank u very much I'll try it :D
One more thing, the server and client, in this example, are both made in construct! ....and I was trying to create a game with a server running natively in javascript
B
11
S
3
G
5
Posts: 19
Reputation: 3,639


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests