
April 28th, 2003, 06:10 PM
|
 |
not a fan of fascism (n00b)
|
|
Join Date: Feb 2003
Location: ct
|
|
|
my strings get fuxxored when sent over tcp/ip
im making this chess game, and part of the data sent in the packet is a string with a message. here is the struct i use to send it:
Code:
struct Message //structure that contains data sent in the messages
{
char type; //type of message; { C - connect , D - disconnect
// , M - move , T - talk , S - status}
int row; //row #
int col; //column #
int oldRow; ///aha, found out we need to send the old position as well
int oldCol; // see above __/^
string talk; //good ol fashion **** talking between players, oh yea and comp messages
char piece; //the piece being moved
bool firstPlayer;//tells the player who is black and who is white, by default teh first
}; //one to register gets to be white... or is it black? ;0
all the data arrives fine besides the string; it arrives with odd symbols and mixed up characters. i have also tried using char * , CStrings, but they all get mixed up. when i try to use a char [] , then i get compile errors. anyone got any ideas on this?
|