summaryrefslogtreecommitdiffstats
path: root/src/Client/InformationManager.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-03-16 19:13:42 +0100
committerMatthias Schiffer <matthias@gamezock.de>2009-03-16 19:13:42 +0100
commit8f098fc3070f791302ec1f497588fab6ed409980 (patch)
tree6cff9f7bb973342344a22636a5d9ef26c7a0d940 /src/Client/InformationManager.cpp
parentaef0f2e7a5085b8da3aa2e97565215d182d3dd2d (diff)
downloadmad-8f098fc3070f791302ec1f497588fab6ed409980.tar
mad-8f098fc3070f791302ec1f497588fab6ed409980.zip
Request- und RequestHandler-Interfaces vereinfacht
Diffstat (limited to 'src/Client/InformationManager.cpp')
-rw-r--r--src/Client/InformationManager.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/Client/InformationManager.cpp b/src/Client/InformationManager.cpp
index cafe2fa..4c9800b 100644
--- a/src/Client/InformationManager.cpp
+++ b/src/Client/InformationManager.cpp
@@ -29,7 +29,7 @@ namespace Client {
InformationManager InformationManager::informationManager;
-void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(Net::Connection *connection, uint16_t requestId, const Common::XmlPacket &packet) {
+void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(const Common::XmlPacket &packet) {
if(packet.getType() != "UpdateHostState") {
Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet.");
@@ -37,7 +37,7 @@ void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(Net::Conn
ret.setType("Error");
ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
- connection->send(ret.encode(requestId));
+ sendPacket(ret);
signalFinished().emit();
return;
@@ -53,7 +53,7 @@ void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(Net::Conn
Common::XmlPacket ret;
ret.setType("OK");
- connection->send(ret.encode(requestId));
+ sendPacket(ret);
signalFinished().emit();
}
@@ -71,11 +71,8 @@ void InformationManager::updateDaemonList(Net::Connection *con) {
if(updating)
return;
- Common::RequestManager::get()->sendRequest(con,
- std::auto_ptr<Common::Request>(
- new Requests::DaemonListRequest(sigc::mem_fun(this, &InformationManager::daemonListRequestFinished))
- )
- );
+ Common::RequestManager::get()->sendRequest<Requests::DaemonListRequest>(con,
+ sigc::mem_fun(this, &InformationManager::daemonListRequestFinished));
updating = true;
}