Interesting topic! Mr_Light your making this into a tutorial or what
Might actually do that at some point but considering other work I also need to finish work for well euh work
awesome thanks for the help. ill see what i can find on google but why is it called array split? aren't i using strings? or is it that you split the strings different parts into an array?
The result is probably an array of strings
edit: nevermind i answered my own question. However, would it not be easier to do it something like this:
1*W A C K O
and split it at the "*" instead of spaces
As you can probably tell there are a couple of approaches to arrange the data in the protocol:
You can use a predefined fixed length fixed format.
You can encode the lengths in the message.
EndOfXXX / separator 'bit'(can be a character or a certain series of bytes).
Depending on the data your sending any of the above might work well. (There are a couple of other variants but those don't really make sense considering games)
It's probably wise to use an EndOfXXX / separator 'bit' that doesn't occur often (never presume that you never send it, in a different context) When you do send the 'bit' make sure you escape it. (Google for escape characters)