Changes in / [e2a0a27:45c9d0f] in network-game
- Location:
- common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
common/MessageContainer.cpp
re2a0a27 r45c9d0f 11 11 this->msg = mc.msg; 12 12 this->clientAddr = mc.clientAddr; 13 this->timeSent = mc.timeSent;14 13 this->isAcked = mc.isAcked; 15 14 this->timeAcked = mc.timeAcked; … … 19 18 this->clientAddr = clientAddr; 20 19 this->msg = msg; 21 this->timeSent = 0;22 20 this->isAcked = false; 23 21 this->timeAcked = 0; … … 27 25 } 28 26 29 NETWORK_MSG* MessageContainer::getMessage() {30 return &msg;31 }32 33 27 bool MessageContainer::getAcked() { 34 28 return this->isAcked; 35 }36 37 unsigned long long MessageContainer::getTimeSent() {38 return this->timeSent;39 29 } 40 30 … … 43 33 } 44 34 45 void MessageContainer::setAcked(bool acked) {46 this->isAcked = acked;35 NETWORK_MSG* MessageContainer::getMessage() { 36 return &msg; 47 37 } 48 38 49 void MessageContainer::setTimeSent(unsigned long long time) { 50 this->timeSent = time; 39 void MessageContainer::setAcked(bool acked) { 40 cout << "acked before: " << this->isAcked << endl; 41 this->isAcked = acked; 42 cout << "acked after: " << this->isAcked << endl; 51 43 } 44 52 45 53 46 void MessageContainer::setTimeAcked(unsigned long long time) { -
common/MessageContainer.h
re2a0a27 r45c9d0f 59 59 struct sockaddr_in clientAddr; 60 60 bool isAcked; 61 unsigned long long timeSent;62 61 unsigned long long timeAcked; 63 62 … … 68 67 ~MessageContainer(); 69 68 69 bool getAcked(); 70 unsigned long long getTimeAcked(); 70 71 NETWORK_MSG* getMessage(); 71 bool getAcked();72 unsigned long long getTimeSent();73 unsigned long long getTimeAcked();74 72 75 73 void setAcked(bool acked); 76 void setTimeSent(unsigned long long time);77 74 void setTimeAcked(unsigned long long time); 78 75
Note:
See TracChangeset
for help on using the changeset viewer.