This message was edited by DrMarten at 2006-6-13 22:37:36
: This is what i want to do:
: im making a simple online game,but the tutorial for winsock only showed how to get a message and put it in a string.
: what i need to know is how to know how to put it in diffrent variables.
: so lets say that the you send the client his HP(Hit points) that the client knows to put in to the HP vareible
Without seeing the WINSOCK example, my suggestion is, if you send two items of data then make the first one received the HP variable.
More than one byte or variable sent is known as a "packet" of data.
Think of a packet like a box.
It contains an apple and an orange.
To make sure the person you send the apple to always gets the apple first, then send the apple first.
Same goes in terms of online communications.
Send your HP variable 1st along with all the other bits of data.
The receiving program picks the items it needs as it knows the order in which they were sent.
Send 1234 and you know this is in number order as YOU
A computer is thick, it doesn't know. it might as well be 2431.
You have to program in the same way you teach a kid to read.
A step at a time, precisely as YOU want it.
Think about all the steps to make a cup of tea as an example.
Hope this helps?