From 3fa91241aad706ab4800878d5f4866240b3e72ae Mon Sep 17 00:00:00 2001 From: acaruso-xx <151804137+acaruso-xx@users.noreply.github.com> Date: Sat, 16 Nov 2024 15:37:49 +0000 Subject: [PATCH] Add missing CCHttpRequest members and member functions (#1161) --- .../cocos/extensions/network/HttpRequest.h | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/loader/include/Geode/cocos/extensions/network/HttpRequest.h b/loader/include/Geode/cocos/extensions/network/HttpRequest.h index 042e159ad..b44934b11 100644 --- a/loader/include/Geode/cocos/extensions/network/HttpRequest.h +++ b/loader/include/Geode/cocos/extensions/network/HttpRequest.h @@ -28,6 +28,8 @@ #include "../../include/cocos2d.h" #include "../ExtensionMacros.h" +enum class GJHttpType; + NS_CC_EXT_BEGIN class CC_DLL CCHttpClient; @@ -216,6 +218,50 @@ class CC_DLL CCHttpRequest : public CCObject return _headers; } + inline int getType() { + return _type; + } + + inline void setType(int type) { + _type = type; + } + + // @note Geode addition + inline void setType(GJHttpType type) { + _type = static_cast(type); + } + + inline bool getShouldCancel() { + return _shouldCancel; + } + + inline void setShouldCancel(bool shouldCancel) { + _shouldCancel = shouldCancel; + } + + inline int getDownloadProgress() { + return _downloadProgress; + } + + inline void setDownloadProgress(int downloadProgress) { + _downloadProgress = downloadProgress; + } + + inline int getReadTimeout() { + return _readTimeout; + } + + inline void setReadTimeout(int readTimeout) { + _readTimeout = readTimeout; + } + + inline int getConnectTimeout() { + return _connectTimeout; + } + + inline void setConnectTimeout(int connectTimeout) { + _connectTimeout = connectTimeout; + } protected: // properties @@ -229,13 +275,15 @@ class CC_DLL CCHttpRequest : public CCObject gd::vector _headers; /// custom http headers // @note RobTop Addition - int _requestTypeGJ; + int _type; // @note RobTop Addition bool _shouldCancel; // @note RobTop Addition int _downloadProgress; // @note RobTop Addition int _readTimeout; + // @note RobTop Addition + int _connectTimeout; }; NS_CC_EXT_END