Changes in / [e2a0a27:45c9d0f] in network-game


Ignore:
Location:
common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • common/MessageContainer.cpp

    re2a0a27 r45c9d0f  
    1111   this->msg = mc.msg;
    1212   this->clientAddr = mc.clientAddr;
    13    this->timeSent = mc.timeSent;
    1413   this->isAcked = mc.isAcked;
    1514   this->timeAcked = mc.timeAcked;
     
    1918   this->clientAddr = clientAddr;
    2019   this->msg = msg;
    21    this->timeSent = 0;
    2220   this->isAcked = false;
    2321   this->timeAcked = 0;
     
    2725}
    2826
    29 NETWORK_MSG* MessageContainer::getMessage() {
    30    return &msg;
    31 }
    32 
    3327bool MessageContainer::getAcked() {
    3428   return this->isAcked;
    35 }
    36 
    37 unsigned long long MessageContainer::getTimeSent() {
    38    return this->timeSent;
    3929}
    4030
     
    4333}
    4434
    45 void MessageContainer::setAcked(bool acked) {
    46    this->isAcked = acked;
     35NETWORK_MSG* MessageContainer::getMessage() {
     36   return &msg;
    4737}
    4838
    49 void MessageContainer::setTimeSent(unsigned long long time) {
    50    this->timeSent = time;
     39void MessageContainer::setAcked(bool acked) {
     40   cout << "acked before: " << this->isAcked << endl;
     41   this->isAcked = acked;
     42   cout << "acked after: " << this->isAcked << endl;
    5143}
     44
    5245
    5346void MessageContainer::setTimeAcked(unsigned long long time) {
  • common/MessageContainer.h

    re2a0a27 r45c9d0f  
    5959   struct sockaddr_in clientAddr;
    6060   bool isAcked;
    61    unsigned long long timeSent;
    6261   unsigned long long timeAcked;
    6362
     
    6867   ~MessageContainer();
    6968
     69   bool getAcked();
     70   unsigned long long getTimeAcked();
    7071   NETWORK_MSG* getMessage();
    71    bool getAcked();
    72    unsigned long long getTimeSent();
    73    unsigned long long getTimeAcked();
    7472
    7573   void setAcked(bool acked);
    76    void setTimeSent(unsigned long long time);
    7774   void setTimeAcked(unsigned long long time);
    7875
Note: See TracChangeset for help on using the changeset viewer.