summaryrefslogtreecommitdiffstats
path: root/src/Common/Requests
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-14 23:16:58 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-14 23:16:58 +0200
commit082dac7a8cb39ec1b005680680c4f3e1e8ddc256 (patch)
tree1db7b02d84cdd1882e15d3a1abfd8e93925a4af6 /src/Common/Requests
parentfd9b1506a3b3858235e91cce45805f6d54caae4f (diff)
downloadmad-082dac7a8cb39ec1b005680680c4f3e1e8ddc256.tar
mad-082dac7a8cb39ec1b005680680c4f3e1e8ddc256.zip
Verwende statische Instanzen von ConfigManager, ConnectionManager und RequestManager (Singleton)
Diffstat (limited to 'src/Common/Requests')
-rw-r--r--src/Common/Requests/DisconnectRequest.cpp4
-rw-r--r--src/Common/Requests/DisconnectRequest.h5
-rw-r--r--src/Common/Requests/GSSAPIAuthRequest.cpp4
-rw-r--r--src/Common/Requests/GSSAPIAuthRequest.h2
-rw-r--r--src/Common/Requests/IdentifyRequest.cpp8
-rw-r--r--src/Common/Requests/IdentifyRequest.h5
6 files changed, 11 insertions, 17 deletions
diff --git a/src/Common/Requests/DisconnectRequest.cpp b/src/Common/Requests/DisconnectRequest.cpp
index 2652af2..0b6e3bc 100644
--- a/src/Common/Requests/DisconnectRequest.cpp
+++ b/src/Common/Requests/DisconnectRequest.cpp
@@ -24,12 +24,12 @@ namespace Mad {
namespace Common {
namespace Requests {
-bool DisconnectRequest::send(Net::Connection *connection, RequestManager &requestManager, const sigc::slot<void> &callback) {
+bool DisconnectRequest::send(Net::Connection *connection, const sigc::slot<void> &callback) {
DisconnectRequest *request = new DisconnectRequest();
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/Common/Requests/DisconnectRequest.h b/src/Common/Requests/DisconnectRequest.h
index a569d8f..6c87f85 100644
--- a/src/Common/Requests/DisconnectRequest.h
+++ b/src/Common/Requests/DisconnectRequest.h
@@ -26,9 +26,6 @@
namespace Mad {
namespace Common {
-
-class RequestManager;
-
namespace Requests {
class DisconnectRequest : public Request {
@@ -38,7 +35,7 @@ class DisconnectRequest : public Request {
DisconnectRequest() {}
public:
- static bool send(Net::Connection *connection, RequestManager &requestManager, const sigc::slot<void> &callback);
+ static bool send(Net::Connection *connection, const sigc::slot<void> &callback);
virtual bool sendRequest(Net::Connection *connection, uint16_t requestId);
virtual bool handlePacket(Net::Connection *connection, const Net::Packet &packet);
diff --git a/src/Common/Requests/GSSAPIAuthRequest.cpp b/src/Common/Requests/GSSAPIAuthRequest.cpp
index 1874064..705db41 100644
--- a/src/Common/Requests/GSSAPIAuthRequest.cpp
+++ b/src/Common/Requests/GSSAPIAuthRequest.cpp
@@ -37,10 +37,10 @@ GSSAPIAuthRequest::~GSSAPIAuthRequest() {
gss_release_name(&minStat, &gssServiceName);
}
-bool GSSAPIAuthRequest::send(Net::Connection *connection, RequestManager &requestManager, const std::string &serviceName0) {
+bool GSSAPIAuthRequest::send(Net::Connection *connection, const std::string &serviceName0) {
GSSAPIAuthRequest *request = new GSSAPIAuthRequest(serviceName0);
- if(requestManager.sendRequest(connection, request))
+ if(Mad::Common::RequestManager::getRequestManager()->sendRequest(connection, request))
return true;
delete request;
diff --git a/src/Common/Requests/GSSAPIAuthRequest.h b/src/Common/Requests/GSSAPIAuthRequest.h
index a4a2f17..e9a200e 100644
--- a/src/Common/Requests/GSSAPIAuthRequest.h
+++ b/src/Common/Requests/GSSAPIAuthRequest.h
@@ -46,7 +46,7 @@ class GSSAPIAuthRequest : public Request {
public:
virtual ~GSSAPIAuthRequest();
- static bool send(Net::Connection *connection, RequestManager &requestManager, const std::string &serviceName0);
+ static bool send(Net::Connection *connection, const std::string &serviceName0);
virtual bool sendRequest(Net::Connection *connection, uint16_t requestId);
virtual bool handlePacket(Net::Connection *connection, const Net::Packet &packet);
diff --git a/src/Common/Requests/IdentifyRequest.cpp b/src/Common/Requests/IdentifyRequest.cpp
index 18b515f..54d49e2 100644
--- a/src/Common/Requests/IdentifyRequest.cpp
+++ b/src/Common/Requests/IdentifyRequest.cpp
@@ -25,10 +25,10 @@ namespace Mad {
namespace Common {
namespace Requests {
-bool IdentifyRequest::send(Net::Connection *connection, RequestManager &requestManager, const std::string &hostname0) {
+bool IdentifyRequest::send(Net::Connection *connection, const std::string &hostname0) {
IdentifyRequest *request = new IdentifyRequest(hostname0);
- if(requestManager.sendRequest(connection, request))
+ if(RequestManager::getRequestManager()->sendRequest(connection, request))
return true;
delete request;
@@ -53,8 +53,8 @@ bool IdentifyRequest::handlePacket(Net::Connection*, const Net::Packet &packet)
if(packet.getType() != Net::Packet::OK)
return false; // TODO Logging
- setFinished();
- return true;
+ setFinished();
+ return true;
}
}
diff --git a/src/Common/Requests/IdentifyRequest.h b/src/Common/Requests/IdentifyRequest.h
index 9fb45d9..0b783e4 100644
--- a/src/Common/Requests/IdentifyRequest.h
+++ b/src/Common/Requests/IdentifyRequest.h
@@ -25,9 +25,6 @@
namespace Mad {
namespace Common {
-
-class RequestManager;
-
namespace Requests {
class IdentifyRequest : public Request {
@@ -37,7 +34,7 @@ class IdentifyRequest : public Request {
std::string hostname;
public:
- static bool send(Net::Connection *connection, RequestManager &requestManager, const std::string &hostname0);
+ static bool send(Net::Connection *connection, const std::string &hostname0);
virtual bool sendRequest(Net::Connection *connection, uint16_t requestId);
virtual bool handlePacket(Net::Connection*, const Net::Packet &packet);