I'm currently creating a game which should be multiplayer (client-server-client), but I'm stuck.
I have been doing crazy things like building a text chain like
string networkMessage = userHash+" "+userX+" "+userY+" "+userRotation;
but it looks crazy and parsing is also bad
string[] pieces = networkMessage.Split(' ');
string userHash = pieces[0];
int userX = pieces[1];
int userY = pieces[2];
float userRotation = pieces[3];
So, what is the best way to pack my network commands & parse them on the second side?
Yeah, ehm.. I'm using TCP & StreamReader/StreamWriter
PS: yes, I know that giving client a possibility to set their coordinates is cheating risk and I'll change it later, so server will be more authorative)