summaryrefslogtreecommitdiffstats
path: root/src/Client
diff options
context:
space:
mode:
Diffstat (limited to 'src/Client')
-rw-r--r--src/Client/CommandParser.cpp4
-rw-r--r--src/Client/CommandParser.h7
-rw-r--r--src/Client/Requests/CoreStatusRequest.cpp4
-rw-r--r--src/Client/Requests/CoreStatusRequest.h6
4 files changed, 6 insertions, 15 deletions
diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp
index decb28e..9644d71 100644
--- a/src/Client/CommandParser.cpp
+++ b/src/Client/CommandParser.cpp
@@ -86,14 +86,14 @@ void CommandParser::helpCommand(const std::vector<std::string> &args) {
void CommandParser::statusCommand(const std::vector<std::string>&) {
activeRequests++;
- Requests::CoreStatusRequest::send(connection, *requestManager, sigc::mem_fun(this, &CommandParser::coreStatusRequestFinished));
+ Requests::CoreStatusRequest::send(connection, sigc::mem_fun(this, &CommandParser::coreStatusRequestFinished));
}
void CommandParser::exitCommand(const std::vector<std::string>&) {
activeRequests++;
disconnect = true;
- Common::Requests::DisconnectRequest::send(connection, *requestManager, sigc::mem_fun(this, &CommandParser::requestFinished));
+ Common::Requests::DisconnectRequest::send(connection, sigc::mem_fun(this, &CommandParser::requestFinished));
}
void CommandParser::coreStatusRequestFinished(const Net::Packets::HostStatusPacket &packet) {
diff --git a/src/Client/CommandParser.h b/src/Client/CommandParser.h
index 78ed6fa..69ed217 100644
--- a/src/Client/CommandParser.h
+++ b/src/Client/CommandParser.h
@@ -26,10 +26,6 @@
namespace Mad {
-namespace Common {
-class RequestManager;
-}
-
namespace Net {
class Connection;
@@ -56,7 +52,6 @@ class CommandParser {
sigc::signal<void> finished;
- Common::RequestManager *requestManager;
Net::Connection *connection;
unsigned int activeRequests;
@@ -80,7 +75,7 @@ class CommandParser {
}
public:
- CommandParser(Common::RequestManager *requestManager0, Net::Connection *connection0) : requestManager(requestManager0), connection(connection0), activeRequests(0), disconnect(false) {}
+ CommandParser(Net::Connection *connection0) : connection(connection0), activeRequests(0), disconnect(false) {}
bool requestsActive() {return (activeRequests > 0);}
bool willDisconnect() {return disconnect;}
diff --git a/src/Client/Requests/CoreStatusRequest.cpp b/src/Client/Requests/CoreStatusRequest.cpp
index fa3f1f1..6d0f634 100644
--- a/src/Client/Requests/CoreStatusRequest.cpp
+++ b/src/Client/Requests/CoreStatusRequest.cpp
@@ -28,12 +28,12 @@ namespace Mad {
namespace Client {
namespace Requests {
-bool CoreStatusRequest::send(Net::Connection *connection, Common::RequestManager &requestManager, const sigc::slot<void,const Net::Packets::HostStatusPacket&> &callback) {
+bool CoreStatusRequest::send(Net::Connection *connection, const sigc::slot<void,const Net::Packets::HostStatusPacket&> &callback) {
CoreStatusRequest *request = new CoreStatusRequest();
request->finished.connect(callback);
- if(requestManager.sendRequest(connection, request))
+ if(Mad::Common::RequestManager::getRequestManager()->sendRequest(connection, request))
return true;
delete request;
diff --git a/src/Client/Requests/CoreStatusRequest.h b/src/Client/Requests/CoreStatusRequest.h
index 7de8a68..55d6a22 100644
--- a/src/Client/Requests/CoreStatusRequest.h
+++ b/src/Client/Requests/CoreStatusRequest.h
@@ -26,10 +26,6 @@
namespace Mad {
-namespace Common {
-class RequestManager;
-}
-
namespace Net {
namespace Packets {
class HostStatusPacket;
@@ -46,7 +42,7 @@ class CoreStatusRequest : public Common::Request {
CoreStatusRequest() {}
public:
- static bool send(Net::Connection *connection, Common::RequestManager &requestManager, const sigc::slot<void,const Net::Packets::HostStatusPacket&> &callback);
+ static bool send(Net::Connection *connection, const sigc::slot<void,const Net::Packets::HostStatusPacket&> &callback);
virtual bool sendRequest(Net::Connection *connection, uint16_t requestId);
virtual bool handlePacket(Net::Connection*, const Net::Packet &packet);