diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-02-24 22:03:34 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-02-24 22:03:34 +0100 |
commit | f85b6d5ab264910f272e69ce5997cebec54886ce (patch) | |
tree | 06b801d5b11c2d8a2dfae16b698ebaf0b74f429b /src/Common/Requests/StatusRequest.cpp | |
parent | 8d629ca48e9b5530416127e2e52c945fe1f9ee52 (diff) | |
download | mad-f85b6d5ab264910f272e69ce5997cebec54886ce.tar mad-f85b6d5ab264910f272e69ce5997cebec54886ce.zip |
Requests Status, DaemonStatus und UserList in XmlRequests umgewandelt
Diffstat (limited to 'src/Common/Requests/StatusRequest.cpp')
-rw-r--r-- | src/Common/Requests/StatusRequest.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Common/Requests/StatusRequest.cpp b/src/Common/Requests/StatusRequest.cpp index dbaba23..3526e23 100644 --- a/src/Common/Requests/StatusRequest.cpp +++ b/src/Common/Requests/StatusRequest.cpp @@ -25,16 +25,19 @@ namespace Common { namespace Requests { void StatusRequest::sendRequest(Net::Connection *connection, uint16_t requestId) { - connection->send(Net::Packet(Net::Packet::STATUS, requestId)); + XmlPacket packet; + packet.setType("GetStatus"); + + connection->send(packet.encode(requestId)); } -void StatusRequest::handlePacket(Net::Connection*, const Net::Packet &packet) { - if(packet.getType() != Net::Packet::OK) { +void StatusRequest::handlePacket(Net::Connection*, uint16_t, const XmlPacket &packet) { + if(packet.getType() != "OK") { finishWithError(Exception(Exception::UNEXPECTED_PACKET)); return; // TODO Logging } - finish(Net::Packets::HostStatusPacket(packet)); + finish(packet); } } |