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

Upgrade v4 #18

Merged
merged 36 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8506bdb
updated includes to v4
pasotee Apr 23, 2024
c0642b6
updating logger
pasotee Apr 23, 2024
4fdfc90
fixed network adapter errors
pasotee Apr 23, 2024
e5a7a0e
Updated hooks API
pasotee Apr 24, 2024
b7225c5
force fix all compilation errors
pasotee Apr 24, 2024
f50f6aa
Enable exception to build for target platforms properly
pasotee Apr 26, 2024
db8e2c3
update includes from cpp-sdk after PR approval
pasotee Apr 26, 2024
21a8dcb
starting to re-work wrappers
pasotee Apr 29, 2024
0e2c4fc
wrapper refactor to UObjects
pasotee Apr 30, 2024
1ba6aa6
improved wrappers structure
pasotee Apr 30, 2024
3a24e3e
added workflow dispatch to manually trigger runs
pasotee May 4, 2024
cd99a56
Fixed crash when no user is provided
pasotee May 4, 2024
4fcb82b
Merge branch 'upgrade-v4' of https://github.com/configcat/unreal-engi…
pasotee May 5, 2024
a90cedc
temp refactor
pasotee May 12, 2024
a390945
wrappers new classes
pasotee May 12, 2024
75872a3
Finished settings wrapper
pasotee May 12, 2024
f2133cf
Finished one more wrapper
pasotee May 12, 2024
c4a1422
started implementation for the last 2 wrappers
pasotee May 12, 2024
ceceffa
Percentageoption done
pasotee May 12, 2024
71eaf9a
fixed includes for PR CI
pasotee May 13, 2024
3db8965
missing include for CI
pasotee May 13, 2024
5f10108
WIP targeting rules wrapper
pasotee May 14, 2024
085f36a
wrappers for targeting rules
pasotee May 15, 2024
f9ca35d
separate module for wrappers
pasotee May 15, 2024
437ba49
moved wrapper classes to separate module
pasotee May 15, 2024
6ed37c9
fixed nullptr crashes
pasotee May 15, 2024
de0fced
enable wrapper classes to show up in blueprints
pasotee May 15, 2024
a54bd75
fixed macos compiler error
pasotee May 15, 2024
96f0e0b
Merge branch 'upgrade-v4' of https://github.com/configcat/unreal-engi…
pasotee May 15, 2024
f1bb1d2
fixed CI - wrapper exceptions + missing shared_ptr include
pasotee May 15, 2024
278e206
Apply suggestions from code review
pasotee May 22, 2024
45a1e9e
fixed wrong copyright notice
pasotee May 22, 2024
1256470
one more missing copyright
pasotee May 22, 2024
7129e83
Ensure Wrapper
pasotee May 22, 2024
4522590
implemented missing methods
pasotee May 22, 2024
473727e
versioning for VCPKG library
pasotee May 22, 2024
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
9 changes: 9 additions & 0 deletions .github/workflows/plugin-cd.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: Plugin CD

on:
workflow_dispatch:
push:
tags:
- 'v*'

env:
VCPKG_COMMIT_HASH: "59852bb5bd0779788e5fc95e50d2048ae6c9399d"

jobs:
build-win64:
runs-on: windows-latest
Expand All @@ -15,6 +19,7 @@ jobs:
- name: Install via vcpkg
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }}
./build/vcpkg/bootstrap-vcpkg.bat
./build/vcpkg/vcpkg install configcat[core] --triplet x64-windows

Expand All @@ -34,6 +39,7 @@ jobs:
- name: Install via vcpkg
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }}
./build/vcpkg/bootstrap-vcpkg.bat
./build/vcpkg/vcpkg install configcat[core] --triplet arm64-android

Expand All @@ -53,6 +59,7 @@ jobs:
- name: Install via vcpkg
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }}
./build/vcpkg/bootstrap-vcpkg.sh
./build/vcpkg/vcpkg install configcat[core] --triplet universal-osx-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets"

Expand All @@ -72,6 +79,7 @@ jobs:
- name: Install via vcpkg
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }}
./build/vcpkg/bootstrap-vcpkg.sh
./build/vcpkg/vcpkg install configcat[core] --triplet arm64-ios-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets"

Expand All @@ -91,6 +99,7 @@ jobs:
- name: Install via vcpkg
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }}
./build/vcpkg/bootstrap-vcpkg.sh

# Extra steps for Unreal Engine integration
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/plugin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- main

