Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing CCHttpRequest members and member functions #1161

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion loader/include/Geode/cocos/extensions/network/HttpRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "../../include/cocos2d.h"
#include "../ExtensionMacros.h"

enum class GJHttpType;

NS_CC_EXT_BEGIN

class CC_DLL CCHttpClient;
Expand Down Expand Up @@ -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<int>(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
Expand All @@ -229,13 +275,15 @@ class CC_DLL CCHttpRequest : public CCObject
gd::vector<gd::string> _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
Expand Down