source: network-game/common/MessageContainer.cpp@ 297682c

Last change on this file since 297682c was 46d6469, checked in by dportnoy <dmp1488@…>, 11 years ago

Some bug fixes for MessageProcessor. MessageContainer is now in its own files.

  • Property mode set to 100644
File size: 1.0 KB
Line 
1#include "MessageContainer.h"
2
3#include <iostream>
4
5#include "Compiler.h"
6
7using namespace std;
8
9MessageContainer::MessageContainer() {
10}
11
12MessageContainer::MessageContainer(const MessageContainer& mc) {
13 this->msg = mc.msg;
14 this->clientAddr = mc.clientAddr;
15 this->isAcked = mc.isAcked;
16 this->timeAcked = mc.timeAcked;
17}
18
19MessageContainer::MessageContainer(NETWORK_MSG msg, struct sockaddr_in clientAddr) {
20 this->clientAddr = clientAddr;
21 this->msg = msg;
22 this->isAcked = false;
23 this->timeAcked = 0;
24}
25
26MessageContainer::~MessageContainer() {
27}
28
29bool MessageContainer::getAcked() {
30 return this->isAcked;
31}
32
33unsigned long long MessageContainer::getTimeAcked() {
34 return this->timeAcked;
35}
36
37NETWORK_MSG* MessageContainer::getMessage() {
38 return &msg;
39}
40
41void MessageContainer::setAcked(bool acked) {
42 cout << "acked before: " << this->isAcked << endl;
43 this->isAcked = acked;
44 cout << "acked after: " << this->isAcked << endl;
45}
46
47void MessageContainer::setTimeAcked(unsigned long long time) {
48 this->timeAcked = time;
49}
Note: See TracBrowser for help on using the repository browser.