Changeset 5806dc2 in network-game for common/Player.cpp
- Timestamp:
- Jan 29, 2013, 7:30:52 PM (12 years ago)
- Branches:
- master
- Children:
- b128109
- Parents:
- ad5d122
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
rad5d122 r5806dc2 59 59 void Player::deserialize(char* buffer) 60 60 { 61 char test[256];62 63 61 memcpy(&this->id, buffer, 4); 64 strcpy(test,buffer+4);65 memcpy(&this->pos.x, buffer+5+ strlen(test), 4);66 memcpy(&this->pos.y, buffer+9+ strlen(test), 4);62 this->name.assign(buffer+4); 63 memcpy(&this->pos.x, buffer+5+this->name.size(), 4); 64 memcpy(&this->pos.y, buffer+9+this->name.size(), 4); 67 65 68 66 cout << "id: " << this->id << endl; 69 cout << "name: " << t est<< endl;67 cout << "name: " << this->name << endl; 70 68 cout << "x: " << this->pos.x << endl; 71 69 cout << "y: " << this->pos.y << endl;
Note:
See TracChangeset
for help on using the changeset viewer.