From f85b6d5ab264910f272e69ce5997cebec54886ce Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 24 Feb 2009 22:03:34 +0100 Subject: Requests Status, DaemonStatus und UserList in XmlRequests umgewandelt --- src/Client/Requests/DaemonStatusRequest.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Client/Requests/DaemonStatusRequest.cpp') diff --git a/src/Client/Requests/DaemonStatusRequest.cpp b/src/Client/Requests/DaemonStatusRequest.cpp index 94407b4..2d83b8b 100644 --- a/src/Client/Requests/DaemonStatusRequest.cpp +++ b/src/Client/Requests/DaemonStatusRequest.cpp @@ -26,20 +26,20 @@ namespace Client { namespace Requests { void DaemonStatusRequest::sendRequest(Net::Connection *connection, uint16_t requestId) { - connection->send(Net::Packet(Net::Packet::DAEMON_STATUS, requestId, daemon.c_str(), daemon.length())); + Common::XmlPacket packet; + packet.setType("GetDaemonStatus"); + packet.add("daemonName", daemon); + + connection->send(packet.encode(requestId)); } -void DaemonStatusRequest::handlePacket(Net::Connection*, const Net::Packet &packet) { - if(packet.getType() == Net::Packet::ERROR) { - finishWithError(Net::Packets::ErrorPacket(packet).getException()); - return; - } - else if(packet.getType() != Net::Packet::OK) { +void DaemonStatusRequest::handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet) { + if(packet.getType() != "OK") { finishWithError(Common::Exception(Common::Exception::UNEXPECTED_PACKET)); return; // TODO Logging } - finish(Net::Packets::HostStatusPacket(packet)); + finish(packet); } } -- cgit v1.2.3