Changeset 13a8212 in network-game for common/MessageContainer.cpp


Ignore:
Timestamp:
Oct 7, 2015, 11:52:50 PM (9 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
master
Children:
e2a0a27
Parents:
35d702d
Message:

In the MessageContainer, add a field for when the message was originally sent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/MessageContainer.cpp

    r35d702d r13a8212  
    1111   this->msg = mc.msg;
    1212   this->clientAddr = mc.clientAddr;
     13   this->timeSent = mc.timeSent;
    1314   this->isAcked = mc.isAcked;
    1415   this->timeAcked = mc.timeAcked;
     
    1819   this->clientAddr = clientAddr;
    1920   this->msg = msg;
     21   this->timeSent = 0;
    2022   this->isAcked = false;
    2123   this->timeAcked = 0;
     
    2527}
    2628
     29NETWORK_MSG* MessageContainer::getMessage() {
     30   return &msg;
     31}
     32
    2733bool MessageContainer::getAcked() {
    2834   return this->isAcked;
     35}
     36
     37unsigned long long MessageContainer::getTimeSent() {
     38   return this->timeSent;
    2939}
    3040
     
    3343}
    3444
    35 NETWORK_MSG* MessageContainer::getMessage() {
    36    return &msg;
     45void MessageContainer::setAcked(bool acked) {
     46   this->isAcked = acked;
    3747}
    3848
    39 void MessageContainer::setAcked(bool acked) {
    40    cout << "acked before: " << this->isAcked << endl;
    41    this->isAcked = acked;
    42    cout << "acked after: " << this->isAcked << endl;
     49void MessageContainer::setTimeSent(unsigned long long time) {
     50   this->timeSent = time;
    4351}
    44 
    4552
    4653void MessageContainer::setTimeAcked(unsigned long long time) {
Note: See TracChangeset for help on using the changeset viewer.