[engine] [cocos2d-x] [jsb-adapter] 适配引擎 v2.4.12 版本

This commit is contained in:
SmallMain
2023-10-30 22:32:32 +08:00
parent 2508616ad9
commit 0092eb9f05
787 changed files with 206249 additions and 422 deletions

View File

@@ -30,6 +30,7 @@ THE SOFTWARE.
#include <memory>
#include <vector>
#include <functional>
#include <thread>
#include "base/ccMacros.h"

View File

@@ -174,11 +174,11 @@ static bool configureCURL(HttpClient* client, HttpRequest* request, CURL* handle
if (code != CURLE_OK) {
return false;
}
code = curl_easy_setopt(handle, CURLOPT_TIMEOUT, request->getTimeout());
code = curl_easy_setopt(handle, CURLOPT_TIMEOUT, static_cast<long>(request->getTimeout()));
if (code != CURLE_OK) {
return false;
}
code = curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, request->getTimeout());
code = curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, static_cast<long>(request->getTimeout()));
if (code != CURLE_OK) {
return false;
}

View File

@@ -263,7 +263,7 @@ static std::mutex __instanceMutex;
static struct lws_context* __wsContext = nullptr;
static WsThreadHelper* __wsHelper = nullptr;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_OPENHARMONY)
static std::string getFileNameForPath(const std::string& filePath)
{
std::string fileName = filePath;
@@ -852,7 +852,7 @@ void WebSocketImpl::close()
}
void WebSocketImpl::closeAsync(int code, const std::string &reason)
{
{
if (_wsInstance)
{
lws_close_reason(_wsInstance, (lws_close_status)code, (unsigned char*)const_cast<char*>(reason.c_str()), reason.length());
@@ -917,7 +917,7 @@ struct lws_vhost* WebSocketImpl::createVhost(struct lws_protocols* protocols, in
{
if (isCAFileExist)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_OPENHARMONY)
// if ca file is in the apk, try to extract it to writable path
std::string writablePath = fileUtils->getWritablePath();
std::string caFileName = getFileNameForPath(_caFilePath);