├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ ├── others.md │ ├── unity-bug.yml │ └── unreal-bug.yml └── workflows │ ├── clang-format-check.yml │ ├── cnb_sync.yml │ ├── composites │ ├── unity-build-plugins │ │ ├── android │ │ │ └── action.yml │ │ ├── ios │ │ │ └── action.yml │ │ ├── linux │ │ │ └── action.yml │ │ ├── ohos │ │ │ └── action.yml │ │ ├── osx │ │ │ └── action.yml │ │ ├── wasm │ │ │ └── action.yml │ │ └── windows │ │ │ └── action.yml │ ├── unity-download-backend │ │ └── action.yml │ └── unity-setup │ │ └── action.yml │ ├── unity_build_plugins.yml │ ├── unity_build_plugins_custom.yml │ ├── unity_openupm_publish.yml │ ├── unity_publish.yml │ ├── unity_unittest.yml │ ├── unreal_ci.yml │ └── unreal_publish.yml ├── .gitignore ├── LICENSE ├── README.md ├── doc ├── faq.md ├── pic │ ├── 1.png │ ├── puerts_conf.png │ ├── puerts_debugger.png │ ├── puerts_gen_dts.png │ ├── puerts_logo.png │ ├── puerts_module_dependencies.png │ ├── select_character.png │ ├── ue_throttle_cpu.png │ └── unity_run_in_background.png ├── unity │ ├── en │ │ ├── bugs.md │ │ ├── faq.md │ │ ├── install.md │ │ ├── knowjs │ │ │ ├── debugging.md │ │ │ ├── module.md │ │ │ ├── typescript.md │ │ │ └── webgl.md │ │ ├── other │ │ │ ├── building.md │ │ │ ├── commercial.md │ │ │ ├── community.md │ │ │ ├── dotnet.md │ │ │ └── upgrade.md │ │ ├── performance │ │ │ ├── il2cpp.md │ │ │ └── index.md │ │ ├── tutorial │ │ │ ├── cs2js.md │ │ │ ├── js2cs.md │ │ │ ├── runJS.md │ │ │ └── wxMinigame.md │ │ └── wrapper │ │ │ ├── all_attribute.md │ │ │ ├── blittablecopy.md │ │ │ ├── extension.md │ │ │ ├── filter.md │ │ │ └── wrapper.md │ └── zhcn │ │ ├── bugs.md │ │ ├── faq.md │ │ ├── install.md │ │ ├── knowjs │ │ ├── debugging.md │ │ ├── module.md │ │ ├── typescript.md │ │ └── webgl.md │ │ ├── other │ │ ├── building.md │ │ ├── commercial.md │ │ ├── community.md │ │ ├── dotnet.md │ │ └── upgrade.md │ │ ├── performance │ │ ├── il2cpp.md │ │ └── index.md │ │ ├── tutorial │ │ ├── cs2js.md │ │ ├── js2cs.md │ │ ├── runJS.md │ │ └── wxMinigame.md │ │ └── wrapper │ │ ├── all_attribute.md │ │ ├── blittablecopy.md │ │ ├── extension.md │ │ ├── filter.md │ │ └── wrapper.md └── unreal │ ├── en │ ├── README.md │ ├── changelog.md │ ├── demos.md │ ├── dev_environment.md │ ├── engine_call_script.md │ ├── faq.md │ ├── getting_started.md │ ├── install.md │ ├── manual.md │ ├── mixin.md │ ├── script_call_uclass.md │ ├── start_a_virtual_machine.md │ ├── template_binding.md │ ├── uclass_extends.md │ └── vscode_debug.md │ └── zhcn │ ├── bugs.md │ ├── changelog.md │ ├── demos.md │ ├── dev_environment.md │ ├── engine_call_script.md │ ├── faq.md │ ├── getting_started.md │ ├── install.md │ ├── manual.md │ ├── mixin.md │ ├── readme.md │ ├── script_call_uclass.md │ ├── start_a_virtual_machine.md │ ├── template_binding.md │ ├── uclass_extends.md │ ├── vscode_debug.md │ └── wasm.md ├── unity ├── .gitignore ├── Assets │ ├── commonjs │ │ └── upm │ │ │ ├── LICENSE │ │ │ ├── LICENSE.meta │ │ │ ├── Runtime.meta │ │ │ ├── Runtime │ │ │ ├── CommonJS.cs │ │ │ ├── CommonJS.cs.meta │ │ │ ├── Resources.meta │ │ │ ├── Resources │ │ │ │ ├── puer-commonjs.meta │ │ │ │ └── puer-commonjs │ │ │ │ │ ├── load.mjs │ │ │ │ │ ├── load.mjs.meta │ │ │ │ │ ├── modular.mjs │ │ │ │ │ └── modular.mjs.meta │ │ │ ├── com.tencent.puerts.commonjs.asmdef │ │ │ └── com.tencent.puerts.commonjs.asmdef.meta │ │ │ ├── Samples~ │ │ │ ├── Example.cs │ │ │ ├── Example.unity │ │ │ └── Resources │ │ │ │ ├── main.js.txt │ │ │ │ └── module1.js.txt │ │ │ ├── Typing.meta │ │ │ ├── Typing │ │ │ ├── index.d.ts │ │ │ └── index.d.ts.meta │ │ │ ├── package.json │ │ │ ├── package.json.meta │ │ │ ├── readme.md │ │ │ └── readme.md.meta │ ├── core │ │ └── upm │ │ │ ├── Editor │ │ │ ├── Resources │ │ │ │ └── puerts │ │ │ │ │ ├── templates │ │ │ │ │ ├── dts.tpl.mjs │ │ │ │ │ ├── extension_methods_gen.tpl.mjs │ │ │ │ │ ├── il2cpp_snippets.mjs │ │ │ │ │ ├── il2cppbridge.tpl.mjs │ │ │ │ │ ├── il2cppfieldwrapper.tpl.mjs │ │ │ │ │ ├── il2cppvaluetype.tpl.mjs │ │ │ │ │ ├── il2cppwrapper.tpl.mjs │ │ │ │ │ ├── il2cppwrapperdef.tpl.mjs │ │ │ │ │ ├── linkxmlgen.tpl.mjs │ │ │ │ │ ├── registerinfo.tpl.mjs │ │ │ │ │ ├── tte.mjs │ │ │ │ │ └── wrapper.tpl.mjs │ │ │ │ │ └── xil2cpp │ │ │ │ │ ├── Puerts_il2cpp.cpp.txt │ │ │ │ │ ├── TDataTrans.h.txt │ │ │ │ │ ├── pesapi.h.txt │ │ │ │ │ ├── pesapi_adpt.c.txt │ │ │ │ │ ├── pesapi_webgl.cpp.txt │ │ │ │ │ ├── pesapi_webgl.h.txt │ │ │ │ │ └── unityenv_for_puerts.h.tpl.mjs │ │ │ ├── Src │ │ │ │ ├── CJSImporter.cs │ │ │ │ ├── Configure.cs │ │ │ │ ├── DocResolver.cs │ │ │ │ ├── Generator │ │ │ │ │ ├── DTS.cs │ │ │ │ │ ├── FAQHelper.cs │ │ │ │ │ ├── FileExporter.cs │ │ │ │ │ ├── IL2Cpp │ │ │ │ │ │ ├── FileExporter.cs │ │ │ │ │ │ ├── InstructionsFilter.cs │ │ │ │ │ │ ├── Mono.Reflection.dll │ │ │ │ │ │ ├── Mono.Reflection.pdb │ │ │ │ │ │ └── UnityMenu.cs │ │ │ │ │ ├── RegisterInfo.cs │ │ │ │ │ ├── UnityMenu.cs │ │ │ │ │ ├── Utils.cs │ │ │ │ │ └── Wrapper.cs │ │ │ │ ├── MJSImporter.cs │ │ │ │ ├── U2018Compatible.cs │ │ │ │ └── UnityNodeJS.cs │ │ │ └── com.tencent.puerts.core.Editor.asmdef │ │ │ ├── LICENSE │ │ │ ├── Plugins │ │ │ ├── Android.meta │ │ │ ├── Android │ │ │ │ ├── libs.meta │ │ │ │ └── libs │ │ │ │ │ ├── arm64-v8a.meta │ │ │ │ │ ├── arm64-v8a │ │ │ │ │ ├── libbrotli.a.meta │ │ │ │ │ ├── libcares.a.meta │ │ │ │ │ ├── libhistogram.a.meta │ │ │ │ │ ├── libllhttp.a.meta │ │ │ │ │ ├── libnghttp2.a.meta │ │ │ │ │ ├── libnode.a.meta │ │ │ │ │ ├── libnode_stub.a.meta │ │ │ │ │ ├── libopenssl.a.meta │ │ │ │ │ ├── libpuerts.so.meta │ │ │ │ │ ├── libpuerts_il2cpp.a.meta │ │ │ │ │ ├── libuv.a.meta │ │ │ │ │ ├── libuvwasi.a.meta │ │ │ │ │ ├── libv8_base_without_compiler.a.meta │ │ │ │ │ ├── libv8_compiler.a.meta │ │ │ │ │ ├── libv8_initializers.a.meta │ │ │ │ │ ├── libv8_libbase.a.meta │ │ │ │ │ ├── libv8_libplatform.a.meta │ │ │ │ │ ├── libv8_snapshot.a.meta │ │ │ │ │ ├── libv8_zlib.a.meta │ │ │ │ │ ├── libwee8.a.meta │ │ │ │ │ └── libzlib.a.meta │ │ │ │ │ ├── armeabi-v7a.meta │ │ │ │ │ ├── armeabi-v7a │ │ │ │ │ ├── libbrotli.a.meta │ │ │ │ │ ├── libcares.a.meta │ │ │ │ │ ├── libhistogram.a.meta │ │ │ │ │ ├── libllhttp.a.meta │ │ │ │ │ ├── libnghttp2.a.meta │ │ │ │ │ ├── libnode.a.meta │ │ │ │ │ ├── libnode_stub.a.meta │ │ │ │ │ ├── libopenssl.a.meta │ │ │ │ │ ├── libpuerts.so.meta │ │ │ │ │ ├── libpuerts_il2cpp.a.meta │ │ │ │ │ ├── libuv.a.meta │ │ │ │ │ ├── libuvwasi.a.meta │ │ │ │ │ ├── libv8_base_without_compiler.a.meta │ │ │ │ │ ├── libv8_compiler.a.meta │ │ │ │ │ ├── libv8_initializers.a.meta │ │ │ │ │ ├── libv8_libbase.a.meta │ │ │ │ │ ├── libv8_libplatform.a.meta │ │ │ │ │ ├── libv8_snapshot.a.meta │ │ │ │ │ ├── libv8_zlib.a.meta │ │ │ │ │ ├── libwee8.a.meta │ │ │ │ │ └── libzlib.a.meta │ │ │ │ │ ├── x86_64.meta │ │ │ │ │ └── x86_64 │ │ │ │ │ ├── libpuerts.so.meta │ │ │ │ │ ├── libpuerts_il2cpp.a.meta │ │ │ │ │ └── libwee8.a.meta │ │ │ ├── OpenHarmony.meta │ │ │ ├── OpenHarmony │ │ │ │ ├── libs.meta │ │ │ │ └── libs │ │ │ │ │ ├── arm64-v8a.meta │ │ │ │ │ ├── arm64-v8a │ │ │ │ │ └── libpuerts.so.meta │ │ │ │ │ ├── armeabi-v7a.meta │ │ │ │ │ └── armeabi-v7a │ │ │ │ │ └── libpuerts.so.meta │ │ │ ├── iOS.meta │ │ │ ├── iOS │ │ │ │ ├── libbrotli.a.meta │ │ │ │ ├── libcares.a.meta │ │ │ │ ├── libhistogram.a.meta │ │ │ │ ├── libllhttp.a.meta │ │ │ │ ├── libnghttp2.a.meta │ │ │ │ ├── libnode.a.meta │ │ │ │ ├── libnode_stub.a.meta │ │ │ │ ├── libopenssl.a.meta │ │ │ │ ├── libpuerts.a.meta │ │ │ │ ├── libuv.a.meta │ │ │ │ ├── libuvwasi.a.meta │ │ │ │ ├── libv8_base_without_compiler.a.meta │ │ │ │ ├── libv8_compiler.a.meta │ │ │ │ ├── libv8_initializers.a.meta │ │ │ │ ├── libv8_libbase.a.meta │ │ │ │ ├── libv8_libplatform.a.meta │ │ │ │ ├── libv8_snapshot.a.meta │ │ │ │ ├── libv8_zlib.a.meta │ │ │ │ └── libzlib.a.meta │ │ │ ├── macOS.meta │ │ │ ├── macOS │ │ │ │ ├── arm64.meta │ │ │ │ ├── arm64 │ │ │ │ │ ├── libnode.93.dylib.meta │ │ │ │ │ └── libpuerts.dylib.meta │ │ │ │ ├── libnode.93.dylib.meta │ │ │ │ ├── puerts.bundle.meta │ │ │ │ ├── puerts_il2cpp.bundle.meta │ │ │ │ ├── x86_64.meta │ │ │ │ └── x86_64 │ │ │ │ │ ├── libnode.93.dylib.meta │ │ │ │ │ ├── puerts.bundle.meta │ │ │ │ │ └── puerts_il2cpp.bundle.meta │ │ │ ├── x86.meta │ │ │ ├── x86_64.meta │ │ │ └── x86_64 │ │ │ │ ├── libnode.dll.meta │ │ │ │ ├── libnode.so.93.meta │ │ │ │ ├── libpuerts.so.meta │ │ │ │ └── puerts.dll.meta │ │ │ ├── Runtime │ │ │ ├── Resources │ │ │ │ └── puerts │ │ │ │ │ ├── csharp.mjs │ │ │ │ │ ├── dispose.mjs │ │ │ │ │ ├── esm_bootstrap.cjs │ │ │ │ │ ├── events.mjs │ │ │ │ │ ├── init.mjs │ │ │ │ │ ├── init_il2cpp.mjs │ │ │ │ │ ├── log.mjs │ │ │ │ │ ├── module.mjs │ │ │ │ │ ├── nodepatch.mjs │ │ │ │ │ ├── polyfill.mjs │ │ │ │ │ ├── promises.mjs │ │ │ │ │ ├── timer.mjs │ │ │ │ │ └── websocketpp.mjs │ │ │ ├── Src │ │ │ │ ├── ArrayBuffer.cs │ │ │ │ ├── Backend.cs │ │ │ │ ├── Default │ │ │ │ │ ├── JSType │ │ │ │ │ │ ├── GenericDelegate.cs │ │ │ │ │ │ └── JSObject.cs │ │ │ │ │ ├── JsEnv.cs │ │ │ │ │ ├── Native │ │ │ │ │ │ ├── PuertsDLL.cs │ │ │ │ │ │ └── StaticCallbacks.cs │ │ │ │ │ ├── Translator │ │ │ │ │ │ ├── ArgumentHelper.cs │ │ │ │ │ │ ├── DataTranslate.cs │ │ │ │ │ │ ├── NativeValueApiGeneric.cs │ │ │ │ │ │ ├── ObjectPool.cs │ │ │ │ │ │ └── StaticTranslate.cs │ │ │ │ │ ├── TypeExtensions.cs │ │ │ │ │ ├── TypeMapping │ │ │ │ │ │ ├── TypeManager.cs │ │ │ │ │ │ └── TypeRegister.cs │ │ │ │ │ ├── Utils.cs │ │ │ │ │ └── Wrapper │ │ │ │ │ │ ├── GenericMethodWrap.cs │ │ │ │ │ │ ├── LazyWrap.cs │ │ │ │ │ │ ├── ReflectionWrap.cs │ │ │ │ │ │ └── StaticWrapRegister.cs │ │ │ │ ├── IL2Cpp │ │ │ │ │ ├── ArrayExtension.cs │ │ │ │ │ ├── ExtensionMethodInfos_Gen_Internal.cs │ │ │ │ │ ├── JSType │ │ │ │ │ │ └── JSObject.cs │ │ │ │ │ ├── JsEnv.cs │ │ │ │ │ ├── Native │ │ │ │ │ │ └── NativeAPI.cs │ │ │ │ │ ├── ObjectPool.cs │ │ │ │ │ ├── TypeRegister.cs │ │ │ │ │ └── TypeUtils.cs │ │ │ │ ├── Loader.cs │ │ │ │ ├── PathHelper.cs │ │ │ │ ├── RegisterInfoManager.cs │ │ │ │ └── TypedValue.cs │ │ │ └── com.tencent.puerts.core.asmdef │ │ │ ├── Typing │ │ │ └── puerts │ │ │ │ └── index.d.ts │ │ │ ├── changelog-hans.md │ │ │ ├── changelog.md │ │ │ └── package.json │ └── webgl │ │ ├── package.json │ │ └── upm │ │ ├── Changelog.md │ │ ├── Changelog.md.meta │ │ ├── Cli.meta │ │ ├── Cli │ │ └── Javascripts~ │ │ │ ├── cmd.js │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── PuertsWebglBuildProcessing.cs │ │ ├── PuertsWebglBuildProcessing.cs.meta │ │ ├── com.tencent.puerts.webgl.Editor.asmdef │ │ └── com.tencent.puerts.webgl.Editor.asmdef.meta │ │ ├── Javascripts~ │ │ ├── PuertsDLLMock │ │ │ ├── buffer.ts │ │ │ ├── build.js │ │ │ ├── declare.d.ts │ │ │ ├── dist │ │ │ │ └── puerts-runtime.js │ │ │ ├── index.ts │ │ │ ├── library.ts │ │ │ ├── mixins │ │ │ │ ├── getFromJSArgument.ts │ │ │ │ ├── getFromJSReturn.ts │ │ │ │ ├── register.ts │ │ │ │ ├── setToInvokeJSArgument.ts │ │ │ │ ├── setToJSInvokeReturn.ts │ │ │ │ └── setToJSOutArgument.ts │ │ │ ├── pesapiImpl.ts │ │ │ ├── tsconfig.json │ │ │ └── webpack.config.js │ │ └── package.json │ │ ├── LICENSE │ │ ├── LICENSE.meta │ │ ├── Runtime.meta │ │ ├── Runtime │ │ ├── Plugins.meta │ │ ├── Plugins │ │ │ ├── WebGL.meta │ │ │ └── WebGL │ │ │ │ ├── puerts.cpp │ │ │ │ ├── puerts.cpp.meta │ │ │ │ ├── puerts.jslib │ │ │ │ └── puerts.jslib.meta │ │ ├── WebGL.cs │ │ ├── WebGL.cs.meta │ │ ├── com.tencent.puerts.webgl.asmdef │ │ └── com.tencent.puerts.webgl.asmdef.meta │ │ ├── package.json │ │ ├── package.json.meta │ │ ├── readme.md │ │ └── readme.md.meta ├── README.md ├── cli │ ├── backend.mjs │ ├── backends.json │ ├── cmd.mjs │ ├── index.js │ ├── make.mjs │ └── test.mjs ├── native_src │ ├── CMakeLists.txt │ ├── Inc │ │ ├── BackendEnv.h │ │ ├── Common.h │ │ ├── CommonTypes.h │ │ ├── CppObjectMapper.h │ │ ├── DataTransfer.h │ │ ├── ExecuteModuleJSCode.h │ │ ├── IPuertsPlugin.h │ │ ├── JSClassRegister.h │ │ ├── JSEngine.h │ │ ├── JSFunction.h │ │ ├── Log.h │ │ ├── NamespaceDef.h │ │ ├── ObjectCacheNode.h │ │ ├── ObjectMapper.h │ │ ├── PString.h │ │ ├── PuertsNamespaceDef.h │ │ ├── TypeInfo.hpp │ │ ├── V8Utils.h │ │ └── pesapi.h │ ├── Src │ │ ├── BackendEnv.cpp │ │ ├── CppObjectMapper.cpp │ │ ├── DataTransfer.cpp │ │ ├── JSClassRegister.cpp │ │ ├── JSEngine.cpp │ │ ├── JSFunction.cpp │ │ ├── Log.cpp │ │ ├── PesapiAddonLoad.cpp │ │ ├── PesapiV8Impl.cpp │ │ ├── PluginImpl.cpp │ │ ├── Puerts.cpp │ │ ├── PuertsMultBackend.cpp │ │ └── pesapi_wrap.c │ ├── backend-quickjs │ │ ├── include │ │ │ ├── Blob │ │ │ │ ├── Android │ │ │ │ │ ├── arm64 │ │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ │ ├── armv7a │ │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ │ └── x64 │ │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ ├── Linux │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ ├── Win32 │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ ├── Win64 │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ ├── Win64MD │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ ├── iOS │ │ │ │ │ ├── arm64 │ │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ │ └── bitcode │ │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ ├── macOS │ │ │ │ │ └── SnapshotBlob.h │ │ │ │ └── macOS_arm64 │ │ │ │ │ └── SnapshotBlob.h │ │ │ ├── libplatform │ │ │ │ ├── libplatform-export.h │ │ │ │ └── libplatform.h │ │ │ ├── v8-platform.h │ │ │ ├── v8.h │ │ │ └── v8config.h │ │ ├── quickjs │ │ │ ├── _VERSION │ │ │ ├── cutils.c │ │ │ ├── cutils.h │ │ │ ├── libbf.c │ │ │ ├── libbf.h │ │ │ ├── libregexp-opcode.h │ │ │ ├── libregexp.c │ │ │ ├── libregexp.h │ │ │ ├── libunicode-table.h │ │ │ ├── libunicode.c │ │ │ ├── libunicode.h │ │ │ ├── list.h │ │ │ ├── quickjs-atom.h │ │ │ ├── quickjs-c-atomics.h │ │ │ ├── quickjs-opcode.h │ │ │ ├── quickjs.c │ │ │ ├── quickjs.h │ │ │ └── unicode_gen_def.h │ │ └── src │ │ │ └── v8-impl.cc │ ├── cmake │ │ ├── android.toolchain.cmake │ │ ├── android.windows.toolchain.cmake │ │ ├── iOS.cmake │ │ └── ios.toolchain.cmake │ └── papi-quickjs │ │ ├── include │ │ ├── CppObjectMapperQuickjs.h │ │ ├── ObjectCacheNodeQuickjs.h │ │ └── PapiData.h │ │ └── source │ │ ├── CppObjectMapperQuickjs.cpp │ │ └── PapiQuickjsImpl.cpp ├── package-lock.json ├── package.json ├── test │ ├── Src │ │ ├── Cases │ │ │ ├── API │ │ │ │ ├── EvalTest.cs │ │ │ │ ├── ForofTest.cs │ │ │ │ ├── NodeJSTest.cs │ │ │ │ ├── TimerTest.cs │ │ │ │ └── TypedValueTest.cs │ │ │ ├── AccessControlTest.cs │ │ │ ├── CSharpModuleTest.cs │ │ │ ├── CrossLang │ │ │ │ ├── BlittableCopyTest.cs │ │ │ │ ├── CrossLangTest.cs │ │ │ │ ├── DelegateTest.cs │ │ │ │ ├── ExtensionTest.cs │ │ │ │ ├── GenericTest.cs │ │ │ │ └── OptionalParametersTest.cs │ │ │ ├── ExceptionTest.cs │ │ │ ├── LazyWeakCJSTest.cs │ │ │ ├── MultiTest.cs │ │ │ └── WebsocketTest.cs │ │ ├── Resources │ │ │ ├── CSharpModuleTest │ │ │ │ ├── access_innerclass_test.mjs │ │ │ │ ├── array_extension_test.mjs │ │ │ │ ├── console_log_test.mjs │ │ │ │ ├── empty.mjs │ │ │ │ ├── forof_test.mjs │ │ │ │ └── generic_method_test.mjs │ │ │ ├── a_cjs.cjs │ │ │ ├── a_mjs.mjs │ │ │ ├── bootstrap_test.mjs │ │ │ ├── circular_m1.cjs │ │ │ ├── circular_m2.cjs │ │ │ ├── cjs │ │ │ │ └── whatever.cjs │ │ │ ├── eval-error │ │ │ │ └── whatever.mjs │ │ │ ├── import-circular │ │ │ │ ├── main.mjs │ │ │ │ ├── module1.mjs │ │ │ │ └── module2.mjs │ │ │ ├── import-eval-error │ │ │ │ ├── entry.mjs │ │ │ │ └── whatever.mjs │ │ │ ├── import-not-relative │ │ │ │ ├── lib │ │ │ │ │ └── test.mjs │ │ │ │ ├── main.mjs │ │ │ │ └── module2.mjs │ │ │ ├── import-package │ │ │ │ ├── index.js.txt │ │ │ │ └── lib.js.txt │ │ │ ├── import-relative │ │ │ │ ├── a │ │ │ │ │ └── entry.mjs │ │ │ │ └── b │ │ │ │ │ └── whatever.mjs │ │ │ ├── lazymodule.cjs │ │ │ ├── lazymodule1.cjs │ │ │ ├── lazymodule2.cjs │ │ │ ├── mjs │ │ │ │ └── whatever.mjs │ │ │ └── notfound │ │ │ │ └── entry.mjs │ │ ├── TestFramework │ │ │ └── Src │ │ │ │ └── Attributes.cs │ │ ├── UnitTestEnv.cs │ │ ├── UnitTestLoader.cs │ │ ├── com.tencent.puerts.unittest.asmdef │ │ └── package.json │ ├── dotnet │ │ └── Src │ │ │ ├── Helloworld.cs │ │ │ ├── TxtLoader.cs │ │ │ └── WrapperGenerator │ │ │ ├── PuerRegisterInfo_Gen.cs │ │ │ └── WrapperGenerate.cs │ └── unity │ │ ├── Assets │ │ ├── Editor │ │ │ ├── PuerCfg.cs │ │ │ ├── PuerCfg.cs.meta │ │ │ ├── TestBuilder.cs │ │ │ └── TestBuilder.cs.meta │ │ ├── Resources │ │ │ └── BillingMode.json │ │ ├── Scenes │ │ │ ├── HelloWorld.unity │ │ │ ├── HelloWorld.unity.meta │ │ │ ├── Test.unity │ │ │ └── Test.unity.meta │ │ ├── Scripts │ │ │ ├── HelloWorlder.cs │ │ │ ├── HelloWorlder.cs.meta │ │ │ ├── Tester.cs │ │ │ └── Tester.cs.meta │ │ └── link.xml │ │ ├── Packages │ │ ├── manifest.json │ │ └── packages-lock.json │ │ └── ProjectSettings │ │ ├── AudioManager.asset │ │ ├── AutoStreamingSettings.asset │ │ ├── ClusterInputManager.asset │ │ ├── DynamicsManager.asset │ │ ├── EditorBuildSettings.asset │ │ ├── EditorSettings.asset │ │ ├── GraphicsSettings.asset │ │ ├── InputManager.asset │ │ ├── MemorySettings.asset │ │ ├── NavMeshAreas.asset │ │ ├── PackageManagerSettings.asset │ │ ├── Physics2DSettings.asset │ │ ├── PresetManager.asset │ │ ├── ProjectSettings.asset │ │ ├── ProjectVersion.txt │ │ ├── QualitySettings.asset │ │ ├── TagManager.asset │ │ ├── TimeManager.asset │ │ ├── UnityConnectSettings.asset │ │ ├── VFXManager.asset │ │ ├── VersionControlSettings.asset │ │ └── boot.config ├── tsconfig.json └── v8cc │ ├── CMakeLists.txt │ └── v8cc.cc └── unreal ├── Puerts ├── Content │ └── JavaScript │ │ ├── PuertsEditor │ │ ├── CodeAnalyze.js │ │ ├── CodeAnalyze.js.map │ │ ├── TypeScriptInternal.js │ │ ├── TypeScriptInternal.js.map │ │ ├── UEMeta.js │ │ ├── UEMeta.js.map │ │ └── package.json │ │ ├── ffi │ │ ├── binding.js │ │ ├── buffer-ext.js │ │ ├── index.js │ │ └── type.js │ │ ├── puerts │ │ ├── argv.js │ │ ├── callable.js │ │ ├── events.js │ │ ├── first_run.js │ │ ├── hot_reload.js │ │ ├── jit_skeleton.js │ │ ├── jit_stub.js │ │ ├── log.js │ │ ├── message.js │ │ ├── modular.js │ │ ├── pesaddon.js │ │ ├── polyfill.js │ │ ├── promises.js │ │ ├── uelazyload.js │ │ ├── wasm3_helper.js │ │ └── websocketpp.js │ │ ├── react-umg │ │ └── index.js │ │ ├── thirdparty │ │ └── base64-binary.js │ │ ├── utils │ │ └── fs.js │ │ └── wasm │ │ ├── WasmMain.json │ │ ├── WasmMain.wasm │ │ ├── WasmMain_Editor.wasm │ │ ├── main.wasm │ │ ├── modules.json │ │ ├── test.wasm │ │ └── testvector.wasm ├── Puerts.uplugin ├── PuertsEditor │ ├── CodeAnalyze.ts │ ├── TypeScriptInternal.ts │ ├── UEMeta.ts │ ├── package.json │ └── tsconfig.json ├── Resources │ ├── ButtonIcon_40x.png │ └── Icon128.png ├── Source │ ├── CSharpParamDefaultValueMetas │ │ ├── CSharpParamDefaultValueMetas.cs │ │ └── CSharpParamDefaultValueMetas.ubtplugin.csproj │ ├── DeclarationGenerator │ │ ├── DeclarationGenerator.Build.cs │ │ ├── Private │ │ │ ├── CodeGenerator.cpp │ │ │ ├── DeclarationGenerator.cpp │ │ │ ├── GenDTSCommands.cpp │ │ │ ├── GenDTSStyle.cpp │ │ │ └── TemplateBindingGenerator.cpp │ │ └── Public │ │ │ ├── CodeGenerator.h │ │ │ ├── GenDTSCommands.h │ │ │ ├── GenDTSStyle.h │ │ │ ├── IDeclarationGenerator.h │ │ │ ├── TemplateBindingGenerator.h │ │ │ └── TypeScriptDeclarationGenerator.h │ ├── JsEnv │ │ ├── JsEnv.Build.cs │ │ ├── Private │ │ │ ├── ContainerMeta.cpp │ │ │ ├── ContainerMeta.h │ │ │ ├── ContainerWrapper.cpp │ │ │ ├── ContainerWrapper.h │ │ │ ├── CppObjectMapper.cpp │ │ │ ├── CppObjectMapper.h │ │ │ ├── DataTransfer.cpp │ │ │ ├── DefaultJSModuleLoader.cpp │ │ │ ├── DelegateWrapper.cpp │ │ │ ├── DelegateWrapper.h │ │ │ ├── DynamicDelegateProxy.cpp │ │ │ ├── DynamicDelegateProxy.h │ │ │ ├── Ext │ │ │ │ └── UEExtension.cpp │ │ │ ├── ExtensionMethods.cpp │ │ │ ├── FFIBinding.cpp │ │ │ ├── FunctionTranslator.cpp │ │ │ ├── FunctionTranslator.h │ │ │ ├── Gen │ │ │ │ ├── FBox2D_Wrap.cpp │ │ │ │ ├── FColor_Wrap.cpp │ │ │ │ ├── FGuid_Wrap.cpp │ │ │ │ ├── FIntPoint_Wrap.cpp │ │ │ │ ├── FIntVector_Wrap.cpp │ │ │ │ ├── FLinearColor_Wrap.cpp │ │ │ │ ├── FQuat_Wrap.cpp │ │ │ │ ├── FRotator_Wrap.cpp │ │ │ │ ├── FTransform_Wrap.cpp │ │ │ │ ├── FVector2D_Wrap.cpp │ │ │ │ ├── FVector4_Wrap.cpp │ │ │ │ ├── FVector_Wrap.cpp │ │ │ │ └── UsingTypeDecl.hpp │ │ │ ├── IOS │ │ │ │ └── PesapiFrameworkLoader.mm │ │ │ ├── JSAnimGeneratedClass.cpp │ │ │ ├── JSAnimGeneratedClass.h │ │ │ ├── JSClassRegister.cpp │ │ │ ├── JSGeneratedClass.cpp │ │ │ ├── JSGeneratedClass.h │ │ │ ├── JSGeneratedFunction.cpp │ │ │ ├── JSGeneratedFunction.h │ │ │ ├── JSLogger.cpp │ │ │ ├── JSWidgetGeneratedClass.cpp │ │ │ ├── JSWidgetGeneratedClass.h │ │ │ ├── JsEnv.cpp │ │ │ ├── JsEnvGroup.cpp │ │ │ ├── JsEnvImpl.cpp │ │ │ ├── JsEnvImpl.h │ │ │ ├── JsEnvModule.cpp │ │ │ ├── ObjectCacheNode.h │ │ │ ├── ObjectMapper.h │ │ │ ├── ObjectRetainer.cpp │ │ │ ├── PesapiAddonLoad.cpp │ │ │ ├── PesapiV8Impl.cpp │ │ │ ├── PromiseRejectCallback.hpp │ │ │ ├── PropertyTranslator.cpp │ │ │ ├── PropertyTranslator.h │ │ │ ├── PuertsWasm │ │ │ │ ├── WasmJsFunctionParams.cpp │ │ │ │ ├── WasmJsFunctionParams.h │ │ │ │ ├── WasmStaticUEBinding.cpp │ │ │ │ └── WasmTestForStaticBinding.cpp │ │ │ ├── SoftObjectWrapper.cpp │ │ │ ├── SoftObjectWrapper.h │ │ │ ├── SourceFileWatcher.cpp │ │ │ ├── StructWrapper.cpp │ │ │ ├── StructWrapper.h │ │ │ ├── TypeScriptBlueprint.cpp │ │ │ ├── TypeScriptGeneratedClass.cpp │ │ │ ├── V8InspectorImpl.cpp │ │ │ ├── V8InspectorImpl.h │ │ │ ├── V8Utils.cpp │ │ │ └── WebSocketImpl.cpp │ │ └── Public │ │ │ ├── ArrayBuffer.h │ │ │ ├── Binding.hpp │ │ │ ├── DataTransfer.h │ │ │ ├── DynamicInvoker.h │ │ │ ├── ExtensionMethods.h │ │ │ ├── FFIBinding.h │ │ │ ├── JSClassRegister.h │ │ │ ├── JSLogger.h │ │ │ ├── JSModuleLoader.h │ │ │ ├── JsEnv.h │ │ │ ├── JsEnvGroup.h │ │ │ ├── JsEnvModule.h │ │ │ ├── JsObject.h │ │ │ ├── NamespaceDef.h │ │ │ ├── Object.hpp │ │ │ ├── ObjectRetainer.h │ │ │ ├── PString.h │ │ │ ├── PathEscape.h │ │ │ ├── PesapiBackend.hpp │ │ │ ├── PesapiObject.hpp │ │ │ ├── PropertyMacros.h │ │ │ ├── PuertsNamespaceDef.h │ │ │ ├── ScriptBackend.hpp │ │ │ ├── SourceFileWatcher.h │ │ │ ├── StaticCall.hpp │ │ │ ├── StdFunctionConverter.hpp │ │ │ ├── TsDynamicInvoker.h │ │ │ ├── TypeInfo.hpp │ │ │ ├── TypeScriptBlueprint.h │ │ │ ├── TypeScriptGeneratedClass.h │ │ │ ├── UECompatible.h │ │ │ ├── UEDataBinding.hpp │ │ │ ├── V8Backend.hpp │ │ │ ├── V8FastCall.hpp │ │ │ ├── V8Object.hpp │ │ │ ├── V8Utils.h │ │ │ └── pesapi.h │ ├── ParamDefaultValueMetas │ │ ├── ParamDefaultValueMetas.Build.cs │ │ └── Private │ │ │ └── ParamDefaultValueMetasModule.cpp │ ├── Puerts │ │ ├── Private │ │ │ ├── PuertsModule.cpp │ │ │ ├── PuertsSetting.cpp │ │ │ └── PuertsSetting.h │ │ ├── Public │ │ │ └── PuertsModule.h │ │ └── Puerts.Build.cs │ ├── PuertsEditor │ │ ├── Private │ │ │ ├── FileSystemOperation.cpp │ │ │ ├── PEBlueprintAsset.cpp │ │ │ ├── PEBlueprintMetaData.cpp │ │ │ ├── PEDirectoryWatcher.cpp │ │ │ ├── PuertsEditorModule.cpp │ │ │ ├── TypeScriptCompilerContext.cpp │ │ │ └── TypeScriptCompilerContext.h │ │ ├── Public │ │ │ ├── FileSystemOperation.h │ │ │ ├── PEBlueprintAsset.h │ │ │ ├── PEBlueprintMetaData.h │ │ │ ├── PEDirectoryWatcher.h │ │ │ └── PuertsEditorModule.h │ │ └── PuertsEditor.Build.cs │ └── WasmCore │ │ ├── Private │ │ ├── Wasm3ExportDef.cpp │ │ ├── WasmCore.cpp │ │ ├── WasmEnv.cpp │ │ ├── WasmFunction.cpp │ │ ├── WasmModule.cpp │ │ ├── WasmModuleInstance.cpp │ │ ├── WasmRuntime.cpp │ │ └── WasmStaticLink.cpp │ │ ├── Public │ │ ├── Wasm3ExportDef.h │ │ ├── WasmBindingTemplate.hpp │ │ ├── WasmCommonIncludes.h │ │ ├── WasmCore.h │ │ ├── WasmEnv.h │ │ ├── WasmFunction.h │ │ ├── WasmModule.h │ │ ├── WasmModuleInstance.h │ │ ├── WasmRuntime.h │ │ └── WasmStaticLink.h │ │ ├── ThirdPart │ │ └── wasm3 │ │ │ ├── m3_api_libc.c │ │ │ ├── m3_api_libc.h │ │ │ ├── m3_api_meta_wasi.c │ │ │ ├── m3_api_tracer.c │ │ │ ├── m3_api_tracer.h │ │ │ ├── m3_api_uvwasi.c │ │ │ ├── m3_api_wasi.c │ │ │ ├── m3_api_wasi.h │ │ │ ├── m3_bind.c │ │ │ ├── m3_bind.h │ │ │ ├── m3_code.c │ │ │ ├── m3_code.h │ │ │ ├── m3_compile.c │ │ │ ├── m3_compile.h │ │ │ ├── m3_config.h │ │ │ ├── m3_config_platforms.h │ │ │ ├── m3_core.c │ │ │ ├── m3_core.h │ │ │ ├── m3_env.c │ │ │ ├── m3_env.h │ │ │ ├── m3_exception.h │ │ │ ├── m3_exec.c │ │ │ ├── m3_exec.h │ │ │ ├── m3_exec_defs.h │ │ │ ├── m3_function.c │ │ │ ├── m3_function.h │ │ │ ├── m3_info.c │ │ │ ├── m3_info.h │ │ │ ├── m3_math_utils.h │ │ │ ├── m3_module.c │ │ │ ├── m3_parse.c │ │ │ ├── wasm3.h │ │ │ └── wasm3_defs.h │ │ └── WasmCore.Build.cs ├── ThirdParty │ ├── Include │ │ ├── asio │ │ │ ├── asio.hpp │ │ │ └── asio │ │ │ │ ├── any_io_executor.hpp │ │ │ │ ├── associated_allocator.hpp │ │ │ │ ├── associated_cancellation_slot.hpp │ │ │ │ ├── associated_executor.hpp │ │ │ │ ├── associator.hpp │ │ │ │ ├── async_result.hpp │ │ │ │ ├── awaitable.hpp │ │ │ │ ├── basic_datagram_socket.hpp │ │ │ │ ├── basic_deadline_timer.hpp │ │ │ │ ├── basic_io_object.hpp │ │ │ │ ├── basic_raw_socket.hpp │ │ │ │ ├── basic_seq_packet_socket.hpp │ │ │ │ ├── basic_serial_port.hpp │ │ │ │ ├── basic_signal_set.hpp │ │ │ │ ├── basic_socket.hpp │ │ │ │ ├── basic_socket_acceptor.hpp │ │ │ │ ├── basic_socket_iostream.hpp │ │ │ │ ├── basic_socket_streambuf.hpp │ │ │ │ ├── basic_stream_socket.hpp │ │ │ │ ├── basic_streambuf.hpp │ │ │ │ ├── basic_streambuf_fwd.hpp │ │ │ │ ├── basic_waitable_timer.hpp │ │ │ │ ├── bind_cancellation_slot.hpp │ │ │ │ ├── bind_executor.hpp │ │ │ │ ├── buffer.hpp │ │ │ │ ├── buffered_read_stream.hpp │ │ │ │ ├── buffered_read_stream_fwd.hpp │ │ │ │ ├── buffered_stream.hpp │ │ │ │ ├── buffered_stream_fwd.hpp │ │ │ │ ├── buffered_write_stream.hpp │ │ │ │ ├── buffered_write_stream_fwd.hpp │ │ │ │ ├── buffers_iterator.hpp │ │ │ │ ├── cancellation_signal.hpp │ │ │ │ ├── cancellation_state.hpp │ │ │ │ ├── cancellation_type.hpp │ │ │ │ ├── co_spawn.hpp │ │ │ │ ├── completion_condition.hpp │ │ │ │ ├── compose.hpp │ │ │ │ ├── connect.hpp │ │ │ │ ├── coroutine.hpp │ │ │ │ ├── deadline_timer.hpp │ │ │ │ ├── defer.hpp │ │ │ │ ├── detached.hpp │ │ │ │ ├── detail │ │ │ │ ├── array.hpp │ │ │ │ ├── array_fwd.hpp │ │ │ │ ├── assert.hpp │ │ │ │ ├── atomic_count.hpp │ │ │ │ ├── base_from_cancellation_state.hpp │ │ │ │ ├── base_from_completion_cond.hpp │ │ │ │ ├── bind_handler.hpp │ │ │ │ ├── blocking_executor_op.hpp │ │ │ │ ├── buffer_resize_guard.hpp │ │ │ │ ├── buffer_sequence_adapter.hpp │ │ │ │ ├── buffered_stream_storage.hpp │ │ │ │ ├── bulk_executor_op.hpp │ │ │ │ ├── call_stack.hpp │ │ │ │ ├── chrono.hpp │ │ │ │ ├── chrono_time_traits.hpp │ │ │ │ ├── completion_handler.hpp │ │ │ │ ├── concurrency_hint.hpp │ │ │ │ ├── conditionally_enabled_event.hpp │ │ │ │ ├── conditionally_enabled_mutex.hpp │ │ │ │ ├── config.hpp │ │ │ │ ├── consuming_buffers.hpp │ │ │ │ ├── cstddef.hpp │ │ │ │ ├── cstdint.hpp │ │ │ │ ├── date_time_fwd.hpp │ │ │ │ ├── deadline_timer_service.hpp │ │ │ │ ├── dependent_type.hpp │ │ │ │ ├── descriptor_ops.hpp │ │ │ │ ├── descriptor_read_op.hpp │ │ │ │ ├── descriptor_write_op.hpp │ │ │ │ ├── dev_poll_reactor.hpp │ │ │ │ ├── epoll_reactor.hpp │ │ │ │ ├── event.hpp │ │ │ │ ├── eventfd_select_interrupter.hpp │ │ │ │ ├── executor_function.hpp │ │ │ │ ├── executor_op.hpp │ │ │ │ ├── fd_set_adapter.hpp │ │ │ │ ├── fenced_block.hpp │ │ │ │ ├── functional.hpp │ │ │ │ ├── future.hpp │ │ │ │ ├── gcc_arm_fenced_block.hpp │ │ │ │ ├── gcc_hppa_fenced_block.hpp │ │ │ │ ├── gcc_sync_fenced_block.hpp │ │ │ │ ├── gcc_x86_fenced_block.hpp │ │ │ │ ├── global.hpp │ │ │ │ ├── handler_alloc_helpers.hpp │ │ │ │ ├── handler_cont_helpers.hpp │ │ │ │ ├── handler_invoke_helpers.hpp │ │ │ │ ├── handler_tracking.hpp │ │ │ │ ├── handler_type_requirements.hpp │ │ │ │ ├── handler_work.hpp │ │ │ │ ├── hash_map.hpp │ │ │ │ ├── impl │ │ │ │ │ ├── buffer_sequence_adapter.ipp │ │ │ │ │ ├── descriptor_ops.ipp │ │ │ │ │ ├── dev_poll_reactor.hpp │ │ │ │ │ ├── dev_poll_reactor.ipp │ │ │ │ │ ├── epoll_reactor.hpp │ │ │ │ │ ├── epoll_reactor.ipp │ │ │ │ │ ├── eventfd_select_interrupter.ipp │ │ │ │ │ ├── handler_tracking.ipp │ │ │ │ │ ├── kqueue_reactor.hpp │ │ │ │ │ ├── kqueue_reactor.ipp │ │ │ │ │ ├── null_event.ipp │ │ │ │ │ ├── pipe_select_interrupter.ipp │ │ │ │ │ ├── posix_event.ipp │ │ │ │ │ ├── posix_mutex.ipp │ │ │ │ │ ├── posix_thread.ipp │ │ │ │ │ ├── posix_tss_ptr.ipp │ │ │ │ │ ├── reactive_descriptor_service.ipp │ │ │ │ │ ├── reactive_serial_port_service.ipp │ │ │ │ │ ├── reactive_socket_service_base.ipp │ │ │ │ │ ├── resolver_service_base.ipp │ │ │ │ │ ├── scheduler.ipp │ │ │ │ │ ├── select_reactor.hpp │ │ │ │ │ ├── select_reactor.ipp │ │ │ │ │ ├── service_registry.hpp │ │ │ │ │ ├── service_registry.ipp │ │ │ │ │ ├── signal_set_service.ipp │ │ │ │ │ ├── socket_ops.ipp │ │ │ │ │ ├── socket_select_interrupter.ipp │ │ │ │ │ ├── strand_executor_service.hpp │ │ │ │ │ ├── strand_executor_service.ipp │ │ │ │ │ ├── strand_service.hpp │ │ │ │ │ ├── strand_service.ipp │ │ │ │ │ ├── thread_context.ipp │ │ │ │ │ ├── throw_error.ipp │ │ │ │ │ ├── timer_queue_ptime.ipp │ │ │ │ │ ├── timer_queue_set.ipp │ │ │ │ │ ├── win_event.ipp │ │ │ │ │ ├── win_iocp_handle_service.ipp │ │ │ │ │ ├── win_iocp_io_context.hpp │ │ │ │ │ ├── win_iocp_io_context.ipp │ │ │ │ │ ├── win_iocp_serial_port_service.ipp │ │ │ │ │ ├── win_iocp_socket_service_base.ipp │ │ │ │ │ ├── win_mutex.ipp │ │ │ │ │ ├── win_object_handle_service.ipp │ │ │ │ │ ├── win_static_mutex.ipp │ │ │ │ │ ├── win_thread.ipp │ │ │ │ │ ├── win_tss_ptr.ipp │ │ │ │ │ ├── winrt_ssocket_service_base.ipp │ │ │ │ │ ├── winrt_timer_scheduler.hpp │ │ │ │ │ ├── winrt_timer_scheduler.ipp │ │ │ │ │ └── winsock_init.ipp │ │ │ │ ├── io_control.hpp │ │ │ │ ├── io_object_impl.hpp │ │ │ │ ├── is_buffer_sequence.hpp │ │ │ │ ├── is_executor.hpp │ │ │ │ ├── keyword_tss_ptr.hpp │ │ │ │ ├── kqueue_reactor.hpp │ │ │ │ ├── limits.hpp │ │ │ │ ├── local_free_on_block_exit.hpp │ │ │ │ ├── macos_fenced_block.hpp │ │ │ │ ├── memory.hpp │ │ │ │ ├── mutex.hpp │ │ │ │ ├── non_const_lvalue.hpp │ │ │ │ ├── noncopyable.hpp │ │ │ │ ├── null_event.hpp │ │ │ │ ├── null_fenced_block.hpp │ │ │ │ ├── null_global.hpp │ │ │ │ ├── null_mutex.hpp │ │ │ │ ├── null_reactor.hpp │ │ │ │ ├── null_signal_blocker.hpp │ │ │ │ ├── null_socket_service.hpp │ │ │ │ ├── null_static_mutex.hpp │ │ │ │ ├── null_thread.hpp │ │ │ │ ├── null_tss_ptr.hpp │ │ │ │ ├── object_pool.hpp │ │ │ │ ├── old_win_sdk_compat.hpp │ │ │ │ ├── op_queue.hpp │ │ │ │ ├── operation.hpp │ │ │ │ ├── pipe_select_interrupter.hpp │ │ │ │ ├── pop_options.hpp │ │ │ │ ├── posix_event.hpp │ │ │ │ ├── posix_fd_set_adapter.hpp │ │ │ │ ├── posix_global.hpp │ │ │ │ ├── posix_mutex.hpp │ │ │ │ ├── posix_signal_blocker.hpp │ │ │ │ ├── posix_static_mutex.hpp │ │ │ │ ├── posix_thread.hpp │ │ │ │ ├── posix_tss_ptr.hpp │ │ │ │ ├── push_options.hpp │ │ │ │ ├── reactive_descriptor_service.hpp │ │ │ │ ├── reactive_null_buffers_op.hpp │ │ │ │ ├── reactive_serial_port_service.hpp │ │ │ │ ├── reactive_socket_accept_op.hpp │ │ │ │ ├── reactive_socket_connect_op.hpp │ │ │ │ ├── reactive_socket_recv_op.hpp │ │ │ │ ├── reactive_socket_recvfrom_op.hpp │ │ │ │ ├── reactive_socket_recvmsg_op.hpp │ │ │ │ ├── reactive_socket_send_op.hpp │ │ │ │ ├── reactive_socket_sendto_op.hpp │ │ │ │ ├── reactive_socket_service.hpp │ │ │ │ ├── reactive_socket_service_base.hpp │ │ │ │ ├── reactive_wait_op.hpp │ │ │ │ ├── reactor.hpp │ │ │ │ ├── reactor_fwd.hpp │ │ │ │ ├── reactor_op.hpp │ │ │ │ ├── reactor_op_queue.hpp │ │ │ │ ├── recycling_allocator.hpp │ │ │ │ ├── regex_fwd.hpp │ │ │ │ ├── resolve_endpoint_op.hpp │ │ │ │ ├── resolve_op.hpp │ │ │ │ ├── resolve_query_op.hpp │ │ │ │ ├── resolver_service.hpp │ │ │ │ ├── resolver_service_base.hpp │ │ │ │ ├── scheduler.hpp │ │ │ │ ├── scheduler_operation.hpp │ │ │ │ ├── scheduler_thread_info.hpp │ │ │ │ ├── scoped_lock.hpp │ │ │ │ ├── scoped_ptr.hpp │ │ │ │ ├── select_interrupter.hpp │ │ │ │ ├── select_reactor.hpp │ │ │ │ ├── service_registry.hpp │ │ │ │ ├── signal_blocker.hpp │ │ │ │ ├── signal_handler.hpp │ │ │ │ ├── signal_init.hpp │ │ │ │ ├── signal_op.hpp │ │ │ │ ├── signal_set_service.hpp │ │ │ │ ├── socket_holder.hpp │ │ │ │ ├── socket_ops.hpp │ │ │ │ ├── socket_option.hpp │ │ │ │ ├── socket_select_interrupter.hpp │ │ │ │ ├── socket_types.hpp │ │ │ │ ├── solaris_fenced_block.hpp │ │ │ │ ├── source_location.hpp │ │ │ │ ├── static_mutex.hpp │ │ │ │ ├── std_event.hpp │ │ │ │ ├── std_fenced_block.hpp │ │ │ │ ├── std_global.hpp │ │ │ │ ├── std_mutex.hpp │ │ │ │ ├── std_static_mutex.hpp │ │ │ │ ├── std_thread.hpp │ │ │ │ ├── strand_executor_service.hpp │ │ │ │ ├── strand_service.hpp │ │ │ │ ├── string_view.hpp │ │ │ │ ├── thread.hpp │ │ │ │ ├── thread_context.hpp │ │ │ │ ├── thread_group.hpp │ │ │ │ ├── thread_info_base.hpp │ │ │ │ ├── throw_error.hpp │ │ │ │ ├── throw_exception.hpp │ │ │ │ ├── timer_queue.hpp │ │ │ │ ├── timer_queue_base.hpp │ │ │ │ ├── timer_queue_ptime.hpp │ │ │ │ ├── timer_queue_set.hpp │ │ │ │ ├── timer_scheduler.hpp │ │ │ │ ├── timer_scheduler_fwd.hpp │ │ │ │ ├── tss_ptr.hpp │ │ │ │ ├── type_traits.hpp │ │ │ │ ├── variadic_templates.hpp │ │ │ │ ├── wait_handler.hpp │ │ │ │ ├── wait_op.hpp │ │ │ │ ├── win_event.hpp │ │ │ │ ├── win_fd_set_adapter.hpp │ │ │ │ ├── win_fenced_block.hpp │ │ │ │ ├── win_global.hpp │ │ │ │ ├── win_iocp_handle_read_op.hpp │ │ │ │ ├── win_iocp_handle_service.hpp │ │ │ │ ├── win_iocp_handle_write_op.hpp │ │ │ │ ├── win_iocp_io_context.hpp │ │ │ │ ├── win_iocp_null_buffers_op.hpp │ │ │ │ ├── win_iocp_operation.hpp │ │ │ │ ├── win_iocp_overlapped_op.hpp │ │ │ │ ├── win_iocp_overlapped_ptr.hpp │ │ │ │ ├── win_iocp_serial_port_service.hpp │ │ │ │ ├── win_iocp_socket_accept_op.hpp │ │ │ │ ├── win_iocp_socket_connect_op.hpp │ │ │ │ ├── win_iocp_socket_recv_op.hpp │ │ │ │ ├── win_iocp_socket_recvfrom_op.hpp │ │ │ │ ├── win_iocp_socket_recvmsg_op.hpp │ │ │ │ ├── win_iocp_socket_send_op.hpp │ │ │ │ ├── win_iocp_socket_service.hpp │ │ │ │ ├── win_iocp_socket_service_base.hpp │ │ │ │ ├── win_iocp_thread_info.hpp │ │ │ │ ├── win_iocp_wait_op.hpp │ │ │ │ ├── win_mutex.hpp │ │ │ │ ├── win_object_handle_service.hpp │ │ │ │ ├── win_static_mutex.hpp │ │ │ │ ├── win_thread.hpp │ │ │ │ ├── win_tss_ptr.hpp │ │ │ │ ├── winapp_thread.hpp │ │ │ │ ├── wince_thread.hpp │ │ │ │ ├── winrt_async_manager.hpp │ │ │ │ ├── winrt_async_op.hpp │ │ │ │ ├── winrt_resolve_op.hpp │ │ │ │ ├── winrt_resolver_service.hpp │ │ │ │ ├── winrt_socket_connect_op.hpp │ │ │ │ ├── winrt_socket_recv_op.hpp │ │ │ │ ├── winrt_socket_send_op.hpp │ │ │ │ ├── winrt_ssocket_service.hpp │ │ │ │ ├── winrt_ssocket_service_base.hpp │ │ │ │ ├── winrt_timer_scheduler.hpp │ │ │ │ ├── winrt_utils.hpp │ │ │ │ ├── winsock_init.hpp │ │ │ │ ├── work_dispatcher.hpp │ │ │ │ └── wrapped_handler.hpp │ │ │ │ ├── dispatch.hpp │ │ │ │ ├── error.hpp │ │ │ │ ├── error_code.hpp │ │ │ │ ├── execution.hpp │ │ │ │ ├── execution │ │ │ │ ├── allocator.hpp │ │ │ │ ├── any_executor.hpp │ │ │ │ ├── bad_executor.hpp │ │ │ │ ├── blocking.hpp │ │ │ │ ├── blocking_adaptation.hpp │ │ │ │ ├── bulk_execute.hpp │ │ │ │ ├── bulk_guarantee.hpp │ │ │ │ ├── connect.hpp │ │ │ │ ├── context.hpp │ │ │ │ ├── context_as.hpp │ │ │ │ ├── detail │ │ │ │ │ ├── as_invocable.hpp │ │ │ │ │ ├── as_operation.hpp │ │ │ │ │ ├── as_receiver.hpp │ │ │ │ │ ├── bulk_sender.hpp │ │ │ │ │ ├── submit_receiver.hpp │ │ │ │ │ └── void_receiver.hpp │ │ │ │ ├── execute.hpp │ │ │ │ ├── executor.hpp │ │ │ │ ├── impl │ │ │ │ │ ├── bad_executor.ipp │ │ │ │ │ └── receiver_invocation_error.ipp │ │ │ │ ├── invocable_archetype.hpp │ │ │ │ ├── mapping.hpp │ │ │ │ ├── occupancy.hpp │ │ │ │ ├── operation_state.hpp │ │ │ │ ├── outstanding_work.hpp │ │ │ │ ├── prefer_only.hpp │ │ │ │ ├── receiver.hpp │ │ │ │ ├── receiver_invocation_error.hpp │ │ │ │ ├── relationship.hpp │ │ │ │ ├── schedule.hpp │ │ │ │ ├── scheduler.hpp │ │ │ │ ├── sender.hpp │ │ │ │ ├── set_done.hpp │ │ │ │ ├── set_error.hpp │ │ │ │ ├── set_value.hpp │ │ │ │ ├── start.hpp │ │ │ │ └── submit.hpp │ │ │ │ ├── execution_context.hpp │ │ │ │ ├── executor.hpp │ │ │ │ ├── executor_work_guard.hpp │ │ │ │ ├── experimental │ │ │ │ ├── append.hpp │ │ │ │ ├── as_single.hpp │ │ │ │ ├── as_tuple.hpp │ │ │ │ ├── awaitable_operators.hpp │ │ │ │ ├── cancellation_condition.hpp │ │ │ │ ├── coro.hpp │ │ │ │ ├── deferred.hpp │ │ │ │ ├── detail │ │ │ │ │ ├── completion_handler_erasure.hpp │ │ │ │ │ ├── coro_promise_allocator.hpp │ │ │ │ │ ├── coro_traits.hpp │ │ │ │ │ └── partial_promise.hpp │ │ │ │ ├── impl │ │ │ │ │ ├── append.hpp │ │ │ │ │ ├── as_single.hpp │ │ │ │ │ ├── as_tuple.hpp │ │ │ │ │ ├── deferred.hpp │ │ │ │ │ ├── parallel_group.hpp │ │ │ │ │ ├── prepend.hpp │ │ │ │ │ └── promise.hpp │ │ │ │ ├── parallel_group.hpp │ │ │ │ ├── prepend.hpp │ │ │ │ ├── promise.hpp │ │ │ │ └── use_coro.hpp │ │ │ │ ├── generic │ │ │ │ ├── basic_endpoint.hpp │ │ │ │ ├── datagram_protocol.hpp │ │ │ │ ├── detail │ │ │ │ │ ├── endpoint.hpp │ │ │ │ │ └── impl │ │ │ │ │ │ └── endpoint.ipp │ │ │ │ ├── raw_protocol.hpp │ │ │ │ ├── seq_packet_protocol.hpp │ │ │ │ └── stream_protocol.hpp │ │ │ │ ├── handler_alloc_hook.hpp │ │ │ │ ├── handler_continuation_hook.hpp │ │ │ │ ├── handler_invoke_hook.hpp │ │ │ │ ├── high_resolution_timer.hpp │ │ │ │ ├── impl │ │ │ │ ├── awaitable.hpp │ │ │ │ ├── buffered_read_stream.hpp │ │ │ │ ├── buffered_write_stream.hpp │ │ │ │ ├── co_spawn.hpp │ │ │ │ ├── compose.hpp │ │ │ │ ├── connect.hpp │ │ │ │ ├── defer.hpp │ │ │ │ ├── detached.hpp │ │ │ │ ├── dispatch.hpp │ │ │ │ ├── error.ipp │ │ │ │ ├── error_code.ipp │ │ │ │ ├── execution_context.hpp │ │ │ │ ├── execution_context.ipp │ │ │ │ ├── executor.hpp │ │ │ │ ├── executor.ipp │ │ │ │ ├── handler_alloc_hook.ipp │ │ │ │ ├── io_context.hpp │ │ │ │ ├── io_context.ipp │ │ │ │ ├── multiple_exceptions.ipp │ │ │ │ ├── post.hpp │ │ │ │ ├── read.hpp │ │ │ │ ├── read_at.hpp │ │ │ │ ├── read_until.hpp │ │ │ │ ├── redirect_error.hpp │ │ │ │ ├── serial_port_base.hpp │ │ │ │ ├── serial_port_base.ipp │ │ │ │ ├── spawn.hpp │ │ │ │ ├── src.hpp │ │ │ │ ├── system_context.hpp │ │ │ │ ├── system_context.ipp │ │ │ │ ├── system_executor.hpp │ │ │ │ ├── thread_pool.hpp │ │ │ │ ├── thread_pool.ipp │ │ │ │ ├── use_awaitable.hpp │ │ │ │ ├── use_future.hpp │ │ │ │ ├── write.hpp │ │ │ │ └── write_at.hpp │ │ │ │ ├── io_context.hpp │ │ │ │ ├── io_context_strand.hpp │ │ │ │ ├── io_service.hpp │ │ │ │ ├── io_service_strand.hpp │ │ │ │ ├── ip │ │ │ │ ├── address.hpp │ │ │ │ ├── address_v4.hpp │ │ │ │ ├── address_v4_iterator.hpp │ │ │ │ ├── address_v4_range.hpp │ │ │ │ ├── address_v6.hpp │ │ │ │ ├── address_v6_iterator.hpp │ │ │ │ ├── address_v6_range.hpp │ │ │ │ ├── bad_address_cast.hpp │ │ │ │ ├── basic_endpoint.hpp │ │ │ │ ├── basic_resolver.hpp │ │ │ │ ├── basic_resolver_entry.hpp │ │ │ │ ├── basic_resolver_iterator.hpp │ │ │ │ ├── basic_resolver_query.hpp │ │ │ │ ├── basic_resolver_results.hpp │ │ │ │ ├── detail │ │ │ │ │ ├── endpoint.hpp │ │ │ │ │ ├── impl │ │ │ │ │ │ └── endpoint.ipp │ │ │ │ │ └── socket_option.hpp │ │ │ │ ├── host_name.hpp │ │ │ │ ├── icmp.hpp │ │ │ │ ├── impl │ │ │ │ │ ├── address.hpp │ │ │ │ │ ├── address.ipp │ │ │ │ │ ├── address_v4.hpp │ │ │ │ │ ├── address_v4.ipp │ │ │ │ │ ├── address_v6.hpp │ │ │ │ │ ├── address_v6.ipp │ │ │ │ │ ├── basic_endpoint.hpp │ │ │ │ │ ├── host_name.ipp │ │ │ │ │ ├── network_v4.hpp │ │ │ │ │ ├── network_v4.ipp │ │ │ │ │ ├── network_v6.hpp │ │ │ │ │ └── network_v6.ipp │ │ │ │ ├── multicast.hpp │ │ │ │ ├── network_v4.hpp │ │ │ │ ├── network_v6.hpp │ │ │ │ ├── resolver_base.hpp │ │ │ │ ├── resolver_query_base.hpp │ │ │ │ ├── tcp.hpp │ │ │ │ ├── udp.hpp │ │ │ │ ├── unicast.hpp │ │ │ │ └── v6_only.hpp │ │ │ │ ├── is_applicable_property.hpp │ │ │ │ ├── is_executor.hpp │ │ │ │ ├── is_read_buffered.hpp │ │ │ │ ├── is_write_buffered.hpp │ │ │ │ ├── local │ │ │ │ ├── basic_endpoint.hpp │ │ │ │ ├── connect_pair.hpp │ │ │ │ ├── datagram_protocol.hpp │ │ │ │ ├── detail │ │ │ │ │ ├── endpoint.hpp │ │ │ │ │ └── impl │ │ │ │ │ │ └── endpoint.ipp │ │ │ │ └── stream_protocol.hpp │ │ │ │ ├── multiple_exceptions.hpp │ │ │ │ ├── packaged_task.hpp │ │ │ │ ├── placeholders.hpp │ │ │ │ ├── posix │ │ │ │ ├── basic_descriptor.hpp │ │ │ │ ├── basic_stream_descriptor.hpp │ │ │ │ ├── descriptor.hpp │ │ │ │ ├── descriptor_base.hpp │ │ │ │ └── stream_descriptor.hpp │ │ │ │ ├── post.hpp │ │ │ │ ├── prefer.hpp │ │ │ │ ├── query.hpp │ │ │ │ ├── read.hpp │ │ │ │ ├── read_at.hpp │ │ │ │ ├── read_until.hpp │ │ │ │ ├── redirect_error.hpp │ │ │ │ ├── require.hpp │ │ │ │ ├── require_concept.hpp │ │ │ │ ├── serial_port.hpp │ │ │ │ ├── serial_port_base.hpp │ │ │ │ ├── signal_set.hpp │ │ │ │ ├── socket_base.hpp │ │ │ │ ├── spawn.hpp │ │ │ │ ├── ssl.hpp │ │ │ │ ├── ssl │ │ │ │ ├── context.hpp │ │ │ │ ├── context_base.hpp │ │ │ │ ├── detail │ │ │ │ │ ├── buffered_handshake_op.hpp │ │ │ │ │ ├── engine.hpp │ │ │ │ │ ├── handshake_op.hpp │ │ │ │ │ ├── impl │ │ │ │ │ │ ├── engine.ipp │ │ │ │ │ │ └── openssl_init.ipp │ │ │ │ │ ├── io.hpp │ │ │ │ │ ├── openssl_init.hpp │ │ │ │ │ ├── openssl_types.hpp │ │ │ │ │ ├── password_callback.hpp │ │ │ │ │ ├── read_op.hpp │ │ │ │ │ ├── shutdown_op.hpp │ │ │ │ │ ├── stream_core.hpp │ │ │ │ │ ├── verify_callback.hpp │ │ │ │ │ └── write_op.hpp │ │ │ │ ├── error.hpp │ │ │ │ ├── host_name_verification.hpp │ │ │ │ ├── impl │ │ │ │ │ ├── context.hpp │ │ │ │ │ ├── context.ipp │ │ │ │ │ ├── error.ipp │ │ │ │ │ ├── host_name_verification.ipp │ │ │ │ │ ├── rfc2818_verification.ipp │ │ │ │ │ └── src.hpp │ │ │ │ ├── rfc2818_verification.hpp │ │ │ │ ├── stream.hpp │ │ │ │ ├── stream_base.hpp │ │ │ │ ├── verify_context.hpp │ │ │ │ └── verify_mode.hpp │ │ │ │ ├── static_thread_pool.hpp │ │ │ │ ├── steady_timer.hpp │ │ │ │ ├── strand.hpp │ │ │ │ ├── streambuf.hpp │ │ │ │ ├── system_context.hpp │ │ │ │ ├── system_error.hpp │ │ │ │ ├── system_executor.hpp │ │ │ │ ├── system_timer.hpp │ │ │ │ ├── this_coro.hpp │ │ │ │ ├── thread.hpp │ │ │ │ ├── thread_pool.hpp │ │ │ │ ├── time_traits.hpp │ │ │ │ ├── traits │ │ │ │ ├── bulk_execute_free.hpp │ │ │ │ ├── bulk_execute_member.hpp │ │ │ │ ├── connect_free.hpp │ │ │ │ ├── connect_member.hpp │ │ │ │ ├── equality_comparable.hpp │ │ │ │ ├── execute_free.hpp │ │ │ │ ├── execute_member.hpp │ │ │ │ ├── prefer_free.hpp │ │ │ │ ├── prefer_member.hpp │ │ │ │ ├── query_free.hpp │ │ │ │ ├── query_member.hpp │ │ │ │ ├── query_static_constexpr_member.hpp │ │ │ │ ├── require_concept_free.hpp │ │ │ │ ├── require_concept_member.hpp │ │ │ │ ├── require_free.hpp │ │ │ │ ├── require_member.hpp │ │ │ │ ├── schedule_free.hpp │ │ │ │ ├── schedule_member.hpp │ │ │ │ ├── set_done_free.hpp │ │ │ │ ├── set_done_member.hpp │ │ │ │ ├── set_error_free.hpp │ │ │ │ ├── set_error_member.hpp │ │ │ │ ├── set_value_free.hpp │ │ │ │ ├── set_value_member.hpp │ │ │ │ ├── start_free.hpp │ │ │ │ ├── start_member.hpp │ │ │ │ ├── static_query.hpp │ │ │ │ ├── static_require.hpp │ │ │ │ ├── static_require_concept.hpp │ │ │ │ ├── submit_free.hpp │ │ │ │ └── submit_member.hpp │ │ │ │ ├── ts │ │ │ │ ├── buffer.hpp │ │ │ │ ├── executor.hpp │ │ │ │ ├── internet.hpp │ │ │ │ ├── io_context.hpp │ │ │ │ ├── net.hpp │ │ │ │ ├── netfwd.hpp │ │ │ │ ├── socket.hpp │ │ │ │ └── timer.hpp │ │ │ │ ├── unyield.hpp │ │ │ │ ├── use_awaitable.hpp │ │ │ │ ├── use_future.hpp │ │ │ │ ├── uses_executor.hpp │ │ │ │ ├── version.hpp │ │ │ │ ├── wait_traits.hpp │ │ │ │ ├── windows │ │ │ │ ├── basic_object_handle.hpp │ │ │ │ ├── basic_overlapped_handle.hpp │ │ │ │ ├── basic_random_access_handle.hpp │ │ │ │ ├── basic_stream_handle.hpp │ │ │ │ ├── object_handle.hpp │ │ │ │ ├── overlapped_handle.hpp │ │ │ │ ├── overlapped_ptr.hpp │ │ │ │ ├── random_access_handle.hpp │ │ │ │ └── stream_handle.hpp │ │ │ │ ├── write.hpp │ │ │ │ ├── write_at.hpp │ │ │ │ └── yield.hpp │ │ ├── ffi │ │ │ ├── Android │ │ │ │ ├── arm64-v8a │ │ │ │ │ ├── ffi.h │ │ │ │ │ ├── fficonfig.h │ │ │ │ │ └── ffitarget.h │ │ │ │ └── armeabi-v7a │ │ │ │ │ ├── ffi.h │ │ │ │ │ ├── fficonfig.h │ │ │ │ │ └── ffitarget.h │ │ │ ├── Win64 │ │ │ │ ├── ffi.h │ │ │ │ ├── fficonfig.h │ │ │ │ └── ffitarget.h │ │ │ ├── iOS │ │ │ │ ├── ffi.h │ │ │ │ ├── ffi_arm64.h │ │ │ │ ├── ffitarget.h │ │ │ │ └── ffitarget_arm64.h │ │ │ └── macOS │ │ │ │ ├── ffi.h │ │ │ │ └── ffitarget.h │ │ └── websocketpp │ │ │ └── websocketpp │ │ │ ├── CMakeLists.txt │ │ │ ├── base64 │ │ │ └── base64.hpp │ │ │ ├── client.hpp │ │ │ ├── close.hpp │ │ │ ├── common │ │ │ ├── asio.hpp │ │ │ ├── asio_ssl.hpp │ │ │ ├── chrono.hpp │ │ │ ├── connection_hdl.hpp │ │ │ ├── cpp11.hpp │ │ │ ├── functional.hpp │ │ │ ├── md5.hpp │ │ │ ├── memory.hpp │ │ │ ├── network.hpp │ │ │ ├── platforms.hpp │ │ │ ├── random.hpp │ │ │ ├── regex.hpp │ │ │ ├── stdint.hpp │ │ │ ├── system_error.hpp │ │ │ ├── thread.hpp │ │ │ ├── time.hpp │ │ │ └── type_traits.hpp │ │ │ ├── concurrency │ │ │ ├── basic.hpp │ │ │ └── none.hpp │ │ │ ├── config │ │ │ ├── asio.hpp │ │ │ ├── asio_client.hpp │ │ │ ├── asio_no_tls.hpp │ │ │ ├── asio_no_tls_client.hpp │ │ │ ├── boost_config.hpp │ │ │ ├── core.hpp │ │ │ ├── core_client.hpp │ │ │ ├── debug.hpp │ │ │ ├── debug_asio.hpp │ │ │ ├── debug_asio_no_tls.hpp │ │ │ ├── minimal_client.hpp │ │ │ └── minimal_server.hpp │ │ │ ├── connection.hpp │ │ │ ├── connection_base.hpp │ │ │ ├── endpoint.hpp │ │ │ ├── endpoint_base.hpp │ │ │ ├── error.hpp │ │ │ ├── extensions │ │ │ ├── extension.hpp │ │ │ └── permessage_deflate │ │ │ │ ├── disabled.hpp │ │ │ │ └── enabled.hpp │ │ │ ├── frame.hpp │ │ │ ├── http │ │ │ ├── constants.hpp │ │ │ ├── impl │ │ │ │ ├── parser.hpp │ │ │ │ ├── request.hpp │ │ │ │ └── response.hpp │ │ │ ├── parser.hpp │ │ │ ├── request.hpp │ │ │ └── response.hpp │ │ │ ├── impl │ │ │ ├── connection_impl.hpp │ │ │ ├── endpoint_impl.hpp │ │ │ └── utilities_impl.hpp │ │ │ ├── logger │ │ │ ├── basic.hpp │ │ │ ├── levels.hpp │ │ │ ├── stub.hpp │ │ │ └── syslog.hpp │ │ │ ├── message_buffer │ │ │ ├── alloc.hpp │ │ │ ├── message.hpp │ │ │ └── pool.hpp │ │ │ ├── processors │ │ │ ├── base.hpp │ │ │ ├── hybi00.hpp │ │ │ ├── hybi07.hpp │ │ │ ├── hybi08.hpp │ │ │ ├── hybi13.hpp │ │ │ └── processor.hpp │ │ │ ├── random │ │ │ ├── none.hpp │ │ │ └── random_device.hpp │ │ │ ├── roles │ │ │ ├── client_endpoint.hpp │ │ │ └── server_endpoint.hpp │ │ │ ├── server.hpp │ │ │ ├── sha1 │ │ │ └── sha1.hpp │ │ │ ├── transport │ │ │ ├── asio │ │ │ │ ├── base.hpp │ │ │ │ ├── connection.hpp │ │ │ │ ├── endpoint.hpp │ │ │ │ └── security │ │ │ │ │ ├── base.hpp │ │ │ │ │ ├── none.hpp │ │ │ │ │ └── tls.hpp │ │ │ ├── base │ │ │ │ ├── connection.hpp │ │ │ │ └── endpoint.hpp │ │ │ ├── debug │ │ │ │ ├── base.hpp │ │ │ │ ├── connection.hpp │ │ │ │ └── endpoint.hpp │ │ │ ├── iostream │ │ │ │ ├── base.hpp │ │ │ │ ├── connection.hpp │ │ │ │ └── endpoint.hpp │ │ │ └── stub │ │ │ │ ├── base.hpp │ │ │ │ ├── connection.hpp │ │ │ │ └── endpoint.hpp │ │ │ ├── uri.hpp │ │ │ ├── utf8_validator.hpp │ │ │ ├── utilities.hpp │ │ │ └── version.hpp │ ├── Libnode_APL.xml │ └── Library │ │ └── ffi │ │ ├── Android │ │ ├── arm64-v8a │ │ │ └── libffi.a │ │ └── armeabi-v7a │ │ │ └── libffi.a │ │ ├── Win64 │ │ └── ffi.lib │ │ ├── iOS │ │ └── libffi.a │ │ └── macOS │ │ └── libffi.a ├── Typing │ ├── ffi │ │ └── index.d.ts │ ├── puerts │ │ └── index.d.ts │ └── ue │ │ ├── index.d.ts │ │ ├── puerts.d.ts │ │ └── puerts_decorators.d.ts ├── enable_puerts_module.js ├── gen_pesapi_adpt.js └── make_puerts_libs.js └── README.md /.github/ISSUE_TEMPLATE/others.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F4DD others" 3 | title: "[Unity]/[UE] suggestion" 4 | about: discussion, suggestion and question 5 | --- 6 | 7 | ## detail | 详细描述 8 | -------------------------------------------------------------------------------- /.github/workflows/clang-format-check.yml: -------------------------------------------------------------------------------- 1 | name: clang-format Check 2 | on: 3 | push: 4 | paths: 5 | - unreal/Puerts/Source/** 6 | - .clang-format 7 | pull_request: 8 | paths: 9 | - unreal/Puerts/Source/** 10 | - .clang-format 11 | jobs: 12 | formatting-check: 13 | name: Formatting Check 14 | runs-on: ubuntu-latest 15 | strategy: 16 | matrix: 17 | path: 18 | - check: 'unreal/Puerts/Source' 19 | exclude: 'WasmCore/ThirdPart' 20 | steps: 21 | - uses: actions/checkout@v3 22 | - name: Run clang-format style check 23 | uses: jidicula/clang-format-action@v4.9.0 24 | with: 25 | clang-format-version: '12' 26 | check-path: ${{ matrix.path['check'] }} 27 | exclude-regex: ${{ matrix.path['exclude'] }} 28 | -------------------------------------------------------------------------------- /.github/workflows/cnb_sync.yml: -------------------------------------------------------------------------------- 1 | name: Sync to CNB 2 | on: [push] 3 | 4 | jobs: 5 | sync: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v3 9 | with: 10 | fetch-depth: 0 11 | 12 | - name: Sync to CNB Repository 13 | run: | 14 | docker run --rm \ 15 | -v ${{ github.workspace }}:${{ github.workspace }} \ 16 | -w ${{ github.workspace }} \ 17 | -e PLUGIN_TARGET_URL="https://cnb.cool/tencent/puerts/puerts.git" \ 18 | -e PLUGIN_AUTH_TYPE="https" \ 19 | -e PLUGIN_USERNAME="cnb" \ 20 | -e PLUGIN_PASSWORD=${{ secrets.CNB_TOKEN }} \ 21 | -e PLUGIN_FORCE="true" \ 22 | tencentcom/git-sync 23 | -------------------------------------------------------------------------------- /.github/workflows/composites/unity-build-plugins/ios/action.yml: -------------------------------------------------------------------------------- 1 | name: build ios unity plugin 2 | 3 | inputs: 4 | backend: 5 | description: 'js backend' 6 | required: true 7 | config: 8 | type: choice 9 | description: Release Or Debug 10 | default: 'Release' 11 | options: 12 | - Release 13 | - Debug 14 | websocket: 15 | description: enable websocket 16 | default: '0' 17 | build_proj_dir: 18 | description: 'build project dir' 19 | required: false 20 | default: 'native_src' 21 | GITHUB_TOKEN: 22 | required: 23 | 24 | runs: 25 | using: "composite" 26 | steps: 27 | - name: Build 28 | shell: bash 29 | run: | 30 | cd unity 31 | npm i 32 | cd ${{ inputs.build_proj_dir }} 33 | node ../cli make --platform ios --backend ${{ inputs.backend }} --config ${{ inputs.config }} --websocket ${{ inputs.websocket }} 34 | - name: Upload 35 | uses: actions/upload-artifact@v4 36 | with: 37 | path: ./unity/Assets/core/upm/Plugins/**/* 38 | name: Unity_Plugins_${{ inputs.backend }}_${{ inputs.config }}_ios 39 | - name: Clean 40 | shell: bash 41 | run: rm -rf ./unity/Assets/core/upm/Plugins/**/* -------------------------------------------------------------------------------- /.github/workflows/composites/unity-build-plugins/ohos/action.yml: -------------------------------------------------------------------------------- 1 | name: build harmony unity plugin 2 | 3 | inputs: 4 | backend: 5 | description: 'js backend' 6 | required: true 7 | config: 8 | type: choice 9 | description: Release Or Debug 10 | default: 'Release' 11 | options: 12 | - Release 13 | - Debug 14 | websocket: 15 | description: enable websocket 16 | default: '0' 17 | build_proj_dir: 18 | description: 'build project dir' 19 | required: false 20 | default: 'native_src' 21 | GITHUB_TOKEN: 22 | required: 23 | 24 | runs: 25 | using: "composite" 26 | steps: 27 | - name: Build 28 | shell: bash 29 | run: | 30 | cd unity 31 | npm i 32 | cd ${{ inputs.build_proj_dir }} 33 | OHOS_NDK_HOME=~/ohos-sdk/linux/native node ../cli make --platform ohos --backend ${{ inputs.backend }} --config ${{ inputs.config }} --websocket ${{ inputs.websocket }} 34 | - name: Upload 35 | uses: actions/upload-artifact@v4 36 | with: 37 | path: ./unity/Assets/core/upm/Plugins/**/* 38 | name: Unity_Plugins_${{ inputs.backend }}_${{ inputs.config }}_harmony 39 | - name: Clean 40 | shell: bash 41 | run: rm -rf ./unity/Assets/core/upm/Plugins/**/* -------------------------------------------------------------------------------- /.github/workflows/composites/unity-build-plugins/osx/action.yml: -------------------------------------------------------------------------------- 1 | name: build osx unity plugin 2 | 3 | inputs: 4 | backend: 5 | description: 'js backend' 6 | required: true 7 | config: 8 | type: choice 9 | description: Release Or Debug 10 | default: 'Release' 11 | options: 12 | - Release 13 | - Debug 14 | websocket: 15 | description: enable websocket 16 | default: '0' 17 | build_proj_dir: 18 | description: 'build project dir' 19 | required: false 20 | default: 'native_src' 21 | GITHUB_TOKEN: 22 | required: 23 | 24 | runs: 25 | using: "composite" 26 | steps: 27 | - name: Build 28 | shell: bash 29 | run: | 30 | cd unity 31 | npm i 32 | cd ${{ inputs.build_proj_dir }} 33 | node ../cli make --platform osx --backend ${{ inputs.backend }} --config ${{ inputs.config }} --websocket ${{ inputs.websocket }} 34 | - name: Upload 35 | uses: actions/upload-artifact@v4 36 | with: 37 | path: ./unity/Assets/core/upm/Plugins/**/* 38 | name: Unity_Plugins_${{ inputs.backend }}_${{ inputs.config }}_osx 39 | - name: Clean 40 | shell: bash 41 | run: rm -rf ./unity/Assets/core/upm/Plugins/**/* -------------------------------------------------------------------------------- /.github/workflows/unity_openupm_publish.yml: -------------------------------------------------------------------------------- 1 | name: unity openupm publish 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | tag_name: 7 | description: 'tag name' 8 | required: true 9 | 10 | env: 11 | RUNID: 613573412 12 | 13 | jobs: 14 | publish: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v3 18 | - name: publish webgl openupm package 19 | run: | 20 | git filter-branch --subdirectory-filter unity/Assets/webgl/upm 21 | git clean -ffdx 22 | git tag upm/webgl/${{ github.event.inputs.tag_name }} 23 | git push origin --tag -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode -------------------------------------------------------------------------------- /doc/pic/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/pic/1.png -------------------------------------------------------------------------------- /doc/pic/puerts_conf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/pic/puerts_conf.png -------------------------------------------------------------------------------- /doc/pic/puerts_debugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/pic/puerts_debugger.png -------------------------------------------------------------------------------- /doc/pic/puerts_gen_dts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/pic/puerts_gen_dts.png -------------------------------------------------------------------------------- /doc/pic/puerts_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/pic/puerts_logo.png -------------------------------------------------------------------------------- /doc/pic/puerts_module_dependencies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/pic/puerts_module_dependencies.png -------------------------------------------------------------------------------- /doc/pic/select_character.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/pic/select_character.png -------------------------------------------------------------------------------- /doc/pic/ue_throttle_cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/pic/ue_throttle_cpu.png -------------------------------------------------------------------------------- /doc/pic/unity_run_in_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/pic/unity_run_in_background.png -------------------------------------------------------------------------------- /doc/unity/en/bugs.md: -------------------------------------------------------------------------------- 1 | # Known bug 2 | * https://github.com/Tencent/puerts/issues/65 3 | Typescript类继承CSharp类会引起的内存问题 | Memory Management problem when a typescript class is extended a csharp class 4 | 5 | * https://github.com/Tencent/puerts/issues/291 6 | 显示接口实现的方法无法在Typescript侧调用 | Cannot call `Explicit Interface Implementation` method in typescript. 7 | 8 | * https://github.com/Tencent/puerts/issues/281 9 | ref struct生成后会报错 | Could not generate ref struct 10 | -------------------------------------------------------------------------------- /doc/unity/en/other/commercial.md: -------------------------------------------------------------------------------- 1 | Comming soon. -------------------------------------------------------------------------------- /doc/unity/en/other/community.md: -------------------------------------------------------------------------------- 1 | # PuerTS's community 2 | 3 | The following content is all from the community. PuerTS will periodically collect excellent content and add it to the list below, but we hope that you will share your own content through PR. 4 | 5 | * Library or Framework 6 | 7 | | Author | repo | type | star | 8 | | --- | --- | --- | --- | 9 | | @sbfkcel | https://github.com/sbfkcel/puerts_cli | Cli | | 10 | | @throw-out | https://github.com/throw-out/puerts-unity-kit | Framework | | 11 | | @Justin-sky | https://github.com/Justin-sky/Nice-TS | Framework | 280+ | 12 | | @Geequlim | https://github.com/Geequlim/puerts-starter-kit | Framework | 100+ | 13 | | @zgz682000 | https://github.com/zgz682000/puerts-component | Framework | 20+ | 14 | | @jungog | https://github.com/jungog/UnityTs | Framework | | 15 | | @zombieyang | https://github.com/zombieyang/puerts-ts-loader | Library | | 16 | 17 | * Sample 18 | 19 | | Author | repo | type | star | 20 | | --- | --- | --- | --- | 21 | | @zombieyang | https://github.com/zombieyang/puerts_unity_webgl_demo | Samples | 70+ | 22 | | @throw-out | https://github.com/throw-out/PerformanceTesting | Samples | | 23 | | @DOSexample | https://github.com/DOSexample/puerts_unity_demo | Samples | | 24 | -------------------------------------------------------------------------------- /doc/unity/en/other/dotnet.md: -------------------------------------------------------------------------------- 1 | # Using PuerTS in a Dotnet Project 2 | 3 | PuerTS Unity is not only limited to Unity C#, but can also be used in a pure Dotnet project. The steps to do so are very simple: 4 | 5 | 1. Make sure your Dotnet project references all the PuerTS C# code. 6 | 2. Add the PUERTS_GENERAL macro. 7 | 3. Write a specific Loader to allow PuerTS to load the built-in JS. 8 | 9 | 10 | ## Sample 11 | PuerTS itself doing code unittest by DotNet. Your can refer to the `github action` configuration file: `/.github/workflows/unity-unittest.yml`, do the following: 12 | 13 | cd into `/unity/test/dotnet`, run `node ../../cli dotnet-test v8_9.4` . 14 | 15 | then a Dotnet project named `vsauto-static` will be generated in the working directory -------------------------------------------------------------------------------- /doc/unity/en/other/upgrade.md: -------------------------------------------------------------------------------- 1 | # Upgrade Guide 2 | 3 | This document is used to record the parts that need to be handled when upgrading between different versions. 4 | 5 | ## 1.4.x -> 2.0.x 6 | 1. DateTime will no longer be mapped to js Date object. On the js side, System.DateTime should be used instead. 7 | 2. TypedValue can only be passed to object type and no longer has the function of selecting overload. 8 | 3. Under reflection mode, if a function has no overload or default parameters, no parameter check will be performed. 9 | 4. The index used by Ref has changed from ['value'] to [0] (if your code uses puer.$ref and puer.$unref instead of directly using the index, it will not be affected). 10 | 5. As announced in version 1.4, require is no longer included in version 2.0. It is recommended to use ExecuteModule instead. If the cost of transformation is too high, you can directly use [puerts-commonjs](https://github.com/Tencent/puerts/tree/master/unity/Assets/commonjs/upm). 11 | 6. `Puerts.Editor.Generator.BindingMode` has been renamed to `Puerts.BindingMode`. -------------------------------------------------------------------------------- /doc/unity/en/tutorial/runJS.md: -------------------------------------------------------------------------------- 1 | # Getting Started with PuerTS 2 | First, please follow the [installation guide](../install.md) to install PuerTS into your Unity project. 3 | 4 | Then, prepare a scene and a MonoBehaviour component in Unity, and write the following code in the MonoBehaviour: 5 | 6 | ```csharp 7 | //1. Hello World 8 | void Start() { 9 | Puerts.JsEnv env = new Puerts.JsEnv(); 10 | env.Eval(@" 11 | console.log('hello world'); 12 | ") 13 | } 14 | ``` 15 | After execution, you will see `Hello world` in the Unity console. 16 | 17 | ![throttle cpu](../../..//pic/1.png) 18 | 19 | Success! 20 | 21 | This means that we have executed real JavaScript in Unity! 22 | 23 | That's how easy it is with PuerTS! 24 | 25 | ------------ 26 | 27 | With the help of PuerTS, the integration between JavaScript and C# can be even more exciting. Keep reading. -------------------------------------------------------------------------------- /doc/unity/en/tutorial/wxMinigame.md: -------------------------------------------------------------------------------- 1 | # One-Click Export for WeChat Mini Games 2 | 3 | Since Puerts requires some post-processing on the exported WeChat Mini Game, the WeChat Mini Game export tool cannot be used directly. Instead, use the Tools/PuerTS/Export WXMiniGame menu option. Executing this menu item will first invoke the WeChat Mini Game export tool to perform the export, followed by the necessary post-processing steps. -------------------------------------------------------------------------------- /doc/unity/en/wrapper/blittablecopy.md: -------------------------------------------------------------------------------- 1 | # BlittableCopy Memory Optimization 2 | PuerTS provides a way to share struct memory between C# and C++ using the `BlittableCopy` attribute, which reduces GC when passing structs from C# to JavaScript. 3 | 4 | **Note that you need to enable the unsafe switch to use this feature.** 5 | 6 | ```csharp 7 | //1. The configuration class must have the [Configure] tag 8 | //2. It must be placed in the Editor directory 9 | [Configure] 10 | public class ExamplesCfg 11 | { 12 | [BlittableCopy] 13 | static IEnumerable Blittables 14 | { 15 | get 16 | { 17 | return new List() 18 | { 19 | //Enabling this will optimize the GC for Vector3, but you need to enable unsafe compilation 20 | //typeof(Vector3), 21 | }; 22 | } 23 | } 24 | } 25 | ``` -------------------------------------------------------------------------------- /doc/unity/en/wrapper/extension.md: -------------------------------------------------------------------------------- 1 | 2 | # using C# extension methods 3 | For methods implemented using C# extension in the project, there are three ways to handle them when calling on the JS side: 4 | 5 | 1. Add the target class and the class containing the extension method to the wrapper generation list (recommended). 6 | When generating code, Puerts will help you iterate through the entire assembly and add all extension functions that exist in the class to the static-wrapper, so that they can be called normally on the JS side. 7 | 8 | 2. Call the extension method manually on the JS side. 9 | As shown in the figure below, Parameter 0 is the extended target class, and Parameter 1 is the extended class that contains the extension method. You can call this function at the initialization of JsEnv. 10 | 11 | ```javascript 12 | puer.$extension(CS.PuertsTest.BaseClass, CS.PuertsTest.BaseClassExtension); 13 | ``` 14 | 3. Enable the PUERTS_REFLECT_ALL_EXTENSION macro. 15 | After enabling this macro, Puerts will help you iterate through the entire assembly when the first reflection call is generated. This means that you don't need to generate it or call the extension function manually, but the side effect is that the waiting time for the first reflection call will become longer, and the memory usage will increase. -------------------------------------------------------------------------------- /doc/unity/zhcn/bugs.md: -------------------------------------------------------------------------------- 1 | # 已知bug及其说明 2 | * https://github.com/Tencent/puerts/issues/65 3 | Typescript类继承CSharp类会引起的内存问题 | Memory Management problem when a typescript class is extended a csharp class 4 | 5 | * https://github.com/Tencent/puerts/issues/291 6 | 显示接口实现的方法无法在Typescript侧调用 | Cannot call `Explicit Interface Implementation` method in typescript. 7 | 8 | * https://github.com/Tencent/puerts/issues/281 9 | ref struct生成后会报错 | Could not generate ref struct 10 | -------------------------------------------------------------------------------- /doc/unity/zhcn/install.md: -------------------------------------------------------------------------------- 1 | # 安装PuerTS 2 | 3 | 如果你不清楚该使用哪种安装方式,该用哪个版本,请参见 [FAQ](./faq.md#安装相关) 4 | 5 | ### GitHub Clone 并用 Unity UPM 安装 6 | 7 | 带有upm的unity版本,可以使用这种方式安装 8 | 9 | - git clone `https://github.com/chexiongsheng/puerts_unity_demo.git` 10 | - open Package Manager 11 | - click `+` 12 | - select `Add from File` 13 | - select [your cloned path]/package/package.json 14 | - click `Add` 15 | 16 | ### 从 OpenUPM 安装 | Unity 2018+ 可用 17 | 18 | PuerTS 现已上传 OpenUPM: https://openupm.com/packages/com.tencent.puerts.core/ 19 | 20 | 你可按照[OpenUPM](https://openupm.com/)所支持的方式安装 21 | 22 | 国内网络推荐使用`openupm-cn` 23 | 24 | ### 手动下载代码与插件 | 全版本可用 25 | 以往支持的源码安装模式依旧支持。相比前两种方式管理起来稍麻烦,但对代码魔改更友好。 26 | 27 | 1. 前往 [Github Releases](https://github.com/Tencent/puerts/releases) 下载PuerTS_V8_x.x.x.tgz 或是别的你需要的Puerts版本。 28 | 2. 将压缩包内的Puerts文件夹解压至你的Assets目录 29 | 30 | > 如果你是2018以下版本,还需要你将Puerts代码内的内置js手动加上.txt后缀 31 | 32 | > mac下如果遇到移入废纸篓问题,请使用sudo xattr -r -d com.apple.quarantine puerts.bundle。但用了后提交git容易出问题 33 | 34 | #### 当然还有一种最简单的办法:从官方Demo中拷贝出来用。 35 | -------------------------------------------------------------------------------- /doc/unity/zhcn/knowjs/webgl.md: -------------------------------------------------------------------------------- 1 | # WebGL支持 2 | 3 | PuerTS 基于 JS 提供脚本能力,因此在打包WebGL上有很大的优势。 4 | 5 | ## WebGL平台与JIT技术 6 | 7 | JIT(即时编译)技术可以提高脚本语言的执行速度,包括JS、Lua和WASM等。有了JIT,脚本的执行速度可以与编译型语言相媲美。但如果没有JIT,脚本语言就会非常慢。v8、LuaJIT都是能将其脚本代码用JIT的方式执行的(iOS除外、某些游戏机平台也不行)。 8 | 9 | Unity游戏发布到WebGL平台后,其C#代码会经Il2cpp转化为WASM,并通过浏览器的WASM引擎通过JIT执行。但如果你的游戏包含Lua,如果是xLua的方案,这些Lua代码会在编译为WASM的Lua虚拟机里执行,此时Lua代码是**无法享受**JIT的(浏览器有JIT权限,执行WASM可以JIT。但WASM没有JIT权限,执行脚本无法JIT)。 10 | 11 | ## PuerTS-WebGL 12 | 13 | PuerTS的优势在于:它可以将JS脚本发送到浏览器的JS环境里,利用浏览器的JIT能力来执行JS。这意味着,相比xLua,PuerTS在脚本执行上有压倒性的优势。 14 | 15 | 下面是一个比较表格,展示了在100k fibonacci(12)的情况下,xLua WebGL和PuerTS WebGL的执行速度对比: 16 | 17 | | | 100k fibonacci(12) | 18 | | --- | --- | 19 | |xLua WebGL | 6200ms | 20 | |Puerts WebGL | 165ms | 21 | 22 | WebGL目前处在一个子包中,并不在puerts本体里。如果你想了解更多关于WebGL能力的信息,可以查看[PuerTS-WebGL](https://github.com/Tencent/puerts/tree/master/unity/Assets/webgl)。 23 | 24 | > 上面的测试是关于执行速度的。在跨语言性能上,这个方案并不优秀。但我们还是可以利用WebGL平台的特性,通过别的方式解决问题,参见[这篇知乎文章](https://zhuanlan.zhihu.com/p/646932579) 25 | -------------------------------------------------------------------------------- /doc/unity/zhcn/other/dotnet.md: -------------------------------------------------------------------------------- 1 | # 在Dotnet项目中使用PuerTS 2 | PuerTS Unity不仅可以在Unity C#中使用,同样可以在一个纯Dotnet项目中使用。步骤也非常简单: 3 | 1. 让dotnet项目引用所有PuerTS C#代码 4 | 2. 添加 PUERTS_GENERAL 宏 5 | 3. 编写特定的 Loader 使PuerTS可以加载内置JS 6 | 7 | ## 示例 8 | 普洱官方采用了一个dotnet程序进行代码单元测试,你可以参见我们的github action配置:`/.github/workflows/unity-unittest.yml`。 9 | 10 | 进入官方仓库的`/unity/test/dotnet`目录,执行 `node ../../cli dotnet-test v8_9.4` 。 11 | 12 | 随后就会在该目录下生成名为`vsauto-static`的dotnet项目。 -------------------------------------------------------------------------------- /doc/unity/zhcn/other/upgrade.md: -------------------------------------------------------------------------------- 1 | # 升级指南 2 | 本文档用于记录各个大版本之间主要的升级内容及其注意事项。 3 | 4 | ## 1.4.x -> 2.0.x 5 | * 主要新功能 6 | 1. 新增[xil2cpp模式](../performance/il2cpp.md),极大提高跨语言性能。但需要你自己编译普洱的binary,牺牲一点灵活度。 7 | 2. 目录结构完全遵循upm格式 8 | 9 | * 不向下兼容的变动: 10 | 1. DateTime不再映射到js Date对象。js侧需要按照System.DateTime来使用。 11 | 2. TypedValue只能传给object类型,不再具备选择重载的作用。 12 | 3. 反射模式下,如果一个函数无重载也无默认参数,不会进行参数检查。 13 | 4. Ref所使用的下标由['value']变为[0](如果你代码使用的是puer.$ref和puer.$unref,而不是直接使用下标的话,不受影响)。 14 | 5. 1.4版本中预告过的:2.0版本不自带require,建议改用ExecuteModule。如果改造成本过大,可以直接使用[puerts-commonjs](https://github.com/Tencent/puerts/tree/master/unity/Assets/commonjs/upm) 15 | 6. `Puerts.Editor.Generator.BindingMode`更名为`Puerts.BindingMode` 16 | 17 | ## 1.3.x -> 1.4.x 18 | * 主要新功能 19 | 1. 支持Apple silicon(m系列) 20 | 2. 全平台支持Node.js 21 | 3. 新增子包 [puerts-webgl](https://github.com/zombieyang/puerts_unity_webgl_demo),新增webGL平台支持,且在该平台下有极大的[性能优势](../knowjs/webgl.md) 22 | 4. 新增子包 [puerts-tsloader](https://github.com/zombieyang/puerts-ts-loader),内置Typescript处理,用于减少Typescript新手上手的学习成本,类似Deno的想法。支持node_modules的直接加载。 23 | 5. 新增ESModule支持,且官方后续都建议使用ESModule。这种方式更为贴近JS标准。 -------------------------------------------------------------------------------- /doc/unity/zhcn/tutorial/runJS.md: -------------------------------------------------------------------------------- 1 | # 开始PuerTS之旅 2 | 首先,请跟随[安装指引](../install.md)将PuerTS装入你的Unity项目 3 | 4 | ------------ 5 | 6 | 然后,在Unity里准备好一个场景及一个MonoBehaviour组件,在MonoBehaviour里编写如下代码: 7 | ```csharp 8 | //1. Hello World 9 | void Start() { 10 | Puerts.JsEnv env = new Puerts.JsEnv(); 11 | env.Eval(@" 12 | console.log('hello world'); 13 | ") 14 | } 15 | ``` 16 | 执行后,你能看见Unity控制台中打印出了`Hello world`。 17 | 18 | ![throttle cpu](../../..//pic/1.png) 19 | 20 | 成功了! 21 | 22 | 这就意味着,我们在Unity里执行了一段真正的Javascript! 23 | 24 | PuerTS就是这么容易! 25 | 26 | ------------ 27 | 28 | 在PuerTS的帮助下,Javascript和C#的打通还可以更精彩,请往下看 -------------------------------------------------------------------------------- /doc/unity/zhcn/tutorial/wxMinigame.md: -------------------------------------------------------------------------------- 1 | # 微信小游戏一键导出 2 | 3 | 由于puerts需要对导出的微信小游戏做些后处理,所以不能直接直接用微信小游戏导出工具,改为使用`Tools/PuerTS/Export WXMiniGame`菜单,执行该菜单会先调用微信小游戏导出工具导出后,然后再进行后处理。 -------------------------------------------------------------------------------- /doc/unity/zhcn/wrapper/blittablecopy.md: -------------------------------------------------------------------------------- 1 | # BlittableCopy 内存优化 2 | PuerTS提供一种 C# 和 C++ 共享结构体内存的方式,让你从 C# 往 Javascript 传递结构体时能减少GC,它就是`BlittableCopy`标签。 3 | 4 | **注意你需要打开unsafe开关才能用这个功能。** 5 | ```csharp 6 | //1、配置类必须打[Configure]标签 7 | //2、必须放Editor目录 8 | [Configure] 9 | public class ExamplesCfg 10 | { 11 | [BlittableCopy] 12 | static IEnumerable Blittables 13 | { 14 | get 15 | { 16 | return new List() 17 | { 18 | //打开这个可以优化Vector3的GC,但需要开启unsafe编译 19 | //typeof(Vector3), 20 | }; 21 | } 22 | } 23 | } 24 | ``` -------------------------------------------------------------------------------- /doc/unity/zhcn/wrapper/extension.md: -------------------------------------------------------------------------------- 1 | # 使用extension函数 2 | 3 | 对于项目中存在的C# extension函数,默认是无法调用的(在编辑器下可以,下面有说,但打包后会报错)。如果要在JS侧调用,你可以选以下三种办法中的一种来处理: 4 | 5 | 1. 把扩展目标类与扩展函数所在类加入wrapper生成列表(推荐) 6 | 7 | puerts会在生成代码时帮你遍历整个assembly,将该类存在的所有扩展函数都塞到`static-wrapper`里,这样在JS侧就可以正常调用。 8 | 9 | 2. 在JS侧调用手动扩展函数 10 | 11 | 如下图所示,参数0是扩展目标类,参数1是包含扩展函数的扩展类。你可以在JsEnv初始化的位置去调用这个函数 12 | ``` 13 | puer.$extension(CS.PuertsTest.BaseClass, CS.PuertsTest.BaseClassExtension); 14 | ``` 15 | 16 | 3. 打开PUERTS_REFLECT_ALL_EXTENSION宏 17 | 18 | 打开这个宏后,puerts会在首次产生反射调用时帮你遍历所有assembly,这个也是PuerTS在编辑器里的做法。这样就不需要你生成它或者手动调用扩展函数,但副作用是首次反射调用的等待时长会变长,且内存占用会变多 -------------------------------------------------------------------------------- /doc/unreal/en/README.md: -------------------------------------------------------------------------------- 1 | ## What? 2 | Puerts is a TypeScript programming solution within game engines. 3 | * Provides a JavaScript Runtime 4 | * Allows TypeScript to access the host engine(module-binding on the JavaScript level and generating TypeScript declarations) 5 | 6 | ## Why? 7 | * Facililates game building processes by combining JavaScript packages and toolchains with the rendering power of professional game engines 8 | * In contrast to lua script, TypeScript supports static type checking, which significantly improves code robustness and maintainability. 9 | * WebGL support. Much faster than lua in WebGL. 10 | * High efficiency: supports reflection binding throughout the platform (engine) - no extra steps (code generation) needed for development. 11 | * High performance:supports static binding throughout the platform (engine) - takes care of complex scenes 12 | 13 | ## Avaliable on these environment 14 | * Unreal Engine 4.22 -> latest 15 | 16 | ## Available on these Platform 17 | * IOS,Android,Windows,Macos 18 | 19 | 20 | ## Ask for help 21 | [Github Discussion](https://github.com/Tencent/puerts/discussions) 22 | -------------------------------------------------------------------------------- /doc/unreal/zhcn/dev_environment.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/unreal/zhcn/dev_environment.md -------------------------------------------------------------------------------- /doc/unreal/zhcn/getting_started.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/unreal/zhcn/getting_started.md -------------------------------------------------------------------------------- /doc/unreal/zhcn/start_a_virtual_machine.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/doc/unreal/zhcn/start_a_virtual_machine.md -------------------------------------------------------------------------------- /doc/unreal/zhcn/vscode_debug.md: -------------------------------------------------------------------------------- 1 | ## vscode debug指引 2 | 3 | ### 自创建虚拟机的调试 4 | 5 | * 创建FJsEnv传入调试端口 6 | 7 | ~~~cpp 8 | //8080是调试端口 9 | GameScript = MakeShared(std::make_unique(TEXT("JavaScript")), std::make_shared(), 8080); 10 | ~~~ 11 | 12 | * 阻塞等待调试器链接 13 | 14 | ~~~cpp 15 | GameScript = MakeShared(std::make_unique(TEXT("JavaScript")), std::make_shared(), 8080); 16 | GameScript->WaitDebugger(); 17 | 18 | //... 19 | 20 | GameScript->Start("QuickStart", Arguments); 21 | ~~~ 22 | 23 | ### 开启”继承引擎类功能“ 24 | 25 | 开启”继承引擎类功能“后,系统会启动一个默认的虚拟机,该虚拟机通过配置界面来设置调试端口 26 | 27 | * 菜单上选择“编辑->项目设置”,打开设置页面后在“插件->Puerts Setting”页面中开启调试以及设置端口 28 | 29 | ![puerts_conf](../..//pic/puerts_conf.png) 30 | 31 | * 勾选WaitDebugger是阻塞等待调试器链接 32 | - 调试器通过websocket连接,期间有TCP的握手,websocket握手,建立连接后,调试器和V8还会交换些信息,整个过程大概几百毫秒 33 | - 在这几百毫秒内执行的脚本将无法断点,如果你想断点这些代码,可以用puerts的阻塞等待调试器连接功能 34 | 35 | ### vscode以及UE编辑器的注意事项 36 | 37 | * vscode下打开setting,搜索auto attach,将Debug>Node:Auto Attach设置为“on”(高版本vscode没有该选项,可以不设置) 38 | 39 | 40 | * 菜单打开“编辑->编辑器偏好设置”页面,在“通用->性能”中把“处于背景中时占用较少CPU”的勾选去掉,否则debug连接会很慢 41 | 42 | ![throttle cpu](../..//pic/ue_throttle_cpu.png) 43 | -------------------------------------------------------------------------------- /doc/unreal/zhcn/wasm.md: -------------------------------------------------------------------------------- 1 | - 如何开启wasm 2 | 3 | - 在JsEnv.build.cs中,将USE_WASM3修改为true即可,之后会在global里面提供Wasm3变量,使用方式和WebAssebly完全一致,一般建议仅仅在ios上打开 4 | - 如果在JsEnv.build.cs中将WASM3_OVERRIDE_WEBASSEMBLY打开,会用Wasm3替换WebAssembly的实现,一般建议仅仅在ios上打开 5 | - 如何使用wasm 6 | 7 | - 在JavaScript目录下新增一个wasm目录,目录下需要有几个文件 8 | - 在js中使用wasm和普通的webassembly完全一致,需要注意的是,我们还没有实现Global,Table以及module的export等接口,因此wasm如果依赖这些功能可能会出现问题 9 | - 在cpp中使用wasm可以参考 WasmCore.cpp,直接使用WasmFunction的Call即可 10 | 11 | 12 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4fb04bce231fe4c29a142e094d1acd00 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5db147f38dc414d0b9ee57a4640b959d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Runtime/CommonJS.cs: -------------------------------------------------------------------------------- 1 | namespace Puerts.ThirdParty 2 | { 3 | public class CommonJS 4 | { 5 | public static void InjectSupportForCJS(Puerts.JsEnv env) 6 | { 7 | env.ExecuteModule("puer-commonjs/load.mjs"); 8 | env.ExecuteModule("puer-commonjs/modular.mjs"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Runtime/CommonJS.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 245651f9e36a64860a030aa9c8636cba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Runtime/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1acb787307d4d4d6bae60082dca17baa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Runtime/Resources/puer-commonjs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cec3312d322244567b7079fa1715196c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Runtime/Resources/puer-commonjs/load.mjs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f822ce05a239a417d80b32235df76963 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: fc4d649ef11264ef18e5d3e61d12ed23, type: 3} 11 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Runtime/Resources/puer-commonjs/modular.mjs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc8b6d2693ad14b899b7f3cedb4c17ea 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: fc4d649ef11264ef18e5d3e61d12ed23, type: 3} 11 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Runtime/com.tencent.puerts.commonjs.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.commonjs", 3 | "rootNamespace": "", 4 | "references": [ 5 | "com.tencent.puerts.core" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Runtime/com.tencent.puerts.commonjs.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c173aae61b9c7475a9e89edb29370744 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Samples~/Example.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Puerts; 3 | public class Example : MonoBehaviour 4 | { 5 | void Start() 6 | { 7 | JsEnv env = new JsEnv(); 8 | Puerts.ThirdParty.CommonJS.InjectSupportForCJS(env); 9 | env.Eval("require('main.js')"); 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Samples~/Resources/main.js.txt: -------------------------------------------------------------------------------- 1 | const module1 = require('module1'); 2 | 3 | module1.callMe('from john'); 4 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Samples~/Resources/module1.js.txt: -------------------------------------------------------------------------------- 1 | const CSharp = require('csharp'); 2 | 3 | CSharp.UnityEngine.Debug.LogWarning('module1 loading'); 4 | 5 | function callMe(msg) { 6 | console.log('callMe called', msg); 7 | } 8 | 9 | exports.callMe = callMe; -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Typing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdaf5db2391184aa09175dd3beb9842d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Typing/index.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace puer { 2 | function require(name: string): any; 3 | 4 | function genRequire(): (name: string) => any; 5 | 6 | function getModuleBySID(id: number): any; 7 | 8 | function clearModuleCache(): void; 9 | } 10 | 11 | declare module 'puerts' 12 | { 13 | export = puer; 14 | } 15 | 16 | declare module 'csharp' 17 | { 18 | export = CS; 19 | } 20 | 21 | declare function require(name: string): any; -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/Typing/index.d.ts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bf82ee1ec2c34e32ba49c4d60ccaf8b 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.commonjs", 3 | "displayName": "PuerTS commonjs support", 4 | "version": "1.1.0-pre.0", 5 | "description": "add commonjs support for puerts 1.4.0-rc.0+", 6 | "scripts": { 7 | }, 8 | "author": { 9 | "name": "Tencent Puerts Group", 10 | "email": "johnche@tencent.com", 11 | "url": "https://github.com/puerts" 12 | }, 13 | 14 | "samples": [ 15 | { 16 | "displayName": "Commonjs Sample", 17 | "description": "Commonjs Sample", 18 | "path": "Samples~/" 19 | } 20 | ], 21 | "license": "BSD-3 Clause" 22 | } 23 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ed3d11e313bd431e8f763866fae654f 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/readme.md: -------------------------------------------------------------------------------- 1 | # PuerTS CommonJS支持 2 | PuerTS新版本中默认不带有CommonJS的支持,如果你项目中只有少量CommonJS模块,建议直接改成ESM格式。 3 | 4 | 你也可以通过本包恢复该能力。 5 | 6 | 1. 首先通过upm方式添加该包 7 | 8 | * 比如git clone本项目,在PackageManager处`add from disk`添加本目录下的package.json。 9 | 10 | 11 | 2. 使用 12 | ``` 13 | env = new JsEnv(); 14 | Puerts.ThirdParty.CommonJS.InjectSupportForCJS(env); 15 | env.Eval("console.log(require('test.cjs'))"); 16 | ``` 17 | 18 | ## 如何将CommonJS包改为ESM格式 19 | 1. module.exports 改为 export default 20 | 2. exports.xxx 改为 export xxx 21 | 3. require 改为 import -------------------------------------------------------------------------------- /unity/Assets/commonjs/upm/readme.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1aa69e0b4667e4a438189e3ccea8d1d8 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Editor/Resources/puerts/xil2cpp/unityenv_for_puerts.h.tpl.mjs: -------------------------------------------------------------------------------- 1 | import * as il2cpp_snippets from "../templates/il2cpp_snippets.mjs" 2 | 3 | export default function unityenv_for_puerts(definesList) { 4 | var defines = il2cpp_snippets.listToJsArray(definesList); 5 | return defines.map(d => `#ifndef ${d} 6 | #define ${d} 7 | #endif`).join('\n'); 8 | 9 | } -------------------------------------------------------------------------------- /unity/Assets/core/upm/Editor/Src/CJSImporter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | #if UNITY_2018_1_OR_NEWER 9 | using System.IO; 10 | #if UNITY_2020_2_OR_NEWER 11 | using UnityEditor.AssetImporters; 12 | #else 13 | using UnityEditor.Experimental.AssetImporters; 14 | #endif 15 | using UnityEngine; 16 | 17 | [ScriptedImporter(1, "cjs")] 18 | public class CJSImporter : ScriptedImporter 19 | { 20 | public override void OnImportAsset(AssetImportContext ctx) 21 | { 22 | TextAsset subAsset = new TextAsset(File.ReadAllText(ctx.assetPath)); 23 | ctx.AddObjectToAsset("text", subAsset); 24 | ctx.SetMainObject(subAsset); 25 | 26 | #if ENABLE_CJS_AUTO_RELOAD 27 | Puerts.JsEnv.ClearAllModuleCaches(); 28 | #endif 29 | } 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Editor/Src/Generator/IL2Cpp/Mono.Reflection.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unity/Assets/core/upm/Editor/Src/Generator/IL2Cpp/Mono.Reflection.dll -------------------------------------------------------------------------------- /unity/Assets/core/upm/Editor/Src/Generator/IL2Cpp/Mono.Reflection.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unity/Assets/core/upm/Editor/Src/Generator/IL2Cpp/Mono.Reflection.pdb -------------------------------------------------------------------------------- /unity/Assets/core/upm/Editor/Src/MJSImporter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | #if UNITY_2018_1_OR_NEWER 9 | using System.IO; 10 | #if UNITY_2020_2_OR_NEWER 11 | using UnityEditor.AssetImporters; 12 | #else 13 | using UnityEditor.Experimental.AssetImporters; 14 | #endif 15 | using UnityEngine; 16 | 17 | [ScriptedImporter(1, "mjs")] 18 | public class MJSImporter : ScriptedImporter 19 | { 20 | public override void OnImportAsset(AssetImportContext ctx) 21 | { 22 | TextAsset subAsset = new TextAsset(File.ReadAllText(ctx.assetPath)); 23 | ctx.AddObjectToAsset("text", subAsset); 24 | ctx.SetMainObject(subAsset); 25 | 26 | #if ENABLE_CJS_AUTO_RELOAD 27 | Puerts.JsEnv.ClearAllModuleCaches(); 28 | #endif 29 | } 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Editor/com.tencent.puerts.core.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.core.Editor", 3 | "rootNamespace": "", 4 | "references": [ 5 | "com.tencent.puerts.core" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3ab7e39f52e64e4680aba662f2f391c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/Android/libs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86f5eef576418a44eaaec20c03e3c2bf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/Android/libs/arm64-v8a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7345491b618030e4c8a015ab750d7200 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/Android/libs/armeabi-v7a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c879a9e48aacf9478aa7fd503b5fc4a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/Android/libs/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 111373f58f8734ee2872b959193a7215 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/OpenHarmony.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a465e522ad6ad6b42a01afe22aac8354 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/OpenHarmony/libs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e207b96dd07e0d24a800d21cff1b1ac7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/OpenHarmony/libs/arm64-v8a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbb16387e0adca244a22f1ae7ed5dca7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/OpenHarmony/libs/armeabi-v7a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ebb3a097370bb14b9097e85a5e72531 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb473f972df95bc47a6d607ef437a5f1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/macOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8a4fc1c4c38a3c418f00952b7e6f953 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/macOS/arm64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1783003456c4f346a70b854b42ffe66 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/macOS/puerts_il2cpp.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d99cbcc506df24f8891fb279be9816cf 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 1 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Standalone: OSXUniversal 27 | second: 28 | enabled: 1 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/macOS/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4e16a87d42ae94478237291936c5f9c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2818213782f3c4500bd082a05947601a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Plugins/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 602a20ed365058247abc711b5d61f75c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/core/upm/Runtime/Resources/puerts/nodepatch.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | process.on('uncaughtException', (e) => { console.error(e); }) 9 | process.exit = function() { 10 | console.log('`process.exit` is not allowed in puerts') 11 | } 12 | process.kill = function() { 13 | console.log('`process.kill` is not allowed in puerts') 14 | } 15 | const customPromisify = require('util').promisify.custom; 16 | Object.defineProperty(setTimeout, customPromisify, { 17 | enumerable: true, 18 | get() { 19 | return function(delay) { 20 | return new Promise(resolve=> setTimeout(resolve, delay)) 21 | }; 22 | } 23 | }); 24 | globalThis.setImmediate = function(fn) { return setTimeout(fn, 0) } 25 | globalThis.clearImmediate = function(fn) { clearTimeout(fn) } -------------------------------------------------------------------------------- /unity/Assets/core/upm/Runtime/Resources/puerts/polyfill.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | var global = global || globalThis || (function () { return this; }()); 9 | 10 | global.process = { env: { NODE_ENV: 'development' } }; -------------------------------------------------------------------------------- /unity/Assets/core/upm/Runtime/com.tencent.puerts.core.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.core", 3 | "rootNamespace": "", 4 | "references": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": true, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [], 13 | "noEngineReferences": false 14 | } -------------------------------------------------------------------------------- /unity/Assets/core/upm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.core", 3 | "displayName": "Puerts", 4 | "version": "2.2.2", 5 | "description": "Write your game with TypeScript in UE4 or Unity. Puerts can be pronounced as pu-erh TS(普洱TS)", 6 | "keywords": [ 7 | "Script" 8 | ], 9 | "author": { 10 | "name": "Tencent Puerts Group", 11 | "email": "johnche@tencent.com", 12 | "url": "https://github.com/puerts" 13 | }, 14 | "category": "Libraries" 15 | } -------------------------------------------------------------------------------- /unity/Assets/webgl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@puerts/webgl", 3 | "displayName": "Puerts WebGL Support", 4 | "version": "2.2.0", 5 | "description": "Use PuerTS in WebGL mode. Javascript code will run in browser's JS environment and get speed up by JIT.", 6 | "keywords": [ 7 | "Script" 8 | ], 9 | "author": { 10 | "name": "Tencent Puerts Group", 11 | "email": "zombieyang@tencent.com", 12 | "url": "https://github.com/puerts" 13 | }, 14 | "dependencies": {} 15 | } -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Changelog.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b49ac28c01e0e64c92525fe6c65a466 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Cli.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae309ae615479b341a770419b0c1892c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Cli/Javascripts~/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const cp = require('child_process'); 3 | const path = require('path'); 4 | 5 | if (!fs.existsSync(path.join(__dirname, 'node_modules'))) { 6 | cp.exec('npm i', { cwd: __dirname }, (error, stdout, stderr) => { 7 | if (error) { 8 | console.error('Error in installing dependency ', error); 9 | } else { 10 | console.log('Success'); 11 | executeCommand(); 12 | } 13 | }); 14 | } else { 15 | executeCommand(); 16 | } 17 | 18 | function executeCommand () { 19 | require('./cmd.js'); 20 | }; 21 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Cli/Javascripts~/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@babel/core": "^7.20.5", 4 | "@babel/preset-env": "^7.20.2", 5 | "@puerts/shell-util": "^2.0.1", 6 | "commander": "^9.3.0", 7 | "glob": "^8.0.3" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c83ecd8b32ca974c82cddd77a1c7423 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Editor/PuertsWebglBuildProcessing.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59c74a03ed688a14a98cbbc41df7fb3b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Editor/com.tencent.puerts.webgl.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.webgl.Editor", 3 | "rootNamespace": "", 4 | "references": [ 5 | "com.tencent.puerts.webgl" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Editor/com.tencent.puerts.webgl.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f7719f2cbec53448b9c9e8b3dbf03ed 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Javascripts~/PuertsDLLMock/build.js: -------------------------------------------------------------------------------- 1 | const rimraf = require('rimraf'); 2 | const { compileTypescriptProject } = require('@puerts/build-util') 3 | const { join } = require('path'); 4 | const { renameSync } = require('fs'); 5 | const path = require('path'); 6 | const { execSync } = require('child_process'); 7 | const mkdirp = require('mkdirp'); 8 | 9 | module.exports = function (lastBuildPath) { 10 | // tsc 11 | compileTypescriptProject(join(__dirname, 'tsconfig.json')); 12 | 13 | // webpack 14 | execSync('npx webpack -c webpack.config.js', { 15 | cwd: path.join(__dirname, 'PuertsDLLMock') 16 | }) 17 | 18 | rimraf.sync(join(__dirname, "output")); 19 | 20 | mkdirp.sync(lastBuildPath); 21 | 22 | renameSync( 23 | path.join(__dirname, 'dist/puerts-runtime.js'), 24 | path.join(lastBuildPath, 'puerts-runtime.js') 25 | ) 26 | }; 27 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Javascripts~/PuertsDLLMock/declare.d.ts: -------------------------------------------------------------------------------- 1 | 2 | interface IntPtr {__cannotMockInJS: boolean} 3 | interface CSString {__cannotMockInJS: boolean} 4 | declare const Module: any 5 | declare const unityInstance: any 6 | declare type CSIdentifier = number; // 可以是一个CSObjectPool的ID,如果是BlittableCopy的Struct则是内存地址 7 | declare type int = number; 8 | declare type double = number; 9 | declare type bool = boolean; 10 | declare const wx: any; 11 | 12 | declare type MockIntPtr = number; 13 | declare type JSFunctionPtr = number; 14 | declare type JSObjectPtr = number; 15 | // declare type MockIntPtr = number; -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Javascripts~/PuertsDLLMock/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "commonjs", 5 | "sourceMap": true, 6 | "noImplicitAny": true, 7 | "typeRoots": [ 8 | "../Assets/Puerts/Typing", 9 | "../Assets/Gen/Typing", 10 | "./node_modules/@types" 11 | ], 12 | "outDir": "output" 13 | } 14 | } -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Javascripts~/PuertsDLLMock/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | 3 | module.exports = { 4 | mode: 'development', 5 | entry: __dirname + '/output/index.js', 6 | output: { 7 | path: path.resolve(__dirname, 'dist'), 8 | filename: 'puerts-runtime.js' 9 | }, 10 | devtool: 'inline-source-map' 11 | } -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Javascripts~/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "cd PuertsDLLMock && tsc -p tsconfig.json && webpack -c webpack.config.js" 4 | }, 5 | "dependencies": { 6 | "@puerts/build-util": "^1.0.1", 7 | "@types/node": "^18.11.10", 8 | "concurrently": "^6.3.0", 9 | "glob": "^7.2.0", 10 | "iconv-lite": "^0.6.3", 11 | "mkdirp": "^1.0.4", 12 | "mv": "^2.1.1", 13 | "rimraf": "^3.0.2", 14 | "webpack": "^5.63.0", 15 | "webpack-cli": "^4.9.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a864acef736ddfb429b9e166d3a657c5 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17f60b627d38cc94e90ab7039a872231 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Runtime/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cacba85e454b4d8418385c645a57914f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Runtime/Plugins/WebGL.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4086807e4a4d064c88a88502f1a896a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Runtime/Plugins/WebGL/puerts.cpp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5dd35b4af88a6469c9e343463930a46a 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | userData: 26 | assetBundleName: 27 | assetBundleVariant: 28 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Runtime/Plugins/WebGL/puerts.jslib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b45210fd8c3f9534a8e35a39da56288e 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | WebGL: WebGL 27 | second: 28 | enabled: 1 29 | settings: {} 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Runtime/WebGL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Collections.Generic; 4 | 5 | namespace Puerts 6 | { 7 | namespace WebGL 8 | { 9 | public class MainEnv 10 | { 11 | private static JsEnv jsEnvInstance; 12 | 13 | public static JsEnv Get() 14 | { 15 | if (jsEnvInstance != null) 16 | { 17 | return jsEnvInstance; 18 | } 19 | return Get(new Puerts.DefaultLoader()); 20 | } 21 | 22 | public static JsEnv Get(Puerts.ILoader loader, int debugPort = -1) 23 | { 24 | if (jsEnvInstance != null) 25 | { 26 | return jsEnvInstance; 27 | } 28 | 29 | jsEnvInstance = new JsEnv(loader, debugPort); 30 | return jsEnvInstance; 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Runtime/WebGL.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 548962931a9de85429eb6f5f694e710e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Runtime/com.tencent.puerts.webgl.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.webgl", 3 | "rootNamespace": "", 4 | "references": [ 5 | "com.tencent.puerts.core" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/Runtime/com.tencent.puerts.webgl.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0c5253c92c684b46bd2d7164d58951b 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.webgl", 3 | "displayName": "Puerts WebGL Support", 4 | "version": "2.2.2", 5 | "description": "Use PuerTS in WebGL mode. Javascript code will run in browser's JS environment and get speed up by JIT.", 6 | "keywords": [ 7 | "Script" 8 | ], 9 | "author": { 10 | "name": "Tencent Puerts Group", 11 | "email": "johnche@tencent.com", 12 | "url": "https://github.com/puerts" 13 | }, 14 | "category": "Libraries", 15 | "dependencies": { 16 | "com.tencent.puerts.core": "2.2.2" 17 | } 18 | } -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbfb98141a7cffc468a7feac763b04e0 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/webgl/upm/readme.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae704b92cc88ab345b5ec9f60197068e 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/README.md: -------------------------------------------------------------------------------- 1 | # puerts for unity 2 | 3 | ## 突破点 4 | 5 | * 带静态类型检查的脚本 6 | 7 | * on the fly:拷贝即可使用,无需生成胶水代码即可完成所有功能 8 | 9 | * 基于指针的Blittable结构体GC优化 10 | 11 | * 跨语言异步:TypeScript的async方法可以await C#的async方法 12 | 13 | ## 特性列表 14 | 15 | * 对象的构造 16 | 17 | * 静态/实例字段的访问 18 | 19 | * 静态/实例属性的访问 20 | 21 | * 静态/实例方法调用 22 | 23 | * 引用参数 24 | 25 | * 函数重载 26 | 27 | * 操作符调用 28 | 29 | * TypeScript函数映射到C#的delegate,delegate的+=、-=操作 30 | 31 | * event的add/remove 32 | 33 | * 枚举 34 | 35 | * 在typescript里await一个C#的async方法 36 | 37 | * C#泛型的访问 38 | 39 | ## 引擎版本及平台支持 40 | 41 | * unity 5 ~ 最新版本 42 | 43 | * iOS,Android,Windows,Macos,或者任意.net环境 44 | -------------------------------------------------------------------------------- /unity/cli/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const cp = require('child_process'); 3 | 4 | if (!fs.existsSync(__dirname + '/../node_modules')) { 5 | cp.exec('npm i', { cwd: __dirname + '/..' }, (error, stdout, stderr) => { 6 | if (error) { 7 | console.error('Error in installing dependency ', error); 8 | } else { 9 | console.log('Success'); 10 | executeCommand(); 11 | } 12 | }); 13 | } else { 14 | executeCommand(); 15 | } 16 | 17 | async function executeCommand () { 18 | await import('./cmd.mjs'); 19 | }; 20 | -------------------------------------------------------------------------------- /unity/native_src/Inc/Common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "CommonTypes.h" 11 | 12 | #pragma warning(push, 0) 13 | #include 14 | #include 15 | #pragma warning(pop) 16 | 17 | #if !defined(PUERTS_NAMESPACE) 18 | #define PUERTS_NAMESPACE puerts 19 | #endif 20 | 21 | #if defined(USING_QJS_SUFFIX) && defined(CUSTOMV8NAMESPACE) 22 | namespace v8 = CUSTOMV8NAMESPACE; 23 | #endif 24 | 25 | 26 | -------------------------------------------------------------------------------- /unity/native_src/Inc/CommonTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | #pragma once 9 | 10 | namespace puerts 11 | { 12 | 13 | typedef void (*FuncPtr)(void); 14 | 15 | 16 | enum JsValueType 17 | { 18 | NullOrUndefined = 1, 19 | BigInt = 2, 20 | Number = 4, 21 | String = 8, 22 | Boolean = 16, 23 | NativeObject = 32, 24 | JsObject = 64, 25 | Array = 128, 26 | Function = 256, 27 | Date = 512, 28 | ArrayBuffer = 1024, 29 | Unknow = 2048, 30 | }; 31 | 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /unity/native_src/Inc/Log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | #pragma once 9 | 10 | #ifdef __cplusplus 11 | #include 12 | 13 | namespace puerts 14 | { 15 | enum LogLevel 16 | { 17 | Log = 0, 18 | Warning = 1, 19 | Error = 2 20 | }; 21 | 22 | void PLog(LogLevel Level, const char* Fmt, ...); 23 | 24 | } 25 | #else 26 | void puerts_log(const char* fmt, ...); 27 | #endif 28 | 29 | typedef void(*LogCallback)(const char* value); 30 | -------------------------------------------------------------------------------- /unity/native_src/Inc/NamespaceDef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "PuertsNamespaceDef.h" 12 | 13 | #if defined(WITH_QJS_NAMESPACE_SUFFIX) 14 | namespace v8 = v8_qjs; 15 | #endif 16 | -------------------------------------------------------------------------------- /unity/native_src/Src/PesapiAddonLoad.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #include "pesapi.h" 10 | 11 | EXTERN_C_START 12 | int pesapi_load_addon(const char* path, const char* module_name) 13 | { 14 | return -1; 15 | } 16 | 17 | EXTERN_C_END 18 | 19 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/Android/arm64/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //android arm64 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = { 7 | }; 8 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/Android/armv7a/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //android armv7 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = { 7 | }; 8 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/Android/x64/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //android x64 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = { 7 | }; 8 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/Linux/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //osx 64 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = { 7 | }; 8 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/Win32/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //window x86 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = {0}; 7 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/Win64/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //window x64 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = {0}; 7 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/Win64MD/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //window x64 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = {0}; 7 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/iOS/arm64/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //ios arm64 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = { 7 | }; 8 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/iOS/bitcode/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //ios arm64(bitcode) 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = { 7 | }; 8 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/macOS/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //osx 64 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = { 7 | }; 8 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/Blob/macOS_arm64/SnapshotBlob.h: -------------------------------------------------------------------------------- 1 | //osx 64 2 | #pragma once 3 | 4 | #include 5 | 6 | static const uint8_t SnapshotBlobCode[] = { 7 | }; 8 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/libplatform/libplatform-export.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 the V8 project authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_ 6 | #define V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_ 7 | 8 | #if defined(_WIN32) 9 | 10 | #ifdef BUILDING_V8_PLATFORM_SHARED 11 | #define V8_PLATFORM_EXPORT __declspec(dllexport) 12 | #elif USING_V8_PLATFORM_SHARED 13 | #define V8_PLATFORM_EXPORT __declspec(dllimport) 14 | #else 15 | #define V8_PLATFORM_EXPORT 16 | #endif // BUILDING_V8_PLATFORM_SHARED 17 | 18 | #else // defined(_WIN32) 19 | 20 | // Setup for Linux shared library export. 21 | #ifdef BUILDING_V8_PLATFORM_SHARED 22 | #define V8_PLATFORM_EXPORT __attribute__((visibility("default"))) 23 | #else 24 | #define V8_PLATFORM_EXPORT 25 | #endif 26 | 27 | #endif // defined(_WIN32) 28 | 29 | #endif // V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_ 30 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/libplatform/libplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef V8_LIBPLATFORM_LIBPLATFORM_H_ 2 | #define V8_LIBPLATFORM_LIBPLATFORM_H_ 3 | 4 | #include 5 | 6 | #include "v8config.h" 7 | #include "libplatform/libplatform-export.h" 8 | #include "v8-platform.h" 9 | 10 | namespace CUSTOMV8NAMESPACE { 11 | namespace platform { 12 | 13 | V8_PLATFORM_EXPORT std::unique_ptr NewDefaultPlatform(); 14 | 15 | } // namespace platform 16 | } // namespace CUSTOMV8NAMESPACE 17 | 18 | #endif // V8_LIBPLATFORM_LIBPLATFORM_H_ 19 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/include/v8-platform.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 the V8 project authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef V8_V8_PLATFORM_H_ 6 | #define V8_V8_PLATFORM_H_ 7 | 8 | #include 9 | #include 10 | #include // For abort. 11 | #include 12 | #include 13 | 14 | 15 | namespace CUSTOMV8NAMESPACE { 16 | 17 | class Platform { 18 | 19 | }; 20 | 21 | } // namespace CUSTOMV8NAMESPACE 22 | 23 | #endif // V8_V8_PLATFORM_H_ 24 | -------------------------------------------------------------------------------- /unity/native_src/backend-quickjs/quickjs/_VERSION: -------------------------------------------------------------------------------- 1 | 2020-11-08 2 | -------------------------------------------------------------------------------- /unity/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "native_src", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "make.js", 6 | "scripts": { 7 | "build": "" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@puerts/shell-util": "^2.0.1", 13 | "axios": "^1.7.5", 14 | "commander": "^9.3.0", 15 | "glob": "^8.0.3", 16 | "progress": "^2.0.3", 17 | "tar": "^7.4.3" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /unity/test/Src/Cases/API/NodeJSTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using System; 3 | using Puerts; 4 | 5 | namespace Puerts.UnitTest 6 | { 7 | [TestFixture] 8 | public class NodeJSTest 9 | { 10 | [Test] 11 | public void BackendIsNodeJSTest() 12 | { 13 | var env = UnitTestEnv.GetEnv(); 14 | if (env.Backend is BackendNodeJS) { 15 | int pid = env.Eval("process.pid"); 16 | 17 | Assert.AreEqual(pid, System.Diagnostics.Process.GetCurrentProcess().Id); 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /unity/test/Src/Cases/CrossLang/DelegateTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using NUnit.Framework; 4 | 5 | namespace Puerts.UnitTest 6 | { 7 | public delegate void TestCallback(string msg); 8 | public class DelegateTestClass 9 | { 10 | public TestCallback Callback; 11 | 12 | public void CSMessage() 13 | { 14 | Callback("cs_msg"); 15 | } 16 | }; 17 | 18 | [TestFixture] 19 | public class DelegateTest 20 | { 21 | [Test] 22 | public void DelegateBase() 23 | { 24 | var jsEnv = UnitTestEnv.GetEnv(); 25 | 26 | jsEnv.Eval(@" 27 | globalThis.deleteobj = new CS.Puerts.UnitTest.DelegateTestClass() 28 | deleteobj.Callback = (msg) => globalThis.info = msg; 29 | deleteobj.CSMessage(); 30 | "); 31 | 32 | string info = jsEnv.Eval("globalThis.info"); 33 | Assert.AreEqual("cs_msg", info); 34 | 35 | jsEnv.Eval(@"deleteobj.Callback.Invoke('js_msg')"); 36 | info = jsEnv.Eval("globalThis.info"); 37 | Assert.AreEqual("js_msg", info); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /unity/test/Src/Cases/CrossLang/GenericTest.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unity/test/Src/Cases/CrossLang/GenericTest.cs -------------------------------------------------------------------------------- /unity/test/Src/Resources/CSharpModuleTest/access_innerclass_test.mjs: -------------------------------------------------------------------------------- 1 | CS.NUnit.Framework.Assert.AreEqual(CS.Puerts.UnitTest.CSharpModuleTest.Inner.i, 3) -------------------------------------------------------------------------------- /unity/test/Src/Resources/CSharpModuleTest/console_log_test.mjs: -------------------------------------------------------------------------------- 1 | console.log('console.log ok'); 2 | (typeof CS.UnityEngine.Debug.Log == 'function' ? CS.UnityEngine.Debug.Log : CS.System.Console.WriteLine) 3 | ('CS.UnityEngine.Debug.Log ok') -------------------------------------------------------------------------------- /unity/test/Src/Resources/CSharpModuleTest/empty.mjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unity/test/Src/Resources/CSharpModuleTest/empty.mjs -------------------------------------------------------------------------------- /unity/test/Src/Resources/CSharpModuleTest/forof_test.mjs: -------------------------------------------------------------------------------- 1 | let Assert_AreEqual = CS.NUnit.Framework.Assert.AreEqual 2 | 3 | 4 | let IntList = puer.$generic(CS.System.Collections.Generic.List$1, CS.System.Int32); 5 | let list = new IntList(); 6 | list.Add(1); 7 | list.Add(2); 8 | 9 | let IntDict = puer.$generic(CS.System.Collections.Generic.Dictionary$2, CS.System.Int32, CS.System.Int32); 10 | let dict = new IntDict(); 11 | dict.Add(10, 20); 12 | dict.Add(30, 40); 13 | let total = 0; 14 | for (const listElement of list) { 15 | total += listElement; 16 | } 17 | for (const dictElement of dict) { 18 | total += dictElement.Key + dictElement.Value; 19 | } 20 | Assert_AreEqual(total, 103); 21 | 22 | 23 | let StringList = puer.$generic(CS.System.Collections.Generic.List$1, CS.System.String); 24 | let listFromCS = CS.Puerts.UnitTest.ForofTestHelper.GetAStringList(); 25 | let ret = []; 26 | for (const element of listFromCS) { 27 | ret.push(element); 28 | } 29 | Assert_AreEqual(ret.join(" "), "puerts really good"); -------------------------------------------------------------------------------- /unity/test/Src/Resources/a_cjs.cjs: -------------------------------------------------------------------------------- 1 | exports["default"] = 'hello world'; 2 | -------------------------------------------------------------------------------- /unity/test/Src/Resources/a_mjs.mjs: -------------------------------------------------------------------------------- 1 | 2 | import str from 'a_cjs.cjs'; 3 | 4 | export default str; -------------------------------------------------------------------------------- /unity/test/Src/Resources/bootstrap_test.mjs: -------------------------------------------------------------------------------- 1 | import { createRequire } from 'puerts/module.mjs'; 2 | 3 | const require = createRequire(''); 4 | 5 | const lm = require('./lazymodule.cjs'); 6 | 7 | globalThis.lazyss = "boot>>"; 8 | lm.foo(); 9 | -------------------------------------------------------------------------------- /unity/test/Src/Resources/circular_m1.cjs: -------------------------------------------------------------------------------- 1 | const m2 = require('circular_m2.cjs'); 2 | 3 | exports.foo = () => { 4 | return m2.bar(); // expect "hello john" 5 | } 6 | 7 | exports.f1 = "hello john"; 8 | 9 | 10 | m2.bar(); 11 | 12 | -------------------------------------------------------------------------------- /unity/test/Src/Resources/circular_m2.cjs: -------------------------------------------------------------------------------- 1 | const m1 = require('circular_m1.cjs'); 2 | 3 | exports.bar = () => { 4 | return m1.f1; 5 | } -------------------------------------------------------------------------------- /unity/test/Src/Resources/cjs/whatever.cjs: -------------------------------------------------------------------------------- 1 | exports["default"] = 'hello world'; 2 | -------------------------------------------------------------------------------- /unity/test/Src/Resources/eval-error/whatever.mjs: -------------------------------------------------------------------------------- 1 | var obj = {}; obj.func(); -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-circular/main.mjs: -------------------------------------------------------------------------------- 1 | 2 | import module1 from './module1.mjs'; 3 | import module2 from './module2.mjs'; 4 | 5 | module1.callMe('from john'); 6 | module2.callMe('from bob'); -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-circular/module1.mjs: -------------------------------------------------------------------------------- 1 | 2 | import module2 from './module2.mjs'; 3 | // CS.System.Console.WriteLine('module1 loading'); 4 | 5 | function callMe(msg) 6 | { 7 | module2.callMe('module 2'); 8 | // CS.System.Console.WriteLine('callMe called', msg); 9 | } 10 | 11 | class M1 12 | { 13 | constructor() 14 | { 15 | // CS.System.Console.WriteLine('M1'); 16 | } 17 | } 18 | 19 | export default { callMe, M1 }; -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-circular/module2.mjs: -------------------------------------------------------------------------------- 1 | 2 | import module1 from './module1.mjs'; 3 | // CS.System.Console.WriteLine('module2 loading'); 4 | 5 | function callMe(msg) 6 | { 7 | new module1.M1(); 8 | // CS.System.Console.WriteLine('callMe called', msg); 9 | } 10 | 11 | 12 | export default { callMe }; -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-eval-error/entry.mjs: -------------------------------------------------------------------------------- 1 | import './whatever.mjs' -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-eval-error/whatever.mjs: -------------------------------------------------------------------------------- 1 | var obj = {}; obj.func(); -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-not-relative/lib/test.mjs: -------------------------------------------------------------------------------- 1 | import { M2 } from 'import-not-relative/module2.mjs'; 2 | const Test = 'Test ' + M2 3 | 4 | export { Test }; -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-not-relative/main.mjs: -------------------------------------------------------------------------------- 1 | import { M2 } from 'import-not-relative/module2.mjs' 2 | import { Test } from './lib/test.mjs'; 3 | 4 | export default M2 + Test; -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-not-relative/module2.mjs: -------------------------------------------------------------------------------- 1 | const M2 = 'M2'; 2 | export { M2 }; -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-package/index.js.txt: -------------------------------------------------------------------------------- 1 | import str from './lib.js' 2 | export default str -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-package/lib.js.txt: -------------------------------------------------------------------------------- 1 | export default 'lib in package' 2 | -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-relative/a/entry.mjs: -------------------------------------------------------------------------------- 1 | import { str } from '../b/whatever.mjs'; 2 | export { str }; -------------------------------------------------------------------------------- /unity/test/Src/Resources/import-relative/b/whatever.mjs: -------------------------------------------------------------------------------- 1 | export const str = 'hello' -------------------------------------------------------------------------------- /unity/test/Src/Resources/lazymodule.cjs: -------------------------------------------------------------------------------- 1 | globalThis.lazyss = globalThis.lazyss ? globalThis.lazyss + "module_root>>" : "module_root>>"; 2 | 3 | function foo () { 4 | globalThis.lazyss += "foo>>"; 5 | } 6 | 7 | exports.foo = foo; 8 | -------------------------------------------------------------------------------- /unity/test/Src/Resources/lazymodule1.cjs: -------------------------------------------------------------------------------- 1 | const lm2 = require('./lazymodule2.cjs'); 2 | 3 | exports.bar = () => { 4 | console.log('lazymodule1 bar'); 5 | lm2.foo(); 6 | } 7 | 8 | exports.notusinglm2 = () => { 9 | console.log('lazymodule1 notusinglm2'); 10 | } 11 | -------------------------------------------------------------------------------- /unity/test/Src/Resources/lazymodule2.cjs: -------------------------------------------------------------------------------- 1 | 2 | exports.foo = () => { 3 | console.log('lazymodule2 foo'); 4 | } 5 | -------------------------------------------------------------------------------- /unity/test/Src/Resources/mjs/whatever.mjs: -------------------------------------------------------------------------------- 1 | import str from '../cjs/whatever.cjs'; 2 | 3 | export default str; -------------------------------------------------------------------------------- /unity/test/Src/Resources/notfound/entry.mjs: -------------------------------------------------------------------------------- 1 | import './whatever.mjs' -------------------------------------------------------------------------------- /unity/test/Src/com.tencent.puerts.unittest.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.unittest", 3 | "rootNamespace": "", 4 | "references": [ 5 | "com.tencent.puerts.core", 6 | "com.tencent.puerts.webgl", 7 | "com.tencent.puerts.commonjs" 8 | ], 9 | "includePlatforms": [], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": true, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /unity/test/Src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.tencent.puerts.unittest", 3 | "displayName": "PuertsUnittest", 4 | "version": "1.0.0", 5 | "description": "Write your game with TypeScript in UE4 or Unity. Puerts can be pronounced as pu-erh TS(普洱TS)", 6 | "keywords": [ 7 | "Script" 8 | ], 9 | "author": { 10 | "name": "Tencent Puerts Group", 11 | "email": "johnche@tencent.com", 12 | "url": "https://github.com/puerts" 13 | }, 14 | "category": "Libraries" 15 | } -------------------------------------------------------------------------------- /unity/test/dotnet/Src/Helloworld.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | using Puerts; 9 | 10 | public class PuertsTest 11 | { 12 | public static void Main() 13 | { 14 | var jsEnv = new JsEnv(new TxtLoader()); 15 | jsEnv.Eval(@" 16 | CS.System.Console.WriteLine('hello world'); 17 | "); 18 | jsEnv.Dispose(); 19 | } 20 | } -------------------------------------------------------------------------------- /unity/test/dotnet/Src/WrapperGenerator/PuerRegisterInfo_Gen.cs: -------------------------------------------------------------------------------- 1 | using Puerts.TypeMapping; 2 | using Puerts; 3 | 4 | namespace PuertsStaticWrap 5 | { 6 | #if ENABLE_IL2CPP 7 | [UnityEngine.Scripting.Preserve] 8 | #endif 9 | public static class PuerRegisterInfo_Gen 10 | { 11 | public static void AddRegisterInfoGetterIntoJsEnv(JsEnv jsEnv) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /unity/test/unity/Assets/Editor/PuerCfg.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0992a8d62b68b7246a50bcde64c2fe7b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/test/unity/Assets/Editor/TestBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95d54b11e0936be4ea246a28bce745e0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/test/unity/Assets/Resources/BillingMode.json: -------------------------------------------------------------------------------- 1 | {"androidStore":"GooglePlay"} -------------------------------------------------------------------------------- /unity/test/unity/Assets/Scenes/HelloWorld.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 562bd29ef6418674aaea419720917ef1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/test/unity/Assets/Scenes/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0359e27c67e970e459769a466096d6aa 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/test/unity/Assets/Scripts/HelloWorlder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Puerts; 5 | 6 | public class HelloWorlder : MonoBehaviour 7 | { 8 | public static int ShouldDispose = 0; 9 | 10 | private JsEnv env; 11 | 12 | // Start is called before the first frame update 13 | void Start() 14 | { 15 | Application.runInBackground = true; 16 | env = new JsEnv(new DefaultLoader(), 8080); 17 | env.WaitDebugger(); 18 | env.Eval("setTimeout(()=> { console.log('Dispose'); CS.HelloWorlder.ShouldDispose = 1 }, 5000)"); 19 | 20 | } 21 | 22 | // Update is called once per frame 23 | void Update() 24 | { 25 | if (env != null) 26 | { 27 | if (ShouldDispose > 0) 28 | { 29 | env.Dispose(); 30 | return; 31 | } 32 | env.Tick(); 33 | env.Eval("console.log('Update');"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /unity/test/unity/Assets/Scripts/HelloWorlder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14265605dcbef164f9df40c2e17ed407 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/test/unity/Assets/Scripts/Tester.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0cf277cd6f8489439c77e0fca003120 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/test/unity/Assets/link.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_EnableOutputSuspension: 1 16 | m_SpatializerPlugin: 17 | m_AmbisonicDecoderPlugin: 18 | m_DisableAudio: 0 19 | m_VirtualizeEffects: 1 20 | m_RequestedDSPBufferSize: 0 21 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/AutoStreamingSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1200 &1 4 | AutoStreamingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | mSearchMode: 15 8 | mCustomSearchFile: 9 | mTextureSearchString: 10 | mMeshSearchString: 11 | mTextures: [] 12 | mAudios: [] 13 | mMeshes: [] 14 | mScenes: [] 15 | mConfigCCD: 16 | useCCD: 0 17 | cosKey: 18 | projectGuid: 19 | bucketUuid: 20 | bucketName: 21 | badgeName: 22 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.cn 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_ConfigSource: 0 29 | m_UserSelectedRegistryName: 30 | m_UserAddingNewScopedRegistry: 0 31 | m_RegistryInfoDraft: 32 | m_Modified: 0 33 | m_ErrorMessage: 34 | m_UserModificationsInstanceId: -890 35 | m_OriginalInstanceId: -892 36 | m_LoadAssets: 0 37 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.19f1c1 2 | m_EditorVersionWithRevision: 2021.3.19f1c1 (b8e3cea1e9d3) 3 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_CNEventUrl: https://cdp.cloud.unity.cn/v1/events 14 | m_CNConfigUrl: https://cdp.cloud.unity.cn/config 15 | m_TestInitMode: 0 16 | CrashReportingSettings: 17 | m_EventUrl: https://perf-events.cloud.unity.cn 18 | m_Enabled: 0 19 | m_LogBufferSize: 10 20 | m_CaptureEditorExceptions: 1 21 | UnityPurchasingSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | UnityAnalyticsSettings: 25 | m_Enabled: 0 26 | m_TestMode: 0 27 | m_InitializeOnStartup: 1 28 | m_PackageRequiringCoreStatsPresent: 0 29 | UnityAdsSettings: 30 | m_Enabled: 0 31 | m_InitializeOnStartup: 1 32 | m_TestMode: 0 33 | m_IosGameId: 34 | m_AndroidGameId: 35 | m_GameIds: {} 36 | m_GameId: 37 | PerformanceReportingSettings: 38 | m_Enabled: 0 39 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | m_CompiledVersion: 0 14 | m_RuntimeVersion: 0 15 | m_RuntimeResources: {fileID: 0} 16 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /unity/test/unity/ProjectSettings/boot.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unity/test/unity/ProjectSettings/boot.config -------------------------------------------------------------------------------- /unity/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "target": "esnext", 5 | "module": "ES2020", 6 | "jsx": "react", 7 | "sourceMap": true, 8 | "moduleResolution": "node", 9 | "noImplicitAny": true, 10 | "typeRoots": [ 11 | "./node_modules/@types" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/PuertsEditor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PuertsEditor", 3 | "version": "1.0.0", 4 | "description": "PuertsEditor", 5 | "scripts": {}, 6 | "dependencies": { 7 | "typescript": "4.7.4" 8 | }, 9 | "devDependencies": {} 10 | } 11 | -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/ffi/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | module.exports = require('ffi_bindings'); 9 | module.exports.binding = require('binding').binding; 10 | module.exports.closure= require('binding').closure; 11 | module.exports.typeInfo = require('type').typeInfo; 12 | module.exports.makeStruct = require('type').makeStruct; 13 | module.exports.makePointer = require('type').makePointer; 14 | -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/puerts/argv.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | (function () { 9 | "use strict"; 10 | 11 | let argList = []; 12 | let argMap = {}; 13 | 14 | puerts.argv = { 15 | getByIndex : function(index) { 16 | return argList[index] 17 | }, 18 | 19 | getByName : function(name) { 20 | return argMap[name]; 21 | }, 22 | 23 | add : function(name, value) { 24 | argList.push(value); 25 | argMap[name] = value; 26 | } 27 | } 28 | }()); -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/puerts/first_run.js: -------------------------------------------------------------------------------- 1 | //createInspector(8080) -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/puerts/jit_stub.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | var global = global || (function () { return this; }()); 9 | (function (global) { 10 | "use strict"; 11 | 12 | let requestJitModuleMethod = global.__tgjsRequestJitModuleMethod; 13 | global.__tgjsRequestJitModuleMethod = undefined; 14 | 15 | puerts.requestJitModuleMethod = function(moduleName, methodName, callback, ... args) { 16 | let data = moduleName + "#" + methodName + "#" + JSON.stringify(args); 17 | requestJitModuleMethod(data, (err, result) => { 18 | if (err) { 19 | callback(err); 20 | } else { 21 | callback(undefined, JSON.parse(result)); 22 | } 23 | }); 24 | } 25 | }(global)); 26 | -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/puerts/polyfill.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | var global = global || (function () { return this; }()); 9 | (function (global) { 10 | "use strict"; 11 | global.process = { env: { NODE_ENV: 'development' } }; 12 | }(global)); -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/react-umg/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./react-umg.js'); 4 | 5 | let components = require('components.js'); 6 | 7 | for(let k in components) { 8 | module.exports[k] = components[k]; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/utils/fs.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | let base64binary = require("thirdparty/base64-binary.js"); 9 | 10 | exports.loadBinarySync = function(name) { 11 | let ret = puerts.sendRequestSync('loadBinary', name); 12 | return base64binary.decode(ret); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/wasm/WasmMain.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unreal/Puerts/Content/JavaScript/wasm/WasmMain.wasm -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/wasm/WasmMain_Editor.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unreal/Puerts/Content/JavaScript/wasm/WasmMain_Editor.wasm -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/wasm/main.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unreal/Puerts/Content/JavaScript/wasm/main.wasm -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/wasm/modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "WasmMain" : { 3 | "LinkCategory" : 0, 4 | "GlobalNameInTs" : "WasmMain" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/wasm/test.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unreal/Puerts/Content/JavaScript/wasm/test.wasm -------------------------------------------------------------------------------- /unreal/Puerts/Content/JavaScript/wasm/testvector.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unreal/Puerts/Content/JavaScript/wasm/testvector.wasm -------------------------------------------------------------------------------- /unreal/Puerts/PuertsEditor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PuertsEditor", 3 | "version": "1.0.0", 4 | "description": "PuertsEditor", 5 | "scripts": { 6 | "build": "tsc -p tsconfig.json", 7 | "postbuild": "copy ..\\Content\\JavaScript\\PuertsEditor\\* ..\\..\\..\\Content\\JavaScript\\PuertsEditor\\" 8 | }, 9 | "dependencies": { 10 | "typescript": "4.7.4" 11 | }, 12 | "devDependencies": {} 13 | } 14 | -------------------------------------------------------------------------------- /unreal/Puerts/PuertsEditor/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "commonjs", 5 | "jsx": "react", 6 | "sourceMap": true, 7 | "typeRoots": [ 8 | "../../../Typing", 9 | ], 10 | "outDir": "../Content/Javascript/PuertsEditor" 11 | }, 12 | } -------------------------------------------------------------------------------- /unreal/Puerts/Resources/ButtonIcon_40x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unreal/Puerts/Resources/ButtonIcon_40x.png -------------------------------------------------------------------------------- /unreal/Puerts/Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/puerts/5adf2e02434f419e193deb32b0ddb429c2c8af15/unreal/Puerts/Resources/Icon128.png -------------------------------------------------------------------------------- /unreal/Puerts/Source/DeclarationGenerator/Private/CodeGenerator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | #include "CodeGenerator.h" 9 | 10 | // Add default functionality here for any ICodeGenerator functions that are not pure virtual. 11 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/DeclarationGenerator/Private/GenDTSCommands.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #include "GenDTSCommands.h" 10 | 11 | #define LOCTEXT_NAMESPACE "FGenDTSModule" 12 | 13 | void FGenDTSCommands::RegisterCommands() 14 | { 15 | UI_COMMAND( 16 | PluginAction, "puerts", "Generate *.d.ts and copy some js builtin libs", EUserInterfaceActionType::Button, FInputChord()); 17 | } 18 | 19 | #undef LOCTEXT_NAMESPACE 20 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/DeclarationGenerator/Public/CodeGenerator.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "UObject/Interface.h" 7 | #include "CodeGenerator.generated.h" 8 | 9 | // This class does not need to be modified. 10 | UINTERFACE(MinimalAPI) 11 | class UCodeGenerator : public UInterface 12 | { 13 | GENERATED_BODY() 14 | }; 15 | 16 | /** 17 | * 18 | */ 19 | class DECLARATIONGENERATOR_API ICodeGenerator 20 | { 21 | GENERATED_BODY() 22 | 23 | // Add interface functions to this class. This is the class that will be inherited to implement this interface. 24 | public: 25 | UFUNCTION(BlueprintNativeEvent) 26 | void Gen() const; 27 | }; 28 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/DeclarationGenerator/Public/GenDTSCommands.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | #include "Framework/Commands/Commands.h" 13 | #include "GenDTSStyle.h" 14 | 15 | class FGenDTSCommands : public TCommands 16 | { 17 | public: 18 | FGenDTSCommands() 19 | : TCommands( 20 | TEXT("GenDTS"), NSLOCTEXT("Contexts", "GenDTS", "GenDTS Plugin"), NAME_None, FGenDTSStyle::GetStyleSetName()) 21 | { 22 | } 23 | 24 | // TCommands<> interface 25 | void RegisterCommands() override; 26 | 27 | public: 28 | TSharedPtr PluginAction; 29 | }; 30 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/DeclarationGenerator/Public/GenDTSStyle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | #include "Styling/SlateStyle.h" 13 | 14 | class FGenDTSStyle 15 | { 16 | public: 17 | static void Initialize(); 18 | 19 | static void Shutdown(); 20 | 21 | /** reloads textures used by slate renderer */ 22 | static void ReloadTextures(); 23 | 24 | /** @return The Slate style set for the Shooter game */ 25 | static const ISlateStyle& Get(); 26 | 27 | static FName GetStyleSetName(); 28 | 29 | private: 30 | static TSharedRef Create(); 31 | 32 | private: 33 | static TSharedPtr StyleInstance; 34 | }; -------------------------------------------------------------------------------- /unreal/Puerts/Source/DeclarationGenerator/Public/TemplateBindingGenerator.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CodeGenerator.h" 6 | #include "TypeScriptDeclarationGenerator.h" 7 | 8 | #include "CoreMinimal.h" 9 | #include "UObject/NoExportTypes.h" 10 | #include "TemplateBindingGenerator.generated.h" 11 | 12 | /** 13 | * 14 | */ 15 | UCLASS() 16 | class DECLARATIONGENERATOR_API UTemplateBindingGenerator : public UObject, public ICodeGenerator 17 | { 18 | GENERATED_BODY() 19 | 20 | public: 21 | UFUNCTION(BlueprintNativeEvent) 22 | void Gen() const; 23 | 24 | virtual void Gen_Implementation() const override; 25 | }; 26 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Private/DynamicDelegateProxy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #include "DynamicDelegateProxy.h" 10 | 11 | void UDynamicDelegateProxy::Fire() 12 | { 13 | // Do Nothing 14 | } 15 | 16 | void UDynamicDelegateProxy::ProcessEvent(UFunction*, void* Params) 17 | { 18 | auto PinedDynamicInvoker = DynamicInvoker.Pin(); 19 | if (PinedDynamicInvoker && Owner.IsValid()) 20 | { 21 | #ifdef THREAD_SAFE 22 | v8::Locker Locker(Isolate); 23 | #endif 24 | if (ensureAlwaysMsgf(!JsFunction.IsEmpty(), TEXT("Invalid JS Function"))) 25 | { 26 | PinedDynamicInvoker->InvokeDelegateCallback(this, Params); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Private/ExtensionMethods.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #include "ExtensionMethods.h" 10 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Private/Gen/UsingTypeDecl.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | #include "Binding.hpp" 13 | #include "UEDataBinding.hpp" 14 | 15 | UsingUStruct(FBox2D); 16 | UsingUStruct(FVector2D); 17 | UsingUStruct(FLinearColor); 18 | UsingUStruct(FColor); 19 | UsingUStruct(FVector); 20 | UsingUStruct(FGuid); 21 | UsingUStruct(FIntPoint); 22 | UsingUStruct(FIntVector); 23 | UsingUStruct(FQuat); 24 | UsingUStruct(FRotator); 25 | UsingUStruct(FTransform); 26 | UsingUStruct(FVector4); 27 | UsingUStruct(FPlane); 28 | UsingCppType(FFloat16Color); 29 | UsingUStruct(FMatrix); 30 | UsingContainer(TArray); 31 | UsingUStruct(FIntVector4); 32 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Private/JSLogger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #include "JSLogger.h" 10 | 11 | DEFINE_LOG_CATEGORY(Puerts); 12 | 13 | namespace PUERTS_NAMESPACE 14 | { 15 | void FDefaultLogger::Log(const FString& Message) const 16 | { 17 | UE_LOG(Puerts, Log, TEXT("(0x%p) %s"), this, *Message); 18 | } 19 | 20 | void FDefaultLogger::Info(const FString& Message) const 21 | { 22 | UE_LOG(Puerts, Display, TEXT("(0x%p) %s"), this, *Message); 23 | } 24 | 25 | void FDefaultLogger::Warn(const FString& Message) const 26 | { 27 | UE_LOG(Puerts, Warning, TEXT("(0x%p) %s"), this, *Message); 28 | } 29 | 30 | void FDefaultLogger::Error(const FString& Message) const 31 | { 32 | UE_LOG(Puerts, Error, TEXT("(0x%p) %s"), this, *Message); 33 | } 34 | 35 | } // namespace PUERTS_NAMESPACE -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Private/PuertsWasm/WasmStaticUEBinding.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #if USE_WASM3 10 | #include 11 | #include 12 | #include "WasmRuntime.h" 13 | #include "WasmModule.h" 14 | #include "WasmFunction.h" 15 | #include "WasmStaticLink.h" 16 | #include "CoreMinimal.h" 17 | #include "Binding.hpp" 18 | #include "UEDataBinding.hpp" 19 | 20 | struct AutoRegisterForWasmExtension 21 | { 22 | }; 23 | AutoRegisterForWasmExtension __AutoRegisterForWasmExtension__; 24 | #endif -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Private/PuertsWasm/WasmTestForStaticBinding.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #if USE_WASM3 10 | #include 11 | #include 12 | #include "WasmRuntime.h" 13 | #include "WasmModule.h" 14 | #include "WasmFunction.h" 15 | #include "WasmStaticLink.h" 16 | #include "CoreMinimal.h" 17 | #include "Binding.hpp" 18 | #include "UEDataBinding.hpp" 19 | #include "Kismet/KismetMathLibrary.h" 20 | 21 | float atan2_ue_bind(float X, float Y) 22 | { 23 | return UKismetMathLibrary::Atan2(X, Y); 24 | } 25 | 26 | WASM_BEGIN_LINK_GLOBAL(TestMath, 0) 27 | WASM_LINK_GLOBAL(atan2_ue_bind) 28 | WASM_END_LINK_GLOBAL(TestMath, 0) 29 | 30 | #endif -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Private/SoftObjectWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | 13 | #include "NamespaceDef.h" 14 | 15 | PRAGMA_DISABLE_UNDEFINED_IDENTIFIER_WARNINGS 16 | #pragma warning(push, 0) 17 | #include "libplatform/libplatform.h" 18 | #include "v8.h" 19 | #pragma warning(pop) 20 | PRAGMA_ENABLE_UNDEFINED_IDENTIFIER_WARNINGS 21 | 22 | namespace PUERTS_NAMESPACE 23 | { 24 | class FSoftObjectWrapper 25 | { 26 | public: 27 | static v8::Local ToFunctionTemplate(v8::Isolate* Isolate); 28 | 29 | private: 30 | static void LoadSynchronous(const v8::FunctionCallbackInfo& Info); 31 | 32 | static void Get(const v8::FunctionCallbackInfo& Info); 33 | }; 34 | } // namespace PUERTS_NAMESPACE 35 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Private/TypeScriptBlueprint.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "TypeScriptBlueprint.h" 4 | #include "TypeScriptGeneratedClass.h" 5 | 6 | #if WITH_EDITOR 7 | UClass* UTypeScriptBlueprint::GetBlueprintClass() const 8 | { 9 | return UTypeScriptGeneratedClass::StaticClass(); 10 | } 11 | #endif 12 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Public/ArrayBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | #include "ArrayBuffer.generated.h" 13 | 14 | USTRUCT(BlueprintType) 15 | struct FArrayBuffer 16 | { 17 | public: 18 | GENERATED_USTRUCT_BODY() 19 | 20 | public: 21 | void* Data; 22 | 23 | size_t Length; 24 | 25 | bool bCopy = false; 26 | }; 27 | 28 | USTRUCT(BlueprintType) 29 | struct FArrayBufferValue 30 | { 31 | public: 32 | GENERATED_USTRUCT_BODY() 33 | 34 | public: 35 | TArray Data; 36 | }; -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Public/Binding.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "PuertsNamespaceDef.h" 12 | #include "StaticCall.hpp" 13 | #include "ScriptBackend.hpp" 14 | #include "Object.hpp" 15 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Public/ExtensionMethods.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | #include "Kismet/BlueprintFunctionLibrary.h" 13 | #include "ExtensionMethods.generated.h" 14 | 15 | /** 16 | * 17 | */ 18 | UCLASS() 19 | class JSENV_API UExtensionMethods : public UBlueprintFunctionLibrary 20 | { 21 | GENERATED_BODY() 22 | }; 23 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Public/FFIBinding.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "inttypes.h" 12 | #include "CoreMinimal.h" 13 | 14 | typedef void (*FuncPtr)(); 15 | 16 | JSENV_API void SetFunctionArray(FuncPtr* FuncArray, uint32_t FuncArrayLength); 17 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Public/NamespaceDef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "PuertsNamespaceDef.h" 12 | 13 | #if defined(WITH_QJS_NAMESPACE_SUFFIX) 14 | namespace v8 = v8_qjs; 15 | #endif 16 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Public/TsDynamicInvoker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "UObject/Stack.h" 12 | #include "UObject/Object.h" 13 | #include "UObject/Class.h" 14 | #include "PuertsNamespaceDef.h" 15 | 16 | class UTypeScriptGeneratedClass; 17 | 18 | namespace PUERTS_NAMESPACE 19 | { 20 | class ITsDynamicInvoker 21 | { 22 | public: 23 | virtual void TsConstruct(UTypeScriptGeneratedClass* Class, UObject* Object) = 0; 24 | 25 | virtual void InvokeTsMethod(UObject* ContextObject, UFunction* Function, FFrame& Stack, void* RESULT_PARAM) = 0; 26 | 27 | virtual void NotifyReBind(UTypeScriptGeneratedClass* Class) = 0; 28 | }; 29 | 30 | } // namespace PUERTS_NAMESPACE 31 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/JsEnv/Public/TypeScriptBlueprint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | #include "Engine/Blueprint.h" 13 | #include "TypeScriptBlueprint.generated.h" 14 | 15 | /** 16 | * 17 | */ 18 | UCLASS() 19 | class JSENV_API UTypeScriptBlueprint : public UBlueprint 20 | { 21 | GENERATED_BODY() 22 | 23 | public: 24 | #if WITH_EDITOR 25 | virtual UClass* GetBlueprintClass() const override; 26 | #endif 27 | }; 28 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/Puerts/Private/PuertsSetting.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #include "PuertsSetting.h" 10 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/Puerts/Puerts.Build.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms. 5 | * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. 6 | */ 7 | 8 | using System; 9 | using System.IO; 10 | using UnrealBuildTool; 11 | 12 | public class Puerts : ModuleRules 13 | { 14 | public Puerts(ReadOnlyTargetRules Target) : base(Target) 15 | { 16 | PublicDependencyModuleNames.AddRange( 17 | new string[] 18 | { 19 | "Core", "CoreUObject", "Engine", "InputCore", "Serialization", "OpenSSL","UMG","JsEnv", 20 | } 21 | ); 22 | 23 | if (Target.bBuildEditor == true) 24 | { 25 | PrivateDependencyModuleNames.Add("UnrealEd"); 26 | } 27 | 28 | //PublicDefinitions.Add(string.Format("DECL_OUTPUT_PATH={0}", Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "Content", "Scripts")))); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/PuertsEditor/Private/TypeScriptCompilerContext.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | 5 | #include "KismetCompiler.h" 6 | 7 | class FTypeScriptCompilerContext final : public FKismetCompilerContext 8 | { 9 | using Super = FKismetCompilerContext; 10 | 11 | public: 12 | FTypeScriptCompilerContext( 13 | UBlueprint* SourceSketch, FCompilerResultsLog& MessageLog, const FKismetCompilerOptions& CompilerOptions); 14 | 15 | private: 16 | void SpawnNewClass(const FString& NewClassName) override; 17 | }; 18 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/PuertsEditor/Public/PEDirectoryWatcher.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "IDirectoryWatcher.h" 6 | 7 | #include "CoreMinimal.h" 8 | #include "UObject/NoExportTypes.h" 9 | #include "PEDirectoryWatcher.generated.h" 10 | 11 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( 12 | FDirectoryWatcherCallback, const TArray&, Added, const TArray&, Modified, const TArray&, Removed); 13 | 14 | /** 15 | * 16 | */ 17 | UCLASS() 18 | class PUERTSEDITOR_API UPEDirectoryWatcher : public UObject 19 | { 20 | GENERATED_BODY() 21 | 22 | public: 23 | FDelegateHandle DelegateHandle; 24 | 25 | UPROPERTY(BlueprintAssignable) 26 | FDirectoryWatcherCallback OnChanged; 27 | 28 | UFUNCTION(BlueprintCallable, Category = "File") 29 | bool Watch(const FString& InDirectory); 30 | 31 | UFUNCTION(BlueprintCallable, Category = "File") 32 | void UnWatch(); 33 | 34 | UPEDirectoryWatcher(); 35 | 36 | ~UPEDirectoryWatcher(); 37 | 38 | private: 39 | FString Directory; 40 | }; 41 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/PuertsEditor/Public/PuertsEditorModule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | #include "Modules/ModuleManager.h" 15 | #include "CoreMinimal.h" 16 | 17 | class IPuertsEditorModule : public IModuleInterface 18 | { 19 | public: 20 | static inline IPuertsEditorModule& Get() 21 | { 22 | return FModuleManager::LoadModuleChecked("PuertsEditor"); 23 | } 24 | 25 | static inline bool IsAvailable() 26 | { 27 | return FModuleManager::Get().IsModuleLoaded("PuertsEditor"); 28 | } 29 | 30 | virtual void SetCmdImpl(std::function Func) = 0; 31 | }; 32 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/Private/WasmEnv.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #include "WasmEnv.h" 10 | 11 | WasmEnv::WasmEnv() 12 | { 13 | _Env = m3_NewEnvironment(); // m3_FreeEnvironment 14 | } 15 | 16 | WasmEnv::~WasmEnv() 17 | { 18 | if (_Env) 19 | { 20 | m3_FreeEnvironment(_Env); 21 | _Env = nullptr; 22 | } 23 | } -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/Private/WasmFunction.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #include "WasmFunction.h" 10 | #include "WasmModule.h" 11 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/Private/WasmModule.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #include "WasmModule.h" 10 | #include "Misc/FileHelper.h" 11 | #include "WasmRuntime.h" 12 | #include "WasmFunction.h" 13 | #include "WasmStaticLink.h" 14 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/Public/Wasm3ExportDef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | #include "CoreMinimal.h" 11 | #include "wasm3.h" 12 | #include "m3_env.h" 13 | 14 | // true表示成功,false表示失败 15 | WASMCORE_API bool Export_m3_GetResults(IM3Function i_function, uint32_t i_retc, const void* o_retptrs[]); 16 | WASMCORE_API bool Export_m3_Call(IM3Function i_function, uint32_t i_argc, const void* i_argptrs[]); 17 | WASMCORE_API bool Export_m3_LinkRawFunctionEx(IM3Module io_module, const char* const i_moduleName, const char* const i_functionName, 18 | const char* const i_signature, M3RawCall i_function, const void* i_userdata); 19 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/Public/WasmCommonIncludes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | #include "CoreMinimal.h" 11 | #include "wasm3.h" 12 | #include "m3_env.h" 13 | #define WASM_PTR u32 14 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/Public/WasmCore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | #include "Modules/ModuleManager.h" 13 | 14 | class WasmCoreModule : public IModuleInterface 15 | { 16 | public: 17 | virtual void StartupModule() override; 18 | virtual void ShutdownModule() override; 19 | }; 20 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/Public/WasmEnv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | #include "CoreMinimal.h" 11 | #include "WasmCommonIncludes.h" 12 | 13 | class WASMCORE_API WasmEnv final 14 | { 15 | private: 16 | IM3Environment _Env; 17 | 18 | public: 19 | WasmEnv(); 20 | ~WasmEnv(); 21 | FORCEINLINE IM3Environment GetEnv() 22 | { 23 | return _Env; 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/Public/WasmModule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Puerts available. 3 | * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 4 | * Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may 5 | * be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE', 6 | * which is part of this source code package. 7 | */ 8 | 9 | #pragma once 10 | #include "CoreMinimal.h" 11 | #include "wasm3.h" 12 | #include "WasmEnv.h" 13 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/ThirdPart/wasm3/m3_api_libc.h: -------------------------------------------------------------------------------- 1 | // 2 | // m3_api_libc.h 3 | // 4 | // Created by Volodymyr Shymanskyy on 11/20/19. 5 | // Copyright © 2019 Volodymyr Shymanskyy. All rights reserved. 6 | // 7 | 8 | #ifndef m3_api_libc_h 9 | #define m3_api_libc_h 10 | 11 | #include "m3_core.h" 12 | 13 | d_m3BeginExternC 14 | 15 | M3Result m3_LinkLibC (IM3Module io_module); 16 | M3Result m3_LinkSpecTest (IM3Module io_module); 17 | 18 | d_m3EndExternC 19 | 20 | #endif // m3_api_libc_h 21 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/ThirdPart/wasm3/m3_api_tracer.h: -------------------------------------------------------------------------------- 1 | // 2 | // m3_api_tracer.h 3 | // 4 | // Created by Volodymyr Shymanskyy on 02/18/20. 5 | // Copyright © 2020 Volodymyr Shymanskyy. All rights reserved. 6 | // 7 | 8 | #ifndef m3_api_tracer_h 9 | #define m3_api_tracer_h 10 | 11 | #include "m3_core.h" 12 | 13 | d_m3BeginExternC 14 | 15 | M3Result m3_LinkTracer (IM3Module io_module); 16 | 17 | d_m3EndExternC 18 | 19 | #endif // m3_api_tracer_h 20 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/ThirdPart/wasm3/m3_api_wasi.h: -------------------------------------------------------------------------------- 1 | // 2 | // m3_api_wasi.h 3 | // 4 | // Created by Volodymyr Shymanskyy on 11/20/19. 5 | // Copyright © 2019 Volodymyr Shymanskyy. All rights reserved. 6 | // 7 | 8 | #ifndef m3_api_wasi_h 9 | #define m3_api_wasi_h 10 | 11 | #include "m3_core.h" 12 | 13 | #if defined(d_m3HasUVWASI) 14 | #include "uvwasi.h" 15 | #endif 16 | 17 | d_m3BeginExternC 18 | 19 | typedef struct m3_wasi_context_t 20 | { 21 | i32 exit_code; 22 | u32 argc; 23 | ccstr_t * argv; 24 | } m3_wasi_context_t; 25 | 26 | M3Result m3_LinkWASI (IM3Module io_module); 27 | 28 | #if defined(d_m3HasUVWASI) 29 | 30 | M3Result m3_LinkWASIWithOptions (IM3Module io_module, uvwasi_options_t uvwasiOptions); 31 | 32 | #endif 33 | 34 | m3_wasi_context_t* m3_GetWasiContext(); 35 | 36 | d_m3EndExternC 37 | 38 | #endif // m3_api_wasi_h 39 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/ThirdPart/wasm3/m3_bind.h: -------------------------------------------------------------------------------- 1 | // 2 | // m3_bind.h 3 | // 4 | // Created by Steven Massey on 2/27/20. 5 | // Copyright © 2020 Steven Massey. All rights reserved. 6 | // 7 | 8 | #ifndef m3_bind_h 9 | #define m3_bind_h 10 | 11 | #include "m3_env.h" 12 | 13 | d_m3BeginExternC 14 | 15 | u8 ConvertTypeCharToTypeId (char i_code); 16 | M3Result SignatureToFuncType (IM3FuncType * o_functionType, ccstr_t i_signature); 17 | 18 | d_m3EndExternC 19 | 20 | #endif /* m3_bind_h */ 21 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/ThirdPart/wasm3/m3_exception.h: -------------------------------------------------------------------------------- 1 | // 2 | // m3_exception.h 3 | // 4 | // Created by Steven Massey on 7/5/19. 5 | // Copyright © 2019 Steven Massey. All rights reserved. 6 | // 7 | // some macros to emulate try/catch 8 | 9 | #ifndef m3_exception_h 10 | #define m3_exception_h 11 | 12 | #include "m3_config.h" 13 | 14 | # if d_m3EnableExceptionBreakpoint 15 | 16 | // declared in m3_info.c 17 | void ExceptionBreakpoint (cstr_t i_exception, cstr_t i_message); 18 | 19 | # define EXCEPTION_PRINT(ERROR) ExceptionBreakpoint (ERROR, (__FILE__ ":" M3_STR(__LINE__))) 20 | 21 | # else 22 | # define EXCEPTION_PRINT(...) 23 | # endif 24 | 25 | 26 | #define _try M3Result result = m3Err_none; 27 | #define _(TRY) { result = TRY; if (M3_UNLIKELY(result)) { EXCEPTION_PRINT (result); goto _catch; } } 28 | #define _throw(ERROR) { result = ERROR; EXCEPTION_PRINT (result); goto _catch; } 29 | #define _throwif(ERROR, COND) if (M3_UNLIKELY(COND)) { _throw(ERROR); } 30 | 31 | #define _throwifnull(PTR) _throwif (m3Err_mallocFailed, !(PTR)) 32 | 33 | #endif // m3_exception_h 34 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/ThirdPart/wasm3/m3_exec.c: -------------------------------------------------------------------------------- 1 | // 2 | // m3_exec.c 3 | // 4 | // Created by Steven Massey on 4/17/19. 5 | // Copyright © 2019 Steven Massey. All rights reserved. 6 | // 7 | 8 | // EMPTY FOR NOW 9 | -------------------------------------------------------------------------------- /unreal/Puerts/Source/WasmCore/ThirdPart/wasm3/m3_info.h: -------------------------------------------------------------------------------- 1 | // 2 | // m3_info.h 3 | // 4 | // Created by Steven Massey on 12/6/19. 5 | // Copyright © 2019 Steven Massey. All rights reserved. 6 | // 7 | 8 | #ifndef m3_info_h 9 | #define m3_info_h 10 | 11 | #include "m3_compile.h" 12 | 13 | d_m3BeginExternC 14 | 15 | void ProfileHit (cstr_t i_operationName); 16 | 17 | #ifdef DEBUG 18 | 19 | void dump_type_stack (IM3Compilation o); 20 | void log_opcode (IM3Compilation o, m3opcode_t i_opcode); 21 | const char * get_indention_string (IM3Compilation o); 22 | void log_emit (IM3Compilation o, IM3Operation i_operation); 23 | 24 | cstr_t SPrintFuncTypeSignature (IM3FuncType i_funcType); 25 | 26 | #else // DEBUG 27 | 28 | #define dump_type_stack(...) {} 29 | #define log_opcode(...) {} 30 | #define get_indention_string(...) "" 31 | #define emit_stack_dump(...) {} 32 | #define log_emit(...) {} 33 | 34 | #endif // DEBUG 35 | 36 | d_m3EndExternC 37 | 38 | #endif // m3_info_h 39 | -------------------------------------------------------------------------------- /unreal/Puerts/ThirdParty/Include/asio/asio/associator.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // associator.hpp 3 | // ~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_ASSOCIATOR_HPP 12 | #define ASIO_ASSOCIATOR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace puerts_asio { 23 | 24 | /// Used to generically specialise associators for a type. 25 | template