env:
VCPKG_COMMIT_HASH: "59852bb5bd0779788e5fc95e50d2048ae6c9399d"

jobs:
build-linux:
runs-on: ubuntu-latest
Expand All @@ -18,6 +21,7 @@ jobs:
- name: Install via vcpkg
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }}
./build/vcpkg/bootstrap-vcpkg.sh
# Extra steps for Unreal Engine integration
Expand Down
6 changes: 6 additions & 0 deletions ConfigCat.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
"LoadingPhase": "PreDefault",
"PlatformAllowList": [ "Win64", "Mac", "Linux", "Android", "iOS" ]
},
{
"Name": "ConfigCatWrappers",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"PlatformAllowList": [ "Win64", "Mac", "Linux", "Android", "iOS" ]
},
{
"Name": "ConfigCatEditor",
"Type": "Editor",
Expand Down
3 changes: 3 additions & 0 deletions Source/ConfigCat/ConfigCat.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public ConfigCat(ReadOnlyTargetRules Target) : base(Target)

PrivateDependencyModuleNames.AddRange(new[]
{
"ConfigCatWrappers",
"ConfigCatCppSdk"
});

Expand All @@ -31,5 +32,7 @@ public ConfigCat(ReadOnlyTargetRules Target) : base(Target)

PrivateDefinitions.Add("CONFIGCAT_HTTPTHREAD_WORKAROUND");
}

bEnableExceptions = true;
}
}
8 changes: 7 additions & 1 deletion Source/ConfigCat/Private/ConfigCatLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FConfigCatLogger::FConfigCatLogger() : ILogger(LOG_LEVEL_DEBUG)
{
}

void FConfigCatLogger::log(configcat::LogLevel level, const std::string& message)
void FConfigCatLogger::log(configcat::LogLevel level, const std::string& message, const std::exception_ptr& exception)
{
const FString& LogMessage = UTF8_TO_TCHAR(message.c_str());

Expand All @@ -32,4 +32,10 @@ void FConfigCatLogger::log(configcat::LogLevel level, const std::string& message
UE_LOG(LogConfigCat, Log, TEXT("[CPP-SDK] %s"), *LogMessage);
break;
}

if (exception)
{
const FString ExceptionMessage = UTF8_TO_TCHAR(unwrap_exception_message(exception).c_str());
UE_LOG(LogConfigCat, Error, TEXT("[CPP-SDK] Exception: %s"), *ExceptionMessage);
}
}
15 changes: 9 additions & 6 deletions Source/ConfigCat/Private/ConfigCatNetworkAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ bool ConfigCatNetworkAdapter::init(uint32_t connectTimeoutMs, uint32_t readTimeo
}

Response ConfigCatNetworkAdapter::get(
const std::string& url, const std::map<std::string, std::string>& header, const std::map<std::string, std::string>& proxies, const std::map<std::string, ProxyAuthentication>& proxyAuthentications
const std::string& url,
const std::map<std::string, std::string>& header,
const std::map<std::string, std::string>& proxies,
const std::map<std::string, ProxyAuthentication>& proxyAuthentications
)
{
UE_LOG(LogConfigCat, Verbose, TEXT("Network Adapter performing GET request."));
Expand All @@ -57,10 +60,10 @@ Response ConfigCatNetworkAdapter::get(
const float Timeout = (ConnectionTimeout + ReadTimeout) / 1000.0f;
GetRequest->SetTimeout(Timeout);

for (const auto& it : header)
for (const std::pair<const std::string, std::string>& It : header)
{
const FString HeaderKey = UTF8_TO_TCHAR(it.first.c_str());
const FString HeaderValue = UTF8_TO_TCHAR(it.second.c_str());
const FString HeaderKey = UTF8_TO_TCHAR(It.first.c_str());
const FString HeaderValue = UTF8_TO_TCHAR(It.second.c_str());
GetRequest->SetHeader(HeaderKey, HeaderValue);
}

Expand Down Expand Up @@ -101,7 +104,7 @@ Response ConfigCatNetworkAdapter::get(
if (!GetResponse)
{
Response.error = "Unreal Engine Network Adapter failed to launch request. Check logs";
Response.operationTimedOut = GetRequest->GetElapsedTime() > Timeout;
Response.errorCode = ResponseErrorCode::InternalError;
return Response;
}

Expand Down Expand Up @@ -131,4 +134,4 @@ void ConfigCatNetworkAdapter::close()
{
GetRequest->CancelRequest();
}
}
}
Loading
Loading