summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-29 20:28:26 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-29 20:28:26 +0200
commit07768a871691433e2f3c490aa14c45cde40e00b4 (patch)
treeebbed7642368809834f1a502b0b4a165f41559b9
parentcc617dba41d5acfc43552847cdd747e7ea8c67da (diff)
downloadmad-07768a871691433e2f3c490aa14c45cde40e00b4.tar
mad-07768a871691433e2f3c490aa14c45cde40e00b4.zip
Status in HostInfo hei?t jetzt State
-rw-r--r--src/Client/CommandParser.cpp4
-rw-r--r--src/Common/HostInfo.h10
-rw-r--r--src/Core/ConnectionManager.cpp4
-rw-r--r--src/Net/Packets/HostListPacket.cpp4
-rw-r--r--src/Net/Packets/HostListPacket.h2
5 files changed, 12 insertions, 12 deletions
diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp
index a271a7e..bc179fa 100644
--- a/src/Client/CommandParser.cpp
+++ b/src/Client/CommandParser.cpp
@@ -106,7 +106,7 @@ void CommandParser::listHostsCommand(const std::vector<std::string> &args) {
bool output = false;
for(std::map<std::string, Common::HostInfo>::const_iterator host = hosts.begin(); host != hosts.end(); ++host) {
- if(host->second.getStatus() == Common::HostInfo::INACTIVE)
+ if(host->second.getState() == Common::HostInfo::INACTIVE)
continue;
if(!output) {
@@ -130,7 +130,7 @@ void CommandParser::listHostsCommand(const std::vector<std::string> &args) {
std::cout << "Host list:" << std::endl;
for(std::map<std::string, Common::HostInfo>::const_iterator host = hosts.begin(); host != hosts.end(); ++host) {
- std::cout << " " << host->first << " (" << (host->second.getStatus() == Common::HostInfo::RUNNING ? "running" : "inactive") << ")" << std::endl;
+ std::cout << " " << host->first << " (" << (host->second.getState() == Common::HostInfo::RUNNING ? "running" : "inactive") << ")" << std::endl;
}
}
else {
diff --git a/src/Common/HostInfo.h b/src/Common/HostInfo.h
index db7f5d1..c036b5c 100644
--- a/src/Common/HostInfo.h
+++ b/src/Common/HostInfo.h
@@ -27,7 +27,7 @@ namespace Common {
class HostInfo {
public:
- enum Status {
+ enum State {
INACTIVE, RUNNING
};
@@ -35,10 +35,10 @@ class HostInfo {
std::string name;
std::string ip;
- Status status;
+ State state;
public:
- HostInfo(const std::string& name0 = std::string()) : name(name0), status(INACTIVE) {}
+ HostInfo(const std::string& name0 = std::string()) : name(name0), state(INACTIVE) {}
void setName(const std::string &newName) {name = newName;}
const std::string& getName() const {return name;}
@@ -46,8 +46,8 @@ class HostInfo {
void setIP(const std::string& newIp) {ip = newIp;}
const std::string& getIP() const {return ip;}
- void setStatus(Status newStatus) {status = newStatus;}
- Status getStatus() const {return status;}
+ void setState(State newState) {state = newState;}
+ State getState() const {return state;}
};
}
diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp
index faf6e29..506a7d4 100644
--- a/src/Core/ConnectionManager.cpp
+++ b/src/Core/ConnectionManager.cpp
@@ -137,7 +137,7 @@ void ConnectionManager::handleConnections(std::list<Net::ServerConnection*>& con
if(idCon->second == *con) {
idCon->second = 0;
- daemonInfo[idCon->first].setStatus(Common::HostInfo::INACTIVE);
+ daemonInfo[idCon->first].setState(Common::HostInfo::INACTIVE);
break;
}
}
@@ -200,7 +200,7 @@ void ConnectionManager::identifyDaemonConnection(Net::Connection *connection, co
}
idCon->second = *con;
- daemonInfo[idCon->first].setStatus(Common::HostInfo::RUNNING);
+ daemonInfo[idCon->first].setState(Common::HostInfo::RUNNING);
connection->setIdentified();
Common::Logger::logf("Identified as '%s'.", name.c_str());
diff --git a/src/Net/Packets/HostListPacket.cpp b/src/Net/Packets/HostListPacket.cpp
index 30a33b3..8c3d395 100644
--- a/src/Net/Packets/HostListPacket.cpp
+++ b/src/Net/Packets/HostListPacket.cpp
@@ -46,7 +46,7 @@ void HostListPacket::assemblePacket() {
*nHosts = htons(hostList.size());
for(size_t i = 0; i < hostList.size(); ++i) {
- hostData[i].status = htons((uint16_t)hostList[i].getStatus());
+ hostData[i].state = htons((uint16_t)hostList[i].getState());
}
}
@@ -69,7 +69,7 @@ void HostListPacket::parsePacket() {
std::istringstream stream(std::string(charData, getLength() - (sizeof(uint16_t)+sizeof(HostData)*hostList.size())));
for(size_t i = 0; i < hostList.size(); ++i) {
- hostList[i].setStatus((Common::HostInfo::Status)ntohs(hostData[i].status));
+ hostList[i].setState((Common::HostInfo::State)ntohs(hostData[i].state));
if(!stream.eof()) {
std::string str;
diff --git a/src/Net/Packets/HostListPacket.h b/src/Net/Packets/HostListPacket.h
index 4d0b2d0..2cec9b0 100644
--- a/src/Net/Packets/HostListPacket.h
+++ b/src/Net/Packets/HostListPacket.h
@@ -33,7 +33,7 @@ namespace Packets {
class HostListPacket : public Packet {
protected:
struct HostData {
- uint16_t status;
+ uint16_t state;
};
uint16_t *nHosts;