Skip to content

Commit bef3409

Browse files
committed
feat: use si wasmer recipe
1 parent 7a77819 commit bef3409

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

unreal-cpp-net-fps/Config/DefaultEcsact.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[/Script/Ecsact.EcsactSettings]
2-
bEnableBuild=False
2+
bEnableBuild=True
33
CustomEcsactRuntimeLibraryPath=Binaries/Win64/EcsactRuntime.dll
44
BuildReportFilter=None
55
+Recipes=rt_entt
66
+Recipes=async_reference
77
+Recipes=serialize_reference
8+
+Recipes=si_wasmer
89
Runner=Custom
910
CustomRunnerClass=None
1011
bAutoCollectBlueprintRunnerSubsystems=True

unreal-cpp-net-fps/Source/EcsactUnrealFps/ExampleCustomEcsactRunnerStarter.cpp

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "ExampleCustomEcsactRunnerStarter.h"
22
#include "ecsact/runtime/core.h"
3-
#include "ecsact/wasm.h"
3+
#include "ecsact/si/wasm.h"
44
#include "Ecsact/Private/EcsactGameInstanceSubsystem.h"
55
#include "Engine/GameInstance.h"
66
#include "EcsactUnreal/EcsactSyncRunner.h"
@@ -19,10 +19,10 @@ static auto LoadWasmSystemImpls() -> void {
1919
file_path = FPaths::Combine(FPaths::ProjectDir(), file_path);
2020
}
2121

22-
if(ecsactsi_wasm_load_file != nullptr) {
22+
if(ecsact_si_wasm_load_file != nullptr) {
2323
// reason for const_casts:
2424
// https://github.com/ecsact-dev/ecsact_si_wasm/issues/80
25-
auto err = ecsactsi_wasm_load_file(
25+
auto err = ecsact_si_wasm_load_file(
2626
const_cast<char*>(TCHAR_TO_UTF8(*file_path)),
2727
EcsactUnreal::CodegenMeta::ExampleFpsSystemLikeIds.size(),
2828
const_cast<ecsact_system_like_id*>(
@@ -32,32 +32,33 @@ static auto LoadWasmSystemImpls() -> void {
3232
EcsactUnreal::CodegenMeta::ExampleFpsExportNames.data()
3333
)
3434
);
35-
if(err != ECSACTSI_WASM_OK) {
36-
#define HANDLE_ECSACTSI_ERROR_CASE(err) \
37-
case err: \
38-
UE_LOG(LogTemp, Error, TEXT("ecsactsi_wasm_load_file error: " #err)); \
35+
if(err != ECSACT_SI_WASM_OK) {
36+
#define HANDLE_ECSACT_SI_ERROR_CASE(err) \
37+
case err: \
38+
UE_LOG(LogTemp, Error, TEXT("ecsact_si_wasm_load_file error: " #err)); \
3939
break
4040
switch(err) {
41-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_FILE_OPEN_FAIL);
42-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_FILE_READ_FAIL);
43-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_COMPILE_FAIL);
44-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_INSTANTIATE_FAIL);
45-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_EXPORT_NOT_FOUND);
46-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_EXPORT_INVALID);
47-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_GUEST_IMPORT_UNKNOWN);
48-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_GUEST_IMPORT_INVALID);
49-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_INITIALIZE_FAIL);
50-
HANDLE_ECSACTSI_ERROR_CASE(ECSACTSI_WASM_ERR_NO_SET_SYSTEM_EXECUTION);
51-
case ECSACTSI_WASM_OK:
41+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_FILE_OPEN_FAIL);
42+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_FILE_READ_FAIL);
43+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_COMPILE_FAIL);
44+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_INSTANTIATE_FAIL);
45+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_EXPORT_NOT_FOUND);
46+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_EXPORT_INVALID);
47+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_GUEST_IMPORT_UNKNOWN);
48+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_GUEST_IMPORT_INVALID);
49+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_INITIALIZE_FAIL);
50+
HANDLE_ECSACT_SI_ERROR_CASE(ECSACT_SI_WASM_ERR_NO_SET_SYSTEM_EXECUTION
51+
);
52+
case ECSACT_SI_WASM_OK:
5253
break;
5354
}
54-
#undef HANDLE_ECSACTSI_ERROR_CASE
55+
#undef HANDLE_ECSACT_SI_ERROR_CASE
5556
}
5657
} else {
5758
UE_LOG(
5859
LogTemp,
5960
Error,
60-
TEXT("ecsactsi_wasm_load_file unavailable - cannot load wasm system "
61+
TEXT("ecsact_si_wasm_load_file unavailable - cannot load wasm system "
6162
"impls")
6263
);
6364
}
@@ -86,6 +87,7 @@ auto UExampleCustomEcsactRunnerStarter::StartMultiplayerRunner( //
8687
auto ecsact_game_subsystem =
8788
world->GetGameInstance()->GetSubsystem<UEcsactGameInstanceSubsystem>();
8889
check(ecsact_game_subsystem);
90+
LoadWasmSystemImpls();
8991
ecsact_game_subsystem->StartCustomRunner<UEcsactAsyncRunner>();
9092
}
9193

0 commit comments

Comments
 (0)