Changeset b35b2b2 in network-game for common/MessageProcessor.cpp


Ignore:
Timestamp:
Jul 29, 2013, 10:32:59 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
d05086b
Parents:
297682c
Message:

Added a basic ingame debug console

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/MessageProcessor.cpp

    r297682c rb35b2b2  
    5252         cout << "Got message of type " << msg->type << endl;
    5353
    54       ackedMessages[msg->id] = getCurrentMillis();
     54      ackedMessages[msg->id] = MessageContainer(*msg, *source);
     55      ackedMessages[msg->id].setAcked(true);
     56      ackedMessages[msg->id].setTimeAcked(getCurrentMillis());
    5557
    5658      NETWORK_MSG ack;
     
    6870
    6971void MessageProcessor::resendUnackedMessages(int sock) {
    70    map<int, map<unsigned long, MessageContainer> >::iterator it;
     72   map<unsigned int, map<unsigned long, MessageContainer> >::iterator it;
    7173   map<unsigned long, MessageContainer>::iterator it2;
    7274   map<unsigned long, MessageContainer> sentMsg;
     
    8385
    8486void MessageProcessor::cleanAckedMessages() {
    85    map<int, map<unsigned long, MessageContainer> >::iterator it = sentMessages.begin();
     87   map<unsigned int, map<unsigned long, MessageContainer> >::iterator it = sentMessages.begin();
    8688   map<unsigned long, MessageContainer>::iterator it2;
    8789
     
    104106   }
    105107
     108   /*
    106109   map<unsigned int, unsigned long long>::iterator it3 = ackedMessages.begin();
    107110
     
    112115         it3++;
    113116   }
     117   */
    114118}
     119
     120map<unsigned int, map<unsigned long, MessageContainer> >& MessageProcessor::getSentMessages() {
     121   return this->sentMessages;
     122}
     123
     124map<unsigned int, MessageContainer>& MessageProcessor::getAckedMessages() {
     125   return this->ackedMessages;
     126}
Note: See TracChangeset for help on using the changeset viewer.