mirror of https://github.com/axmolengine/axmol.git
Merge pull request #4801 from minggo/namespace
fix compiling errors because of new namespace of network module
This commit is contained in:
commit
2b5be1bacf
|
@ -167,7 +167,7 @@ void MinXmlHttpRequest::_setHttpRequestHeader()
|
||||||
* @param sender Object which initialized callback
|
* @param sender Object which initialized callback
|
||||||
* @param respone Response object
|
* @param respone Response object
|
||||||
*/
|
*/
|
||||||
void MinXmlHttpRequest::handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response)
|
void MinXmlHttpRequest::handle_requestResponse(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response)
|
||||||
{
|
{
|
||||||
if (0 != strlen(response->getHttpRequest()->getTag()))
|
if (0 != strlen(response->getHttpRequest()->getTag()))
|
||||||
{
|
{
|
||||||
|
@ -247,7 +247,7 @@ void MinXmlHttpRequest::handle_requestResponse(network::HttpClient *sender, netw
|
||||||
void MinXmlHttpRequest::_sendRequest(JSContext *cx)
|
void MinXmlHttpRequest::_sendRequest(JSContext *cx)
|
||||||
{
|
{
|
||||||
_httpRequest->setResponseCallback(this, httpresponse_selector(MinXmlHttpRequest::handle_requestResponse));
|
_httpRequest->setResponseCallback(this, httpresponse_selector(MinXmlHttpRequest::handle_requestResponse));
|
||||||
network::HttpClient::getInstance()->send(_httpRequest);
|
cocos2d::network::HttpClient::getInstance()->send(_httpRequest);
|
||||||
_httpRequest->release();
|
_httpRequest->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ MinXmlHttpRequest::MinXmlHttpRequest()
|
||||||
_requestHeader.clear();
|
_requestHeader.clear();
|
||||||
_withCredentialsValue = true;
|
_withCredentialsValue = true;
|
||||||
_cx = ScriptingCore::getInstance()->getGlobalContext();
|
_cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||||
_httpRequest = new network::HttpRequest();
|
_httpRequest = new cocos2d::network::HttpRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -627,11 +627,11 @@ JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, open)
|
||||||
|
|
||||||
if (_meth.compare("post") == 0 || _meth.compare("POST") == 0)
|
if (_meth.compare("post") == 0 || _meth.compare("POST") == 0)
|
||||||
{
|
{
|
||||||
_httpRequest->setRequestType(network::HttpRequest::Type::POST);
|
_httpRequest->setRequestType(cocos2d::network::HttpRequest::Type::POST);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_httpRequest->setRequestType(network::HttpRequest::Type::GET);
|
_httpRequest->setRequestType(cocos2d::network::HttpRequest::Type::GET);
|
||||||
}
|
}
|
||||||
|
|
||||||
_httpRequest->setUrl(_url.c_str());
|
_httpRequest->setUrl(_url.c_str());
|
||||||
|
|
|
@ -80,7 +80,7 @@ public:
|
||||||
JS_BINDED_FUNC(MinXmlHttpRequest, setRequestHeader);
|
JS_BINDED_FUNC(MinXmlHttpRequest, setRequestHeader);
|
||||||
JS_BINDED_FUNC(MinXmlHttpRequest, overrideMimeType);
|
JS_BINDED_FUNC(MinXmlHttpRequest, overrideMimeType);
|
||||||
|
|
||||||
void handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response);
|
void handle_requestResponse(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -12,7 +12,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "network/WebSocket.h"
|
#include "network/WebSocket.h"
|
||||||
class LuaWebSocket: public network::WebSocket,public network::WebSocket::Delegate
|
class LuaWebSocket: public cocos2d::network::WebSocket,public cocos2d::network::WebSocket::Delegate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~LuaWebSocket();
|
virtual ~LuaWebSocket();
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
LuaMinXmlHttpRequest();
|
LuaMinXmlHttpRequest();
|
||||||
~LuaMinXmlHttpRequest();
|
~LuaMinXmlHttpRequest();
|
||||||
|
|
||||||
void handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response);
|
void handle_requestResponse(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response);
|
||||||
|
|
||||||
inline void setResponseType(ResponseType type) { _responseType = type; }
|
inline void setResponseType(ResponseType type) { _responseType = type; }
|
||||||
inline ResponseType getResponseType() {return _responseType; }
|
inline ResponseType getResponseType() {return _responseType; }
|
||||||
|
@ -48,7 +48,7 @@ public:
|
||||||
inline void setReadyState(int readyState) { _readyState = readyState; }
|
inline void setReadyState(int readyState) { _readyState = readyState; }
|
||||||
inline int getReadyState() { return _readyState ;}
|
inline int getReadyState() { return _readyState ;}
|
||||||
|
|
||||||
inline network::HttpRequest* getHttpRequest() { return _httpRequest; }
|
inline cocos2d::network::HttpRequest* getHttpRequest() { return _httpRequest; }
|
||||||
inline int getStatus() { return _status; }
|
inline int getStatus() { return _status; }
|
||||||
inline std::string getStatusText() { return _statusText ;}
|
inline std::string getStatusText() { return _statusText ;}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ private:
|
||||||
ResponseType _responseType;
|
ResponseType _responseType;
|
||||||
unsigned _timeout;
|
unsigned _timeout;
|
||||||
bool _isAsync;
|
bool _isAsync;
|
||||||
network::HttpRequest* _httpRequest;
|
cocos2d::network::HttpRequest* _httpRequest;
|
||||||
bool _isNetwork;
|
bool _isNetwork;
|
||||||
bool _withCredentialsValue;
|
bool _withCredentialsValue;
|
||||||
std::map<std::string, std::string> _httpHeader;
|
std::map<std::string, std::string> _httpHeader;
|
||||||
|
|
Loading…
Reference in New Issue