diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-02-28 19:09:43 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-02-28 19:09:43 +0100 |
commit | 46c110f7a14e4b5d0e8bd27259f7744ae8a36382 (patch) | |
tree | 94693ecffb8f1c553c12ea3a30920b2008e27b11 /src/Core/Requests/DaemonStateUpdateRequest.cpp | |
parent | 8f85624a76934b14e0ba0f49413f471f8f4aa4f1 (diff) | |
download | mad-46c110f7a14e4b5d0e8bd27259f7744ae8a36382.tar mad-46c110f7a14e4b5d0e8bd27259f7744ae8a36382.zip |
DaemonListRequest und DaemonStateUpdateRequest benutzen jetzt XML
Diffstat (limited to 'src/Core/Requests/DaemonStateUpdateRequest.cpp')
-rw-r--r-- | src/Core/Requests/DaemonStateUpdateRequest.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Core/Requests/DaemonStateUpdateRequest.cpp b/src/Core/Requests/DaemonStateUpdateRequest.cpp index 00e0bdf..c00468e 100644 --- a/src/Core/Requests/DaemonStateUpdateRequest.cpp +++ b/src/Core/Requests/DaemonStateUpdateRequest.cpp @@ -19,23 +19,27 @@ #include "DaemonStateUpdateRequest.h" #include <Net/Connection.h> -#include <Net/Packets/HostStatePacket.h> namespace Mad { namespace Core { namespace Requests { void DaemonStateUpdateRequest::sendRequest(Net::Connection *connection, uint16_t requestId) { - connection->send(Net::Packets::HostStatePacket(Net::Packet::DAEMON_STATE_UPDATE, requestId, name, state)); + Common::XmlPacket packet; + + packet.setType("UpdateHostState"); + packet.add("name", name); + packet.add("state", state); + connection->send(packet.encode(requestId)); } -void DaemonStateUpdateRequest::handlePacket(Net::Connection*, const Net::Packet &packet) { - if(packet.getType() != Net::Packet::OK) { +void DaemonStateUpdateRequest::handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet) { + if(packet.getType() != "OK") { finishWithError(Common::Exception(Common::Exception::UNEXPECTED_PACKET)); return; // TODO Logging } - finish(); + finish(packet); } } |