- Timestamp:
- Jan 1, 2013, 12:58:18 AM (12 years ago)
- Branches:
- master
- Children:
- 80b3f94
- Parents:
- 594d2e9
- Location:
- common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Message.h
r594d2e9 r88cdae2 7 7 #define MSG_TYPE_CHAT 4 8 8 #define MSG_TYPE_PLAYER 5 9 #define MSG_TYPE_PLAYER_MOVE 6 9 10 10 11 typedef struct -
common/Player.cpp
r594d2e9 r88cdae2 53 53 ostringstream oss; 54 54 55 cout << "Player name: " << this->name << endl;56 57 /*58 oss.write((char*)&(this->id), sizeof(int));59 oss << this->name;60 cout << "first oss str: " << oss.str() << endl;61 oss.write("\0", 1);62 cout << "second oss str: " << oss.str() << endl;63 oss.write((char*)&(this->pos.x), sizeof(int));64 cout << "third oss str: " << oss.str() << endl;65 oss.write((char*)&(this->pos.y), sizeof(int));66 */67 68 55 oss << this->id; 69 56 oss << this->name; … … 79 66 istringstream iss; 80 67 iss.str(buffer); 81 82 /*83 iss.read((char*)&(this->id), sizeof(int));84 iss >> this->name;85 iss.read((char*)&(this->pos.x), sizeof(int));86 iss.read((char*)&(this->pos.y), sizeof(int));87 */88 68 89 69 iss >> this->id;
Note:
See TracChangeset
for help on using the changeset viewer.