Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualsavail

Posted 29 September 2012 - 03:00 AM

thanks a lot for your articles hplus! I find them very useful. I have one more question though. So far I've been sending only 1 type of struct to server and 1 type from server to client. So I always knew the received structure type but I've read on one article sth like this:

Note that I'm assuming that you know what the packet is through some data that comes before the packet. And, if you're on TCP, I'm assuming you know how big the data is, again through some data before the packet.

In UDP messages don't come in order so I guess I can't realize what's incoming data by some data that arrived before? I thought that I could recognize structure type by structure's size? and then convert it to proper structure types in my program.
And everytime I send a struct with game data there is a header data as well, which is char header[16]. I'm getting quite confused... The header data is used only to recognize that incoming packet comes from good source?(my server) or not? And is that a good approach or a waste of bandwidth to send such a header data with every sturct I'm sending?

#2savail

Posted 29 September 2012 - 02:59 AM

thanks a lot for your articles hplus! I find them very useful. I have one more question though. So far I've been sending only 1 type of struct to server and 1 type from server to client. So I always knew the received structure type but I've read on one article sth like this:

Note that I'm assuming that you know what the packet is through some data that comes before the packet. And, if you're on TCP, I'm assuming you know how big the data is, again through some data before the packet.

In UDP messages don't come in order so I guess I can't realize what's incoming data by some data that arrived before? I thought that I could recognize structure type by structure's size? and then convert it to proper structure types in my program.
And everytime I send a struct with game data there is a header data as well, which is char header[16]. Is that a good approach or a waste of bandwidth?

#1savail

Posted 29 September 2012 - 02:58 AM

thanks a lot for your articles hplus! I find them very useful. I have one more question though. So far I've been sending only 1 type of struct to server and 1 type from server to client. So I always knew the received structure type but I've read on one article sth like this:

Note that I'm assuming that you know what the packet is through some data that comes before the packet. And, if you're on TCP, I'm assuming you know how big the data is, again through some data before the packet.

In UDP messages don't come in order so I guess I can't realize what's incoming data by some data that arrived before? I thought that I could recognize structure type by structure's size? and then convert it to proper structure types in my program.
And everytime I send a struct with game data there is a header data as well. Is that a good approach or a waste of bandwidth?

PARTNERS