Cleaning up some obsolete code.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13513 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
ea7d42c1b8
commit
ac6ce5a4f0
@ -98,7 +98,7 @@ namespace Online{
|
||||
SignInRequest * request = NULL;
|
||||
if(getUserState() != US_SIGNED_IN && UserConfigParams::m_saved_session)
|
||||
{
|
||||
request = new SignInRequest();
|
||||
request = new SignInRequest(true);
|
||||
request->setURL((std::string)UserConfigParams::m_server_multiplayer + "client-user.php");
|
||||
request->setParameter("action",std::string("saved-session"));
|
||||
request->setParameter("userid", UserConfigParams::m_saved_user);
|
||||
|
@ -50,41 +50,32 @@ namespace Online{
|
||||
US_SIGNING_OUT
|
||||
};
|
||||
|
||||
enum RequestType
|
||||
{
|
||||
RT_SIGN_IN = 1,
|
||||
RT_SIGN_OUT,
|
||||
RT_SIGN_UP,
|
||||
RT_SERVER_JOIN,
|
||||
RT_SERVER_CREATION
|
||||
};
|
||||
|
||||
class SignInRequest : public XMLRequest
|
||||
{
|
||||
virtual void callback ();
|
||||
public:
|
||||
SignInRequest() : XMLRequest(RT_SIGN_IN) {}
|
||||
SignInRequest(bool manage_memory = false) : XMLRequest(manage_memory) {}
|
||||
};
|
||||
|
||||
class SignOutRequest : public XMLRequest
|
||||
{
|
||||
virtual void callback ();
|
||||
public:
|
||||
SignOutRequest() : XMLRequest(RT_SIGN_OUT) {}
|
||||
SignOutRequest() : XMLRequest() {}
|
||||
};
|
||||
|
||||
class ServerCreationRequest : public XMLRequest {
|
||||
virtual void callback ();
|
||||
uint32_t m_created_server_id;
|
||||
public:
|
||||
ServerCreationRequest() : XMLRequest(RT_SERVER_CREATION) {}
|
||||
ServerCreationRequest() : XMLRequest() {}
|
||||
const uint32_t getCreatedServerID() const { assert(isDone()); return m_created_server_id;}
|
||||
};
|
||||
|
||||
class ServerJoinRequest : public XMLRequest {
|
||||
virtual void callback ();
|
||||
public:
|
||||
ServerJoinRequest() : XMLRequest(RT_SERVER_JOIN) {}
|
||||
ServerJoinRequest() : XMLRequest() {}
|
||||
};
|
||||
|
||||
class SetAddonVoteRequest : public XMLRequest {
|
||||
|
@ -32,7 +32,7 @@ namespace Online{
|
||||
|
||||
// =========================================================================================
|
||||
|
||||
Request::Request(int type, bool manage_memory, int priority)
|
||||
Request::Request(bool manage_memory, int priority, int type)
|
||||
: m_type(type), m_manage_memory(manage_memory), m_priority(priority)
|
||||
{
|
||||
m_cancel.setAtomic(false);
|
||||
@ -57,11 +57,9 @@ namespace Online{
|
||||
|
||||
// =========================================================================================
|
||||
|
||||
HTTPRequest::HTTPRequest(int type, bool manage_memory, int priority)
|
||||
: Request(priority, manage_memory, type)
|
||||
HTTPRequest::HTTPRequest(bool manage_memory, int priority)
|
||||
: Request(manage_memory, priority, 0)
|
||||
{
|
||||
//Negative numbers are reserved for special requests ment for the HTTP Manager
|
||||
assert(type >= 0);
|
||||
m_url = "";
|
||||
m_parameters = new Parameters();
|
||||
m_progress.setAtomic(0);
|
||||
@ -206,8 +204,8 @@ namespace Online{
|
||||
|
||||
// =========================================================================================
|
||||
|
||||
XMLRequest::XMLRequest(int type, bool manage_memory, int priority)
|
||||
: HTTPRequest(priority, manage_memory, type)
|
||||
XMLRequest::XMLRequest(bool manage_memory, int priority)
|
||||
: HTTPRequest(manage_memory, priority)
|
||||
{
|
||||
m_string_buffer = "";
|
||||
m_info = "";
|
||||
|
@ -40,9 +40,8 @@ namespace Online{
|
||||
class Request
|
||||
{
|
||||
private:
|
||||
/** Can be used as identifier for the user.
|
||||
/** Type of the request
|
||||
* Has 0 as default value.
|
||||
* Only requests ment to control the HTTP Manager should use negative values, for all other uses positive values are obliged
|
||||
* */
|
||||
const int m_type;
|
||||
/** True if the memory for this Request should be managed by
|
||||
@ -73,13 +72,12 @@ namespace Online{
|
||||
virtual void afterOperation();
|
||||
|
||||
public:
|
||||
/** Negative numbers are reserved for requests that are special for the HTTP Manager*/
|
||||
enum RequestType
|
||||
{
|
||||
RT_QUIT = -1
|
||||
RT_QUIT = 1
|
||||
};
|
||||
|
||||
Request(int type, bool manage_memory, int priority);
|
||||
Request(bool manage_memory, int priority, int type);
|
||||
virtual ~Request();
|
||||
|
||||
void execute();
|
||||
@ -171,7 +169,7 @@ namespace Online{
|
||||
|
||||
|
||||
public :
|
||||
HTTPRequest(int type = 0, bool manage_memory = false, int priority = 1);
|
||||
HTTPRequest(bool manage_memory = false, int priority = 1);
|
||||
virtual ~HTTPRequest();
|
||||
|
||||
void setParameter(const std::string & name, const std::string &value){
|
||||
@ -216,7 +214,7 @@ namespace Online{
|
||||
virtual void afterOperation() OVERRIDE;
|
||||
|
||||
public :
|
||||
XMLRequest(int type = 0, bool manage_memory = false, int priority = 1);
|
||||
XMLRequest(bool manage_memory = false, int priority = 1);
|
||||
virtual ~XMLRequest();
|
||||
|
||||
const XMLNode * getResult() const;
|
||||
|
Loading…
Reference in New Issue
Block a user