Changeset ad5d122 in network-game for common/Player.cpp
- Timestamp:
- Jan 29, 2013, 7:19:59 PM (12 years ago)
- Branches:
- master
- Children:
- 5806dc2
- Parents:
- 80b3f94
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
r80b3f94 rad5d122 53 53 memcpy(buffer, &this->id, 4); 54 54 strcpy(buffer+4, this->name.c_str()); 55 memcpy(buffer+ 4+this->name.length(), &this->pos.x, 4);56 memcpy(buffer+ 8+this->name.length(), &this->pos.y, 4);55 memcpy(buffer+5+this->name.length(), &this->pos.x, 4); 56 memcpy(buffer+9+this->name.length(), &this->pos.y, 4); 57 57 } 58 58 … … 63 63 memcpy(&this->id, buffer, 4); 64 64 strcpy(test, buffer+4); 65 memcpy(&this->pos.x, buffer+ 4+strlen(test), 4);66 memcpy(&this->pos.y, buffer+ 8+strlen(test), 4);65 memcpy(&this->pos.x, buffer+5+strlen(test), 4); 66 memcpy(&this->pos.y, buffer+9+strlen(test), 4); 67 67 68 68 cout << "id: " << this->id << endl;
Note:
See TracChangeset
for help on using the changeset viewer.