diff --git a/BuildCLI/build_android.bat b/BuildCLI/build_android.bat new file mode 100644 index 00000000..dde33c01 --- /dev/null +++ b/BuildCLI/build_android.bat @@ -0,0 +1,9 @@ +cd /d %~dp0 + +call path_define.bat + +%UNITYEDITOR_PATH%/Unity.exe %WORKSPACE% -logFile %BUILD_LOGFILE% -executeMethod TEngine.ReleaseTools.AutomationBuildAndroid -quit -batchmode -CustomArgs:Language=en_US; %WORKSPACE% + +@REM for /f "delims=[" %%i in (%BUILD_LOGFILE%) do echo %%i + +pause \ No newline at end of file diff --git a/BuildCLI/build_android.sh b/BuildCLI/build_android.sh new file mode 100644 index 00000000..d8ba1391 --- /dev/null +++ b/BuildCLI/build_android.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +cd "$(dirname "$0")" + +source ./path_define.sh + +"${UNITYEDITOR_PATH}/Unity" "${WORKSPACE}" \ + -logFile "${BUILD_LOGFILE}" \ + -executeMethod TEngine.ReleaseTools.AutomationBuildAndroid \ + -quit -batchmode \ + -CustomArgs:Language=en_US "${WORKSPACE}" + +while IFS= read -r line; do + echo "$line" +done < "${BUILD_LOGFILE}" + +echo "按任意键继续..." +read -k1 diff --git a/BuildCLI/path_define.bat b/BuildCLI/path_define.bat new file mode 100644 index 00000000..4e20de33 --- /dev/null +++ b/BuildCLI/path_define.bat @@ -0,0 +1,6 @@ +cd /d %~dp0 + +set WORKSPACE=G:/github/TEngine/UnityProject +set UNITYEDITOR_PATH=G:/UnityEditor/2021.3.20f1c1/Editor +set BUILD_DLL_LOGFILE=./build_dll.log +set BUILD_LOGFILE=./build.log diff --git a/BuildCLI/path_define.sh b/BuildCLI/path_define.sh new file mode 100644 index 00000000..b812417b --- /dev/null +++ b/BuildCLI/path_define.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +cd "$(dirname "$0")" + +export WORKSPACE="/Users/your_user/github/TEngine/UnityProject" # 请替换为 macOS 上的实际路径 +export UNITYEDITOR_PATH="/Applications/Unity/Hub/Editor/2021.3.20f1c1/Unity.app/Contents/MacOS" # 请替换为 macOS 上的 Unity 路径 +export BUILD_DLL_LOGFILE="./build_dll.log" +export BUILD_LOGFILE="./build.log" + +echo "环境变量已设置:" +echo "WORKSPACE=${WORKSPACE}" +echo "UNITYEDITOR_PATH=${UNITYEDITOR_PATH}" +echo "BUILD_DLL_LOGFILE=${BUILD_DLL_LOGFILE}" +echo "BUILD_LOGFILE=${BUILD_LOGFILE}" diff --git a/Configs/GameConfig/CustomTemplate/ConfigSystem.cs b/Configs/GameConfig/CustomTemplate/ConfigSystem.cs new file mode 100644 index 00000000..4098e05c --- /dev/null +++ b/Configs/GameConfig/CustomTemplate/ConfigSystem.cs @@ -0,0 +1,50 @@ +using Luban; +using GameBase; +using GameConfig; +using TEngine; +using UnityEngine; + +/// +/// 配置加载器。 +/// +public class ConfigSystem : Singleton +{ + private bool _init = false; + + private Tables _tables; + + public Tables Tables + { + get + { + if (!_init) + { + Load(); + } + + return _tables; + } + } + + /// + /// 加载配置。 + /// + public void Load() + { + _tables = new Tables(LoadByteBuf); + _init = true; + } + + /// + /// 加载二进制配置。 + /// + /// FileName + /// ByteBuf + private ByteBuf LoadByteBuf(string file) + { + TextAsset textAsset = GameModule.Resource.LoadAsset(file); + byte[] bytes = textAsset.bytes; + GameModule.Resource.UnloadAsset(textAsset); + return new ByteBuf(bytes); + } +} \ No newline at end of file diff --git a/Configs/GameConfig/CustomTemplate/CustomTemplate_Client_LazyLoad/cs-bin/tables.sbn b/Configs/GameConfig/CustomTemplate/CustomTemplate_Client_LazyLoad/cs-bin/tables.sbn new file mode 100644 index 00000000..8a3718dd --- /dev/null +++ b/Configs/GameConfig/CustomTemplate/CustomTemplate_Client_LazyLoad/cs-bin/tables.sbn @@ -0,0 +1,55 @@ +using Luban; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + #region The Tables + + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + private {{table.full_name}} m_{{table.name}}; + public {{table.full_name}} {{format_property_name __code_style table.name}} + { + get + { + if (m_{{table.name}} == null) + { + m_{{table.name}} = new {{table.full_name}}(defaultLoader("{{table.output_data_file}}")); + m_{{table.name}}.ResolveRef(this); + } + return m_{{table.name}}; + } + set + { + m_{{table.name}} = value; + m_{{table.name}}.ResolveRef(this); + } + } + {{~end~}} + + #endregion + + System.Func defaultLoader; + + public {{__name}}(System.Func loader) + { + SetDefaultLoader(loader); + Init(); + } + + public void SetDefaultLoader(System.Func loader) + { + defaultLoader = null; + defaultLoader = loader; + } + + //public partial void Init(); + + public void Init(){} +} + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/Configs/GameConfig/Datas/Scene/gameScene.xlsx b/Configs/GameConfig/Datas/Scene/gameScene.xlsx new file mode 100644 index 00000000..e15339b5 Binary files /dev/null and b/Configs/GameConfig/Datas/Scene/gameScene.xlsx differ diff --git a/Configs/GameConfig/Datas/UI/gameUILoad.xlsx b/Configs/GameConfig/Datas/UI/gameUILoad.xlsx new file mode 100644 index 00000000..f8dd3afc Binary files /dev/null and b/Configs/GameConfig/Datas/UI/gameUILoad.xlsx differ diff --git a/Configs/GameConfig/Datas/UI/gameUITip.xlsx b/Configs/GameConfig/Datas/UI/gameUITip.xlsx new file mode 100644 index 00000000..aa8429c0 Binary files /dev/null and b/Configs/GameConfig/Datas/UI/gameUITip.xlsx differ diff --git a/Configs/GameConfig/Datas/UI/gameUIWidget.xlsx b/Configs/GameConfig/Datas/UI/gameUIWidget.xlsx new file mode 100644 index 00000000..a6570c5e Binary files /dev/null and b/Configs/GameConfig/Datas/UI/gameUIWidget.xlsx differ diff --git a/Configs/GameConfig/Datas/UI/gameUIWindows.xlsx b/Configs/GameConfig/Datas/UI/gameUIWindows.xlsx new file mode 100644 index 00000000..e56d857a Binary files /dev/null and b/Configs/GameConfig/Datas/UI/gameUIWindows.xlsx differ diff --git a/Configs/GameConfig/Datas/__beans__.xlsx b/Configs/GameConfig/Datas/__beans__.xlsx new file mode 100644 index 00000000..9fde5587 Binary files /dev/null and b/Configs/GameConfig/Datas/__beans__.xlsx differ diff --git a/Configs/GameConfig/Datas/__enums__.xlsx b/Configs/GameConfig/Datas/__enums__.xlsx new file mode 100644 index 00000000..5d01039a Binary files /dev/null and b/Configs/GameConfig/Datas/__enums__.xlsx differ diff --git a/Configs/GameConfig/Datas/__tables__.xlsx b/Configs/GameConfig/Datas/__tables__.xlsx new file mode 100644 index 00000000..3258c0e3 Binary files /dev/null and b/Configs/GameConfig/Datas/__tables__.xlsx differ diff --git a/Configs/GameConfig/Datas/item.xlsx b/Configs/GameConfig/Datas/item.xlsx new file mode 100644 index 00000000..c463653e Binary files /dev/null and b/Configs/GameConfig/Datas/item.xlsx differ diff --git a/Configs/GameConfig/Datas/roleUnit.xlsx b/Configs/GameConfig/Datas/roleUnit.xlsx new file mode 100644 index 00000000..42e6055b Binary files /dev/null and b/Configs/GameConfig/Datas/roleUnit.xlsx differ diff --git a/Configs/GameConfig/Defines/builtin.xml b/Configs/GameConfig/Defines/builtin.xml new file mode 100644 index 00000000..e535ff48 --- /dev/null +++ b/Configs/GameConfig/Defines/builtin.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Configs/GameConfig/gen_code_bin_to_project.bat b/Configs/GameConfig/gen_code_bin_to_project.bat new file mode 100644 index 00000000..93e4dd03 --- /dev/null +++ b/Configs/GameConfig/gen_code_bin_to_project.bat @@ -0,0 +1,20 @@ +Cd /d %~dp0 +echo %CD% + +set WORKSPACE=../.. +set LUBAN_DLL=%WORKSPACE%\Tools\Luban\Luban.dll +set CONF_ROOT=. +set DATA_OUTPATH=%WORKSPACE%/EintooAR/Assets/AssetRaw/Configs/bytes/ +set CODE_OUTPATH=%WORKSPACE%/EintooAR/Assets/GameScripts/HotFix/GameProto/GameConfig/ + +xcopy /s /e /i /y "%CONF_ROOT%\CustomTemplate\ConfigSystem.cs" "%WORKSPACE%\EintooAR\Assets\GameScripts\HotFix\GameProto\ConfigSystem.cs" + +dotnet %LUBAN_DLL% ^ + -t client ^ + -c cs-bin ^ + -d bin^ + --conf %CONF_ROOT%\luban.conf ^ + -x outputCodeDir=%CODE_OUTPATH% ^ + -x outputDataDir=%DATA_OUTPATH% +pause + diff --git a/Configs/GameConfig/gen_code_bin_to_project.sh b/Configs/GameConfig/gen_code_bin_to_project.sh new file mode 100644 index 00000000..88f683c2 --- /dev/null +++ b/Configs/GameConfig/gen_code_bin_to_project.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +cd "$(dirname "$0")" +echo "当前目录: $(pwd)" + +export WORKSPACE="$(realpath ../../)" +export LUBAN_DLL="${WORKSPACE}/Tools/Luban/Luban.dll" +export CONF_ROOT="$(pwd)" +export DATA_OUTPATH="${WORKSPACE}/EintooAR/Assets/AssetRaw/Configs/bytes/" +export CODE_OUTPATH="${WORKSPACE}/EintooAR/Assets/GameScripts/HotFix/GameProto/GameConfig/" + +cp -R "${CONF_ROOT}/CustomTemplate/ConfigSystem.cs" \ + "${WORKSPACE}/EintooAR/Assets/GameScripts/HotFix/GameProto/ConfigSystem.cs" + +dotnet "${LUBAN_DLL}" \ + -t client \ + -c cs-bin \ + -d bin \ + --conf "${CONF_ROOT}/luban.conf" \ + -x outputCodeDir="${CODE_OUTPATH}" \ + -x outputDataDir="${DATA_OUTPATH}" + +echo "操作完成,按任意键退出..." +read -k1 diff --git a/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat b/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat new file mode 100644 index 00000000..0940c9f8 --- /dev/null +++ b/Configs/GameConfig/gen_code_bin_to_project_lazyload.bat @@ -0,0 +1,21 @@ +Cd /d %~dp0 +echo %CD% + +set WORKSPACE=../.. +set LUBAN_DLL=%WORKSPACE%\Tools\Luban\Luban.dll +set CONF_ROOT=. +set DATA_OUTPATH=%WORKSPACE%/EintooAR/Assets/AssetRaw/Configs/bytes/ +set CODE_OUTPATH=%WORKSPACE%/EintooAR/Assets/GameScripts/HotFix/GameProto/GameConfig/ + +xcopy /s /e /i /y "%CONF_ROOT%\CustomTemplate\ConfigSystem.cs" "%WORKSPACE%\EintooAR\Assets\GameScripts\HotFix\GameProto\ConfigSystem.cs" + +dotnet %LUBAN_DLL% ^ + -t client ^ + -c cs-bin ^ + -d bin^ + --conf %CONF_ROOT%\luban.conf ^ + --customTemplateDir %CONF_ROOT%\CustomTemplate\CustomTemplate_Client_LazyLoad ^ + -x outputCodeDir=%CODE_OUTPATH% ^ + -x outputDataDir=%DATA_OUTPATH% +pause + diff --git a/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh b/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh new file mode 100644 index 00000000..7324d765 --- /dev/null +++ b/Configs/GameConfig/gen_code_bin_to_project_lazyload.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +cd "$(dirname "$0")" +echo "当前目录: $(pwd)" + +export WORKSPACE="$(realpath ../../)" +export LUBAN_DLL="${WORKSPACE}/Tools/Luban/Luban.dll" +export CONF_ROOT="$(pwd)" +export DATA_OUTPATH="${WORKSPACE}/UnityProject/Assets/AssetRaw/Configs/bytes/" +export CODE_OUTPATH="${WORKSPACE}/UnityProject/Assets/GameScripts/HotFix/GameProto/GameConfig/" + +cp -R "${CONF_ROOT}/CustomTemplate/ConfigSystem.cs" \ + "${WORKSPACE}/UnityProject/Assets/GameScripts/HotFix/GameProto/ConfigSystem.cs" + +dotnet "${LUBAN_DLL}" \ + -t client \ + -c cs-bin \ + -d bin \ + --conf "${CONF_ROOT}/luban.conf" \ + --customTemplateDir "${CONF_ROOT}/CustomTemplate/CustomTemplate_Client_LazyLoad" \ + -x outputCodeDir="${CODE_OUTPATH}" \ + -x outputDataDir="${DATA_OUTPATH}" + +echo "操作完成,按任意键退出..." +read -k1 diff --git a/Configs/GameConfig/gen_code_bin_to_server.bat b/Configs/GameConfig/gen_code_bin_to_server.bat new file mode 100644 index 00000000..697220e7 --- /dev/null +++ b/Configs/GameConfig/gen_code_bin_to_server.bat @@ -0,0 +1,18 @@ +Cd /d %~dp0 +echo %CD% + +set WORKSPACE=../../ +set LUBAN_DLL=%WORKSPACE%/Tools/Luban/Luban.dll +set CONF_ROOT=. +set DATA_OUTPATH=%WORKSPACE%/Server/GameConfig +set CODE_OUTPATH=%WORKSPACE%/Server/Hotfix/Config/GameConfig + +dotnet %LUBAN_DLL% ^ + -t server^ + -c cs-bin ^ + -d bin^ + --conf %CONF_ROOT%\luban.conf ^ + -x outputCodeDir=%CODE_OUTPATH% ^ + -x outputDataDir=%DATA_OUTPATH% +pause + diff --git a/Configs/GameConfig/gen_code_bin_to_server.sh b/Configs/GameConfig/gen_code_bin_to_server.sh new file mode 100644 index 00000000..4b257d38 --- /dev/null +++ b/Configs/GameConfig/gen_code_bin_to_server.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +cd "$(dirname "$0")" +echo "当前目录: $(pwd)" + +export WORKSPACE="$(realpath ../../)" +export LUBAN_DLL="${WORKSPACE}/Tools/Luban/Luban.dll" +export CONF_ROOT="$(pwd)" +export DATA_OUTPATH="${WORKSPACE}/Server/GameConfig" +export CODE_OUTPATH="${WORKSPACE}/Server/Hotfix/Config/GameConfig" + +dotnet "${LUBAN_DLL}" \ + -t server \ + -c cs-bin \ + -d bin \ + --conf "${CONF_ROOT}/luban.conf" \ + -x outputCodeDir="${CODE_OUTPATH}" \ + -x outputDataDir="${DATA_OUTPATH}" + +echo "操作完成,按任意键退出..." +read -k1 diff --git a/Configs/GameConfig/luban.conf b/Configs/GameConfig/luban.conf new file mode 100644 index 00000000..851dc679 --- /dev/null +++ b/Configs/GameConfig/luban.conf @@ -0,0 +1,22 @@ +{ + "groups": + [ + {"names":["c"], "default":true}, + {"names":["s"], "default":true}, + {"names":["e"], "default":true} + ], + "schemaFiles": + [ + {"fileName":"Defines", "type":""}, + {"fileName":"Datas/__tables__.xlsx", "type":"table"}, + {"fileName":"Datas/__beans__.xlsx", "type":"bean"}, + {"fileName":"Datas/__enums__.xlsx", "type":"enum"} + ], + "dataDir": "Datas", + "targets": + [ + {"name":"server", "manager":"Tables", "groups":["s"], "topModule":"GameConfig"}, + {"name":"client", "manager":"Tables", "groups":["c"], "topModule":"GameConfig"}, + {"name":"all", "manager":"Tables", "groups":["c,s,e"], "topModule":"GameConfig"} + ] +} \ No newline at end of file diff --git a/GameServer/.idea/.idea.GameServer/.idea/CopilotChatHistory.xml b/GameServer/.idea/.idea.GameServer/.idea/CopilotChatHistory.xml new file mode 100644 index 00000000..73cbf6b4 --- /dev/null +++ b/GameServer/.idea/.idea.GameServer/.idea/CopilotChatHistory.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/GameServer/.idea/.idea.GameServer/.idea/encodings.xml b/GameServer/.idea/.idea.GameServer/.idea/encodings.xml new file mode 100644 index 00000000..df87cf95 --- /dev/null +++ b/GameServer/.idea/.idea.GameServer/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/GameServer/.idea/.idea.GameServer/.idea/indexLayout.xml b/GameServer/.idea/.idea.GameServer/.idea/indexLayout.xml new file mode 100644 index 00000000..7b08163c --- /dev/null +++ b/GameServer/.idea/.idea.GameServer/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/GameServer/.idea/.idea.GameServer/.idea/projectSettingsUpdater.xml b/GameServer/.idea/.idea.GameServer/.idea/projectSettingsUpdater.xml new file mode 100644 index 00000000..4bb9f4d2 --- /dev/null +++ b/GameServer/.idea/.idea.GameServer/.idea/projectSettingsUpdater.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/GameServer/.idea/.idea.GameServer/.idea/vcs.xml b/GameServer/.idea/.idea.GameServer/.idea/vcs.xml new file mode 100644 index 00000000..6c0b8635 --- /dev/null +++ b/GameServer/.idea/.idea.GameServer/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/GameServer/.idea/.idea.GameServer/.idea/workspace.xml b/GameServer/.idea/.idea.GameServer/.idea/workspace.xml new file mode 100644 index 00000000..7f01cfb6 --- /dev/null +++ b/GameServer/.idea/.idea.GameServer/.idea/workspace.xml @@ -0,0 +1,462 @@ + + + + Main/Main.csproj + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "customColor": "", + "associatedIndex": 3 +} + + + + { + "keyToString": { + "RunOnceActivity.ShowReadmeOnStart": "true", + "git-widget-placeholder": "main", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "vue.rearranger.settings.migration": "true" + }, + "keyToStringList": { + "rider.external.source.directories": [ + "C:\\Users\\Administrator\\AppData\\Roaming\\JetBrains\\Rider2024.1\\resharper-host\\DecompilerCache", + "C:\\Users\\Administrator\\AppData\\Roaming\\JetBrains\\Rider2024.1\\resharper-host\\SourcesCache", + "C:\\Users\\Administrator\\AppData\\Local\\Symbols\\src" + ] + } +} + + + + + + + + + 1737038547277 + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250331/Server..2025033117.Debug.log b/GameServer/Bin/Debug/Logs/Server/Server20250331/Server..2025033117.Debug.log new file mode 100644 index 00000000..bc86578b --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250331/Server..2025033117.Debug.log @@ -0,0 +1,14 @@ +2025-03-31 17:00:46.1572 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-03-31 17:00:46.4719 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-03-31 17:00:46.8310 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-03-31 17:00:47.1807 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-03-31 17:02:09.5251 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-03-31 17:02:10.0936 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-03-31 17:02:10.1109 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2589189449237659648 +2025-03-31 17:02:10.1109 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589189449237659648 AccountId:116299279127281665 +2025-03-31 17:02:10.1260 (GateLoginHelper.cs:29) 聊天服务器登录成功 +2025-03-31 17:02:10.2692 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-03-31 17:02:15.5268 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-03-31 17:02:20.1507 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-03-31 17:02:20.2368 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-03-31 17:02:20.2368 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250331/Server..2025033117.Info.log b/GameServer/Bin/Debug/Logs/Server/Server20250331/Server..2025033117.Info.log new file mode 100644 index 00000000..61bdb424 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250331/Server..2025033117.Info.log @@ -0,0 +1,15 @@ +2025-03-31 17:00:45.3401 初始化序列化器成功,数量为:2 +2025-03-31 17:00:45.8794 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-03-31 17:00:46.0745 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-03-31 17:00:46.1572 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-03-31 17:00:46.2787 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-03-31 17:00:46.4719 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-03-31 17:00:46.4719 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-03-31 17:00:46.6685 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-03-31 17:00:46.8310 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-03-31 17:00:47.0177 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-03-31 17:00:47.1807 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-03-31 17:00:47.3679 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-03-31 17:00:47.5466 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-03-31 17:00:47.5466 Process:1 Startup Complete SceneCount:5 +2025-03-31 17:02:10.1109 (G2Chat_LoginRequestHandler.cs:11) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589189449237659648 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250331/Server..2025033117.Warn.log b/GameServer/Bin/Debug/Logs/Server/Server20250331/Server..2025033117.Warn.log new file mode 100644 index 00000000..1fba3469 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250331/Server..2025033117.Warn.log @@ -0,0 +1,2 @@ +2025-03-31 17:02:10.0936 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-03-31 17:02:50.2889 session timeout id:132665183960301570 timeNow:1743411770288 _session.LastReceiveTime:1743411760209 _timeOut:8000 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Debug.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Debug.log new file mode 100644 index 00000000..11b55a7b --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Debug.log @@ -0,0 +1,63 @@ +2025-04-02 13:41:56.4350 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 13:41:56.8252 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 13:41:57.2455 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 13:41:57.6834 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 13:42:30.5078 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 13:42:31.1287 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 13:42:31.1570 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2589079498074882048 +2025-04-02 13:42:31.1570 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589079498074882048 AccountId:116299279127281665 +2025-04-02 13:42:31.3458 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 13:42:36.5175 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 13:42:41.2345 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 13:42:41.3432 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 13:42:41.3432 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose +2025-04-02 13:50:13.4173 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 13:50:13.5916 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 13:50:13.6060 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2590097645842202624 +2025-04-02 13:50:13.6060 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2590097645842202624 AccountId:116299279127281665 +2025-04-02 13:50:13.7916 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 13:50:19.4316 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 13:50:23.6553 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 13:50:23.6709 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 13:50:23.6709 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose +2025-04-02 13:50:55.3332 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 13:50:55.4900 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 13:50:55.5046 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2590190004818935808 +2025-04-02 13:50:55.5046 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2590190004818935808 AccountId:116299279127281665 +2025-04-02 13:50:55.6789 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 13:51:01.3336 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 13:51:05.5539 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 13:51:05.5693 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 13:51:05.5693 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose +2025-04-02 13:54:09.9398 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 13:54:10.3365 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 13:54:10.7633 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 13:54:11.1712 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 13:54:47.4816 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 13:54:47.7243 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 13:54:47.7519 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2589086095144648704 +2025-04-02 13:54:47.7519 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589086095144648704 AccountId:116299279127281665 +2025-04-02 13:54:47.9107 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 13:54:53.4840 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 13:54:57.7908 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 13:54:57.8632 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 13:54:57.8632 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose +2025-04-02 13:56:38.1665 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 13:56:38.7117 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 13:56:39.1181 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 13:56:39.5632 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 13:56:52.6269 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 13:56:52.8846 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 13:56:52.9093 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2589035517609771008 +2025-04-02 13:56:52.9093 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589035517609771008 AccountId:116299279127281665 +2025-04-02 13:56:53.0992 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 13:56:58.6411 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 13:59:44.0458 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 13:59:44.2333 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 13:59:44.2333 (GameAccountManageComponentSystem.cs:68) Gate account already exists(账号已存在缓存中) +2025-04-02 13:59:44.2333 (GameAccountManageComponentSystem.cs:74) Gate 检测当前帐号和当前Session 不是同一个,2589035517609771008,$2589413749609725952 +2025-04-02 13:59:44.2333 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2589413749609725952 +2025-04-02 13:59:44.2333 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589413749609725952 AccountId:116299279127281665 +2025-04-02 13:59:44.2805 (GameAccountManageComponentSystem.cs:120) Gate 已经存在了销毁组件 +2025-04-02 13:59:44.4205 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 13:59:50.0590 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Error.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Error.log new file mode 100644 index 00000000..ff6d61e5 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Error.log @@ -0,0 +1,20 @@ +2025-04-02 13:42:32.9004 System.Exception: OuterMessageScheduler CustomRouteType session does not have an routeComponent component + at Fantasy.Scheduler.OuterMessageScheduler.Scheduler(Session session, APackInfo packInfo) + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Network.Session.Receive(APackInfo packInfo) +2025-04-02 13:50:18.9664 System.Exception: OuterMessageScheduler CustomRouteType session does not have an routeComponent component + at Fantasy.Scheduler.OuterMessageScheduler.Scheduler(Session session, APackInfo packInfo) + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Network.Session.Receive(APackInfo packInfo) +2025-04-02 13:55:01.7187 System.Exception: OuterMessageScheduler CustomRouteType session does not have an routeComponent component + at Fantasy.Scheduler.OuterMessageScheduler.Scheduler(Session session, APackInfo packInfo) + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Network.Session.Receive(APackInfo packInfo) +2025-04-02 13:57:01.6086 System.Exception: OuterMessageScheduler CustomRouteType session does not have an routeComponent component + at Fantasy.Scheduler.OuterMessageScheduler.Scheduler(Session session, APackInfo packInfo) + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Network.Session.Receive(APackInfo packInfo) diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Info.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Info.log new file mode 100644 index 00000000..d059e11a --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Info.log @@ -0,0 +1,48 @@ +2025-04-02 13:41:55.3716 初始化序列化器成功,数量为:2 +2025-04-02 13:41:56.0961 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-02 13:41:56.3272 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-02 13:41:56.4350 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 13:41:56.5922 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-02 13:41:56.8252 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-02 13:41:56.8252 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 13:41:57.0500 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-02 13:41:57.2455 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-02 13:41:57.4742 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-02 13:41:57.6834 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-02 13:41:57.9084 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-02 13:41:58.1278 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-02 13:41:58.1278 Process:1 Startup Complete SceneCount:5 +2025-04-02 13:42:31.1749 (G2Chat_LoginRequestHandler.cs:16) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589079498074882048 +2025-04-02 13:50:13.6216 (G2Chat_LoginRequestHandler.cs:16) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2590097645842202624 +2025-04-02 13:50:55.5211 (G2Chat_LoginRequestHandler.cs:16) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2590190004818935808 +2025-04-02 13:54:09.0954 初始化序列化器成功,数量为:2 +2025-04-02 13:54:09.7432 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-02 13:54:09.9266 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-02 13:54:09.9398 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 13:54:10.1454 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-02 13:54:10.3365 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-02 13:54:10.3365 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 13:54:10.5651 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-02 13:54:10.7633 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-02 13:54:10.9782 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-02 13:54:11.1712 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-02 13:54:11.4010 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-02 13:54:11.6146 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-02 13:54:11.6146 Process:1 Startup Complete SceneCount:5 +2025-04-02 13:54:47.7636 (G2Chat_LoginRequestHandler.cs:17) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589086095144648704 +2025-04-02 13:56:37.0646 初始化序列化器成功,数量为:2 +2025-04-02 13:56:37.8792 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-02 13:56:38.1452 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-02 13:56:38.1665 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 13:56:38.4628 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-02 13:56:38.7117 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-02 13:56:38.7117 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 13:56:38.9304 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-02 13:56:39.1181 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-02 13:56:39.3678 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-02 13:56:39.5632 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-02 13:56:39.7691 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-02 13:56:39.9746 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-02 13:56:39.9746 Process:1 Startup Complete SceneCount:5 +2025-04-02 13:56:52.9277 (G2Chat_LoginRequestHandler.cs:17) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589035517609771008 +2025-04-02 13:59:44.2479 (G2Chat_LoginRequestHandler.cs:17) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589413749609725952 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Warn.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Warn.log new file mode 100644 index 00000000..2bee5003 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040213.Warn.log @@ -0,0 +1,6 @@ +2025-04-02 13:42:31.1287 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 13:50:13.5916 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 13:50:55.4900 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 13:54:47.7243 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 13:56:52.8846 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 13:59:44.2333 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Debug.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Debug.log new file mode 100644 index 00000000..2c9bdbd9 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Debug.log @@ -0,0 +1,31 @@ +2025-04-02 14:01:52.9745 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 14:01:53.0686 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 14:01:53.0701 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose +2025-04-02 14:02:25.3077 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 14:02:25.4630 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 14:02:25.4630 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2589767792353869824 +2025-04-02 14:02:25.4630 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589767792353869824 AccountId:116299279127281665 +2025-04-02 14:02:25.6276 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 14:02:31.3079 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 14:03:53.3827 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 14:03:53.5517 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 14:03:53.5517 (GameAccountManageComponentSystem.cs:68) Gate account already exists(账号已存在缓存中) +2025-04-02 14:03:53.5517 (GameAccountManageComponentSystem.cs:74) Gate 检测当前帐号和当前Session 不是同一个,2589767792353869824,$2589961306400358400 +2025-04-02 14:03:53.5517 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2589961306400358400 +2025-04-02 14:03:53.5517 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589961306400358400 AccountId:116299279127281665 +2025-04-02 14:03:53.5986 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 14:03:59.3836 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 14:04:01.1342 (GameAccountManageComponentSystem.cs:120) Gate 已经存在了销毁组件 +2025-04-02 14:06:54.2586 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 14:06:54.6631 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 14:06:55.0707 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 14:06:55.4956 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 14:07:04.2879 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 14:07:04.5229 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 14:07:04.5478 (GameAccountManageComponentSystem.cs:91) Gate 当前缓存中的 SessionID 2589026721516748800 +2025-04-02 14:07:04.5478 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589026721516748800 AccountId:116299279127281665 +2025-04-02 14:07:04.5848 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 14:07:10.2889 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 14:12:29.5101 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 14:12:29.5875 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 14:12:29.5875 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Error.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Error.log new file mode 100644 index 00000000..adeac7b8 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Error.log @@ -0,0 +1,24 @@ +2025-04-02 14:02:35.9291 System.Exception: OuterMessageScheduler CustomRouteType session does not have an routeComponent component + at Fantasy.Scheduler.OuterMessageScheduler.Scheduler(Session session, APackInfo packInfo) + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Network.Session.Receive(APackInfo packInfo) +2025-04-02 14:04:01.1342 CallInnerRoute routeId == 0 + at Fantasy.Scheduler.NetworkMessagingComponent.CallInnerRoute(Int64 routeId, Type requestType, APackInfo packInfo) + at Fantasy.Scheduler.NetworkMessagingComponent.CallInnerRoute(Int64 routeId, Type requestType, APackInfo packInfo) + at Fantasy.Scheduler.OuterMessageScheduler.Scheduler(Session session, APackInfo packInfo) + at Fantasy.Network.Session.Receive(APackInfo packInfo) + at Fantasy.Network.KCP.KCPServerNetworkChannel.Input(ReadOnlyMemory`1 buffer) + at Fantasy.Network.KCP.KCPServerNetwork.ReadPipeDataAsync() + at System.IO.Pipelines.Pipe.ExecuteWithoutExecutionContext(Object state) + at Fantasy.ThreadSynchronizationContext.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-02 14:04:01.1342 System.NullReferenceException: Object reference not set to an instance of an object. + at System.Object.GetType() + at Fantasy.Network.Session.Send(IMessage message, UInt32 rpcId, Int64 routeId) + at Fantasy.Scheduler.OuterMessageScheduler.Scheduler(Session session, APackInfo packInfo) + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Network.Session.Receive(APackInfo packInfo) diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Info.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Info.log new file mode 100644 index 00000000..bd13bdd6 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Info.log @@ -0,0 +1,18 @@ +2025-04-02 14:02:25.4630 (G2Chat_LoginRequestHandler.cs:17) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589767792353869824 +2025-04-02 14:03:53.5517 (G2Chat_LoginRequestHandler.cs:17) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589961306400358400 +2025-04-02 14:06:53.3342 初始化序列化器成功,数量为:2 +2025-04-02 14:06:54.0008 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-02 14:06:54.2429 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-02 14:06:54.2586 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 14:06:54.4624 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-02 14:06:54.6609 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-02 14:06:54.6609 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 14:06:54.8813 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-02 14:06:55.0685 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-02 14:06:55.2964 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-02 14:06:55.4956 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-02 14:06:55.7100 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-02 14:06:55.9173 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-02 14:06:55.9173 Process:1 Startup Complete SceneCount:5 +2025-04-02 14:07:04.5595 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589026721516748800 +2025-04-02 14:07:07.6648 (C2Chat_TestRequestHandler.cs:11) chatUnitSnowShow AccountId:116299279127281665 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Warn.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Warn.log new file mode 100644 index 00000000..1b21af42 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040214.Warn.log @@ -0,0 +1,5 @@ +2025-04-02 14:01:49.4619 session timeout id:135445814507208705 timeNow:1743573709461 _session.LastReceiveTime:1743573699090 _timeOut:8000 +2025-04-02 14:02:25.4630 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 14:03:53.5517 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 14:07:04.5229 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 14:07:29.4938 session timeout id:135453373649649664 timeNow:1743574049493 _session.LastReceiveTime:1743574038406 _timeOut:8000 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Debug.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Debug.log new file mode 100644 index 00000000..20989f70 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Debug.log @@ -0,0 +1,10 @@ +2025-04-02 16:59:26.8261 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 16:59:27.2194 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 16:59:27.6185 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 16:59:28.0036 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 16:59:50.0545 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 16:59:50.2974 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 16:59:50.3233 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589055308819070976 +2025-04-02 16:59:50.3233 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589055308819070976 AccountId:116299279127281665 +2025-04-02 16:59:50.3575 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 16:59:56.0574 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Error.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Error.log new file mode 100644 index 00000000..486d21d8 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Error.log @@ -0,0 +1,18 @@ +2025-04-02 16:56:15.4982 System.ArgumentException: An item with the same key has already been added. Key: Fantasy.G2Chat_LoginRequest + at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) + at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) + at Fantasy.Network.Interface.MessageDispatcherComponent.LoadInner(Int64 assemblyIdentity) + at Fantasy.Network.Interface.MessageDispatcherComponent.<>c__DisplayClass16_0.b__0() + at Fantasy.ThreadSynchronizationContext.Update() +2025-04-02 16:56:33.3541 System.ArgumentException: An item with the same key has already been added. Key: Fantasy.G2Chat_LoginRequest + at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) + at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) + at Fantasy.Network.Interface.MessageDispatcherComponent.LoadInner(Int64 assemblyIdentity) + at Fantasy.Network.Interface.MessageDispatcherComponent.<>c__DisplayClass16_0.b__0() + at Fantasy.ThreadSynchronizationContext.Update() +2025-04-02 16:57:58.0473 System.ArgumentException: An item with the same key has already been added. Key: Fantasy.G2Chat_LoginRequest + at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) + at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) + at Fantasy.Network.Interface.MessageDispatcherComponent.LoadInner(Int64 assemblyIdentity) + at Fantasy.Network.Interface.MessageDispatcherComponent.<>c__DisplayClass16_0.b__0() + at Fantasy.ThreadSynchronizationContext.Update() diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Info.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Info.log new file mode 100644 index 00000000..24f4b4a9 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Info.log @@ -0,0 +1,18 @@ +2025-04-02 16:56:15.4342 初始化序列化器成功,数量为:2 +2025-04-02 16:56:33.3030 初始化序列化器成功,数量为:2 +2025-04-02 16:57:57.9899 初始化序列化器成功,数量为:2 +2025-04-02 16:59:26.0246 初始化序列化器成功,数量为:2 +2025-04-02 16:59:26.5981 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-02 16:59:26.8136 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-02 16:59:26.8261 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 16:59:27.0291 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-02 16:59:27.2194 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-02 16:59:27.2194 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 16:59:27.4309 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-02 16:59:27.6160 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-02 16:59:27.8212 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-02 16:59:28.0036 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-02 16:59:28.2123 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-02 16:59:28.4153 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-02 16:59:28.4153 Process:1 Startup Complete SceneCount:5 +2025-04-02 16:59:50.3361 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589055308819070976 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Warn.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Warn.log new file mode 100644 index 00000000..fcd38eb2 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040216.Warn.log @@ -0,0 +1 @@ +2025-04-02 16:59:50.2974 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Debug.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Debug.log new file mode 100644 index 00000000..3426b9e0 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Debug.log @@ -0,0 +1,36 @@ +2025-04-02 17:01:45.9357 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 17:01:46.3516 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 17:01:46.7610 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 17:01:47.1682 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 17:01:53.9070 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 17:01:54.1413 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 17:01:54.1677 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589022323470237696 +2025-04-02 17:01:54.1677 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589022323470237696 AccountId:116299279127281665 +2025-04-02 17:01:54.2161 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 17:01:59.9082 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 17:07:26.4240 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 17:07:26.8215 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 17:07:27.2296 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 17:07:27.6696 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 17:08:09.7733 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 17:08:10.0083 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 17:08:10.0360 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589099289284182016 +2025-04-02 17:08:10.0360 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589099289284182016 AccountId:116299279127281665 +2025-04-02 17:08:10.0743 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 17:08:15.7752 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 17:09:14.9881 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 17:11:49.9873 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 17:11:50.4176 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-02 17:11:50.8359 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 17:11:51.2496 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-02 17:12:24.3154 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-02 17:12:24.5750 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-02 17:12:24.6011 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589079498074882048 +2025-04-02 17:12:24.6011 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589079498074882048 AccountId:116299279127281665 +2025-04-02 17:12:24.6390 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-02 17:12:30.3167 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-02 17:12:54.5523 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 17:12:54.6171 (G2Chat_OfflineRequestHandler.cs:11) chat : 聊天服务器SnowShow 下线 +2025-04-02 17:12:54.6171 (GateLoginHelper.cs:44) Gate : chat聊天服务器下线成功 +2025-04-02 17:12:54.6171 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-02 17:12:54.6171 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Error.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Error.log new file mode 100644 index 00000000..8e0e9b2e --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Error.log @@ -0,0 +1,31 @@ +2025-04-02 17:09:15.0026 Fantasy.Timer.TimerComponent Update Error MongoDB.Bson.BsonSerializationException: An error occurred while serializing the Routes field of class Fantasy.GameAccount: When using DictionaryRepresentation.Document key values must serialize as strings. + ---> MongoDB.Bson.BsonSerializationException: When using DictionaryRepresentation.Document key values must serialize as strings. + at MongoDB.Bson.Serialization.Serializers.DictionarySerializerBase`3.SerializeKeyString(TKey key) + at MongoDB.Bson.Serialization.Serializers.DictionarySerializerBase`3.SerializeDocumentRepresentation(BsonSerializationContext context, TDictionary value) + at MongoDB.Bson.Serialization.Serializers.DictionarySerializerBase`3.SerializeValue(BsonSerializationContext context, BsonSerializationArgs args, TDictionary value) + at MongoDB.Bson.Serialization.Serializers.ClassSerializerBase`1.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TValue value) + at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Serialize(IBsonSerializer serializer, BsonSerializationContext context, Object value) + at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.SerializeNormalMember(BsonSerializationContext context, Object obj, BsonMemberMap memberMap) + at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.SerializeMember(BsonSerializationContext context, Object obj, BsonMemberMap memberMap) + --- End of inner exception stack trace --- + at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.SerializeMember(BsonSerializationContext context, Object obj, BsonMemberMap memberMap) + at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.SerializeClass(BsonSerializationContext context, BsonSerializationArgs args, TClass document) + at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TClass value) + at MongoDB.Bson.BsonExtensionMethods.ToBson(Object obj, Type nominalType, BsonBinaryWriterSettings writerSettings, IBsonSerializer serializer, Action`1 configurator, BsonSerializationArgs args, Int32 estimatedBsonSize) + at MongoDB.Bson.BsonExtensionMethods.ToBson[TNominalType](TNominalType obj, IBsonSerializer`1 serializer, BsonBinaryWriterSettings writerSettings, Action`1 configurator, BsonSerializationArgs args, Int32 estimatedBsonSize) + at Fantasy.Serialize.BsonPackHelper.Serialize[T](T object) + at Fantasy.Serialize.BsonPackHelper.Clone[T](T t) + at Fantasy.DataBase.MongoDataBase.Save[T](T entity, String collection) + at Hotfix.GameAccountSystem.SaveToDatabase(GameAccount self, Scene scene) in D:\UnityProject\EintooAR\GameServer\Server\Hotfix\Outter\Gate\GameAccount\GameAccountSystem.cs:line 12 + at Hotfix.GameAccountSystem.DisConnect(GameAccount self) in D:\UnityProject\EintooAR\GameServer\Server\Hotfix\Outter\Gate\GameAccount\GameAccountSystem.cs:line 30 + at Hotfix.EntityTimeOutComponentSystem.Handler(EntityTimeOutComponent self, Int64 parentRunTimeId, Func`1 callback) in D:\UnityProject\EintooAR\GameServer\Server\Hotfix\Outter\Entity\EntityTimeOutComponentSystem.cs:line 48 + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Async.FTask.InnerCoroutine() + at Hotfix.EntityTimeOutComponentSystem.<>c__DisplayClass2_0.b__0() in D:\UnityProject\EintooAR\GameServer\Server\Hotfix\Outter\Entity\EntityTimeOutComponentSystem.cs:line 35 + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Info.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Info.log new file mode 100644 index 00000000..393f1984 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Info.log @@ -0,0 +1,45 @@ +2025-04-02 17:01:45.0878 初始化序列化器成功,数量为:2 +2025-04-02 17:01:45.7153 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-02 17:01:45.9191 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-02 17:01:45.9357 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 17:01:46.1523 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-02 17:01:46.3495 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-02 17:01:46.3516 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 17:01:46.5734 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-02 17:01:46.7610 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-02 17:01:46.9788 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-02 17:01:47.1682 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-02 17:01:47.3781 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-02 17:01:47.5875 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-02 17:01:47.5875 Process:1 Startup Complete SceneCount:5 +2025-04-02 17:01:54.1801 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589022323470237696 +2025-04-02 17:07:25.4986 初始化序列化器成功,数量为:2 +2025-04-02 17:07:26.1987 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-02 17:07:26.4064 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-02 17:07:26.4240 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 17:07:26.6285 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-02 17:07:26.8215 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-02 17:07:26.8215 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 17:07:27.0385 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-02 17:07:27.2296 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-02 17:07:27.4622 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-02 17:07:27.6696 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-02 17:07:27.8931 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-02 17:07:28.1026 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-02 17:07:28.1026 Process:1 Startup Complete SceneCount:5 +2025-04-02 17:08:10.0492 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589099289284182016 +2025-04-02 17:11:49.1038 初始化序列化器成功,数量为:2 +2025-04-02 17:11:49.7598 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-02 17:11:49.9717 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-02 17:11:49.9873 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 17:11:50.2054 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-02 17:11:50.4176 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-02 17:11:50.4176 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-02 17:11:50.6331 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-02 17:11:50.8359 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-02 17:11:51.0480 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-02 17:11:51.2496 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-02 17:11:51.4815 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-02 17:11:51.7176 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-02 17:11:51.7176 Process:1 Startup Complete SceneCount:5 +2025-04-02 17:12:24.6011 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589079498074882048 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Warn.log b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Warn.log new file mode 100644 index 00000000..dff68457 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250402/Server..2025040217.Warn.log @@ -0,0 +1,5 @@ +2025-04-02 17:01:54.1413 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 17:08:10.0083 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 17:09:04.9839 session timeout id:135640032928333824 timeNow:1743584944983 _session.LastReceiveTime:1743584933918 _timeOut:8000 +2025-04-02 17:12:24.5750 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-02 17:12:44.5477 session timeout id:135644413794975744 timeNow:1743585164547 _session.LastReceiveTime:1743585152426 _timeOut:8000 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250410/Server..2025041018.Debug.log b/GameServer/Bin/Debug/Logs/Server/Server20250410/Server..2025041018.Debug.log new file mode 100644 index 00000000..10f680b7 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250410/Server..2025041018.Debug.log @@ -0,0 +1,10 @@ +2025-04-10 18:02:13.2823 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-10 18:02:13.6510 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-10 18:02:14.1352 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-10 18:02:14.5962 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-10 18:03:13.9299 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-10 18:03:14.6191 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-10 18:03:14.6570 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589138871702781952 +2025-04-10 18:03:14.6570 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589138871702781952 AccountId:116299279127281665 +2025-04-10 18:03:14.7414 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-10 18:03:19.9373 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250410/Server..2025041018.Info.log b/GameServer/Bin/Debug/Logs/Server/Server20250410/Server..2025041018.Info.log new file mode 100644 index 00000000..e6ca2795 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250410/Server..2025041018.Info.log @@ -0,0 +1,15 @@ +2025-04-10 18:02:12.0106 初始化序列化器成功,数量为:2 +2025-04-10 18:02:12.9102 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-10 18:02:13.1372 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-10 18:02:13.2823 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-10 18:02:13.4138 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-10 18:02:13.6510 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-10 18:02:13.6510 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-10 18:02:13.9110 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-10 18:02:14.1352 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-10 18:02:14.3893 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-10 18:02:14.5962 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-10 18:02:14.8369 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-10 18:02:15.0847 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-10 18:02:15.0847 Process:1 Startup Complete SceneCount:5 +2025-04-10 18:03:14.6920 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589138871702781952 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250410/Server..2025041018.Warn.log b/GameServer/Bin/Debug/Logs/Server/Server20250410/Server..2025041018.Warn.log new file mode 100644 index 00000000..838eabf1 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250410/Server..2025041018.Warn.log @@ -0,0 +1,7 @@ +2025-04-10 18:03:14.6191 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-10 18:03:19.3288 Scene:738459648 Found Unhandled RouteMessage: Fantasy.C2Chat_BoardMessageRequest +2025-04-10 18:03:33.2455 Scene:738459648 Found Unhandled RouteMessage: Fantasy.C2Chat_BoardMessageRequest +2025-04-10 18:03:34.3330 Scene:738459648 Found Unhandled RouteMessage: Fantasy.C2Chat_BoardMessageRequest +2025-04-10 18:03:35.5108 Scene:738459648 Found Unhandled RouteMessage: Fantasy.C2Chat_BoardMessageRequest +2025-04-10 18:03:35.6998 Scene:738459648 Found Unhandled RouteMessage: Fantasy.C2Chat_BoardMessageRequest +2025-04-10 18:03:35.9334 Scene:738459648 Found Unhandled RouteMessage: Fantasy.C2Chat_BoardMessageRequest diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Debug.log b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Debug.log new file mode 100644 index 00000000..65a05a6c --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Debug.log @@ -0,0 +1,106 @@ +2025-04-11 15:33:27.7754 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:33:28.3052 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:33:28.8746 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:33:29.4622 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:33:50.2754 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 15:33:50.8787 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 15:33:50.8978 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589053109795815424 +2025-04-11 15:33:50.8991 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589053109795815424 AccountId:116299279127281665 +2025-04-11 15:33:50.9430 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 15:33:56.2772 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 15:34:40.8522 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-11 15:35:15.5785 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:35:15.9484 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:35:16.3260 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:35:16.7161 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:36:05.9189 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 15:36:06.2176 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 15:36:06.2564 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589114682446970880 +2025-04-11 15:36:06.2581 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589114682446970880 AccountId:116299279127281665 +2025-04-11 15:36:06.3355 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 15:36:11.9240 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 15:36:26.1967 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-11 15:36:26.2659 (G2Chat_OfflineRequestHandler.cs:11) chat : 聊天服务器SnowShow 下线 +2025-04-11 15:36:26.2659 (GateLoginHelper.cs:44) Gate : chat聊天服务器下线成功 +2025-04-11 15:36:26.2659 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-11 15:36:26.2659 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose +2025-04-11 15:37:54.5531 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 15:37:54.7182 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 15:37:54.7264 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589354375981826048 +2025-04-11 15:37:54.7264 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589354375981826048 AccountId:116299279127281665 +2025-04-11 15:37:54.7724 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 15:38:00.5543 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 15:39:33.1843 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:39:33.5875 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:39:33.9826 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:39:34.3674 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:40:09.8010 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 15:40:10.0575 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 15:40:10.0885 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589086095144648704 +2025-04-11 15:40:10.0885 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589086095144648704 AccountId:116299279127281665 +2025-04-11 15:40:10.1505 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 15:40:13.1258 (C2Chat_BoardRequestMessageHandler.cs:12) Love +2025-04-11 15:40:15.8053 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 15:41:41.4501 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:41:41.8365 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:41:42.2302 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:41:42.6253 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:41:49.7037 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 15:41:49.9609 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 15:41:49.9914 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589022323470237696 +2025-04-11 15:41:49.9914 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589022323470237696 AccountId:116299279127281665 +2025-04-11 15:41:50.0552 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 15:41:53.7608 (C2Chat_BoardRequestMessageHandler.cs:12) Love +2025-04-11 15:41:53.7608 (ChatHelper.cs:21) 85932900352 +2025-04-11 15:41:53.7608 (ChatHelper.cs:21) 94522834944 +2025-04-11 15:41:55.7135 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 15:45:17.4931 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:45:17.8754 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:45:18.2764 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:45:18.6637 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:46:29.4587 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 15:46:29.7089 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 15:46:29.7327 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589163060958593024 +2025-04-11 15:46:29.7327 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589163060958593024 AccountId:116299279127281665 +2025-04-11 15:46:29.7742 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 15:46:33.0385 (C2Chat_BoardRequestMessageHandler.cs:12) Love +2025-04-11 15:46:33.0385 (ChatHelper.cs:21) 85932900352 +2025-04-11 15:46:33.0385 (Chat2G_BoardMessageHandler.cs:19) GateLove +2025-04-11 15:46:35.4618 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 15:49:20.7250 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:49:21.1064 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:49:21.5042 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:49:21.8951 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:49:56.2043 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 15:49:56.4790 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 15:49:56.5206 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589081697098137600 +2025-04-11 15:49:56.5206 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589081697098137600 AccountId:116299279127281665 +2025-04-11 15:49:56.5844 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 15:49:59.1360 (C2Chat_BoardRequestMessageHandler.cs:12) Love +2025-04-11 15:49:59.1360 (ChatHelper.cs:21) 85932900352 +2025-04-11 15:49:59.1528 (Chat2G_BoardMessageHandler.cs:19) Love +2025-04-11 15:50:02.2075 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 15:53:23.1796 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:53:23.6034 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:53:24.0237 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:53:24.4187 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:53:35.0454 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 15:53:35.3006 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 15:53:35.3419 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589031119563259904 +2025-04-11 15:53:35.3419 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589031119563259904 AccountId:116299279127281665 +2025-04-11 15:53:35.4077 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 15:53:38.0390 (C2Chat_BoardRequestMessageHandler.cs:12) Love +2025-04-11 15:53:38.0390 (ChatHelper.cs:21) 85932900352 +2025-04-11 15:53:38.0547 (Chat2G_BoardMessageHandler.cs:19) 0 +2025-04-11 15:53:41.0609 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 15:59:02.1323 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:59:02.4884 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 15:59:02.8598 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:59:03.2376 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 15:59:40.2166 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 15:59:40.4833 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 15:59:40.5250 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589088294167904256 +2025-04-11 15:59:40.5250 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589088294167904256 AccountId:116299279127281665 +2025-04-11 15:59:40.5628 (GateLoginHelper.cs:32) OLine Gate1 +2025-04-11 15:59:40.5892 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 15:59:46.2307 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Error.log b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Error.log new file mode 100644 index 00000000..ff8e00cd --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Error.log @@ -0,0 +1,762 @@ +2025-04-11 15:34:28.2433 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:30.6502 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:31.3106 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:31.5817 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:31.7644 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:31.9531 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:32.1336 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:38.6398 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:38.8670 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:38.8670 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:2 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:39.0708 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:39.2857 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:39.9822 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:40.5772 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:41.1027 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:41.6802 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:42.1975 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:42.7772 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:43.2472 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:43.7720 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:44.1722 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:44.3467 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:44.5410 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:47.3929 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:48.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:3 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:48.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:4 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:48.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:5 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:48.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:6 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:48.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:7 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:48.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:8 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:48.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:9 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:48.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:10 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:49.4911 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:49.7158 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:49.9205 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:50.1102 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:50.3128 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:50.5103 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:50.6892 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:50.8485 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:51.0574 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:51.2710 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:51.4735 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:51.6747 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:51.9875 coroutine lock timeout CoroutineLockQueueType:140718960075648 Key:2589053238644834304 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:11 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:12 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:13 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:14 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:15 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:16 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:17 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:18 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:19 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:20 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:21 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:22 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:23 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:34:58.8810 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:24 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:38:28.7675 coroutine lock timeout CoroutineLockQueueType:140718960002680 Key:2589354504830844928 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:38:46.3961 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:4 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:38:58.9700 coroutine lock timeout CoroutineLockQueueType:140718960002680 Key:2589354504830844928 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:47:03.0395 coroutine lock timeout CoroutineLockQueueType:140718960002680 Key:2589163189807611904 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:47:18.2844 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:2 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:50:29.1380 coroutine lock timeout CoroutineLockQueueType:140718959871608 Key:2589081825947156480 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:54:08.0398 coroutine lock timeout CoroutineLockQueueType:140718960133752 Key:2589029049389023232 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 15:54:24.0541 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:2 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Info.log b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Info.log new file mode 100644 index 00000000..82abddbc --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Info.log @@ -0,0 +1,121 @@ +2025-04-11 15:33:26.5739 初始化序列化器成功,数量为:2 +2025-04-11 15:33:27.3874 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 15:33:27.6503 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 15:33:27.7754 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:33:27.9906 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 15:33:28.3029 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 15:33:28.3052 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:33:28.6006 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 15:33:28.8746 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 15:33:29.1824 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 15:33:29.4622 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 15:33:29.7341 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 15:33:29.9710 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 15:33:29.9710 Process:1 Startup Complete SceneCount:5 +2025-04-11 15:33:50.8991 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589053109795815424 +2025-04-11 15:35:14.7202 初始化序列化器成功,数量为:2 +2025-04-11 15:35:15.3431 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 15:35:15.5644 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 15:35:15.5785 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:35:15.7682 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 15:35:15.9484 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 15:35:15.9484 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:35:16.1532 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 15:35:16.3260 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 15:35:16.5374 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 15:35:16.7161 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 15:35:16.9317 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 15:35:17.1325 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 15:35:17.1325 Process:1 Startup Complete SceneCount:5 +2025-04-11 15:36:06.2898 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589114682446970880 +2025-04-11 15:37:54.7417 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589354375981826048 +2025-04-11 15:39:32.3087 初始化序列化器成功,数量为:2 +2025-04-11 15:39:32.9543 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 15:39:33.1675 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 15:39:33.1843 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:39:33.4019 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 15:39:33.5875 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 15:39:33.5875 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:39:33.7925 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 15:39:33.9826 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 15:39:34.1892 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 15:39:34.3674 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 15:39:34.5846 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 15:39:34.7982 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 15:39:34.7982 Process:1 Startup Complete SceneCount:5 +2025-04-11 15:40:10.1055 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589086095144648704 +2025-04-11 15:41:40.5770 初始化序列化器成功,数量为:2 +2025-04-11 15:41:41.2305 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 15:41:41.4336 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 15:41:41.4501 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:41:41.6505 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 15:41:41.8346 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 15:41:41.8365 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:41:42.0469 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 15:41:42.2302 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 15:41:42.4428 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 15:41:42.6253 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 15:41:42.8275 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 15:41:43.0321 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 15:41:43.0321 Process:1 Startup Complete SceneCount:5 +2025-04-11 15:41:50.0085 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589022323470237696 +2025-04-11 15:45:16.5837 初始化序列化器成功,数量为:2 +2025-04-11 15:45:17.2601 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 15:45:17.4770 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 15:45:17.4931 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:45:17.6924 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 15:45:17.8754 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 15:45:17.8754 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:45:18.0926 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 15:45:18.2764 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 15:45:18.4812 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 15:45:18.6637 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 15:45:18.8768 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 15:45:19.0974 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 15:45:19.0974 Process:1 Startup Complete SceneCount:5 +2025-04-11 15:46:29.7475 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589163060958593024 +2025-04-11 15:49:19.8428 初始化序列化器成功,数量为:2 +2025-04-11 15:49:20.5011 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 15:49:20.7102 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 15:49:20.7250 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:49:20.9195 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 15:49:21.1064 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 15:49:21.1064 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:49:21.3101 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 15:49:21.5042 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 15:49:21.7144 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 15:49:21.8951 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 15:49:22.1004 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 15:49:22.3014 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 15:49:22.3014 Process:1 Startup Complete SceneCount:5 +2025-04-11 15:49:56.5378 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589081697098137600 +2025-04-11 15:53:22.2766 初始化序列化器成功,数量为:2 +2025-04-11 15:53:22.9245 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 15:53:23.1581 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 15:53:23.1796 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:53:23.4150 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 15:53:23.6034 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 15:53:23.6034 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:53:23.8366 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 15:53:24.0237 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 15:53:24.2349 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 15:53:24.4187 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 15:53:24.6313 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 15:53:24.8391 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 15:53:24.8391 Process:1 Startup Complete SceneCount:5 +2025-04-11 15:53:35.3603 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589031119563259904 +2025-04-11 15:59:01.3151 初始化序列化器成功,数量为:2 +2025-04-11 15:59:01.9274 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 15:59:02.1165 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 15:59:02.1313 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:59:02.3145 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 15:59:02.4884 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 15:59:02.4884 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 15:59:02.6804 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 15:59:02.8598 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 15:59:03.0545 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 15:59:03.2376 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 15:59:03.4464 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 15:59:03.6500 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 15:59:03.6500 Process:1 Startup Complete SceneCount:5 +2025-04-11 15:59:40.5431 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589088294167904256 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Warn.log b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Warn.log new file mode 100644 index 00000000..efda794c --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041115.Warn.log @@ -0,0 +1,11 @@ +2025-04-11 15:33:50.8787 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 15:34:30.8472 session timeout id:148901878326099968 timeNow:1744356870847 _session.LastReceiveTime:1744356862804 _timeOut:8000 +2025-04-11 15:36:06.2176 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 15:36:16.1918 session timeout id:148904214788308992 timeNow:1744356976191 _session.LastReceiveTime:1744356968184 _timeOut:8000 +2025-04-11 15:37:54.7182 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 15:40:10.0575 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 15:41:49.9609 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 15:46:29.7089 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 15:49:56.4790 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 15:53:35.3006 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 15:59:40.4833 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Debug.log b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Debug.log new file mode 100644 index 00000000..9d2a9a19 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Debug.log @@ -0,0 +1,63 @@ +2025-04-11 16:02:41.0670 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 16:02:41.4687 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 16:02:41.8843 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 16:02:42.2825 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 16:02:47.1598 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 16:02:47.4039 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 16:02:47.4331 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589017925423726592 +2025-04-11 16:02:47.4331 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589017925423726592 AccountId:116299279127281665 +2025-04-11 16:02:47.4481 (GateLoginHelper.cs:32) OLine Gate1 +2025-04-11 16:02:47.4741 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 16:02:49.1849 (C2Chat_BoardRequestMessageHandler.cs:12) Love +2025-04-11 16:02:49.1849 (ChatHelper.cs:21) 85932900352 +2025-04-11 16:02:53.1615 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 16:06:55.1604 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 16:06:55.5580 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 16:06:55.9862 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 16:06:56.3952 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 16:07:05.2280 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 16:07:05.4977 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 16:07:05.5249 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589026721516748800 +2025-04-11 16:07:05.5249 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589026721516748800 AccountId:116299279127281665 +2025-04-11 16:07:05.5626 (GateLoginHelper.cs:32) OLine Gate1 +2025-04-11 16:07:05.6048 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 16:07:11.2339 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 16:07:12.0761 (C2Chat_BoardRequestMessageHandler.cs:12) Love +2025-04-11 16:07:12.0761 (ChatHelper.cs:21) 85932900352 +2025-04-11 16:07:12.0761 (ChatHelper.cs:21) 94522834944 +2025-04-11 16:10:44.9181 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 16:10:45.3008 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 16:10:45.6843 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 16:10:46.0383 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 16:11:13.0428 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 16:11:13.3245 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 16:11:13.3523 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589066303935348736 +2025-04-11 16:11:13.3523 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589066303935348736 AccountId:116299279127281665 +2025-04-11 16:11:13.3879 (GateLoginHelper.cs:32) OLine Gate1 +2025-04-11 16:11:13.4158 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 16:11:17.5050 (C2Chat_BoardRequestMessageHandler.cs:12) Love +2025-04-11 16:11:17.5050 (ChatHelper.cs:21) 85932900352 +2025-04-11 16:11:17.5050 (ChatHelper.cs:21) 94522834944 +2025-04-11 16:11:19.0489 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 16:11:57.2160 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 16:11:57.6031 (OnCreateScene_InitEvent.cs:16) 初始化鉴权服务器组件 +2025-04-11 16:11:57.9995 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 16:11:58.4045 (OnCreateScene_InitEvent.cs:21) 初始网关(Gate)服务器组件 +2025-04-11 16:12:04.1304 (AuthenticationComponentSystem.cs:130) Authentication: Login Success(登录成功),username:wangwei,password:123,source:客户端,Position:1001 +2025-04-11 16:12:04.3868 (C2G_LoginRequestHandler.cs:31) Gate校验登录成功用户116299279127281665 +2025-04-11 16:12:04.4148 (GameAccountManageComponentSystem.cs:102) Gate 当前缓存中的 SessionID 2589020124446982144 +2025-04-11 16:12:04.4148 (C2G_LoginRequestHandler.cs:43) Gate : Login 登录成功GameAccount:session2589020124446982144 AccountId:116299279127281665 +2025-04-11 16:12:04.4510 (GateLoginHelper.cs:32) OLine Gate1 +2025-04-11 16:12:04.4775 (G2C_GetGameAccountInfoHandler.cs:37) Gate: 获取账号信息 AccountId SnowShow +2025-04-11 16:12:06.6886 (C2Chat_BoardRequestMessageHandler.cs:12) Love +2025-04-11 16:12:06.6886 (ChatHelper.cs:21) 85932900352 +2025-04-11 16:12:06.6886 (ChatHelper.cs:21) 94522834944 +2025-04-11 16:12:06.7062 (Chat2G_BoardMessageHandler.cs:19) 0 +2025-04-11 16:12:06.7062 (Chat2G_BoardMessageHandler.cs:19) 1 +2025-04-11 16:12:06.7062 (Chat2G_BoardMessageHandler.cs:23) 2589020124446982144 +2025-04-11 16:12:10.1328 (AuthenticationComponentSystem.cs:150) Authentication:Login:username:wangwei 用户移除成功 从缓存中 +2025-04-11 16:12:49.3738 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-11 16:12:49.4467 (G2Chat_OfflineRequestHandler.cs:11) chat : 聊天服务器SnowShow 下线 +2025-04-11 16:12:49.4467 (GateLoginHelper.cs:45) Gate : chat聊天服务器下线成功 +2025-04-11 16:12:49.4467 (GameAccountSystem.cs:29) Gate gameAccount 下线前 保存数据到 数据库中 +2025-04-11 16:12:49.4467 (EntityTimeOutComponentSystem.cs:52) session : 0 Dispose diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Error.log b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Error.log new file mode 100644 index 00000000..439d3350 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Error.log @@ -0,0 +1,23 @@ +2025-04-11 16:03:19.1870 coroutine lock timeout CoroutineLockQueueType:140718960002680 Key:2589018054272745472 Tag: + at Fantasy.Async.OnCoroutineLockTimeout.Handler(CoroutineLockTimeout self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass18_0`1.g__OnceTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + +2025-04-11 16:03:31.8883 Unsupported protocol type:Fantasy.C2Chat_BoardMessageRequest rpcId:2 + at Fantasy.Scheduler.NetworkMessagingComponent.ReturnMessageSender(UInt32 rpcId, MessageSender messageSender) + at Fantasy.Scheduler.OnNetworkMessageUpdateCheckTimeout.Handler(NetworkMessageUpdate self) + at Fantasy.Event.EventSystem`1.Invoke(Object self) + at Fantasy.Event.EventComponent.Publish[TEventData](TEventData eventData) + at Fantasy.Timer.TimerSchedulerNet.<>c__DisplayClass22_0`1.g__RepeatedTimerVoid|0() + at Fantasy.Timer.TimerSchedulerNet.Update() + at Fantasy.Entitas.EntityComponent.Update() + at Fantasy.Scene.Update() + at Fantasy.MultiThreadScheduler.Loop(Scene scene, CancellationToken cancellationToken) + at Fantasy.MultiThreadScheduler.<>c__DisplayClass5_0.b__0() + diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Info.log b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Info.log new file mode 100644 index 00000000..f8d612c2 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Info.log @@ -0,0 +1,60 @@ +2025-04-11 16:02:40.1433 初始化序列化器成功,数量为:2 +2025-04-11 16:02:40.8448 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 16:02:41.0507 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 16:02:41.0670 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 16:02:41.2757 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 16:02:41.4687 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 16:02:41.4687 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 16:02:41.6862 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 16:02:41.8815 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 16:02:42.1015 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 16:02:42.2825 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 16:02:42.4984 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 16:02:42.6990 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 16:02:42.6990 Process:1 Startup Complete SceneCount:5 +2025-04-11 16:02:47.4481 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589017925423726592 +2025-04-11 16:06:54.2808 初始化序列化器成功,数量为:2 +2025-04-11 16:06:54.9424 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 16:06:55.1438 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 16:06:55.1604 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 16:06:55.3643 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 16:06:55.5580 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 16:06:55.5580 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 16:06:55.7960 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 16:06:55.9862 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 16:06:56.2088 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 16:06:56.3952 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 16:06:56.6150 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 16:06:56.8238 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 16:06:56.8238 Process:1 Startup Complete SceneCount:5 +2025-04-11 16:07:05.5436 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589026721516748800 +2025-04-11 16:10:44.1046 初始化序列化器成功,数量为:2 +2025-04-11 16:10:44.7048 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 16:10:44.9032 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 16:10:44.9181 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 16:10:45.1210 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 16:10:45.3008 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 16:10:45.3008 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 16:10:45.5018 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 16:10:45.6843 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 16:10:45.8691 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 16:10:46.0377 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 16:10:46.2357 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 16:10:46.4180 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 16:10:46.4180 Process:1 Startup Complete SceneCount:5 +2025-04-11 16:11:13.3704 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589066303935348736 +2025-04-11 16:11:56.3548 初始化序列化器成功,数量为:2 +2025-04-11 16:11:56.9930 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-04-11 16:11:57.1998 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-04-11 16:11:57.2160 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 16:11:57.4152 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-04-11 16:11:57.6011 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-04-11 16:11:57.6031 (AuthenticationJWTComponentSystem.cs:44) RSA密钥导入成功 +2025-04-11 16:11:57.8165 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-04-11 16:11:57.9995 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-04-11 16:11:58.2086 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-04-11 16:11:58.4045 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-04-11 16:11:58.6185 SceneConfigId = 1026 networkTarget = Inner TCPServer Listen 127.0.0.1:11026 +2025-04-11 16:11:58.8222 SceneConfigId = 1026 networkTarget = Outer TCPServer Listen 127.0.0.1:21016 +2025-04-11 16:11:58.8222 Process:1 Startup Complete SceneCount:5 +2025-04-11 16:12:04.4311 (G2Chat_LoginRequestHandler.cs:19) 登录聊天服务器成功 SnowShow AccountId 116299279127281665 GateRoutedId 2589020124446982144 diff --git a/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Warn.log b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Warn.log new file mode 100644 index 00000000..bcbd5eb3 --- /dev/null +++ b/GameServer/Bin/Debug/Logs/Server/Server20250411/Server..2025041116.Warn.log @@ -0,0 +1,5 @@ +2025-04-11 16:02:47.4039 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 16:07:05.4977 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 16:11:13.3245 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 16:12:04.3868 (GateJWTComponentSystem.cs:47) Gate:Token签名校验成功 +2025-04-11 16:12:39.3690 session timeout id:148941288946008064 timeNow:1744359159368 _session.LastReceiveTime:1744359146383 _timeOut:8000 diff --git a/GameServer/Bin/Debug/net9.0/APlugins.dll b/GameServer/Bin/Debug/net9.0/APlugins.dll new file mode 100644 index 00000000..ed581911 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/APlugins.dll differ diff --git a/GameServer/Bin/Debug/net9.0/APlugins.pdb b/GameServer/Bin/Debug/net9.0/APlugins.pdb new file mode 100644 index 00000000..7e866004 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/APlugins.pdb differ diff --git a/GameServer/Bin/Debug/net9.0/CommandLine.dll b/GameServer/Bin/Debug/net9.0/CommandLine.dll new file mode 100644 index 00000000..3eab2be2 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/CommandLine.dll differ diff --git a/GameServer/Bin/Debug/net9.0/DnsClient.dll b/GameServer/Bin/Debug/net9.0/DnsClient.dll new file mode 100644 index 00000000..39aa546a Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/DnsClient.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Entity.dll b/GameServer/Bin/Debug/net9.0/Entity.dll new file mode 100644 index 00000000..bc3b8c64 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Entity.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Entity.pdb b/GameServer/Bin/Debug/net9.0/Entity.pdb new file mode 100644 index 00000000..af19b177 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Entity.pdb differ diff --git a/GameServer/Bin/Debug/net9.0/Fantasy-Net.Config.dll b/GameServer/Bin/Debug/net9.0/Fantasy-Net.Config.dll new file mode 100644 index 00000000..7642a225 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Fantasy-Net.Config.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Fantasy-Net.ConfigTable.dll b/GameServer/Bin/Debug/net9.0/Fantasy-Net.ConfigTable.dll new file mode 100644 index 00000000..8996ebc6 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Fantasy-Net.ConfigTable.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Fantasy-Net.NLog.dll b/GameServer/Bin/Debug/net9.0/Fantasy-Net.NLog.dll new file mode 100644 index 00000000..7ffbcb54 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Fantasy-Net.NLog.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Fantasy-Net.dll b/GameServer/Bin/Debug/net9.0/Fantasy-Net.dll new file mode 100644 index 00000000..41e585d5 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Fantasy-Net.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Fantasy.Tools.ExporterConfigTable.dll b/GameServer/Bin/Debug/net9.0/Fantasy.Tools.ExporterConfigTable.dll new file mode 100644 index 00000000..cabb7662 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Fantasy.Tools.ExporterConfigTable.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Fantasy.Tools.ExporterNetworkProtocol.dll b/GameServer/Bin/Debug/net9.0/Fantasy.Tools.ExporterNetworkProtocol.dll new file mode 100644 index 00000000..22e11f8c Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Fantasy.Tools.ExporterNetworkProtocol.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Hotfix.dll b/GameServer/Bin/Debug/net9.0/Hotfix.dll new file mode 100644 index 00000000..a9b53977 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Hotfix.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Hotfix.pdb b/GameServer/Bin/Debug/net9.0/Hotfix.pdb new file mode 100644 index 00000000..6cacedb2 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Hotfix.pdb differ diff --git a/GameServer/Bin/Debug/net9.0/Main.deps.json b/GameServer/Bin/Debug/net9.0/Main.deps.json new file mode 100644 index 00000000..85b6e4d9 --- /dev/null +++ b/GameServer/Bin/Debug/net9.0/Main.deps.json @@ -0,0 +1,578 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Main/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Entity": "1.0.0", + "Fantasy-Net.NLog": "2024.1.20", + "Hotfix": "1.0.0" + }, + "runtime": { + "Main.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.24": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Config/2024.1.4": { + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "dependencies": { + "Fantasy-Net": "2024.2.24" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.NLog/2024.1.20": { + "dependencies": { + "Fantasy-Net": "2024.2.24", + "NLog": "5.3.4" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.NLog.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {}, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.Formats.Asn1/5.0.0": {}, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.7.0", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "APlugins/1.0.0": { + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "APlugins.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Entity/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.7.0", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "runtime": { + "Entity.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Hotfix/1.0.0": { + "dependencies": { + "Entity": "1.0.0" + }, + "runtime": { + "Hotfix.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Main/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "path": "fantasy-net/2024.2.24", + "hashPath": "fantasy-net.2024.2.24.nupkg.sha512" + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "path": "fantasy-net.config/2024.1.4", + "hashPath": "fantasy-net.config.2024.1.4.nupkg.sha512" + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "path": "fantasy-net.configtable/2024.2.0", + "hashPath": "fantasy-net.configtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.NLog/2024.1.20": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HJuHfecWrD7tcQYEZezJzgayvG5leAbdWlgvo9ft/CUuwTtAB+tkeKP3e3VtbkCoPaAZO4VAUN0Y30Ute2/vrQ==", + "path": "fantasy-net.nlog/2024.1.20", + "hashPath": "fantasy-net.nlog.2024.1.20.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hashPath": "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hashPath": "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OQd5aVepYvh5evOmBMeAYjMIpEcTf1ZCBZaU7Nh/RlhhdXefjFDJeP1L2F2zeNT1unFr+wUu/h3Ac2Xb4BXU6w==", + "path": "microsoft.identitymodel.abstractions/8.7.0", + "hashPath": "microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uzsSAWhNhbrkWbQKBTE8QhzviU6sr3bJ1Bkv7gERlhswfSKOp7HsxTRLTPBpx/whQ/GRRHEwMg8leRIPbMrOgw==", + "path": "microsoft.identitymodel.jsonwebtokens/8.7.0", + "hashPath": "microsoft.identitymodel.jsonwebtokens.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Bs0TznPAu+nxa9rAVHJ+j3CYECHJkT3tG8AyBfhFYlT5ldsDhoxFT7J+PKxJHLf+ayqWfvDZHHc4639W2FQCxA==", + "path": "microsoft.identitymodel.logging/8.7.0", + "hashPath": "microsoft.identitymodel.logging.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5Z6voXjRXAnGklhmZd1mKz89UhcF5ZQQZaZc2iKrOuL4Li1UihG2vlJx8IbiFAOIxy/xdbsAm0A+WZEaH5fxng==", + "path": "microsoft.identitymodel.tokens/8.7.0", + "hashPath": "microsoft.identitymodel.tokens.8.7.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "path": "system.formats.asn1/5.0.0", + "hashPath": "system.formats.asn1.5.0.0.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-8dKL3A9pVqYCJIXHd4H2epQqLxSvKeNxGonR0e5g89yMchyvsM/NLuB06otx29BicUd6+LUJZgNZmvYjjPsPGg==", + "path": "system.identitymodel.tokens.jwt/8.7.0", + "hashPath": "system.identitymodel.tokens.jwt.8.7.0.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "path": "system.security.cryptography.cng/5.0.0", + "hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + }, + "APlugins/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Entity/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Hotfix/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/GameServer/Bin/Debug/net9.0/Main.dll b/GameServer/Bin/Debug/net9.0/Main.dll new file mode 100644 index 00000000..f5df5de0 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Main.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Main.exe b/GameServer/Bin/Debug/net9.0/Main.exe new file mode 100644 index 00000000..9f7efb20 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Main.exe differ diff --git a/GameServer/Bin/Debug/net9.0/Main.pdb b/GameServer/Bin/Debug/net9.0/Main.pdb new file mode 100644 index 00000000..504f5178 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Main.pdb differ diff --git a/GameServer/Bin/Debug/net9.0/Main.runtimeconfig.json b/GameServer/Bin/Debug/net9.0/Main.runtimeconfig.json new file mode 100644 index 00000000..27e402f0 --- /dev/null +++ b/GameServer/Bin/Debug/net9.0/Main.runtimeconfig.json @@ -0,0 +1,18 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "frameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + { + "name": "Microsoft.AspNetCore.App", + "version": "9.0.0" + } + ], + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.Abstractions.dll b/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.Abstractions.dll new file mode 100644 index 00000000..3e6ca08b Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.Abstractions.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll b/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll new file mode 100644 index 00000000..9d7eaebb Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.Logging.dll b/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.Logging.dll new file mode 100644 index 00000000..dbae0fd7 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.Logging.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.Tokens.dll b/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.Tokens.dll new file mode 100644 index 00000000..d959e7a4 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Microsoft.IdentityModel.Tokens.dll differ diff --git a/GameServer/Bin/Debug/net9.0/MongoDB.Bson.dll b/GameServer/Bin/Debug/net9.0/MongoDB.Bson.dll new file mode 100644 index 00000000..c604c81a Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/MongoDB.Bson.dll differ diff --git a/GameServer/Bin/Debug/net9.0/MongoDB.Driver.dll b/GameServer/Bin/Debug/net9.0/MongoDB.Driver.dll new file mode 100644 index 00000000..1308944b Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/MongoDB.Driver.dll differ diff --git a/GameServer/Bin/Debug/net9.0/NLog.config b/GameServer/Bin/Debug/net9.0/NLog.config new file mode 100644 index 00000000..4df5ea1b --- /dev/null +++ b/GameServer/Bin/Debug/net9.0/NLog.config @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Bin/Debug/net9.0/NLog.dll b/GameServer/Bin/Debug/net9.0/NLog.dll new file mode 100644 index 00000000..49604e19 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/NLog.dll differ diff --git a/GameServer/Bin/Debug/net9.0/NLog.xsd b/GameServer/Bin/Debug/net9.0/NLog.xsd new file mode 100644 index 00000000..63c9a0cc --- /dev/null +++ b/GameServer/Bin/Debug/net9.0/NLog.xsd @@ -0,0 +1,3483 @@ + + + + + + + + + + + + + + + Watch config file for changes and reload automatically. + + + + + Print internal NLog messages to the console. Default value is: false + + + + + Print internal NLog messages to the console error output. Default value is: false + + + + + Write internal NLog messages to the specified file. + + + + + Log level threshold for internal log messages. Default value is: Info. + + + + + Global log level threshold for application log messages. Messages below this level won't be logged. + + + + + Throw an exception when there is an internal error. Default value is: false. Not recommend to set to true in production! + + + + + Throw an exception when there is a configuration error. If not set, determined by throwExceptions. + + + + + Gets or sets a value indicating whether Variables should be kept on configuration reload. Default value is: false. + + + + + Write internal NLog messages to the System.Diagnostics.Trace. Default value is: false. + + + + + Write timestamps for internal NLog messages. Default value is: true. + + + + + Use InvariantCulture as default culture instead of CurrentCulture. Default value is: false. + + + + + Perform message template parsing and formatting of LogEvent messages (true = Always, false = Never, empty = Auto Detect). Default value is: empty. + + + + + + + + + + + + + + Make all targets within this section asynchronous (creates additional threads but the calling thread isn't blocked by any target writes). + + + + + + + + + + + + + + + + + Prefix for targets/layout renderers/filters/conditions loaded from this assembly. + + + + + Load NLog extensions from the specified file (*.dll) + + + + + Load NLog extensions from the specified assembly. Assembly name should be fully qualified. + + + + + + + + + + Filter on the name of the logger. May include wildcard characters ('*' or '?'). + + + + + Comma separated list of levels that this rule matches. + + + + + Minimum level that this rule matches. + + + + + Maximum level that this rule matches. + + + + + Level that this rule matches. + + + + + Comma separated list of target names. + + + + + Ignore further rules if this one matches. + + + + + Enable this rule. Note: disabled rules aren't available from the API. + + + + + Rule identifier to allow rule lookup with Configuration.FindRuleByName and Configuration.RemoveRuleByName. + + + + + Loggers matching will be restricted to specified minimum level for following rules. + + + + + + + + + + + + + + + Default action if none of the filters match. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the file to be included. You could use * wildcard. The name is relative to the name of the current config file. + + + + + Ignore any errors in the include file. + + + + + + + + Variable value. Note, the 'value' attribute has precedence over this one. + + + + + + Variable name. + + + + + Variable value. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Action to be taken when the lazy writer thread request queue count exceeds the set limit. + + + + + Limit on the number of requests in the lazy writer thread request queue. + + + + + Number of log events that should be processed in a batch by the lazy writer thread. + + + + + Whether to use the locking queue, instead of a lock-free concurrent queue + + + + + Number of batches of P:NLog.Targets.Wrappers.AsyncTargetWrapper.BatchSize to write before yielding into P:NLog.Targets.Wrappers.AsyncTargetWrapper.TimeToSleepBetweenBatches + + + + + Time in milliseconds to sleep between batches. (1 or less means trigger on new activity) + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Delay the flush until the LogEvent has been confirmed as written + + + + + Condition expression. Log events who meet this condition will cause a flush on the wrapped target. + + + + + Only flush when LogEvent matches condition. Ignore explicit-flush, config-reload-flush and shutdown-flush + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Number of log events to be buffered. + + + + + Action to take if the buffer overflows. + + + + + Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes. + + + + + Indicates whether to use sliding timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Viewer parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Whether an attribute with empty value should be included in the output + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-check if the console is available. - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + Enables output using ANSI Color Codes + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console has been redirected to file - Disables coloring logic when System.Console.IsOutputRedirected = true + + + + + Indicates whether to use default row highlighting rules. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background color. + + + + + Condition that must be met in order to set the specified foreground and background color. + + + + + Foreground color. + + + + + + + + + + + + + + + + + Background color. + + + + + Compile the P:NLog.Targets.ConsoleWordHighlightingRule.Regex? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used. + + + + + Condition that must be met before scanning the row for highlight of words + + + + + Foreground color. + + + + + Indicates whether to ignore case when comparing texts. + + + + + Regular expression to be matched. You must specify either text or regex. + + + + + Text to be matched. You must specify either text or regex. + + + + + Indicates whether to match whole words only. + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console is available - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Whether to activate internal buffering to allow batch writing, instead of using M:System.Console.WriteLine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. + + + + + Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. + + + + + Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. + + + + + Name of the connection string (as specified in <connectionStrings> configuration section. + + + + + Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. + + + + + Indicates whether to keep the database connection open between the log events. + + + + + Name of the database provider. + + + + + Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. + + + + + Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. + + + + + Configures isolated transaction batch writing. If supported by the database, then it will improve insert performance. + + + + + Text of the SQL command to be run on each log level. + + + + + Type of the SQL command to be run on each log level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Convert format of the property value + + + + + Culture used for parsing property string-value for type-conversion + + + + + Value to assign on the object-property + + + + + Name for the object-property + + + + + Type of the object-property + + + + + + + + + + + + + + Type of the command. + + + + + Connection string to run the command against. If not provided, connection string from the target is used. + + + + + Indicates whether to ignore failures. + + + + + Command text. + + + + + + + + + + + + + + + + + + + + Database parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Database parameter DbType. + + + + + Database parameter size. + + + + + Database parameter precision. + + + + + Database parameter scale. + + + + + Type of the parameter. + + + + + Fallback value when result value is not available + + + + + Convert format of the database parameter value. + + + + + Culture used for parsing parameter string-value for type-conversion + + + + + Whether empty value should translate into DbNull. Requires database column to allow NULL values. + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Layout that renders event Category. + + + + + Optional entry type. When not set, or when not convertible to T:System.Diagnostics.EventLogEntryType then determined by T:NLog.LogLevel + + + + + Layout that renders event ID. + + + + + Name of the Event Log to write to. This can be System, Application or any user-defined name. + + + + + Name of the machine on which Event Log service is running. + + + + + Maximum Event log size in kilobytes. + + + + + Message length limit to write to the Event Log. + + + + + Value to be used as the event Source. + + + + + Action to take if the message is larger than the P:NLog.Targets.EventLogTarget.MaxMessageLength option. + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to return to the first target after any successful write. + + + + + Whether to enable batching, but fallback will be handled individually + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Name of the file to write to. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether the footer should be written only when the file is archived. + + + + + Maximum number of archive files that should be kept. + + + + + Maximum days of archive files that should be kept. + + + + + Value of the file size threshold to archive old log file on startup. + + + + + Indicates whether to archive old log file on startup. + + + + + Indicates whether to compress archive files into the zip archive format. + + + + + Name of the file to be used for an archive. + + + + + Is the P:NLog.Targets.FileTarget.ArchiveFileName an absolute or relative path? + + + + + Indicates whether to automatically archive log files every time the specified time passes. + + + + + Value specifying the date format to use when archiving files. + + + + + Size in bytes above which log files will be automatically archived. + + + + + Way file archives are numbered. + + + + + Indicates whether to create directories if they do not exist. + + + + + Indicates whether file creation calls should be synchronized by a system global mutex. + + + + + Gets or set a value indicating whether a managed file stream is forced, instead of using the native implementation. + + + + + Is the P:NLog.Targets.FileTarget.FileName an absolute or relative path? + + + + + File attributes (Windows only). + + + + + Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong. + + + + + Indicates whether to write BOM (byte order mark) in created files. Defaults to true for UTF-16 and UTF-32 + + + + + Indicates whether to enable log file(s) to be deleted. + + + + + Indicates whether to delete old log file on startup. + + + + + File encoding. + + + + + Indicates whether to replace file contents on each write instead of appending log message at the end. + + + + + Line ending mode. + + + + + Number of times the write is appended on the file before NLog discards the log message. + + + + + Delay in milliseconds to wait before attempting to write to the file again. + + + + + Maximum number of seconds before open files are flushed. Zero or negative means disabled. + + + + + Maximum number of seconds that files are kept open. Zero or negative means disabled. + + + + + Indicates whether concurrent writes to the log file by multiple processes on different network hosts. + + + + + Log file buffer size in bytes. + + + + + Indicates whether to automatically flush the file buffers after each log message. + + + + + Indicates whether to keep log file open instead of opening and closing it on each logging event. + + + + + Indicates whether concurrent writes to the log file by multiple processes on the same host. + + + + + Whether or not this target should just discard all data that its asked to write. Mostly used for when testing NLog Stack except final write + + + + + Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Condition expression. Log events who meet this condition will be forwarded to the wrapped target. + + + + + + + + + + + + + + + Name of the target. + + + + + Identifier to perform group-by + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Windows domain name to change context to. + + + + + Required impersonation level. + + + + + Type of the logon provider. + + + + + Logon Type. + + + + + User account password. + + + + + Indicates whether to revert to the credentials of the process instead of impersonating another user. + + + + + Username to change context to. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Interval in which messages will be written up to the P:NLog.Targets.Wrappers.LimitingTargetWrapper.MessageLimit number of messages. + + + + + Maximum allowed number of messages written per P:NLog.Targets.Wrappers.LimitingTargetWrapper.Interval. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether NewLine characters in the body should be replaced with tags. + + + + + Priority used for sending mails. + + + + + Encoding to be used for sending e-mail. + + + + + BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Indicates whether to add new lines between log entries. + + + + + Indicates whether to send message as HTML instead of plain text. + + + + + Sender's email address (e.g. joe@domain.com). + + + + + Mail message body (repeated for each log message send in one mail). + + + + + Mail subject. + + + + + Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Specifies how outgoing email messages will be handled. + + + + + SMTP Server to be used for sending. + + + + + SMTP Authentication mode. + + + + + Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + + + + + Port number that SMTP Server is listening on. + + + + + Indicates whether the default Settings from System.Net.MailSettings should be used. + + + + + Folder where applications save mail messages to be processed by the local SMTP server. + + + + + Indicates the SMTP client timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Max number of items to have in memory + + + + + + + + + + + + + + + + + Name of the target. + + + + + Class name. + + + + + Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g. + + + + + + + + + + + + + + + Name of the parameter. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Fallback value when result value is not available + + + + + Type of the parameter. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Indicates whether to perform layout calculation. + + + + + + + + + + + + + + + + Name of the target. + + + + + Default filter to be applied when no specific rule matches. + + + + + + + + + + + + + Condition to be tested. + + + + + Resulting filter to be applied when the condition matches. + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + Name of the target. + + + + + Number of times to repeat each log message. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Whether to enable batching, and only apply single delay when a whole batch fails + + + + + Number of retries that should be attempted on the wrapped target in case of a failure. + + + + + Time to wait between retries in milliseconds. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Forward F:NLog.LogLevel.Fatal to M:System.Diagnostics.Trace.Fail(System.String) (Instead of M:System.Diagnostics.Trace.TraceError(System.String)) + + + + + Force use M:System.Diagnostics.Trace.WriteLine(System.String) independent of T:NLog.LogLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to pre-authenticate the HttpWebRequest (Requires 'Authorization' in P:NLog.Targets.WebServiceTarget.Headers parameters) + + + + + Value whether escaping be done according to Rfc3986 (Supports Internationalized Resource Identifiers - IRIs) + + + + + Value whether escaping be done according to the old NLog style (Very non-standard) + + + + + Value of the User-agent HTTP header. + + + + + Web service URL. + + + + + Proxy configuration when calling web service + + + + + Custom proxy address, include port separated by a colon + + + + + Protocol to be used when calling web service. + + + + + Web service namespace. Only used with Soap. + + + + + Web service method name. Only used with Soap. + + + + + Should we include the BOM (Byte-order-mark) for UTF? Influences the P:NLog.Targets.WebServiceTarget.Encoding property. This will only work for UTF-8. + + + + + Encoding. + + + + + Name of the root XML element, if POST of XML document chosen. If so, this property must not be null. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + (optional) root namespace of the XML document, if POST of XML document chosen. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom'). + + + + + Column delimiter. + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + Quote Character. + + + + + Quoting mode. + + + + + Indicates whether CVS should include header. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the column. + + + + + Layout of the column. + + + + + Override of Quoting mode + + + + + + + + + + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log event (as JSON) + + + + + Indicates whether to include contents of the T:NLog.GlobalDiagnosticsContext dictionary. + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Option to exclude null/empty properties from the log event (as JSON) + + + + + List of property names to exclude when P:NLog.Layouts.JsonLayout.IncludeAllProperties is true + + + + + How far should the JSON serializer follow object references before backing off + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Json encoded. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Indicates whether to escape non-ascii characters + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log events + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether the log4j:throwable xml-element should be written as CDATA + + + + + + + + + + + + + + Layout text. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the root XML element + + + + + Value inside the root XML element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + + + + + + + + + + + Name of the element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Value inside the element + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Condition expression. + + + + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Append FilterCount to the P:NLog.LogEventInfo.Message when an event is no longer filtered + + + + + Insert FilterCount value into P:NLog.LogEventInfo.Properties when an event is no longer filtered + + + + + Applies the configured action to the initial logevent that starts the timeout period. Used to configure that it should ignore all events until timeout. + + + + + Layout to be used to filter log messages. + + + + + Max length of filter values, will truncate if above limit + + + + + How long before a filter expires, and logging is accepted again + + + + + Default number of unique filter values to expect, will automatically increase if needed + + + + + Max number of unique filter values to expect simultaneously + + + + + Default buffer size for the internal buffers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Bin/Debug/net9.0/Newtonsoft.Json.dll b/GameServer/Bin/Debug/net9.0/Newtonsoft.Json.dll new file mode 100644 index 00000000..d035c38b Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Newtonsoft.Json.dll differ diff --git a/GameServer/Bin/Debug/net9.0/SharpCompress.dll b/GameServer/Bin/Debug/net9.0/SharpCompress.dll new file mode 100644 index 00000000..c1a7f074 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/SharpCompress.dll differ diff --git a/GameServer/Bin/Debug/net9.0/Snappier.dll b/GameServer/Bin/Debug/net9.0/Snappier.dll new file mode 100644 index 00000000..9b68e856 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/Snappier.dll differ diff --git a/GameServer/Bin/Debug/net9.0/System.IdentityModel.Tokens.Jwt.dll b/GameServer/Bin/Debug/net9.0/System.IdentityModel.Tokens.Jwt.dll new file mode 100644 index 00000000..f7a07695 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/System.IdentityModel.Tokens.Jwt.dll differ diff --git a/GameServer/Bin/Debug/net9.0/ZstdSharp.dll b/GameServer/Bin/Debug/net9.0/ZstdSharp.dll new file mode 100644 index 00000000..5d93f7e5 Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/ZstdSharp.dll differ diff --git a/GameServer/Bin/Debug/net9.0/protobuf-net.Core.dll b/GameServer/Bin/Debug/net9.0/protobuf-net.Core.dll new file mode 100644 index 00000000..b3e554dc Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/protobuf-net.Core.dll differ diff --git a/GameServer/Bin/Debug/net9.0/protobuf-net.dll b/GameServer/Bin/Debug/net9.0/protobuf-net.dll new file mode 100644 index 00000000..e75237bc Binary files /dev/null and b/GameServer/Bin/Debug/net9.0/protobuf-net.dll differ diff --git a/GameServer/Bin/Release/Logs/Server/Server20250325/Server..2025032516.Debug.log b/GameServer/Bin/Release/Logs/Server/Server20250325/Server..2025032516.Debug.log new file mode 100644 index 00000000..0d2e2783 --- /dev/null +++ b/GameServer/Bin/Release/Logs/Server/Server20250325/Server..2025032516.Debug.log @@ -0,0 +1,4 @@ +2025-03-25 16:45:05.1461 初始化鉴权服务器组件 +2025-03-25 16:45:05.3997 初始化鉴权服务器组件 +2025-03-25 16:45:05.8064 初始网关(Gate)服务器组件 +2025-03-25 16:45:06.2004 初始网关(Gate)服务器组件 diff --git a/GameServer/Bin/Release/Logs/Server/Server20250325/Server..2025032516.Error.log b/GameServer/Bin/Release/Logs/Server/Server20250325/Server..2025032516.Error.log new file mode 100644 index 00000000..584e45ba --- /dev/null +++ b/GameServer/Bin/Release/Logs/Server/Server20250325/Server..2025032516.Error.log @@ -0,0 +1,21 @@ +2025-03-25 16:43:48.5270 System.Net.Sockets.SocketException (10049): 在其上下文中,该请求的地址无效。 + at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName) + at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) + at System.Net.Sockets.Socket.Bind(EndPoint localEP) + at Fantasy.Network.TCP.TCPServerNetwork.Initialize(NetworkTarget networkTarget, IPEndPoint address) + at Fantasy.Network.NetworkProtocolFactory.CreateServer(Scene scene, NetworkProtocolType protocolType, NetworkTarget networkTarget, String bindIp, Int32 port) + at Fantasy.Scene.Create(Process process, MachineConfig machineConfig, SceneConfig sceneConfig) + at Fantasy.Platform.Net.Process.Create(UInt32 processConfigId) + at Fantasy.Platform.Net.Entry.StartProcess() + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Async.FTask.InnerCoroutine() + at Fantasy.Platform.Net.Entry.StartProcess() + at Fantasy.Platform.Net.Process.Create(UInt32 processConfigId) + at Fantasy.Scene.Create(Process process, MachineConfig machineConfig, SceneConfig sceneConfig) + at Fantasy.Scene.SetScheduler(Scene scene, String sceneRuntimeType) + at Fantasy.Scene.Initialize() + at Fantasy.SingleCollection.SingleCollectionComponent.Initialize() + at Fantasy.Assembly.AssemblySystem.Register(Object obj) + at Fantasy.SingleCollection.SingleCollectionComponent.Load(Int64 assemblyIdentity) + at Fantasy.SingleCollection.SingleCollectionComponent.<>c__DisplayClass5_0.b__0() + at Fantasy.ThreadSynchronizationContext.Update() diff --git a/GameServer/Bin/Release/Logs/Server/Server20250325/Server..2025032516.Info.log b/GameServer/Bin/Release/Logs/Server/Server20250325/Server..2025032516.Info.log new file mode 100644 index 00000000..23ebf5e6 --- /dev/null +++ b/GameServer/Bin/Release/Logs/Server/Server20250325/Server..2025032516.Info.log @@ -0,0 +1,13 @@ +2025-03-25 16:43:47.9511 初始化序列化器成功,数量为:2 +2025-03-25 16:45:04.0820 初始化序列化器成功,数量为:2 +2025-03-25 16:45:04.7487 SceneConfigId = 1001 networkTarget = Inner TCPServer Listen 127.0.0.1:11001 +2025-03-25 16:45:04.9620 SceneConfigId = 1001 networkTarget = Outer KCPServer Listen 127.0.0.1:21001 +2025-03-25 16:45:05.1461 RSA密钥导入成功 +2025-03-25 16:45:05.1957 SceneConfigId = 1002 networkTarget = Inner TCPServer Listen 127.0.0.1:11002 +2025-03-25 16:45:05.3997 SceneConfigId = 1002 networkTarget = Outer KCPServer Listen 127.0.0.1:21002 +2025-03-25 16:45:05.3997 RSA密钥导入成功 +2025-03-25 16:45:05.6180 SceneConfigId = 1010 networkTarget = Inner TCPServer Listen 127.0.0.1:11010 +2025-03-25 16:45:05.8064 SceneConfigId = 1010 networkTarget = Outer KCPServer Listen 127.0.0.1:21010 +2025-03-25 16:45:06.0134 SceneConfigId = 1011 networkTarget = Inner TCPServer Listen 127.0.0.1:11011 +2025-03-25 16:45:06.2004 SceneConfigId = 1011 networkTarget = Outer KCPServer Listen 127.0.0.1:21011 +2025-03-25 16:45:06.2004 Process:1 Startup Complete SceneCount:4 diff --git a/GameServer/Bin/Release/net9.0/APlugins.dll b/GameServer/Bin/Release/net9.0/APlugins.dll new file mode 100644 index 00000000..cc1491d5 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/APlugins.dll differ diff --git a/GameServer/Bin/Release/net9.0/APlugins.pdb b/GameServer/Bin/Release/net9.0/APlugins.pdb new file mode 100644 index 00000000..1045ce75 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/APlugins.pdb differ diff --git a/GameServer/Bin/Release/net9.0/CommandLine.dll b/GameServer/Bin/Release/net9.0/CommandLine.dll new file mode 100644 index 00000000..3eab2be2 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/CommandLine.dll differ diff --git a/GameServer/Bin/Release/net9.0/DnsClient.dll b/GameServer/Bin/Release/net9.0/DnsClient.dll new file mode 100644 index 00000000..39aa546a Binary files /dev/null and b/GameServer/Bin/Release/net9.0/DnsClient.dll differ diff --git a/GameServer/Bin/Release/net9.0/Entity.dll b/GameServer/Bin/Release/net9.0/Entity.dll new file mode 100644 index 00000000..c362e995 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Entity.dll differ diff --git a/GameServer/Bin/Release/net9.0/Entity.pdb b/GameServer/Bin/Release/net9.0/Entity.pdb new file mode 100644 index 00000000..3976e226 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Entity.pdb differ diff --git a/GameServer/Bin/Release/net9.0/Fantasy-Net.Config.dll b/GameServer/Bin/Release/net9.0/Fantasy-Net.Config.dll new file mode 100644 index 00000000..7642a225 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Fantasy-Net.Config.dll differ diff --git a/GameServer/Bin/Release/net9.0/Fantasy-Net.ConfigTable.dll b/GameServer/Bin/Release/net9.0/Fantasy-Net.ConfigTable.dll new file mode 100644 index 00000000..8996ebc6 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Fantasy-Net.ConfigTable.dll differ diff --git a/GameServer/Bin/Release/net9.0/Fantasy-Net.NLog.dll b/GameServer/Bin/Release/net9.0/Fantasy-Net.NLog.dll new file mode 100644 index 00000000..7ffbcb54 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Fantasy-Net.NLog.dll differ diff --git a/GameServer/Bin/Release/net9.0/Fantasy-Net.dll b/GameServer/Bin/Release/net9.0/Fantasy-Net.dll new file mode 100644 index 00000000..41e585d5 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Fantasy-Net.dll differ diff --git a/GameServer/Bin/Release/net9.0/Fantasy.Tools.ExporterConfigTable.dll b/GameServer/Bin/Release/net9.0/Fantasy.Tools.ExporterConfigTable.dll new file mode 100644 index 00000000..cabb7662 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Fantasy.Tools.ExporterConfigTable.dll differ diff --git a/GameServer/Bin/Release/net9.0/Fantasy.Tools.ExporterNetworkProtocol.dll b/GameServer/Bin/Release/net9.0/Fantasy.Tools.ExporterNetworkProtocol.dll new file mode 100644 index 00000000..22e11f8c Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Fantasy.Tools.ExporterNetworkProtocol.dll differ diff --git a/GameServer/Bin/Release/net9.0/Hotfix.dll b/GameServer/Bin/Release/net9.0/Hotfix.dll new file mode 100644 index 00000000..7cc2cb57 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Hotfix.dll differ diff --git a/GameServer/Bin/Release/net9.0/Hotfix.pdb b/GameServer/Bin/Release/net9.0/Hotfix.pdb new file mode 100644 index 00000000..0fbc1833 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Hotfix.pdb differ diff --git a/GameServer/Bin/Release/net9.0/Main.deps.json b/GameServer/Bin/Release/net9.0/Main.deps.json new file mode 100644 index 00000000..d7051637 --- /dev/null +++ b/GameServer/Bin/Release/net9.0/Main.deps.json @@ -0,0 +1,578 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Main/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Entity": "1.0.0", + "Fantasy-Net.NLog": "2024.1.20", + "Hotfix": "1.0.0" + }, + "runtime": { + "Main.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.24": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Config/2024.1.4": { + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "dependencies": { + "Fantasy-Net": "2024.2.24" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.NLog/2024.1.20": { + "dependencies": { + "Fantasy-Net": "2024.2.24", + "NLog": "5.3.4" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.NLog.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {}, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + } + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.Formats.Asn1/5.0.0": {}, + "System.IdentityModel.Tokens.Jwt/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.6.1", + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "APlugins/1.0.0": { + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "APlugins.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Entity/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.6.1", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "runtime": { + "Entity.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Hotfix/1.0.0": { + "dependencies": { + "Entity": "1.0.0" + }, + "runtime": { + "Hotfix.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Main/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "path": "fantasy-net/2024.2.24", + "hashPath": "fantasy-net.2024.2.24.nupkg.sha512" + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "path": "fantasy-net.config/2024.1.4", + "hashPath": "fantasy-net.config.2024.1.4.nupkg.sha512" + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "path": "fantasy-net.configtable/2024.2.0", + "hashPath": "fantasy-net.configtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.NLog/2024.1.20": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HJuHfecWrD7tcQYEZezJzgayvG5leAbdWlgvo9ft/CUuwTtAB+tkeKP3e3VtbkCoPaAZO4VAUN0Y30Ute2/vrQ==", + "path": "fantasy-net.nlog/2024.1.20", + "hashPath": "fantasy-net.nlog.2024.1.20.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hashPath": "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hashPath": "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OwmvCXYTttrxV3qT7QKDkoQP4/DB4RWjTwEqV+dNfb2opHn29WGDzoF+r4BVFQVy+BDYMhRlhIp8g3jSyJd+4Q==", + "path": "microsoft.identitymodel.abstractions/8.6.1", + "hashPath": "microsoft.identitymodel.abstractions.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CAu9DWsPZVtnyE3bOJ83rlPWpahY37sP/0bIOdRlxS90W88zSI4V3FyoCDlXxV8+gloT+a247pwPXfSNjYyAxw==", + "path": "microsoft.identitymodel.jsonwebtokens/8.6.1", + "hashPath": "microsoft.identitymodel.jsonwebtokens.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BdWlVgJYdmcR9TMUOhaZ3vJyaRO7zr7xgK+cRT4R2q59Xl7JMmTB4ctb/VOsyDhxXb497jDNNvLwldp+2ZVBEg==", + "path": "microsoft.identitymodel.logging/8.6.1", + "hashPath": "microsoft.identitymodel.logging.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FvED2com8LIFl9yFXneiX0uxNf9fuf8jKDFcvxC93qXOAfFa8fdLkCiur1vWF+PvgQHhsHVBe6CtDZHzsN8nCQ==", + "path": "microsoft.identitymodel.tokens/8.6.1", + "hashPath": "microsoft.identitymodel.tokens.8.6.1.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "path": "system.formats.asn1/5.0.0", + "hashPath": "system.formats.asn1.5.0.0.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-EXL1Tj+pizswtHHPiQyNumrTo8XOLX7SoTm7Bz00/DyiIoG2H/kQItoajSvr1MYtvDNXveqULsoWDoJFI3aHzQ==", + "path": "system.identitymodel.tokens.jwt/8.6.1", + "hashPath": "system.identitymodel.tokens.jwt.8.6.1.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "path": "system.security.cryptography.cng/5.0.0", + "hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + }, + "APlugins/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Entity/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Hotfix/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/GameServer/Bin/Release/net9.0/Main.dll b/GameServer/Bin/Release/net9.0/Main.dll new file mode 100644 index 00000000..8615b5fc Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Main.dll differ diff --git a/GameServer/Bin/Release/net9.0/Main.exe b/GameServer/Bin/Release/net9.0/Main.exe new file mode 100644 index 00000000..df244ea1 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Main.exe differ diff --git a/GameServer/Bin/Release/net9.0/Main.pdb b/GameServer/Bin/Release/net9.0/Main.pdb new file mode 100644 index 00000000..5807ecc4 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Main.pdb differ diff --git a/GameServer/Bin/Release/net9.0/Main.runtimeconfig.json b/GameServer/Bin/Release/net9.0/Main.runtimeconfig.json new file mode 100644 index 00000000..2e596832 --- /dev/null +++ b/GameServer/Bin/Release/net9.0/Main.runtimeconfig.json @@ -0,0 +1,19 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "frameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + { + "name": "Microsoft.AspNetCore.App", + "version": "9.0.0" + } + ], + "configProperties": { + "System.Reflection.Metadata.MetadataUpdater.IsSupported": false, + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.Abstractions.dll b/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.Abstractions.dll new file mode 100644 index 00000000..54acaf95 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.Abstractions.dll differ diff --git a/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll b/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll new file mode 100644 index 00000000..fce94dc9 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll differ diff --git a/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.Logging.dll b/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.Logging.dll new file mode 100644 index 00000000..e08a8df6 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.Logging.dll differ diff --git a/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.Tokens.dll b/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.Tokens.dll new file mode 100644 index 00000000..b10d9bc7 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Microsoft.IdentityModel.Tokens.dll differ diff --git a/GameServer/Bin/Release/net9.0/MongoDB.Bson.dll b/GameServer/Bin/Release/net9.0/MongoDB.Bson.dll new file mode 100644 index 00000000..c604c81a Binary files /dev/null and b/GameServer/Bin/Release/net9.0/MongoDB.Bson.dll differ diff --git a/GameServer/Bin/Release/net9.0/MongoDB.Driver.dll b/GameServer/Bin/Release/net9.0/MongoDB.Driver.dll new file mode 100644 index 00000000..1308944b Binary files /dev/null and b/GameServer/Bin/Release/net9.0/MongoDB.Driver.dll differ diff --git a/GameServer/Bin/Release/net9.0/NLog.config b/GameServer/Bin/Release/net9.0/NLog.config new file mode 100644 index 00000000..4df5ea1b --- /dev/null +++ b/GameServer/Bin/Release/net9.0/NLog.config @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Bin/Release/net9.0/NLog.dll b/GameServer/Bin/Release/net9.0/NLog.dll new file mode 100644 index 00000000..49604e19 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/NLog.dll differ diff --git a/GameServer/Bin/Release/net9.0/NLog.xsd b/GameServer/Bin/Release/net9.0/NLog.xsd new file mode 100644 index 00000000..63c9a0cc --- /dev/null +++ b/GameServer/Bin/Release/net9.0/NLog.xsd @@ -0,0 +1,3483 @@ + + + + + + + + + + + + + + + Watch config file for changes and reload automatically. + + + + + Print internal NLog messages to the console. Default value is: false + + + + + Print internal NLog messages to the console error output. Default value is: false + + + + + Write internal NLog messages to the specified file. + + + + + Log level threshold for internal log messages. Default value is: Info. + + + + + Global log level threshold for application log messages. Messages below this level won't be logged. + + + + + Throw an exception when there is an internal error. Default value is: false. Not recommend to set to true in production! + + + + + Throw an exception when there is a configuration error. If not set, determined by throwExceptions. + + + + + Gets or sets a value indicating whether Variables should be kept on configuration reload. Default value is: false. + + + + + Write internal NLog messages to the System.Diagnostics.Trace. Default value is: false. + + + + + Write timestamps for internal NLog messages. Default value is: true. + + + + + Use InvariantCulture as default culture instead of CurrentCulture. Default value is: false. + + + + + Perform message template parsing and formatting of LogEvent messages (true = Always, false = Never, empty = Auto Detect). Default value is: empty. + + + + + + + + + + + + + + Make all targets within this section asynchronous (creates additional threads but the calling thread isn't blocked by any target writes). + + + + + + + + + + + + + + + + + Prefix for targets/layout renderers/filters/conditions loaded from this assembly. + + + + + Load NLog extensions from the specified file (*.dll) + + + + + Load NLog extensions from the specified assembly. Assembly name should be fully qualified. + + + + + + + + + + Filter on the name of the logger. May include wildcard characters ('*' or '?'). + + + + + Comma separated list of levels that this rule matches. + + + + + Minimum level that this rule matches. + + + + + Maximum level that this rule matches. + + + + + Level that this rule matches. + + + + + Comma separated list of target names. + + + + + Ignore further rules if this one matches. + + + + + Enable this rule. Note: disabled rules aren't available from the API. + + + + + Rule identifier to allow rule lookup with Configuration.FindRuleByName and Configuration.RemoveRuleByName. + + + + + Loggers matching will be restricted to specified minimum level for following rules. + + + + + + + + + + + + + + + Default action if none of the filters match. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the file to be included. You could use * wildcard. The name is relative to the name of the current config file. + + + + + Ignore any errors in the include file. + + + + + + + + Variable value. Note, the 'value' attribute has precedence over this one. + + + + + + Variable name. + + + + + Variable value. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Action to be taken when the lazy writer thread request queue count exceeds the set limit. + + + + + Limit on the number of requests in the lazy writer thread request queue. + + + + + Number of log events that should be processed in a batch by the lazy writer thread. + + + + + Whether to use the locking queue, instead of a lock-free concurrent queue + + + + + Number of batches of P:NLog.Targets.Wrappers.AsyncTargetWrapper.BatchSize to write before yielding into P:NLog.Targets.Wrappers.AsyncTargetWrapper.TimeToSleepBetweenBatches + + + + + Time in milliseconds to sleep between batches. (1 or less means trigger on new activity) + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Delay the flush until the LogEvent has been confirmed as written + + + + + Condition expression. Log events who meet this condition will cause a flush on the wrapped target. + + + + + Only flush when LogEvent matches condition. Ignore explicit-flush, config-reload-flush and shutdown-flush + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Number of log events to be buffered. + + + + + Action to take if the buffer overflows. + + + + + Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes. + + + + + Indicates whether to use sliding timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Viewer parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Whether an attribute with empty value should be included in the output + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-check if the console is available. - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + Enables output using ANSI Color Codes + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console has been redirected to file - Disables coloring logic when System.Console.IsOutputRedirected = true + + + + + Indicates whether to use default row highlighting rules. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background color. + + + + + Condition that must be met in order to set the specified foreground and background color. + + + + + Foreground color. + + + + + + + + + + + + + + + + + Background color. + + + + + Compile the P:NLog.Targets.ConsoleWordHighlightingRule.Regex? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used. + + + + + Condition that must be met before scanning the row for highlight of words + + + + + Foreground color. + + + + + Indicates whether to ignore case when comparing texts. + + + + + Regular expression to be matched. You must specify either text or regex. + + + + + Text to be matched. You must specify either text or regex. + + + + + Indicates whether to match whole words only. + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console is available - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Whether to activate internal buffering to allow batch writing, instead of using M:System.Console.WriteLine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. + + + + + Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. + + + + + Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. + + + + + Name of the connection string (as specified in <connectionStrings> configuration section. + + + + + Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. + + + + + Indicates whether to keep the database connection open between the log events. + + + + + Name of the database provider. + + + + + Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. + + + + + Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. + + + + + Configures isolated transaction batch writing. If supported by the database, then it will improve insert performance. + + + + + Text of the SQL command to be run on each log level. + + + + + Type of the SQL command to be run on each log level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Convert format of the property value + + + + + Culture used for parsing property string-value for type-conversion + + + + + Value to assign on the object-property + + + + + Name for the object-property + + + + + Type of the object-property + + + + + + + + + + + + + + Type of the command. + + + + + Connection string to run the command against. If not provided, connection string from the target is used. + + + + + Indicates whether to ignore failures. + + + + + Command text. + + + + + + + + + + + + + + + + + + + + Database parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Database parameter DbType. + + + + + Database parameter size. + + + + + Database parameter precision. + + + + + Database parameter scale. + + + + + Type of the parameter. + + + + + Fallback value when result value is not available + + + + + Convert format of the database parameter value. + + + + + Culture used for parsing parameter string-value for type-conversion + + + + + Whether empty value should translate into DbNull. Requires database column to allow NULL values. + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Layout that renders event Category. + + + + + Optional entry type. When not set, or when not convertible to T:System.Diagnostics.EventLogEntryType then determined by T:NLog.LogLevel + + + + + Layout that renders event ID. + + + + + Name of the Event Log to write to. This can be System, Application or any user-defined name. + + + + + Name of the machine on which Event Log service is running. + + + + + Maximum Event log size in kilobytes. + + + + + Message length limit to write to the Event Log. + + + + + Value to be used as the event Source. + + + + + Action to take if the message is larger than the P:NLog.Targets.EventLogTarget.MaxMessageLength option. + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to return to the first target after any successful write. + + + + + Whether to enable batching, but fallback will be handled individually + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Name of the file to write to. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether the footer should be written only when the file is archived. + + + + + Maximum number of archive files that should be kept. + + + + + Maximum days of archive files that should be kept. + + + + + Value of the file size threshold to archive old log file on startup. + + + + + Indicates whether to archive old log file on startup. + + + + + Indicates whether to compress archive files into the zip archive format. + + + + + Name of the file to be used for an archive. + + + + + Is the P:NLog.Targets.FileTarget.ArchiveFileName an absolute or relative path? + + + + + Indicates whether to automatically archive log files every time the specified time passes. + + + + + Value specifying the date format to use when archiving files. + + + + + Size in bytes above which log files will be automatically archived. + + + + + Way file archives are numbered. + + + + + Indicates whether to create directories if they do not exist. + + + + + Indicates whether file creation calls should be synchronized by a system global mutex. + + + + + Gets or set a value indicating whether a managed file stream is forced, instead of using the native implementation. + + + + + Is the P:NLog.Targets.FileTarget.FileName an absolute or relative path? + + + + + File attributes (Windows only). + + + + + Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong. + + + + + Indicates whether to write BOM (byte order mark) in created files. Defaults to true for UTF-16 and UTF-32 + + + + + Indicates whether to enable log file(s) to be deleted. + + + + + Indicates whether to delete old log file on startup. + + + + + File encoding. + + + + + Indicates whether to replace file contents on each write instead of appending log message at the end. + + + + + Line ending mode. + + + + + Number of times the write is appended on the file before NLog discards the log message. + + + + + Delay in milliseconds to wait before attempting to write to the file again. + + + + + Maximum number of seconds before open files are flushed. Zero or negative means disabled. + + + + + Maximum number of seconds that files are kept open. Zero or negative means disabled. + + + + + Indicates whether concurrent writes to the log file by multiple processes on different network hosts. + + + + + Log file buffer size in bytes. + + + + + Indicates whether to automatically flush the file buffers after each log message. + + + + + Indicates whether to keep log file open instead of opening and closing it on each logging event. + + + + + Indicates whether concurrent writes to the log file by multiple processes on the same host. + + + + + Whether or not this target should just discard all data that its asked to write. Mostly used for when testing NLog Stack except final write + + + + + Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Condition expression. Log events who meet this condition will be forwarded to the wrapped target. + + + + + + + + + + + + + + + Name of the target. + + + + + Identifier to perform group-by + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Windows domain name to change context to. + + + + + Required impersonation level. + + + + + Type of the logon provider. + + + + + Logon Type. + + + + + User account password. + + + + + Indicates whether to revert to the credentials of the process instead of impersonating another user. + + + + + Username to change context to. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Interval in which messages will be written up to the P:NLog.Targets.Wrappers.LimitingTargetWrapper.MessageLimit number of messages. + + + + + Maximum allowed number of messages written per P:NLog.Targets.Wrappers.LimitingTargetWrapper.Interval. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether NewLine characters in the body should be replaced with tags. + + + + + Priority used for sending mails. + + + + + Encoding to be used for sending e-mail. + + + + + BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Indicates whether to add new lines between log entries. + + + + + Indicates whether to send message as HTML instead of plain text. + + + + + Sender's email address (e.g. joe@domain.com). + + + + + Mail message body (repeated for each log message send in one mail). + + + + + Mail subject. + + + + + Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Specifies how outgoing email messages will be handled. + + + + + SMTP Server to be used for sending. + + + + + SMTP Authentication mode. + + + + + Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + + + + + Port number that SMTP Server is listening on. + + + + + Indicates whether the default Settings from System.Net.MailSettings should be used. + + + + + Folder where applications save mail messages to be processed by the local SMTP server. + + + + + Indicates the SMTP client timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Max number of items to have in memory + + + + + + + + + + + + + + + + + Name of the target. + + + + + Class name. + + + + + Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g. + + + + + + + + + + + + + + + Name of the parameter. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Fallback value when result value is not available + + + + + Type of the parameter. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Indicates whether to perform layout calculation. + + + + + + + + + + + + + + + + Name of the target. + + + + + Default filter to be applied when no specific rule matches. + + + + + + + + + + + + + Condition to be tested. + + + + + Resulting filter to be applied when the condition matches. + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + Name of the target. + + + + + Number of times to repeat each log message. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Whether to enable batching, and only apply single delay when a whole batch fails + + + + + Number of retries that should be attempted on the wrapped target in case of a failure. + + + + + Time to wait between retries in milliseconds. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Forward F:NLog.LogLevel.Fatal to M:System.Diagnostics.Trace.Fail(System.String) (Instead of M:System.Diagnostics.Trace.TraceError(System.String)) + + + + + Force use M:System.Diagnostics.Trace.WriteLine(System.String) independent of T:NLog.LogLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to pre-authenticate the HttpWebRequest (Requires 'Authorization' in P:NLog.Targets.WebServiceTarget.Headers parameters) + + + + + Value whether escaping be done according to Rfc3986 (Supports Internationalized Resource Identifiers - IRIs) + + + + + Value whether escaping be done according to the old NLog style (Very non-standard) + + + + + Value of the User-agent HTTP header. + + + + + Web service URL. + + + + + Proxy configuration when calling web service + + + + + Custom proxy address, include port separated by a colon + + + + + Protocol to be used when calling web service. + + + + + Web service namespace. Only used with Soap. + + + + + Web service method name. Only used with Soap. + + + + + Should we include the BOM (Byte-order-mark) for UTF? Influences the P:NLog.Targets.WebServiceTarget.Encoding property. This will only work for UTF-8. + + + + + Encoding. + + + + + Name of the root XML element, if POST of XML document chosen. If so, this property must not be null. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + (optional) root namespace of the XML document, if POST of XML document chosen. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom'). + + + + + Column delimiter. + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + Quote Character. + + + + + Quoting mode. + + + + + Indicates whether CVS should include header. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the column. + + + + + Layout of the column. + + + + + Override of Quoting mode + + + + + + + + + + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log event (as JSON) + + + + + Indicates whether to include contents of the T:NLog.GlobalDiagnosticsContext dictionary. + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Option to exclude null/empty properties from the log event (as JSON) + + + + + List of property names to exclude when P:NLog.Layouts.JsonLayout.IncludeAllProperties is true + + + + + How far should the JSON serializer follow object references before backing off + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Json encoded. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Indicates whether to escape non-ascii characters + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log events + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether the log4j:throwable xml-element should be written as CDATA + + + + + + + + + + + + + + Layout text. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the root XML element + + + + + Value inside the root XML element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + + + + + + + + + + + Name of the element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Value inside the element + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Condition expression. + + + + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Append FilterCount to the P:NLog.LogEventInfo.Message when an event is no longer filtered + + + + + Insert FilterCount value into P:NLog.LogEventInfo.Properties when an event is no longer filtered + + + + + Applies the configured action to the initial logevent that starts the timeout period. Used to configure that it should ignore all events until timeout. + + + + + Layout to be used to filter log messages. + + + + + Max length of filter values, will truncate if above limit + + + + + How long before a filter expires, and logging is accepted again + + + + + Default number of unique filter values to expect, will automatically increase if needed + + + + + Max number of unique filter values to expect simultaneously + + + + + Default buffer size for the internal buffers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Bin/Release/net9.0/Newtonsoft.Json.dll b/GameServer/Bin/Release/net9.0/Newtonsoft.Json.dll new file mode 100644 index 00000000..d035c38b Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Newtonsoft.Json.dll differ diff --git a/GameServer/Bin/Release/net9.0/SharpCompress.dll b/GameServer/Bin/Release/net9.0/SharpCompress.dll new file mode 100644 index 00000000..c1a7f074 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/SharpCompress.dll differ diff --git a/GameServer/Bin/Release/net9.0/Snappier.dll b/GameServer/Bin/Release/net9.0/Snappier.dll new file mode 100644 index 00000000..9b68e856 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/Snappier.dll differ diff --git a/GameServer/Bin/Release/net9.0/System.IdentityModel.Tokens.Jwt.dll b/GameServer/Bin/Release/net9.0/System.IdentityModel.Tokens.Jwt.dll new file mode 100644 index 00000000..135ae17d Binary files /dev/null and b/GameServer/Bin/Release/net9.0/System.IdentityModel.Tokens.Jwt.dll differ diff --git a/GameServer/Bin/Release/net9.0/ZstdSharp.dll b/GameServer/Bin/Release/net9.0/ZstdSharp.dll new file mode 100644 index 00000000..5d93f7e5 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/ZstdSharp.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/APlugins.dll b/GameServer/Bin/Release/net9.0/linux-x64/APlugins.dll new file mode 100644 index 00000000..cc1491d5 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/APlugins.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/APlugins.pdb b/GameServer/Bin/Release/net9.0/linux-x64/APlugins.pdb new file mode 100644 index 00000000..1045ce75 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/APlugins.pdb differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/CommandLine.dll b/GameServer/Bin/Release/net9.0/linux-x64/CommandLine.dll new file mode 100644 index 00000000..3eab2be2 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/CommandLine.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/DnsClient.dll b/GameServer/Bin/Release/net9.0/linux-x64/DnsClient.dll new file mode 100644 index 00000000..39aa546a Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/DnsClient.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Entity.dll b/GameServer/Bin/Release/net9.0/linux-x64/Entity.dll new file mode 100644 index 00000000..c362e995 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Entity.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Entity.pdb b/GameServer/Bin/Release/net9.0/linux-x64/Entity.pdb new file mode 100644 index 00000000..3976e226 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Entity.pdb differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.Config.dll b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.Config.dll new file mode 100644 index 00000000..7642a225 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.Config.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.ConfigTable.dll b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.ConfigTable.dll new file mode 100644 index 00000000..8996ebc6 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.ConfigTable.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.NLog.dll b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.NLog.dll new file mode 100644 index 00000000..7ffbcb54 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.NLog.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.dll b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.dll new file mode 100644 index 00000000..41e585d5 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy-Net.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Fantasy.Tools.ExporterConfigTable.dll b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy.Tools.ExporterConfigTable.dll new file mode 100644 index 00000000..cabb7662 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy.Tools.ExporterConfigTable.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Fantasy.Tools.ExporterNetworkProtocol.dll b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy.Tools.ExporterNetworkProtocol.dll new file mode 100644 index 00000000..22e11f8c Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Fantasy.Tools.ExporterNetworkProtocol.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Hotfix.dll b/GameServer/Bin/Release/net9.0/linux-x64/Hotfix.dll new file mode 100644 index 00000000..7cc2cb57 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Hotfix.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Hotfix.pdb b/GameServer/Bin/Release/net9.0/linux-x64/Hotfix.pdb new file mode 100644 index 00000000..0fbc1833 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Hotfix.pdb differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Main b/GameServer/Bin/Release/net9.0/linux-x64/Main new file mode 100644 index 00000000..01a8ff7d Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Main differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Main.deps.json b/GameServer/Bin/Release/net9.0/linux-x64/Main.deps.json new file mode 100644 index 00000000..b54c34d1 --- /dev/null +++ b/GameServer/Bin/Release/net9.0/linux-x64/Main.deps.json @@ -0,0 +1,579 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0/linux-x64", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": {}, + ".NETCoreApp,Version=v9.0/linux-x64": { + "Main/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Entity": "1.0.0", + "Fantasy-Net.NLog": "2024.1.20", + "Hotfix": "1.0.0" + }, + "runtime": { + "Main.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.24": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Config/2024.1.4": { + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "dependencies": { + "Fantasy-Net": "2024.2.24" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.NLog/2024.1.20": { + "dependencies": { + "Fantasy-Net": "2024.2.24", + "NLog": "5.3.4" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.NLog.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {}, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + } + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.Formats.Asn1/5.0.0": {}, + "System.IdentityModel.Tokens.Jwt/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.6.1", + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "APlugins/1.0.0": { + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "APlugins.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Entity/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.6.1", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "runtime": { + "Entity.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Hotfix/1.0.0": { + "dependencies": { + "Entity": "1.0.0" + }, + "runtime": { + "Hotfix.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Main/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "path": "fantasy-net/2024.2.24", + "hashPath": "fantasy-net.2024.2.24.nupkg.sha512" + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "path": "fantasy-net.config/2024.1.4", + "hashPath": "fantasy-net.config.2024.1.4.nupkg.sha512" + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "path": "fantasy-net.configtable/2024.2.0", + "hashPath": "fantasy-net.configtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.NLog/2024.1.20": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HJuHfecWrD7tcQYEZezJzgayvG5leAbdWlgvo9ft/CUuwTtAB+tkeKP3e3VtbkCoPaAZO4VAUN0Y30Ute2/vrQ==", + "path": "fantasy-net.nlog/2024.1.20", + "hashPath": "fantasy-net.nlog.2024.1.20.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hashPath": "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hashPath": "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OwmvCXYTttrxV3qT7QKDkoQP4/DB4RWjTwEqV+dNfb2opHn29WGDzoF+r4BVFQVy+BDYMhRlhIp8g3jSyJd+4Q==", + "path": "microsoft.identitymodel.abstractions/8.6.1", + "hashPath": "microsoft.identitymodel.abstractions.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CAu9DWsPZVtnyE3bOJ83rlPWpahY37sP/0bIOdRlxS90W88zSI4V3FyoCDlXxV8+gloT+a247pwPXfSNjYyAxw==", + "path": "microsoft.identitymodel.jsonwebtokens/8.6.1", + "hashPath": "microsoft.identitymodel.jsonwebtokens.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BdWlVgJYdmcR9TMUOhaZ3vJyaRO7zr7xgK+cRT4R2q59Xl7JMmTB4ctb/VOsyDhxXb497jDNNvLwldp+2ZVBEg==", + "path": "microsoft.identitymodel.logging/8.6.1", + "hashPath": "microsoft.identitymodel.logging.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FvED2com8LIFl9yFXneiX0uxNf9fuf8jKDFcvxC93qXOAfFa8fdLkCiur1vWF+PvgQHhsHVBe6CtDZHzsN8nCQ==", + "path": "microsoft.identitymodel.tokens/8.6.1", + "hashPath": "microsoft.identitymodel.tokens.8.6.1.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "path": "system.formats.asn1/5.0.0", + "hashPath": "system.formats.asn1.5.0.0.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-EXL1Tj+pizswtHHPiQyNumrTo8XOLX7SoTm7Bz00/DyiIoG2H/kQItoajSvr1MYtvDNXveqULsoWDoJFI3aHzQ==", + "path": "system.identitymodel.tokens.jwt/8.6.1", + "hashPath": "system.identitymodel.tokens.jwt.8.6.1.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "path": "system.security.cryptography.cng/5.0.0", + "hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + }, + "APlugins/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Entity/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Hotfix/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Main.dll b/GameServer/Bin/Release/net9.0/linux-x64/Main.dll new file mode 100644 index 00000000..f5a23d4f Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Main.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Main.pdb b/GameServer/Bin/Release/net9.0/linux-x64/Main.pdb new file mode 100644 index 00000000..72b4315c Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Main.pdb differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Main.runtimeconfig.json b/GameServer/Bin/Release/net9.0/linux-x64/Main.runtimeconfig.json new file mode 100644 index 00000000..2e596832 --- /dev/null +++ b/GameServer/Bin/Release/net9.0/linux-x64/Main.runtimeconfig.json @@ -0,0 +1,19 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "frameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + { + "name": "Microsoft.AspNetCore.App", + "version": "9.0.0" + } + ], + "configProperties": { + "System.Reflection.Metadata.MetadataUpdater.IsSupported": false, + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.Abstractions.dll b/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.Abstractions.dll new file mode 100644 index 00000000..54acaf95 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.Abstractions.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.JsonWebTokens.dll b/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.JsonWebTokens.dll new file mode 100644 index 00000000..fce94dc9 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.JsonWebTokens.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.Logging.dll b/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.Logging.dll new file mode 100644 index 00000000..e08a8df6 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.Logging.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.Tokens.dll b/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.Tokens.dll new file mode 100644 index 00000000..b10d9bc7 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Microsoft.IdentityModel.Tokens.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/MongoDB.Bson.dll b/GameServer/Bin/Release/net9.0/linux-x64/MongoDB.Bson.dll new file mode 100644 index 00000000..c604c81a Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/MongoDB.Bson.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/MongoDB.Driver.dll b/GameServer/Bin/Release/net9.0/linux-x64/MongoDB.Driver.dll new file mode 100644 index 00000000..1308944b Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/MongoDB.Driver.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/NLog.config b/GameServer/Bin/Release/net9.0/linux-x64/NLog.config new file mode 100644 index 00000000..4df5ea1b --- /dev/null +++ b/GameServer/Bin/Release/net9.0/linux-x64/NLog.config @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Bin/Release/net9.0/linux-x64/NLog.dll b/GameServer/Bin/Release/net9.0/linux-x64/NLog.dll new file mode 100644 index 00000000..49604e19 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/NLog.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/NLog.xsd b/GameServer/Bin/Release/net9.0/linux-x64/NLog.xsd new file mode 100644 index 00000000..63c9a0cc --- /dev/null +++ b/GameServer/Bin/Release/net9.0/linux-x64/NLog.xsd @@ -0,0 +1,3483 @@ + + + + + + + + + + + + + + + Watch config file for changes and reload automatically. + + + + + Print internal NLog messages to the console. Default value is: false + + + + + Print internal NLog messages to the console error output. Default value is: false + + + + + Write internal NLog messages to the specified file. + + + + + Log level threshold for internal log messages. Default value is: Info. + + + + + Global log level threshold for application log messages. Messages below this level won't be logged. + + + + + Throw an exception when there is an internal error. Default value is: false. Not recommend to set to true in production! + + + + + Throw an exception when there is a configuration error. If not set, determined by throwExceptions. + + + + + Gets or sets a value indicating whether Variables should be kept on configuration reload. Default value is: false. + + + + + Write internal NLog messages to the System.Diagnostics.Trace. Default value is: false. + + + + + Write timestamps for internal NLog messages. Default value is: true. + + + + + Use InvariantCulture as default culture instead of CurrentCulture. Default value is: false. + + + + + Perform message template parsing and formatting of LogEvent messages (true = Always, false = Never, empty = Auto Detect). Default value is: empty. + + + + + + + + + + + + + + Make all targets within this section asynchronous (creates additional threads but the calling thread isn't blocked by any target writes). + + + + + + + + + + + + + + + + + Prefix for targets/layout renderers/filters/conditions loaded from this assembly. + + + + + Load NLog extensions from the specified file (*.dll) + + + + + Load NLog extensions from the specified assembly. Assembly name should be fully qualified. + + + + + + + + + + Filter on the name of the logger. May include wildcard characters ('*' or '?'). + + + + + Comma separated list of levels that this rule matches. + + + + + Minimum level that this rule matches. + + + + + Maximum level that this rule matches. + + + + + Level that this rule matches. + + + + + Comma separated list of target names. + + + + + Ignore further rules if this one matches. + + + + + Enable this rule. Note: disabled rules aren't available from the API. + + + + + Rule identifier to allow rule lookup with Configuration.FindRuleByName and Configuration.RemoveRuleByName. + + + + + Loggers matching will be restricted to specified minimum level for following rules. + + + + + + + + + + + + + + + Default action if none of the filters match. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the file to be included. You could use * wildcard. The name is relative to the name of the current config file. + + + + + Ignore any errors in the include file. + + + + + + + + Variable value. Note, the 'value' attribute has precedence over this one. + + + + + + Variable name. + + + + + Variable value. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Action to be taken when the lazy writer thread request queue count exceeds the set limit. + + + + + Limit on the number of requests in the lazy writer thread request queue. + + + + + Number of log events that should be processed in a batch by the lazy writer thread. + + + + + Whether to use the locking queue, instead of a lock-free concurrent queue + + + + + Number of batches of P:NLog.Targets.Wrappers.AsyncTargetWrapper.BatchSize to write before yielding into P:NLog.Targets.Wrappers.AsyncTargetWrapper.TimeToSleepBetweenBatches + + + + + Time in milliseconds to sleep between batches. (1 or less means trigger on new activity) + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Delay the flush until the LogEvent has been confirmed as written + + + + + Condition expression. Log events who meet this condition will cause a flush on the wrapped target. + + + + + Only flush when LogEvent matches condition. Ignore explicit-flush, config-reload-flush and shutdown-flush + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Number of log events to be buffered. + + + + + Action to take if the buffer overflows. + + + + + Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes. + + + + + Indicates whether to use sliding timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Viewer parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Whether an attribute with empty value should be included in the output + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-check if the console is available. - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + Enables output using ANSI Color Codes + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console has been redirected to file - Disables coloring logic when System.Console.IsOutputRedirected = true + + + + + Indicates whether to use default row highlighting rules. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background color. + + + + + Condition that must be met in order to set the specified foreground and background color. + + + + + Foreground color. + + + + + + + + + + + + + + + + + Background color. + + + + + Compile the P:NLog.Targets.ConsoleWordHighlightingRule.Regex? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used. + + + + + Condition that must be met before scanning the row for highlight of words + + + + + Foreground color. + + + + + Indicates whether to ignore case when comparing texts. + + + + + Regular expression to be matched. You must specify either text or regex. + + + + + Text to be matched. You must specify either text or regex. + + + + + Indicates whether to match whole words only. + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console is available - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Whether to activate internal buffering to allow batch writing, instead of using M:System.Console.WriteLine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. + + + + + Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. + + + + + Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. + + + + + Name of the connection string (as specified in <connectionStrings> configuration section. + + + + + Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. + + + + + Indicates whether to keep the database connection open between the log events. + + + + + Name of the database provider. + + + + + Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. + + + + + Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. + + + + + Configures isolated transaction batch writing. If supported by the database, then it will improve insert performance. + + + + + Text of the SQL command to be run on each log level. + + + + + Type of the SQL command to be run on each log level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Convert format of the property value + + + + + Culture used for parsing property string-value for type-conversion + + + + + Value to assign on the object-property + + + + + Name for the object-property + + + + + Type of the object-property + + + + + + + + + + + + + + Type of the command. + + + + + Connection string to run the command against. If not provided, connection string from the target is used. + + + + + Indicates whether to ignore failures. + + + + + Command text. + + + + + + + + + + + + + + + + + + + + Database parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Database parameter DbType. + + + + + Database parameter size. + + + + + Database parameter precision. + + + + + Database parameter scale. + + + + + Type of the parameter. + + + + + Fallback value when result value is not available + + + + + Convert format of the database parameter value. + + + + + Culture used for parsing parameter string-value for type-conversion + + + + + Whether empty value should translate into DbNull. Requires database column to allow NULL values. + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Layout that renders event Category. + + + + + Optional entry type. When not set, or when not convertible to T:System.Diagnostics.EventLogEntryType then determined by T:NLog.LogLevel + + + + + Layout that renders event ID. + + + + + Name of the Event Log to write to. This can be System, Application or any user-defined name. + + + + + Name of the machine on which Event Log service is running. + + + + + Maximum Event log size in kilobytes. + + + + + Message length limit to write to the Event Log. + + + + + Value to be used as the event Source. + + + + + Action to take if the message is larger than the P:NLog.Targets.EventLogTarget.MaxMessageLength option. + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to return to the first target after any successful write. + + + + + Whether to enable batching, but fallback will be handled individually + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Name of the file to write to. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether the footer should be written only when the file is archived. + + + + + Maximum number of archive files that should be kept. + + + + + Maximum days of archive files that should be kept. + + + + + Value of the file size threshold to archive old log file on startup. + + + + + Indicates whether to archive old log file on startup. + + + + + Indicates whether to compress archive files into the zip archive format. + + + + + Name of the file to be used for an archive. + + + + + Is the P:NLog.Targets.FileTarget.ArchiveFileName an absolute or relative path? + + + + + Indicates whether to automatically archive log files every time the specified time passes. + + + + + Value specifying the date format to use when archiving files. + + + + + Size in bytes above which log files will be automatically archived. + + + + + Way file archives are numbered. + + + + + Indicates whether to create directories if they do not exist. + + + + + Indicates whether file creation calls should be synchronized by a system global mutex. + + + + + Gets or set a value indicating whether a managed file stream is forced, instead of using the native implementation. + + + + + Is the P:NLog.Targets.FileTarget.FileName an absolute or relative path? + + + + + File attributes (Windows only). + + + + + Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong. + + + + + Indicates whether to write BOM (byte order mark) in created files. Defaults to true for UTF-16 and UTF-32 + + + + + Indicates whether to enable log file(s) to be deleted. + + + + + Indicates whether to delete old log file on startup. + + + + + File encoding. + + + + + Indicates whether to replace file contents on each write instead of appending log message at the end. + + + + + Line ending mode. + + + + + Number of times the write is appended on the file before NLog discards the log message. + + + + + Delay in milliseconds to wait before attempting to write to the file again. + + + + + Maximum number of seconds before open files are flushed. Zero or negative means disabled. + + + + + Maximum number of seconds that files are kept open. Zero or negative means disabled. + + + + + Indicates whether concurrent writes to the log file by multiple processes on different network hosts. + + + + + Log file buffer size in bytes. + + + + + Indicates whether to automatically flush the file buffers after each log message. + + + + + Indicates whether to keep log file open instead of opening and closing it on each logging event. + + + + + Indicates whether concurrent writes to the log file by multiple processes on the same host. + + + + + Whether or not this target should just discard all data that its asked to write. Mostly used for when testing NLog Stack except final write + + + + + Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Condition expression. Log events who meet this condition will be forwarded to the wrapped target. + + + + + + + + + + + + + + + Name of the target. + + + + + Identifier to perform group-by + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Windows domain name to change context to. + + + + + Required impersonation level. + + + + + Type of the logon provider. + + + + + Logon Type. + + + + + User account password. + + + + + Indicates whether to revert to the credentials of the process instead of impersonating another user. + + + + + Username to change context to. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Interval in which messages will be written up to the P:NLog.Targets.Wrappers.LimitingTargetWrapper.MessageLimit number of messages. + + + + + Maximum allowed number of messages written per P:NLog.Targets.Wrappers.LimitingTargetWrapper.Interval. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether NewLine characters in the body should be replaced with tags. + + + + + Priority used for sending mails. + + + + + Encoding to be used for sending e-mail. + + + + + BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Indicates whether to add new lines between log entries. + + + + + Indicates whether to send message as HTML instead of plain text. + + + + + Sender's email address (e.g. joe@domain.com). + + + + + Mail message body (repeated for each log message send in one mail). + + + + + Mail subject. + + + + + Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Specifies how outgoing email messages will be handled. + + + + + SMTP Server to be used for sending. + + + + + SMTP Authentication mode. + + + + + Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + + + + + Port number that SMTP Server is listening on. + + + + + Indicates whether the default Settings from System.Net.MailSettings should be used. + + + + + Folder where applications save mail messages to be processed by the local SMTP server. + + + + + Indicates the SMTP client timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Max number of items to have in memory + + + + + + + + + + + + + + + + + Name of the target. + + + + + Class name. + + + + + Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g. + + + + + + + + + + + + + + + Name of the parameter. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Fallback value when result value is not available + + + + + Type of the parameter. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Indicates whether to perform layout calculation. + + + + + + + + + + + + + + + + Name of the target. + + + + + Default filter to be applied when no specific rule matches. + + + + + + + + + + + + + Condition to be tested. + + + + + Resulting filter to be applied when the condition matches. + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + Name of the target. + + + + + Number of times to repeat each log message. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Whether to enable batching, and only apply single delay when a whole batch fails + + + + + Number of retries that should be attempted on the wrapped target in case of a failure. + + + + + Time to wait between retries in milliseconds. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Forward F:NLog.LogLevel.Fatal to M:System.Diagnostics.Trace.Fail(System.String) (Instead of M:System.Diagnostics.Trace.TraceError(System.String)) + + + + + Force use M:System.Diagnostics.Trace.WriteLine(System.String) independent of T:NLog.LogLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to pre-authenticate the HttpWebRequest (Requires 'Authorization' in P:NLog.Targets.WebServiceTarget.Headers parameters) + + + + + Value whether escaping be done according to Rfc3986 (Supports Internationalized Resource Identifiers - IRIs) + + + + + Value whether escaping be done according to the old NLog style (Very non-standard) + + + + + Value of the User-agent HTTP header. + + + + + Web service URL. + + + + + Proxy configuration when calling web service + + + + + Custom proxy address, include port separated by a colon + + + + + Protocol to be used when calling web service. + + + + + Web service namespace. Only used with Soap. + + + + + Web service method name. Only used with Soap. + + + + + Should we include the BOM (Byte-order-mark) for UTF? Influences the P:NLog.Targets.WebServiceTarget.Encoding property. This will only work for UTF-8. + + + + + Encoding. + + + + + Name of the root XML element, if POST of XML document chosen. If so, this property must not be null. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + (optional) root namespace of the XML document, if POST of XML document chosen. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom'). + + + + + Column delimiter. + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + Quote Character. + + + + + Quoting mode. + + + + + Indicates whether CVS should include header. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the column. + + + + + Layout of the column. + + + + + Override of Quoting mode + + + + + + + + + + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log event (as JSON) + + + + + Indicates whether to include contents of the T:NLog.GlobalDiagnosticsContext dictionary. + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Option to exclude null/empty properties from the log event (as JSON) + + + + + List of property names to exclude when P:NLog.Layouts.JsonLayout.IncludeAllProperties is true + + + + + How far should the JSON serializer follow object references before backing off + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Json encoded. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Indicates whether to escape non-ascii characters + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log events + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether the log4j:throwable xml-element should be written as CDATA + + + + + + + + + + + + + + Layout text. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the root XML element + + + + + Value inside the root XML element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + + + + + + + + + + + Name of the element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Value inside the element + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Condition expression. + + + + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Append FilterCount to the P:NLog.LogEventInfo.Message when an event is no longer filtered + + + + + Insert FilterCount value into P:NLog.LogEventInfo.Properties when an event is no longer filtered + + + + + Applies the configured action to the initial logevent that starts the timeout period. Used to configure that it should ignore all events until timeout. + + + + + Layout to be used to filter log messages. + + + + + Max length of filter values, will truncate if above limit + + + + + How long before a filter expires, and logging is accepted again + + + + + Default number of unique filter values to expect, will automatically increase if needed + + + + + Max number of unique filter values to expect simultaneously + + + + + Default buffer size for the internal buffers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Newtonsoft.Json.dll b/GameServer/Bin/Release/net9.0/linux-x64/Newtonsoft.Json.dll new file mode 100644 index 00000000..d035c38b Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Newtonsoft.Json.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/SharpCompress.dll b/GameServer/Bin/Release/net9.0/linux-x64/SharpCompress.dll new file mode 100644 index 00000000..c1a7f074 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/SharpCompress.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/Snappier.dll b/GameServer/Bin/Release/net9.0/linux-x64/Snappier.dll new file mode 100644 index 00000000..9b68e856 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/Snappier.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/System.IdentityModel.Tokens.Jwt.dll b/GameServer/Bin/Release/net9.0/linux-x64/System.IdentityModel.Tokens.Jwt.dll new file mode 100644 index 00000000..135ae17d Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/System.IdentityModel.Tokens.Jwt.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/ZstdSharp.dll b/GameServer/Bin/Release/net9.0/linux-x64/ZstdSharp.dll new file mode 100644 index 00000000..5d93f7e5 Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/ZstdSharp.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/protobuf-net.Core.dll b/GameServer/Bin/Release/net9.0/linux-x64/protobuf-net.Core.dll new file mode 100644 index 00000000..b3e554dc Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/protobuf-net.Core.dll differ diff --git a/GameServer/Bin/Release/net9.0/linux-x64/protobuf-net.dll b/GameServer/Bin/Release/net9.0/linux-x64/protobuf-net.dll new file mode 100644 index 00000000..e75237bc Binary files /dev/null and b/GameServer/Bin/Release/net9.0/linux-x64/protobuf-net.dll differ diff --git a/GameServer/Bin/Release/net9.0/protobuf-net.Core.dll b/GameServer/Bin/Release/net9.0/protobuf-net.Core.dll new file mode 100644 index 00000000..b3e554dc Binary files /dev/null and b/GameServer/Bin/Release/net9.0/protobuf-net.Core.dll differ diff --git a/GameServer/Bin/Release/net9.0/protobuf-net.dll b/GameServer/Bin/Release/net9.0/protobuf-net.dll new file mode 100644 index 00000000..e75237bc Binary files /dev/null and b/GameServer/Bin/Release/net9.0/protobuf-net.dll differ diff --git a/GameServer/Bin/Release/net9.0/新建 文本文档.txt b/GameServer/Bin/Release/net9.0/新建 文本文档.txt new file mode 100644 index 00000000..e69de29b diff --git a/GameServer/Config/Binary/MachineConfigData.bytes b/GameServer/Config/Binary/MachineConfigData.bytes new file mode 100644 index 00000000..d4ebe57e --- /dev/null +++ b/GameServer/Config/Binary/MachineConfigData.bytes @@ -0,0 +1,2 @@ + +# 127.0.0.1 127.0.0.1" 127.0.0.1 \ No newline at end of file diff --git a/GameServer/Config/Binary/ProcessConfigData.bytes b/GameServer/Config/Binary/ProcessConfigData.bytes new file mode 100644 index 00000000..b9c2dfd2 --- /dev/null +++ b/GameServer/Config/Binary/ProcessConfigData.bytes @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/GameServer/Config/Binary/SceneConfigData.bytes b/GameServer/Config/Binary/SceneConfigData.bytes new file mode 100644 index 00000000..7e555d20 --- /dev/null +++ b/GameServer/Config/Binary/SceneConfigData.bytes @@ -0,0 +1,6 @@ + +2" MultiThread*Authentication2KCP8@UH +2" MultiThread*Authentication2KCP8@UH +(" MultiThread*Gate2KCP8@VH +(" MultiThread*Gate2KCP8@VH +(" MultiThread*Chat2TCP8@VH \ No newline at end of file diff --git a/GameServer/Config/Binary/UnitConfigData.bytes b/GameServer/Config/Binary/UnitConfigData.bytes new file mode 100644 index 00000000..041af7b7 --- /dev/null +++ b/GameServer/Config/Binary/UnitConfigData.bytes @@ -0,0 +1,4 @@ + +'Unit01Unit01" +Idle +Run \ No newline at end of file diff --git a/GameServer/Config/Binary/WorldConfigData.bytes b/GameServer/Config/Binary/WorldConfigData.bytes new file mode 100644 index 00000000..62d8946f --- /dev/null +++ b/GameServer/Config/Binary/WorldConfigData.bytes @@ -0,0 +1,2 @@ + +9 测试服mongodb://127.0.0.1" fantasy_main*MongoDB \ No newline at end of file diff --git a/GameServer/Config/Excel/Custom.txt b/GameServer/Config/Excel/Custom.txt new file mode 100644 index 00000000..fd90a9bf --- /dev/null +++ b/GameServer/Config/Excel/Custom.txt @@ -0,0 +1 @@ +// 自定义导出配置文件,用于配置自定义导出自定义程序的路径 diff --git a/GameServer/Config/Excel/Server/MachineConfig.xlsx b/GameServer/Config/Excel/Server/MachineConfig.xlsx new file mode 100644 index 00000000..f2ad337c Binary files /dev/null and b/GameServer/Config/Excel/Server/MachineConfig.xlsx differ diff --git a/GameServer/Config/Excel/Server/ProcessConfig.xlsx b/GameServer/Config/Excel/Server/ProcessConfig.xlsx new file mode 100644 index 00000000..a6d3f7ae Binary files /dev/null and b/GameServer/Config/Excel/Server/ProcessConfig.xlsx differ diff --git a/GameServer/Config/Excel/Server/SceneConfig.xlsx b/GameServer/Config/Excel/Server/SceneConfig.xlsx new file mode 100644 index 00000000..b7f689f7 Binary files /dev/null and b/GameServer/Config/Excel/Server/SceneConfig.xlsx differ diff --git a/GameServer/Config/Excel/Server/WorldConfig.xlsx b/GameServer/Config/Excel/Server/WorldConfig.xlsx new file mode 100644 index 00000000..f060a0bf Binary files /dev/null and b/GameServer/Config/Excel/Server/WorldConfig.xlsx differ diff --git a/GameServer/Config/Excel/UnitConfig.xlsx b/GameServer/Config/Excel/UnitConfig.xlsx new file mode 100644 index 00000000..aaa0bbcf Binary files /dev/null and b/GameServer/Config/Excel/UnitConfig.xlsx differ diff --git a/GameServer/Config/Excel/Version.txt b/GameServer/Config/Excel/Version.txt new file mode 100644 index 00000000..c370f8f3 --- /dev/null +++ b/GameServer/Config/Excel/Version.txt @@ -0,0 +1 @@ +{"WorksheetNames":["UnitConfig","ProcessConfig","MachineConfig","WorldConfig","SceneConfig","SceneTypeConfig"],"Tables":{"UnitConfig":1743089717604,"MachineConfig":1743089717603,"ProcessConfig":1743089717603,"SceneConfig":1743439139119,"WorldConfig":1743089717604}} \ No newline at end of file diff --git a/GameServer/Config/Json/Server/MachineConfigData.Json b/GameServer/Config/Json/Server/MachineConfigData.Json new file mode 100644 index 00000000..f56f98e9 --- /dev/null +++ b/GameServer/Config/Json/Server/MachineConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"OuterIP":"127.0.0.1","OuterBindIP":"127.0.0.1","InnerBindIP":"127.0.0.1"} +]} diff --git a/GameServer/Config/Json/Server/ProcessConfigData.Json b/GameServer/Config/Json/Server/ProcessConfigData.Json new file mode 100644 index 00000000..a05a13c8 --- /dev/null +++ b/GameServer/Config/Json/Server/ProcessConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"MachineId":1,"StartupGroup":0} +]} diff --git a/GameServer/Config/Json/Server/SceneConfigData.Json b/GameServer/Config/Json/Server/SceneConfigData.Json new file mode 100644 index 00000000..6bb866cd --- /dev/null +++ b/GameServer/Config/Json/Server/SceneConfigData.Json @@ -0,0 +1,7 @@ +{"List":[ +{"Id":1001,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Authentication","NetworkProtocol":"KCP","OuterPort":21001,"InnerPort":11001,"SceneType":1}, +{"Id":1002,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Authentication","NetworkProtocol":"KCP","OuterPort":21002,"InnerPort":11002,"SceneType":1}, +{"Id":1010,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":21010,"InnerPort":11010,"SceneType":3}, +{"Id":1011,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":21011,"InnerPort":11011,"SceneType":3}, +{"Id":1026,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Chat","NetworkProtocol":"TCP","OuterPort":21016,"InnerPort":11026,"SceneType":8} +]} diff --git a/GameServer/Config/Json/Server/UnitConfigData.Json b/GameServer/Config/Json/Server/UnitConfigData.Json new file mode 100644 index 00000000..c78ee79d --- /dev/null +++ b/GameServer/Config/Json/Server/UnitConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"Name":"Unit01","Model":"Unit01","Dic":{"Dic":{"1":"Idle","2":"Run"}}} +]} diff --git a/GameServer/Config/Json/Server/WorldConfigData.Json b/GameServer/Config/Json/Server/WorldConfigData.Json new file mode 100644 index 00000000..580dfa92 --- /dev/null +++ b/GameServer/Config/Json/Server/WorldConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"WorldName":"测试服","DbConnection":"mongodb://127.0.0.1","DbName":"fantasy_main","DbType":"MongoDB"} +]} diff --git a/GameServer/Config/NetworkProtocol/Inner/InnerMessage.proto b/GameServer/Config/NetworkProtocol/Inner/InnerMessage.proto new file mode 100644 index 00000000..da9a5f11 --- /dev/null +++ b/GameServer/Config/NetworkProtocol/Inner/InnerMessage.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; +package Sining.Message; + + +//Gate +message G2Chat_LoginRequest // IRouteRequest,Chat2G_LoginResponse +{ + string GameName = 1; + int64 AccountId = 2; + int64 GateRoutedId = 3; +} +message Chat2G_LoginResponse // IRouteResponse +{ + int64 ChatRouteId = 1 ; +} + +message G2Chat_OfflineRequest // IRouteRequest, Chat2G_OfflineResponse +{ + +} +message Chat2G_OfflineResponse // IRouteResponse +{ + +} + + +message Chat2G_BoardMessage // IRouteMessage +{ + string Message = 1; +} + + + + + + +message G2A_TestMessage // IRouteMessage +{ + string Tag = 1; +} +message G2A_TestRequest // IRouteRequest,G2A_TestResponse +{ + +} +message G2A_TestResponse // IRouteResponse +{ + +} +message G2M_RequestAddressableId // IRouteRequest,M2G_ResponseAddressableId +{ + +} +message M2G_ResponseAddressableId // IRouteResponse +{ + int64 AddressableId = 1; // Map服务器返回的AddressableId +} +/// 通知Chat服务器创建一个RouteId +message G2Chat_CreateRouteRequest // IRouteRequest,Chat2G_CreateRouteResponse +{ + int64 GateRouteId = 1; +} +message Chat2G_CreateRouteResponse // IRouteResponse +{ + int64 ChatRouteId = 1; +} +/// Map给另外一个Map发送Unit数据 +// Protocol Bson +message M2M_SendUnitRequest // IRouteRequest,M2M_SendUnitResponse +{ + +} +// Protocol Bson +message M2M_SendUnitResponse // IRouteResponse +{ + +} +/// Gate发送Addressable消息给MAP +message G2M_SendAddressableMessage // IAddressableRouteMessage +{ + string Tag = 1; +} +// Gate通知Map创建一个SubScene +message G2M_CreateSubSceneRequest // IRouteRequest,M2G_CreateSubSceneResponse +{ + +} +message M2G_CreateSubSceneResponse // IRouteResponse +{ + int64 SubSceneRouteId = 1; +} +// Gate给SubScene发送一个消息 +message G2SubScene_SentMessage // IRouteMessage +{ + string Tag = 1; +} +/// Gate通知SubScene创建一个Addressable消息 +message G2SubScene_AddressableIdRequest // IRouteRequest,SubScene2G_AddressableIdResponse +{ + +} +message SubScene2G_AddressableIdResponse // IRouteResponse +{ + int64 AddressableId = 1; // SubScene服务器返回的AddressableId +} \ No newline at end of file diff --git a/GameServer/Config/NetworkProtocol/OpCode.Cache b/GameServer/Config/NetworkProtocol/OpCode.Cache new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/GameServer/Config/NetworkProtocol/OpCode.Cache @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/GameServer/Config/NetworkProtocol/Outer/OuterMessage.proto b/GameServer/Config/NetworkProtocol/Outer/OuterMessage.proto new file mode 100644 index 00000000..335f5e18 --- /dev/null +++ b/GameServer/Config/NetworkProtocol/Outer/OuterMessage.proto @@ -0,0 +1,243 @@ +syntax = "proto3"; +package Fantasy.Network.Message; +// 协议分为: +// ProtoBuf:可以在Outer和Inner文件里使用。 +// MemoryPack:可以在Outer和Inner文件里使用。 +// Bson:仅支持在Inner文件里使用。 +// 使用方式: +// 在message协议上方添加// Protocol+空格+协议名字 +// 例如:// Protocol ProtoBuf 或 // Protocol MemoryPack + + +//Authentication +message C2A_RegisterRequest // IRequest,A2C_RegisterResponse +{ + string Username = 1; + string Password = 2; + string Source = 3; +} +message A2C_RegisterResponse // IResponse +{ + string Tag = 1; +} + +message C2A_LoginRequest // IRequest,A2C_LoginResponse +{ + string Username = 1; + string Password = 2; + string Source = 3; +} + +message A2C_LoginResponse // IResponse +{ + string Token = 1; +} + + +//Gate +message C2G_LoginRequest // IRequest,G2C_LoginResponse +{ + string Token = 1; +} + +message G2C_LoginResponse //IResponse +{ + string Tag = 1; + GameAccountInfo GameAccount = 2; +} + + + +message G2C_LoginRepeatedMessage //IMessage +{ + +} + +message C2G_GetGameAccountInfo //IRequest , G2C_GetGameAccountInfo +{ + int64 AccountId = 1; +} + +message G2C_GetGameAccountInfo //IResponse +{ + GameAccountInfo AccountInfo = 1 ; +} +message GameAccountInfo +{ + int64 CreateTime = 1; + int64 LoginTime = 2 ; + string GameName = 3 ; +} + +message G2C_OpenGameNameInputWindowsMessage //IMessage +{ + string Tag = 1 ; +} + + +message C2G_UpdateAndSaveGameNameRequest //IRequest,G2C_UpdateAndSaveGameNameResponse +{ + int64 AccountId = 1 ; + string GameName = 2 ; +} + +message G2C_UpdateAndSaveGameNameResponse //IResponse +{ + string Tag = 1; +} + +//chat + +message C2Chat_BoardMessageRequest //ICustomRouteRequest,Chat2C_BoardMessageResponse,ChatRoute +{ + string Message = 1; +} +message Chat2C_BoardMessageResponse //ICustomRouteResponse +{ + //string Message = 2; +} + +message Chat2C_BoardMessage // ICustomRouteMessage,ChatRoute +{ + string Message = 1; +} + + + +message C2Chat_TestRequest // ICustomRouteRequest,Chat2C_TestResponse,ChatRoute +{ + +} + +message Chat2C_TestResponse // ICustomRouteResponse +{ + +} + + + + + + + + + + +message C2G_TestMessage // IMessage +{ + string Tag = 1; +} +message C2G_TestRequest // IRequest,G2C_TestResponse +{ + string Tag = 1; +} +message G2C_TestResponse // IResponse +{ + string Tag = 1; +} +message C2G_TestRequestPushMessage // IMessage +{ + +} + + +/// Gate服务器推送一个消息给客户端 +message G2C_PushMessage // IMessage +{ + string Tag = 1; +} +message C2G_CreateAddressableRequest // IRequest,G2C_CreateAddressableResponse +{ + +} +message G2C_CreateAddressableResponse // IResponse +{ + +} +message C2M_TestMessage // IAddressableRouteMessage +{ + string Tag = 1; +} +message C2M_TestRequest // IAddressableRouteRequest,M2C_TestResponse +{ + string Tag = 1; +} +message M2C_TestResponse // IAddressableRouteResponse +{ + string Tag = 1; +} +/// 通知Gate服务器创建一个Chat的Route连接 +message C2G_CreateChatRouteRequest // IRequest,G2C_CreateChatRouteResponse +{ + +} +message G2C_CreateChatRouteResponse // IResponse +{ + +} +/// 发送一个Route消息给Chat +message C2Chat_TestMessage // ICustomRouteMessage,ChatRoute +{ + string Tag = 1; +} +/// 发送一个RPCRoute消息给Chat +message C2Chat_TestMessageRequest // ICustomRouteRequest,Chat2C_TestMessageResponse,ChatRoute +{ + string Tag = 1; +} +message Chat2C_TestMessageResponse // ICustomRouteResponse +{ + string Tag = 1; +} +/// 发送一个RPC消息给Map,让Map里的Entity转移到另外一个Map上 +message C2M_MoveToMapRequest // IAddressableRouteRequest,M2C_MoveToMapResponse +{ + +} +message M2C_MoveToMapResponse // IAddressableRouteResponse +{ + +} +/// 发送一个消息给Gate,让Gate发送一个Addressable消息给MAP +message C2G_SendAddressableToMap // IMessage +{ + string Tag = 1; +} +/// 发送一个消息给Chat,让Chat服务器主动推送一个RouteMessage消息给客户端 +message C2Chat_TestRequestPushMessage // ICustomRouteMessage,ChatRoute +{ + +} +/// Chat服务器主动推送一个消息给客户端 +message Chat2C_PushMessage // ICustomRouteMessage,ChatRoute +{ + string Tag = 1; +} +/// 客户端发送给Gate服务器通知map服务器创建一个SubScene +message C2G_CreateSubSceneRequest // IRequest,G2C_CreateSubSceneResponse +{ + +} +message G2C_CreateSubSceneResponse // IResponse +{ + +} +/// 客户端通知Gate服务器给SubScene发送一个消息 +message C2G_SendToSubSceneMessage // IMessage +{ + +} +/// 客户端通知Gate服务器创建一个SubScene的Address消息 +message C2G_CreateSubSceneAddressableRequest // IRequest,G2C_CreateSubSceneAddressableResponse +{ + +} +message G2C_CreateSubSceneAddressableResponse // IResponse +{ + +} +/// 客户端向SubScene发送一个测试消息 +message C2SubScene_TestMessage // IAddressableRouteMessage +{ + string Tag = 1; +} \ No newline at end of file diff --git a/GameServer/Config/NetworkProtocol/RouteType.Config b/GameServer/Config/NetworkProtocol/RouteType.Config new file mode 100644 index 00000000..66082cf9 --- /dev/null +++ b/GameServer/Config/NetworkProtocol/RouteType.Config @@ -0,0 +1,3 @@ +// Route协议定义(需要定义1000以上、因为1000以内的框架预留) +GateRoute = 1001 // Gate +ChatRoute = 1002 // Chat \ No newline at end of file diff --git a/GameServer/Console/Fantasy.Console.Entity/Entry.cs b/GameServer/Console/Fantasy.Console.Entity/Entry.cs new file mode 100644 index 00000000..7e64a7b0 --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Entity/Entry.cs @@ -0,0 +1,72 @@ +using Fantasy.Async; +using Fantasy.Network; + +namespace Fantasy.Console.Entity; + +public static class Entry +{ + private static Scene _scene; + private static Session _session; + public static async FTask Show() + { + _scene = await Fantasy.Scene.Create(SceneRuntimeType.MainThread); + _session = _scene.Connect( + "127.0.0.1:20000", + NetworkProtocolType.KCP, + OnConnectComplete, + OnConnectFail, + OnConnectDisconnect, + false, 5000); + } + + private static void OnConnectComplete() + { + Log.Debug("连接成功"); + // Session.AddComponent(); + // 添加心跳组件给Session。 + // Start(2000)就是2000毫秒。 + _session.AddComponent().Start(2000); + + // _session.Send(new C2G_TestMessage() + // { + // Tag = "111111111111" + // }); + TestSend1000().Coroutine(); + } + + private static int Index; + private static async FTask TestSend1000() + { + Log.Debug($"Call 1{Thread.CurrentThread.ManagedThreadId}"); + + await _session.Call(new C2G_TestRequest() + { + Tag = "111" + }); + + Log.Debug($"Call 2{Thread.CurrentThread.ManagedThreadId}"); + + // _session.Dispose(); + + // for (int i = 0; i < 1000; i++) + // { + // _session.Send(new C2G_TestMessage() + // { + // Tag = $"{++Index}" + // }); + // // } + // await _session.Scene.TimerComponent.Net.WaitAsync(3000); + // _session.Dispose(); + await FTask.CompletedTask; + } + + private static void OnConnectFail() + { + Log.Debug("连接失败"); + } + + private static void OnConnectDisconnect() + { + Log.Debug("连接断开"); + } +} \ No newline at end of file diff --git a/GameServer/Console/Fantasy.Console.Entity/Fantasy.Console.Entity.csproj b/GameServer/Console/Fantasy.Console.Entity/Fantasy.Console.Entity.csproj new file mode 100644 index 00000000..84df74ca --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Entity/Fantasy.Console.Entity.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterMessage.cs b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterMessage.cs new file mode 100644 index 00000000..00f98e51 --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterMessage.cs @@ -0,0 +1,271 @@ +using ProtoBuf; + +using System.Collections.Generic; +using Fantasy; +using Fantasy.Network.Interface; +using Fantasy.Serialize; +#pragma warning disable CS8618 + +namespace Fantasy +{ + [ProtoContract] + public partial class C2G_TestMessage : AMessage, IMessage, IProto + { + public static C2G_TestMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2G_TestMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class C2G_TestRequest : AMessage, IRequest, IProto + { + public static C2G_TestRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_TestResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_TestRequest; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class G2C_TestResponse : AMessage, IResponse, IProto + { + public static G2C_TestResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_TestResponse; } + [ProtoMember(1)] + public string Tag { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class C2G_CreateAddressableRequest : AMessage, IRequest, IProto + { + public static C2G_CreateAddressableRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_CreateAddressableResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_CreateAddressableRequest; } + } + [ProtoContract] + public partial class G2C_CreateAddressableResponse : AMessage, IResponse, IProto + { + public static G2C_CreateAddressableResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_CreateAddressableResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class C2M_TestMessage : AMessage, IAddressableRouteMessage, IProto + { + public static C2M_TestMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2M_TestMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class C2M_TestRequest : AMessage, IAddressableRouteRequest, IProto + { + public static C2M_TestRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public M2C_TestResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2M_TestRequest; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class M2C_TestResponse : AMessage, IAddressableRouteResponse, IProto + { + public static M2C_TestResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.M2C_TestResponse; } + [ProtoMember(1)] + public string Tag { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + /// + /// 通知Gate服务器创建一个Chat的Route连接 + /// + [ProtoContract] + public partial class C2G_CreateChatRouteRequest : AMessage, IRequest, IProto + { + public static C2G_CreateChatRouteRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_CreateChatRouteResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_CreateChatRouteRequest; } + } + [ProtoContract] + public partial class G2C_CreateChatRouteResponse : AMessage, IResponse, IProto + { + public static G2C_CreateChatRouteResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_CreateChatRouteResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 发送一个Route消息给Chat + /// + [ProtoContract] + public partial class C2Chat_TestMessage : AMessage, ICustomRouteMessage, IProto + { + public static C2Chat_TestMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2Chat_TestMessage; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.ChatRoute; + [ProtoMember(1)] + public string Tag { get; set; } + } + /// + /// 发送一个RPCRoute消息给Chat + /// + [ProtoContract] + public partial class C2Chat_TestMessageRequest : AMessage, ICustomRouteRequest, IProto + { + public static C2Chat_TestMessageRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public Chat2C_TestMessageResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2Chat_TestMessageRequest; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.ChatRoute; + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class Chat2C_TestMessageResponse : AMessage, ICustomRouteResponse, IProto + { + public static Chat2C_TestMessageResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.Chat2C_TestMessageResponse; } + [ProtoMember(1)] + public string Tag { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } +} diff --git a/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterMessage.cs.meta b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterMessage.cs.meta new file mode 100644 index 00000000..37858101 --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 847fa983533504fa582ae1d626226805 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterOpcode.cs b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterOpcode.cs new file mode 100644 index 00000000..084e1b64 --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterOpcode.cs @@ -0,0 +1,19 @@ +namespace Fantasy +{ + public static partial class OuterOpcode + { + public const uint C2G_TestMessage = 134227729; + public const uint C2G_TestRequest = 268445457; + public const uint G2C_TestResponse = 402663185; + public const uint C2G_CreateAddressableRequest = 268445458; + public const uint G2C_CreateAddressableResponse = 402663186; + public const uint C2M_TestMessage = 1342187281; + public const uint C2M_TestRequest = 1476405009; + public const uint M2C_TestResponse = 1610622737; + public const uint C2G_CreateChatRouteRequest = 268445459; + public const uint G2C_CreateChatRouteResponse = 402663187; + public const uint C2Chat_TestMessage = 2147493649; + public const uint C2Chat_TestMessageRequest = 2281711377; + public const uint Chat2C_TestMessageResponse = 2415929105; + } +} diff --git a/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterOpcode.cs.meta b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterOpcode.cs.meta new file mode 100644 index 00000000..5ffd713b --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/OuterOpcode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70749fc21de3a4fe69e5ad35d22d31f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/RouteType.cs b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/RouteType.cs new file mode 100644 index 00000000..cdd0df00 --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/RouteType.cs @@ -0,0 +1,9 @@ +namespace Fantasy +{ + // Route协议定义(需要定义1000以上、因为1000以内的框架预留) + public static class RouteType + { + public const int GateRoute = 1001; // Gate + public const int ChatRoute = 1002; // Chat + } +} diff --git a/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/RouteType.cs.meta b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/RouteType.cs.meta new file mode 100644 index 00000000..de101869 --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Entity/NetworkProtocol/RouteType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20284fcf76b71405fb83dfc6f73048dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GameServer/Console/Fantasy.Console.Main/ConsoleLog.cs b/GameServer/Console/Fantasy.Console.Main/ConsoleLog.cs new file mode 100644 index 00000000..4fa540fb --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Main/ConsoleLog.cs @@ -0,0 +1,138 @@ + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +namespace Fantasy +{ + /// + /// 标准的控制台Log + /// + public sealed class ConsoleLog : ILog + { + + /// + /// 记录跟踪级别的日志消息。 + /// + /// 日志消息。 + public void Trace(string message) + { + System.Console.ForegroundColor = ConsoleColor.White; + System.Console.WriteLine(message); + } + + /// + /// 记录警告级别的日志消息。 + /// + /// 日志消息。 + public void Warning(string message) + { + System.Console.ForegroundColor = ConsoleColor.Yellow; + System.Console.WriteLine(message); + } + + /// + /// 记录信息级别的日志消息。 + /// + /// 日志消息。 + public void Info(string message) + { + System.Console.ForegroundColor = ConsoleColor.Gray; + System.Console.WriteLine(message); + } + + /// + /// 记录调试级别的日志消息。 + /// + /// 日志消息。 + public void Debug(string message) + { + System.Console.ForegroundColor = ConsoleColor.DarkGreen; + System.Console.WriteLine(message); + } + + /// + /// 记录错误级别的日志消息。 + /// + /// 日志消息。 + public void Error(string message) + { + System.Console.ForegroundColor = ConsoleColor.DarkRed; + System.Console.WriteLine(message); + } + + /// + /// 记录严重错误级别的日志消息。 + /// + /// 日志消息。 + public void Fatal(string message) + { + System.Console.ForegroundColor = ConsoleColor.Red; + System.Console.WriteLine(message); + } + + /// + /// 记录跟踪级别的格式化日志消息。 + /// + /// 日志消息模板。 + /// 格式化参数。 + public void Trace(string message, params object[] args) + { + System.Console.ForegroundColor = ConsoleColor.White; + System.Console.WriteLine(message, args); + } + + /// + /// 记录警告级别的格式化日志消息。 + /// + /// 日志消息模板。 + /// 格式化参数。 + public void Warning(string message, params object[] args) + { + System.Console.ForegroundColor = ConsoleColor.Yellow; + System.Console.WriteLine(message, args); + } + + /// + /// 记录信息级别的格式化日志消息。 + /// + /// 日志消息模板。 + /// 格式化参数。 + public void Info(string message, params object[] args) + { + System.Console.ForegroundColor = ConsoleColor.Gray; + System.Console.WriteLine(message, args); + } + + /// + /// 记录调试级别的格式化日志消息。 + /// + /// 日志消息模板。 + /// 格式化参数。 + public void Debug(string message, params object[] args) + { + System.Console.ForegroundColor = ConsoleColor.DarkGreen; + System.Console.WriteLine(message, args); + } + + /// + /// 记录错误级别的格式化日志消息。 + /// + /// 日志消息模板。 + /// 格式化参数。 + public void Error(string message, params object[] args) + { + System.Console.ForegroundColor = ConsoleColor.DarkRed; + System.Console.WriteLine(message, args); + } + + /// + /// 记录严重错误级别的格式化日志消息。 + /// + /// 日志消息模板。 + /// 格式化参数。 + public void Fatal(string message, params object[] args) + { + System.Console.ForegroundColor = ConsoleColor.Red; + System.Console.WriteLine(message, args); + } + } +} \ No newline at end of file diff --git a/GameServer/Console/Fantasy.Console.Main/Fantasy.Console.Main.csproj b/GameServer/Console/Fantasy.Console.Main/Fantasy.Console.Main.csproj new file mode 100644 index 00000000..c17a2faa --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Main/Fantasy.Console.Main.csproj @@ -0,0 +1,14 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + diff --git a/GameServer/Console/Fantasy.Console.Main/Program.cs b/GameServer/Console/Fantasy.Console.Main/Program.cs new file mode 100644 index 00000000..d92ae4f3 --- /dev/null +++ b/GameServer/Console/Fantasy.Console.Main/Program.cs @@ -0,0 +1,10 @@ +using Fantasy; +using Fantasy.Console.Entity; + +SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); +Fantasy.Log.Register(new ConsoleLog()); +Fantasy.Platform.Console.Entry.Initialize(typeof(Fantasy.Console.Entity.Entry).Assembly); +Fantasy.Platform.Console.Entry.StartUpdate(); +Log.Debug($"{Thread.CurrentThread.ManagedThreadId} SynchronizationContext.Current:{SynchronizationContext.Current}"); +Entry.Show().Coroutine(); +Console.ReadKey(); \ No newline at end of file diff --git a/GameServer/Console/Fantasy.Console.sln b/GameServer/Console/Fantasy.Console.sln new file mode 100644 index 00000000..847049bc --- /dev/null +++ b/GameServer/Console/Fantasy.Console.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fantasy.Console.Main", "Fantasy.Console.Main\Fantasy.Console.Main.csproj", "{2FADD1FD-805B-4234-A70D-0C9085EEEF77}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fantasy.Console.Entity", "Fantasy.Console.Entity\Fantasy.Console.Entity.csproj", "{F1FE5BEA-DA59-4B49-863E-3344F43357A7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fantasy.Console", "..\..\Fantays.Console\Fantasy.Console.csproj", "{0D88EEBF-7249-4E7A-89F0-C376012A9297}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2FADD1FD-805B-4234-A70D-0C9085EEEF77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FADD1FD-805B-4234-A70D-0C9085EEEF77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FADD1FD-805B-4234-A70D-0C9085EEEF77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FADD1FD-805B-4234-A70D-0C9085EEEF77}.Release|Any CPU.Build.0 = Release|Any CPU + {F1FE5BEA-DA59-4B49-863E-3344F43357A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1FE5BEA-DA59-4B49-863E-3344F43357A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1FE5BEA-DA59-4B49-863E-3344F43357A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1FE5BEA-DA59-4B49-863E-3344F43357A7}.Release|Any CPU.Build.0 = Release|Any CPU + {0D88EEBF-7249-4E7A-89F0-C376012A9297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0D88EEBF-7249-4E7A-89F0-C376012A9297}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D88EEBF-7249-4E7A-89F0-C376012A9297}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0D88EEBF-7249-4E7A-89F0-C376012A9297}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/GameServer/Console/Fantasy.Console.sln.DotSettings.user b/GameServer/Console/Fantasy.Console.sln.DotSettings.user new file mode 100644 index 00000000..3a437ed4 --- /dev/null +++ b/GameServer/Console/Fantasy.Console.sln.DotSettings.user @@ -0,0 +1,3 @@ + + ForceIncluded + ForceIncluded \ No newline at end of file diff --git a/GameServer/Main/Main.csproj b/GameServer/Main/Main.csproj new file mode 100644 index 00000000..85b49591 --- /dev/null +++ b/GameServer/Main/Main.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/GameServer/Main/Program.cs b/GameServer/Main/Program.cs new file mode 100644 index 00000000..e5dff12b --- /dev/null +++ b/GameServer/Main/Program.cs @@ -0,0 +1,3 @@ +// See https://aka.ms/new-console-template for more information + +Console.WriteLine("Hello, World!"); \ No newline at end of file diff --git a/GameServer/Main/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Main/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Main/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Main/obj/Debug/net9.0/Main.AssemblyInfo.cs b/GameServer/Main/obj/Debug/net9.0/Main.AssemblyInfo.cs new file mode 100644 index 00000000..49fd7ea6 --- /dev/null +++ b/GameServer/Main/obj/Debug/net9.0/Main.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Main")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c77ba7871ef90e86cce47a22e875f550d637f257")] +[assembly: System.Reflection.AssemblyProductAttribute("Main")] +[assembly: System.Reflection.AssemblyTitleAttribute("Main")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Main/obj/Debug/net9.0/Main.AssemblyInfoInputs.cache b/GameServer/Main/obj/Debug/net9.0/Main.AssemblyInfoInputs.cache new file mode 100644 index 00000000..676137d3 --- /dev/null +++ b/GameServer/Main/obj/Debug/net9.0/Main.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +2f768a2aa1e0aaf52c119eb7a7d0345bb3efceeb3a848e62515fbdfd5f40e0f7 diff --git a/GameServer/Main/obj/Debug/net9.0/Main.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Main/obj/Debug/net9.0/Main.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..13602f90 --- /dev/null +++ b/GameServer/Main/obj/Debug/net9.0/Main.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Main +build_property.ProjectDir = E:\UnityProject\TE_AR\GameServer\Main\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Main/obj/Debug/net9.0/Main.GlobalUsings.g.cs b/GameServer/Main/obj/Debug/net9.0/Main.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Main/obj/Debug/net9.0/Main.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Main/obj/Debug/net9.0/Main.assets.cache b/GameServer/Main/obj/Debug/net9.0/Main.assets.cache new file mode 100644 index 00000000..8dd81abf Binary files /dev/null and b/GameServer/Main/obj/Debug/net9.0/Main.assets.cache differ diff --git a/GameServer/Main/obj/Main.csproj.nuget.dgspec.json b/GameServer/Main/obj/Main.csproj.nuget.dgspec.json new file mode 100644 index 00000000..067b1749 --- /dev/null +++ b/GameServer/Main/obj/Main.csproj.nuget.dgspec.json @@ -0,0 +1,68 @@ +{ + "format": 1, + "restore": { + "E:\\UnityProject\\TE_AR\\GameServer\\Main\\Main.csproj": {} + }, + "projects": { + "E:\\UnityProject\\TE_AR\\GameServer\\Main\\Main.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "E:\\UnityProject\\TE_AR\\GameServer\\Main\\Main.csproj", + "projectName": "Main", + "projectPath": "E:\\UnityProject\\TE_AR\\GameServer\\Main\\Main.csproj", + "packagesPath": "C:\\Users\\Administrator\\.nuget\\packages\\", + "outputPath": "E:\\UnityProject\\TE_AR\\GameServer\\Main\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Administrator\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.102/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/GameServer/Main/obj/Main.csproj.nuget.g.props b/GameServer/Main/obj/Main.csproj.nuget.g.props new file mode 100644 index 00000000..437c4e98 --- /dev/null +++ b/GameServer/Main/obj/Main.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\Administrator\.nuget\packages\ + PackageReference + 6.10.1 + + + + + \ No newline at end of file diff --git a/GameServer/Main/obj/Main.csproj.nuget.g.targets b/GameServer/Main/obj/Main.csproj.nuget.g.targets new file mode 100644 index 00000000..3dc06ef3 --- /dev/null +++ b/GameServer/Main/obj/Main.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/GameServer/Main/obj/project.assets.json b/GameServer/Main/obj/project.assets.json new file mode 100644 index 00000000..3c833f07 --- /dev/null +++ b/GameServer/Main/obj/project.assets.json @@ -0,0 +1,73 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "C:\\Users\\Administrator\\.nuget\\packages\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "E:\\UnityProject\\TE_AR\\GameServer\\Main\\Main.csproj", + "projectName": "Main", + "projectPath": "E:\\UnityProject\\TE_AR\\GameServer\\Main\\Main.csproj", + "packagesPath": "C:\\Users\\Administrator\\.nuget\\packages\\", + "outputPath": "E:\\UnityProject\\TE_AR\\GameServer\\Main\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Administrator\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.102/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/GameServer/Main/obj/project.nuget.cache b/GameServer/Main/obj/project.nuget.cache new file mode 100644 index 00000000..cafe797f --- /dev/null +++ b/GameServer/Main/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "VV8VmuEt8WI=", + "success": true, + "projectFilePath": "E:\\UnityProject\\TE_AR\\GameServer\\Main\\Main.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file diff --git a/GameServer/Main/obj/project.packagespec.json b/GameServer/Main/obj/project.packagespec.json new file mode 100644 index 00000000..4f093cd8 --- /dev/null +++ b/GameServer/Main/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"E:\\UnityProject\\TE_AR\\GameServer\\Main\\Main.csproj","projectName":"Main","projectPath":"E:\\UnityProject\\TE_AR\\GameServer\\Main\\Main.csproj","outputPath":"E:\\UnityProject\\TE_AR\\GameServer\\Main\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net9.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"targetAlias":"net9.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"}}"frameworks":{"net9.0":{"targetAlias":"net9.0","imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\9.0.102/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/GameServer/Main/obj/rider.project.model.nuget.info b/GameServer/Main/obj/rider.project.model.nuget.info new file mode 100644 index 00000000..04d6a174 --- /dev/null +++ b/GameServer/Main/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17370234533638474 \ No newline at end of file diff --git a/GameServer/Main/obj/rider.project.restore.info b/GameServer/Main/obj/rider.project.restore.info new file mode 100644 index 00000000..04d6a174 --- /dev/null +++ b/GameServer/Main/obj/rider.project.restore.info @@ -0,0 +1 @@ +17370234533638474 \ No newline at end of file diff --git a/GameServer/Server/.idea/.idea.GameServer/.idea/.gitignore b/GameServer/Server/.idea/.idea.GameServer/.idea/.gitignore new file mode 100644 index 00000000..ca4ab353 --- /dev/null +++ b/GameServer/Server/.idea/.idea.GameServer/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/.idea.GameServer.iml +/modules.xml +/projectSettingsUpdater.xml +/contentModel.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/GameServer/Server/.idea/.idea.GameServer/.idea/.name b/GameServer/Server/.idea/.idea.GameServer/.idea/.name new file mode 100644 index 00000000..6a4412f1 --- /dev/null +++ b/GameServer/Server/.idea/.idea.GameServer/.idea/.name @@ -0,0 +1 @@ +GameServer \ No newline at end of file diff --git a/GameServer/Server/.idea/.idea.GameServer/.idea/CopilotChatHistory.xml b/GameServer/Server/.idea/.idea.GameServer/.idea/CopilotChatHistory.xml new file mode 100644 index 00000000..62b74a49 --- /dev/null +++ b/GameServer/Server/.idea/.idea.GameServer/.idea/CopilotChatHistory.xml @@ -0,0 +1,45 @@ + + + + + + \ No newline at end of file diff --git a/GameServer/Server/.idea/.idea.GameServer/.idea/deployment.xml b/GameServer/Server/.idea/.idea.GameServer/.idea/deployment.xml new file mode 100644 index 00000000..9631dcc8 --- /dev/null +++ b/GameServer/Server/.idea/.idea.GameServer/.idea/deployment.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/.idea/.idea.GameServer/.idea/encodings.xml b/GameServer/Server/.idea/.idea.GameServer/.idea/encodings.xml new file mode 100644 index 00000000..df87cf95 --- /dev/null +++ b/GameServer/Server/.idea/.idea.GameServer/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/GameServer/Server/.idea/.idea.GameServer/.idea/indexLayout.xml b/GameServer/Server/.idea/.idea.GameServer/.idea/indexLayout.xml new file mode 100644 index 00000000..add94f43 --- /dev/null +++ b/GameServer/Server/.idea/.idea.GameServer/.idea/indexLayout.xml @@ -0,0 +1,11 @@ + + + + + ../Config + ../Config/NetworkProtocol + + + + + \ No newline at end of file diff --git a/GameServer/Server/.idea/.idea.GameServer/.idea/sshConfigs.xml b/GameServer/Server/.idea/.idea.GameServer/.idea/sshConfigs.xml new file mode 100644 index 00000000..50ff0fbe --- /dev/null +++ b/GameServer/Server/.idea/.idea.GameServer/.idea/sshConfigs.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/.idea/.idea.GameServer/.idea/vcs.xml b/GameServer/Server/.idea/.idea.GameServer/.idea/vcs.xml new file mode 100644 index 00000000..b2bdec2d --- /dev/null +++ b/GameServer/Server/.idea/.idea.GameServer/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/GameServer/Server/.idea/.idea.GameServer/.idea/webServers.xml b/GameServer/Server/.idea/.idea.GameServer/.idea/webServers.xml new file mode 100644 index 00000000..d3166184 --- /dev/null +++ b/GameServer/Server/.idea/.idea.GameServer/.idea/webServers.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/GameServer/Server/.vs/GameServer/DesignTimeBuild/.dtbcache.v2 b/GameServer/Server/.vs/GameServer/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 00000000..59185afe Binary files /dev/null and b/GameServer/Server/.vs/GameServer/DesignTimeBuild/.dtbcache.v2 differ diff --git a/GameServer/Server/.vs/GameServer/FileContentIndex/02337ab6-ac65-4c33-aba9-0a893e08a6fd.vsidx b/GameServer/Server/.vs/GameServer/FileContentIndex/02337ab6-ac65-4c33-aba9-0a893e08a6fd.vsidx new file mode 100644 index 00000000..70aef67a Binary files /dev/null and b/GameServer/Server/.vs/GameServer/FileContentIndex/02337ab6-ac65-4c33-aba9-0a893e08a6fd.vsidx differ diff --git a/GameServer/Server/.vs/GameServer/FileContentIndex/e7946b6b-af37-4064-bfde-5bf32f813bd6.vsidx b/GameServer/Server/.vs/GameServer/FileContentIndex/e7946b6b-af37-4064-bfde-5bf32f813bd6.vsidx new file mode 100644 index 00000000..cc1462dd Binary files /dev/null and b/GameServer/Server/.vs/GameServer/FileContentIndex/e7946b6b-af37-4064-bfde-5bf32f813bd6.vsidx differ diff --git a/GameServer/Server/.vs/GameServer/FileContentIndex/f09d1882-9418-4756-a216-6f48af18b13e.vsidx b/GameServer/Server/.vs/GameServer/FileContentIndex/f09d1882-9418-4756-a216-6f48af18b13e.vsidx new file mode 100644 index 00000000..578f6c15 Binary files /dev/null and b/GameServer/Server/.vs/GameServer/FileContentIndex/f09d1882-9418-4756-a216-6f48af18b13e.vsidx differ diff --git a/GameServer/Server/.vs/GameServer/v17/.futdcache.v2 b/GameServer/Server/.vs/GameServer/v17/.futdcache.v2 new file mode 100644 index 00000000..08f38ef0 Binary files /dev/null and b/GameServer/Server/.vs/GameServer/v17/.futdcache.v2 differ diff --git a/GameServer/Server/.vs/GameServer/v17/.suo b/GameServer/Server/.vs/GameServer/v17/.suo new file mode 100644 index 00000000..fbcb939a Binary files /dev/null and b/GameServer/Server/.vs/GameServer/v17/.suo differ diff --git a/GameServer/Server/.vs/GameServer/v17/DocumentLayout.backup.json b/GameServer/Server/.vs/GameServer/v17/DocumentLayout.backup.json new file mode 100644 index 00000000..ac08b728 --- /dev/null +++ b/GameServer/Server/.vs/GameServer/v17/DocumentLayout.backup.json @@ -0,0 +1,31 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\TE_UnityProject\\ARSelf\\EintooAR\\GameServer\\Server\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": -1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{269a02dc-6af8-11d3-bdc4-00c04f688e50}" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/GameServer/Server/.vs/GameServer/v17/DocumentLayout.json b/GameServer/Server/.vs/GameServer/v17/DocumentLayout.json new file mode 100644 index 00000000..ac08b728 --- /dev/null +++ b/GameServer/Server/.vs/GameServer/v17/DocumentLayout.json @@ -0,0 +1,31 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\TE_UnityProject\\ARSelf\\EintooAR\\GameServer\\Server\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": -1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{269a02dc-6af8-11d3-bdc4-00c04f688e50}" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/GameServer/Server/.vs/ProjectEvaluation/gameserver.metadata.v9.bin b/GameServer/Server/.vs/ProjectEvaluation/gameserver.metadata.v9.bin new file mode 100644 index 00000000..c5a920bd Binary files /dev/null and b/GameServer/Server/.vs/ProjectEvaluation/gameserver.metadata.v9.bin differ diff --git a/GameServer/Server/.vs/ProjectEvaluation/gameserver.projects.v9.bin b/GameServer/Server/.vs/ProjectEvaluation/gameserver.projects.v9.bin new file mode 100644 index 00000000..488af0b1 Binary files /dev/null and b/GameServer/Server/.vs/ProjectEvaluation/gameserver.projects.v9.bin differ diff --git a/GameServer/Server/.vs/ProjectEvaluation/gameserver.strings.v9.bin b/GameServer/Server/.vs/ProjectEvaluation/gameserver.strings.v9.bin new file mode 100644 index 00000000..3ba3221f Binary files /dev/null and b/GameServer/Server/.vs/ProjectEvaluation/gameserver.strings.v9.bin differ diff --git a/GameServer/Server/APlugins/APlugins.csproj b/GameServer/Server/APlugins/APlugins.csproj new file mode 100644 index 00000000..e4cabbea --- /dev/null +++ b/GameServer/Server/APlugins/APlugins.csproj @@ -0,0 +1,18 @@ + + + + net9.0 + enable + enable + Plugins + + + + + + + + + + + diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/CommandLine.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/CommandLine.dll new file mode 100644 index 00000000..3eab2be2 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/CommandLine.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/EPPlus.Interfaces.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/EPPlus.Interfaces.dll new file mode 100644 index 00000000..599a7671 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/EPPlus.Interfaces.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/EPPlus.System.Drawing.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/EPPlus.System.Drawing.dll new file mode 100644 index 00000000..8df125ea Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/EPPlus.System.Drawing.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/EPPlus.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/EPPlus.dll new file mode 100644 index 00000000..b09ea77b Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/EPPlus.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Custom.txt b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Custom.txt new file mode 100644 index 00000000..fd90a9bf --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Custom.txt @@ -0,0 +1 @@ +// 自定义导出配置文件,用于配置自定义导出自定义程序的路径 diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx new file mode 100644 index 00000000..999e9390 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx new file mode 100644 index 00000000..001235a8 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx new file mode 100644 index 00000000..a4ca05e3 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx new file mode 100644 index 00000000..8194c9a5 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Version.txt b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Version.txt new file mode 100644 index 00000000..1877ad88 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Excel/Version.txt @@ -0,0 +1 @@ +{"WorksheetNames":["MachineConfig","ProcessConfig","WorldConfig","SceneConfig","SceneTypeConfig"],"Tables":{"MachineConfig":1725984682557,"SceneConfig":1726083372000,"WorldConfig":1724007858627,"ProcessConfig":1725195494442}} \ No newline at end of file diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/ExporterSettings.json b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/ExporterSettings.json new file mode 100644 index 00000000..7499bd6d --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/ExporterSettings.json @@ -0,0 +1,44 @@ +{ + "Export": { + "ExcelProgramPath": { + "Value": "../../../Examples/Config/Excel/", + "Comment": "Excel文件夹的根目录" + }, + "ExcelVersionFile": { + "Value": "../../../Examples/Config/Excel/Version.txt", + "Comment": "Excel的Version文件位置、这个文件用于记录每次导出对比是否需要再次导出的文件" + }, + "ExcelServerFileDirectory": { + "Value": "../../../Examples/Server/Entity/Generate/ConfigTable/Entity/", + "Comment": "Excel生成的代码文件、在服务端文件夹位置" + }, + "ExcelClientFileDirectory": { + "Value": "../../../Examples/Client/Unity/Assets/Scripts/Hotfix/Generate/ConfigTable/Entity/", + "Comment": "Excel生成的代码文件、在客户端文件夹位置" + }, + "ExcelServerBinaryDirectory": { + "Value": "../../../Examples/Config/Binary/", + "Comment": "Excel生成服务器二进制数据文件夹位置" + }, + "ExcelClientBinaryDirectory": { + "Value": "../../../Examples/Client/Unity/Assets/Bundles/Config/", + "Comment": "Excel生成在客户端的二进制数据文件夹位置" + }, + "ExcelServerJsonDirectory": { + "Value": "../../../Examples/Config/Json/Server/", + "Comment": "Excel生成在服务端的Json数据文件夹位置" + }, + "ExcelClientJsonDirectory": { + "Value": "../../../Examples/Config/Json/Client/", + "Comment": "Excel生成在客户端的Json数据文件夹位置" + }, + "ServerCustomExportDirectory": { + "Value": "../../../Examples/Server/Entity/Generate/CustomExport/", + "Comment": "Excel在服务端生成自定义代码的文件夹位置" + }, + "ClientCustomExportDirectory": { + "Value": "../../../Examples/Client/Unity/Assets/Scripts/Hotfix/Generate/CustomExport", + "Comment": "Excel在客户端端生成自定义代码的文件夹位置" + } + } +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable new file mode 100644 index 00000000..434496ef Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.deps.json b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.deps.json new file mode 100644 index 00000000..b2488491 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.deps.json @@ -0,0 +1,521 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Fantasy.Tools.ConfigTable/1.0.0": { + "dependencies": { + "CommandLineParser": "2.9.1", + "EPPlus": "7.3.2", + "Microsoft.CodeAnalysis.CSharp": "4.11.0", + "Microsoft.Extensions.Configuration.Json": "8.0.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.30" + }, + "runtime": { + "Fantasy.Tools.ConfigTable.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "EPPlus/7.3.2": { + "dependencies": { + "EPPlus.System.Drawing": "6.1.1", + "Microsoft.Extensions.Configuration.Json": "8.0.0", + "Microsoft.IO.RecyclableMemoryStream": "3.0.1", + "System.ComponentModel.Annotations": "5.0.0", + "System.Formats.Asn1": "8.0.1", + "System.Security.Cryptography.Pkcs": "8.0.0", + "System.Text.Encoding.CodePages": "8.0.0", + "System.Text.Json": "8.0.4" + }, + "runtime": { + "lib/net8.0/EPPlus.dll": { + "assemblyVersion": "7.3.2.0", + "fileVersion": "7.3.2.0" + } + } + }, + "EPPlus.Interfaces/6.1.1": { + "runtime": { + "lib/net7.0/EPPlus.Interfaces.dll": { + "assemblyVersion": "6.1.1.0", + "fileVersion": "6.1.1.0" + } + } + }, + "EPPlus.System.Drawing/6.1.1": { + "dependencies": { + "EPPlus.Interfaces": "6.1.1", + "System.Drawing.Common": "7.0.0" + }, + "runtime": { + "lib/net7.0/EPPlus.System.Drawing.dll": { + "assemblyVersion": "6.1.1.0", + "fileVersion": "6.1.1.0" + } + } + }, + "Microsoft.CodeAnalysis.Analyzers/3.3.4": {}, + "Microsoft.CodeAnalysis.Common/4.11.0": { + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.3.4", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.CodeAnalysis.dll": { + "assemblyVersion": "4.11.0.0", + "fileVersion": "4.1100.24.37604" + } + } + }, + "Microsoft.CodeAnalysis.CSharp/4.11.0": { + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.3.4", + "Microsoft.CodeAnalysis.Common": "4.11.0", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.CodeAnalysis.CSharp.dll": { + "assemblyVersion": "4.11.0.0", + "fileVersion": "4.1100.24.37604" + } + } + }, + "Microsoft.Extensions.Configuration/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Configuration.Abstractions/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Configuration.FileExtensions/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "8.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "Microsoft.Extensions.FileProviders.Physical": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.FileExtensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Configuration.Json/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "8.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.Configuration.FileExtensions": "8.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "System.Text.Json": "8.0.4" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.Json.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.FileProviders.Abstractions/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.FileProviders.Abstractions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.FileProviders.Physical/8.0.0": { + "dependencies": { + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "Microsoft.Extensions.FileSystemGlobbing": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.FileProviders.Physical.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.FileSystemGlobbing/8.0.0": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.FileSystemGlobbing.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.IO.RecyclableMemoryStream/3.0.1": { + "runtime": { + "lib/net6.0/Microsoft.IO.RecyclableMemoryStream.dll": { + "assemblyVersion": "3.0.1.0", + "fileVersion": "3.0.1.0" + } + } + }, + "Microsoft.Win32.SystemEvents/7.0.0": { + "runtime": { + "lib/net7.0/Microsoft.Win32.SystemEvents.dll": { + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net7.0/Microsoft.Win32.SystemEvents.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "protobuf-net/3.2.30": { + "dependencies": { + "protobuf-net.Core": "3.2.30" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.30.709" + } + } + }, + "protobuf-net.Core/3.2.30": { + "dependencies": { + "System.Collections.Immutable": "8.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.30.709" + } + } + }, + "System.Collections.Immutable/8.0.0": {}, + "System.ComponentModel.Annotations/5.0.0": {}, + "System.Drawing.Common/7.0.0": { + "dependencies": { + "Microsoft.Win32.SystemEvents": "7.0.0" + }, + "runtime": { + "lib/net7.0/System.Drawing.Common.dll": { + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net7.0/System.Drawing.Common.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + } + }, + "System.Formats.Asn1/8.0.1": { + "runtime": { + "lib/net8.0/System.Formats.Asn1.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.724.31311" + } + } + }, + "System.Reflection.Metadata/8.0.0": { + "dependencies": { + "System.Collections.Immutable": "8.0.0" + } + }, + "System.Security.Cryptography.Pkcs/8.0.0": { + "dependencies": { + "System.Formats.Asn1": "8.0.1" + }, + "runtime": { + "lib/net8.0/System.Security.Cryptography.Pkcs.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "System.Text.Encoding.CodePages/8.0.0": {}, + "System.Text.Encodings.Web/8.0.0": {}, + "System.Text.Json/8.0.4": { + "dependencies": { + "System.Text.Encodings.Web": "8.0.0" + }, + "runtime": { + "lib/net8.0/System.Text.Json.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.724.31311" + } + } + } + } + }, + "libraries": { + "Fantasy.Tools.ConfigTable/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "EPPlus/7.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9DShQD2VuDZ7QLHp+map1r2HdI1G325YGkvRG+qs4N2fgeMF1Uq0TONCEL5gKCWMNDVGO0ZELJTAIzwNyOZQug==", + "path": "epplus/7.3.2", + "hashPath": "epplus.7.3.2.nupkg.sha512" + }, + "EPPlus.Interfaces/6.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-y7dkrOoE1ZR9Vgy1Jf2rEIaTf3SHlUjYt01NklP+F5Qh7S2ruPbzTcpYLRWMeXiG8XL8h2jqX4CyIkFt3NQGZw==", + "path": "epplus.interfaces/6.1.1", + "hashPath": "epplus.interfaces.6.1.1.nupkg.sha512" + }, + "EPPlus.System.Drawing/6.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lRF5gHYrmkHOOiLMI0t6q8zNYjUrzRgAM5BCXumv5xiqXko8fx3AWI+HCNZfhEqVFGOop+42KfR5GiUcCoyoMw==", + "path": "epplus.system.drawing/6.1.1", + "hashPath": "epplus.system.drawing.6.1.1.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.Analyzers/3.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AxkxcPR+rheX0SmvpLVIGLhOUXAKG56a64kV9VQZ4y9gR9ZmPXnqZvHJnmwLSwzrEP6junUF11vuc+aqo5r68g==", + "path": "microsoft.codeanalysis.analyzers/3.3.4", + "hashPath": "microsoft.codeanalysis.analyzers.3.3.4.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.Common/4.11.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-djf8ujmqYImFgB04UGtcsEhHrzVqzHowS+EEl/Yunc5LdrYrZhGBWUTXoCF0NzYXJxtfuD+UVQarWpvrNc94Qg==", + "path": "microsoft.codeanalysis.common/4.11.0", + "hashPath": "microsoft.codeanalysis.common.4.11.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.CSharp/4.11.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6XYi2EusI8JT4y2l/F3VVVS+ISoIX9nqHsZRaG6W5aFeJ5BEuBosHfT/ABb73FN0RZ1Z3cj2j7cL28SToJPXOw==", + "path": "microsoft.codeanalysis.csharp/4.11.0", + "hashPath": "microsoft.codeanalysis.csharp.4.11.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==", + "path": "microsoft.extensions.configuration/8.0.0", + "hashPath": "microsoft.extensions.configuration.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.Abstractions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==", + "path": "microsoft.extensions.configuration.abstractions/8.0.0", + "hashPath": "microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.FileExtensions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-McP+Lz/EKwvtCv48z0YImw+L1gi1gy5rHhNaNIY2CrjloV+XY8gydT8DjMR6zWeL13AFK+DioVpppwAuO1Gi1w==", + "path": "microsoft.extensions.configuration.fileextensions/8.0.0", + "hashPath": "microsoft.extensions.configuration.fileextensions.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.Json/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-C2wqUoh9OmRL1akaCcKSTmRU8z0kckfImG7zLNI8uyi47Lp+zd5LWAD17waPQEqCz3ioWOCrFUo+JJuoeZLOBw==", + "path": "microsoft.extensions.configuration.json/8.0.0", + "hashPath": "microsoft.extensions.configuration.json.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileProviders.Abstractions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZbaMlhJlpisjuWbvXr4LdAst/1XxH3vZ6A0BsgTphZ2L4PGuxRLz7Jr/S7mkAAnOn78Vu0fKhEgNF5JO3zfjqQ==", + "path": "microsoft.extensions.fileproviders.abstractions/8.0.0", + "hashPath": "microsoft.extensions.fileproviders.abstractions.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileProviders.Physical/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UboiXxpPUpwulHvIAVE36Knq0VSHaAmfrFkegLyBZeaADuKezJ/AIXYAW8F5GBlGk/VaibN2k/Zn1ca8YAfVdA==", + "path": "microsoft.extensions.fileproviders.physical/8.0.0", + "hashPath": "microsoft.extensions.fileproviders.physical.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileSystemGlobbing/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OK+670i7esqlQrPjdIKRbsyMCe9g5kSLpRRQGSr4Q58AOYEe/hCnfLZprh7viNisSUUQZmMrbbuDaIrP+V1ebQ==", + "path": "microsoft.extensions.filesystemglobbing/8.0.0", + "hashPath": "microsoft.extensions.filesystemglobbing.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==", + "path": "microsoft.extensions.primitives/8.0.0", + "hashPath": "microsoft.extensions.primitives.8.0.0.nupkg.sha512" + }, + "Microsoft.IO.RecyclableMemoryStream/3.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-s/s20YTVY9r9TPfTrN5g8zPF1YhwxyqO6PxUkrYTGI2B+OGPe9AdajWZrLhFqXIvqIW23fnUE4+ztrUWNU1+9g==", + "path": "microsoft.io.recyclablememorystream/3.0.1", + "hashPath": "microsoft.io.recyclablememorystream.3.0.1.nupkg.sha512" + }, + "Microsoft.Win32.SystemEvents/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ==", + "path": "microsoft.win32.systemevents/7.0.0", + "hashPath": "microsoft.win32.systemevents.7.0.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "protobuf-net/3.2.30": { + "type": "package", + "serviceable": true, + "sha512": "sha512-C/UTlmxEJHAHpqm8xQK1UyJKaIynVCSNG4mVrbLgnZ7ccH28nN49O8iMJvKEodTgVbnimvy+3mIiAdW6mATwnw==", + "path": "protobuf-net/3.2.30", + "hashPath": "protobuf-net.3.2.30.nupkg.sha512" + }, + "protobuf-net.Core/3.2.30": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v2ZxxYrz+X212ukSx+uqkLuPu414bvmSAnTyf+PBUKR9ENJxO4P/csorA/27456MCp1JNoMssDj/f91RDiwBfQ==", + "path": "protobuf-net.core/3.2.30", + "hashPath": "protobuf-net.core.3.2.30.nupkg.sha512" + }, + "System.Collections.Immutable/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==", + "path": "system.collections.immutable/8.0.0", + "hashPath": "system.collections.immutable.8.0.0.nupkg.sha512" + }, + "System.ComponentModel.Annotations/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg==", + "path": "system.componentmodel.annotations/5.0.0", + "hashPath": "system.componentmodel.annotations.5.0.0.nupkg.sha512" + }, + "System.Drawing.Common/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KIX+oBU38pxkKPxvLcLfIkOV5Ien8ReN78wro7OF5/erwcmortzeFx+iBswlh2Vz6gVne0khocQudGwaO1Ey6A==", + "path": "system.drawing.common/7.0.0", + "hashPath": "system.drawing.common.7.0.0.nupkg.sha512" + }, + "System.Formats.Asn1/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqKba7Mm/koKSjKMfW82olQdmfbI5yqeoLV/tidRp7fbh5rmHAQ5raDI/7SU0swTzv+jgqtUGkzmFxuUg0it1A==", + "path": "system.formats.asn1/8.0.1", + "hashPath": "system.formats.asn1.8.0.1.nupkg.sha512" + }, + "System.Reflection.Metadata/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==", + "path": "system.reflection.metadata/8.0.0", + "hashPath": "system.reflection.metadata.8.0.0.nupkg.sha512" + }, + "System.Security.Cryptography.Pkcs/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ULmp3xoOwNYjOYp4JZ2NK/6NdTgiN1GQXzVVN1njQ7LOZ0d0B9vyMnhyqbIi9Qw4JXj1JgCsitkTShboHRx7Eg==", + "path": "system.security.cryptography.pkcs/8.0.0", + "hashPath": "system.security.cryptography.pkcs.8.0.0.nupkg.sha512" + }, + "System.Text.Encoding.CodePages/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==", + "path": "system.text.encoding.codepages/8.0.0", + "hashPath": "system.text.encoding.codepages.8.0.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==", + "path": "system.text.encodings.web/8.0.0", + "hashPath": "system.text.encodings.web.8.0.0.nupkg.sha512" + }, + "System.Text.Json/8.0.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==", + "path": "system.text.json/8.0.4", + "hashPath": "system.text.json.8.0.4.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.dll new file mode 100644 index 00000000..691c3ecb Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.pdb b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.pdb new file mode 100644 index 00000000..e28ebf3c Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.pdb differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.runtimeconfig.json b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.runtimeconfig.json new file mode 100644 index 00000000..becfaeac --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Fantasy.Tools.ConfigTable.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json new file mode 100644 index 00000000..f56f98e9 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"OuterIP":"127.0.0.1","OuterBindIP":"127.0.0.1","InnerBindIP":"127.0.0.1"} +]} diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json new file mode 100644 index 00000000..a05a13c8 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"MachineId":1,"StartupGroup":0} +]} diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json new file mode 100644 index 00000000..44996e72 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json @@ -0,0 +1,6 @@ +{"List":[ +{"Id":1001,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Addressable","NetworkProtocol":null,"OuterPort":0,"InnerPort":11001,"SceneType":2}, +{"Id":1002,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":20000,"InnerPort":11002,"SceneType":3}, +{"Id":1003,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11003,"SceneType":4}, +{"Id":1004,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Chat","NetworkProtocol":null,"OuterPort":0,"InnerPort":11004,"SceneType":8} +]} diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json new file mode 100644 index 00000000..60dd0908 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"WorldName":"测试服","DbConnection":null,"DbName":"fantasy_main","DbType":"MongoDB"} +]} diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.CodeAnalysis.CSharp.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.CodeAnalysis.CSharp.dll new file mode 100644 index 00000000..c23db489 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.CodeAnalysis.CSharp.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.CodeAnalysis.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.CodeAnalysis.dll new file mode 100644 index 00000000..de7eadd9 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.CodeAnalysis.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.Abstractions.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.Abstractions.dll new file mode 100644 index 00000000..a5ab3136 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.Abstractions.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.FileExtensions.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.FileExtensions.dll new file mode 100644 index 00000000..4efc1a59 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.FileExtensions.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.Json.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.Json.dll new file mode 100644 index 00000000..296db6a8 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.Json.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.dll new file mode 100644 index 00000000..d3e5c229 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Configuration.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.FileProviders.Abstractions.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.FileProviders.Abstractions.dll new file mode 100644 index 00000000..f907206c Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.FileProviders.Abstractions.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.FileProviders.Physical.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.FileProviders.Physical.dll new file mode 100644 index 00000000..6fb7f477 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.FileProviders.Physical.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.FileSystemGlobbing.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.FileSystemGlobbing.dll new file mode 100644 index 00000000..e5907359 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.FileSystemGlobbing.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Primitives.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Primitives.dll new file mode 100644 index 00000000..c24f2a0b Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Extensions.Primitives.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.IO.RecyclableMemoryStream.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.IO.RecyclableMemoryStream.dll new file mode 100644 index 00000000..6e0ea409 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.IO.RecyclableMemoryStream.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Win32.SystemEvents.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 00000000..d40a926e Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Microsoft.Win32.SystemEvents.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto new file mode 100644 index 00000000..a8b51b85 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package Sining.Message; +message G2A_TestRequest // IRouteRequest,G2A_TestResponse +{ + +} +message G2A_TestResponse // IRouteResponse +{ + +} +message G2M_RequestAddressableId // IRouteRequest,M2G_ResponseAddressableId +{ + +} +message M2G_ResponseAddressableId // IRouteResponse +{ + int64 AddressableId = 1; // Map服务器返回的AddressableId +} +/// 通知Chat服务器创建一个RouteId +message G2Chat_CreateRouteRequest // IRouteRequest,Chat2G_CreateRouteResponse +{ + int64 GateRouteId = 1; +} +message Chat2G_CreateRouteResponse // IRouteResponse +{ + int64 ChatRouteId = 1; +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto new file mode 100644 index 00000000..b036a74e --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package Fantasy.Network.Message; +// 协议分为: +// ProtoBuf:可以在Outer和Inner文件里使用。 +// MemoryPack:可以在Outer和Inner文件里使用。 +// Bson:仅支持在Inner文件里使用。 +// 使用方式: +// 在message协议上方添加// Protocol+空格+协议名字 +// 例如:// Protocol ProtoBuf 或 // Protocol MemoryPack +message C2G_TestMessage // IMessage +{ + string Tag = 1; +} +message C2G_TestRequest // IRequest,G2C_TestResponse +{ + string Tag = 1; +} +message G2C_TestResponse // IResponse +{ + string Tag = 1; +} +message C2G_CreateAddressableRequest // IRequest,G2C_CreateAddressableResponse +{ + +} +message G2C_CreateAddressableResponse // IResponse +{ + +} +message C2M_TestMessage // IAddressableRouteMessage +{ + string Tag = 1; +} +message C2M_TestRequest // IAddressableRouteRequest,M2C_TestResponse +{ + string Tag = 1; +} +message M2C_TestResponse // IAddressableRouteResponse +{ + string Tag = 1; +} +/// 通知Gate服务器创建一个Chat的Route连接 +message C2G_CreateChatRouteRequest // IRequest,G2C_CreateChatRouteResponse +{ + +} +message G2C_CreateChatRouteResponse // IResponse +{ + +} +/// 发送一个Route消息给Chat +message C2Chat_TestMessage // ICustomRouteMessage,ChatRoute +{ + string Tag = 1; +} +/// 发送一个RPCRoute消息给Chat +message C2Chat_TestMessageRequest // ICustomRouteRequest,Chat2C_TestMessageResponse,ChatRoute +{ + string Tag = 1; +} +message Chat2C_TestMessageResponse // ICustomRouteResponse +{ + string Tag = 1; +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config new file mode 100644 index 00000000..66082cf9 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config @@ -0,0 +1,3 @@ +// Route协议定义(需要定义1000以上、因为1000以内的框架预留) +GateRoute = 1001 // Gate +ChatRoute = 1002 // Chat \ No newline at end of file diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Newtonsoft.Json.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Newtonsoft.Json.dll new file mode 100644 index 00000000..d035c38b Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Newtonsoft.Json.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/README.md b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/README.md new file mode 100644 index 00000000..697ec052 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/README.md @@ -0,0 +1,16 @@ +# Fantasy-Net.Config +在Config文件夹中,存放着Fantasy所需的各种配置文件。这些文件涵盖了多个方面。每个配置文件都有其特定的格式和功能,通过精心设计的这些配置文件,开发团队能够快速调整框架参数,以实现更好的游戏体验,从而提升Fantasy的整体质量。 +## Excel文件夹 +里面存放了Fantasy.Net所需的四个Excel配置文件。用户可以利用Fantasy-Net.Exporter工具,依据这四个Excel文件生成相应的JSON文件,以供框架使用。这一过程不仅简化了数据处理,还确保了不同组件之间的无缝对接,使得工作流程更加高效。请确保在导出之前,Excel文件的格式和内容符合要求,以避免产生错误。 +## Json文件夹 +在该目录中存放了Fantasy.Net所需的四个JSON配置文件。用户可以根据这四个文件的模板进行添加或修改配置,以满足具体需求。每个项目的功能说明在相应的Excel文件中有详细描述,方便用户理解和使用这些配置文件。我们建议用户仔细阅读Excel文件中的说明,以确保配置的正确性和有效性。 +## NetworkProtocol文件夹 +存放框架所需定义网络协议的模版和文件夹 +### Inner文件夹 +定义服务器之间的网络协议 +### Outer文件夹 +定义客户端和服务器之间的网络协议 +### RouteType.Config +定义自定义Route协议的配置文件 +## 交流与讨论: +__讨论QQ群 : Fantasy服务器开发交流群 569888673 __ \ No newline at end of file diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Run.bat b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Run.bat new file mode 100644 index 00000000..e166f0ec --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Run.bat @@ -0,0 +1,21 @@ +@echo off + +echo Please select an option: +echo 1. Client +echo 2. Server +echo 3. All + +set /p choice=Please select an option: + +if "%choice%"=="1" ( + echo Client + dotnet Fantasy.Tools.ConfigTable.dll --ExportPlatform 1 +) else if "%choice%"=="2" ( + echo Server + dotnet Fantasy.Tools.ConfigTable.dll --ExportPlatform 2 +) else if "%choice%"=="3" ( + echo All + dotnet Fantasy.Tools.ConfigTable.dll --ExportPlatform 3 +) else ( + echo Invalid option +) diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Run.sh b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Run.sh new file mode 100644 index 00000000..491d8d97 --- /dev/null +++ b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/Run.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +echo "1. Client" +echo "2. Server" +echo "3. All" + +read -n 1 -p "Please select an option:" choice +echo "" +echo "" +case $choice in + 1) + dotnet Fantasy.Tools.ConfigTable.dll --ExportPlatform 1 + ;; + 2) + dotnet Fantasy.Tools.ConfigTable.dll --ExportPlatform 2 + ;; + 3) + dotnet Fantasy.Tools.ConfigTable.dll --ExportPlatform 3 + ;; + *) + echo "Invalid option" + ;; +esac diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Drawing.Common.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Drawing.Common.dll new file mode 100644 index 00000000..310d5e8b Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Drawing.Common.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Formats.Asn1.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Formats.Asn1.dll new file mode 100644 index 00000000..16cc849a Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Formats.Asn1.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Security.Cryptography.Pkcs.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Security.Cryptography.Pkcs.dll new file mode 100644 index 00000000..a76a14a8 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Security.Cryptography.Pkcs.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Text.Json.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Text.Json.dll new file mode 100644 index 00000000..0c6d4065 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/System.Text.Json.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/protobuf-net.Core.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/protobuf-net.Core.dll new file mode 100644 index 00000000..845a8403 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/protobuf-net.Core.dll differ diff --git a/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/protobuf-net.dll b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/protobuf-net.dll new file mode 100644 index 00000000..e4b68393 Binary files /dev/null and b/GameServer/Server/APlugins/Tools/Exporter/ConfigTable/protobuf-net.dll differ diff --git a/GameServer/Server/APlugins/bin/Debug/net9.0/APlugins.deps.json b/GameServer/Server/APlugins/bin/Debug/net9.0/APlugins.deps.json new file mode 100644 index 00000000..2b6a56f6 --- /dev/null +++ b/GameServer/Server/APlugins/bin/Debug/net9.0/APlugins.deps.json @@ -0,0 +1,433 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "APlugins/1.0.0": { + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "APlugins.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.22": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Config/2024.1.4": { + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "dependencies": { + "Fantasy-Net": "2024.2.22" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {}, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + } + } + }, + "libraries": { + "APlugins/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.22": { + "type": "package", + "serviceable": true, + "sha512": "sha512-cT6B0YJ5JmbPHBLYgLeVgg2WbXYxxa1tudoIase88uMzAuqU9t7EQ7dFZGSWjP41c5JOQ/0f1q9lzGWTh/hskw==", + "path": "fantasy-net/2024.2.22", + "hashPath": "fantasy-net.2024.2.22.nupkg.sha512" + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "path": "fantasy-net.config/2024.1.4", + "hashPath": "fantasy-net.config.2024.1.4.nupkg.sha512" + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "path": "fantasy-net.configtable/2024.2.0", + "hashPath": "fantasy-net.configtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hashPath": "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hashPath": "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OQd5aVepYvh5evOmBMeAYjMIpEcTf1ZCBZaU7Nh/RlhhdXefjFDJeP1L2F2zeNT1unFr+wUu/h3Ac2Xb4BXU6w==", + "path": "microsoft.identitymodel.abstractions/8.7.0", + "hashPath": "microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Bs0TznPAu+nxa9rAVHJ+j3CYECHJkT3tG8AyBfhFYlT5ldsDhoxFT7J+PKxJHLf+ayqWfvDZHHc4639W2FQCxA==", + "path": "microsoft.identitymodel.logging/8.7.0", + "hashPath": "microsoft.identitymodel.logging.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5Z6voXjRXAnGklhmZd1mKz89UhcF5ZQQZaZc2iKrOuL4Li1UihG2vlJx8IbiFAOIxy/xdbsAm0A+WZEaH5fxng==", + "path": "microsoft.identitymodel.tokens/8.7.0", + "hashPath": "microsoft.identitymodel.tokens.8.7.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/bin/Debug/net9.0/APlugins.dll b/GameServer/Server/APlugins/bin/Debug/net9.0/APlugins.dll new file mode 100644 index 00000000..ed581911 Binary files /dev/null and b/GameServer/Server/APlugins/bin/Debug/net9.0/APlugins.dll differ diff --git a/GameServer/Server/APlugins/bin/Debug/net9.0/APlugins.pdb b/GameServer/Server/APlugins/bin/Debug/net9.0/APlugins.pdb new file mode 100644 index 00000000..7e866004 Binary files /dev/null and b/GameServer/Server/APlugins/bin/Debug/net9.0/APlugins.pdb differ diff --git a/GameServer/Server/APlugins/bin/Release/net9.0/APlugins.deps.json b/GameServer/Server/APlugins/bin/Release/net9.0/APlugins.deps.json new file mode 100644 index 00000000..49f85d0f --- /dev/null +++ b/GameServer/Server/APlugins/bin/Release/net9.0/APlugins.deps.json @@ -0,0 +1,433 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "APlugins/1.0.0": { + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "APlugins.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.22": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Config/2024.1.4": { + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "dependencies": { + "Fantasy-Net": "2024.2.22" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {}, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + } + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + } + } + }, + "libraries": { + "APlugins/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.22": { + "type": "package", + "serviceable": true, + "sha512": "sha512-cT6B0YJ5JmbPHBLYgLeVgg2WbXYxxa1tudoIase88uMzAuqU9t7EQ7dFZGSWjP41c5JOQ/0f1q9lzGWTh/hskw==", + "path": "fantasy-net/2024.2.22", + "hashPath": "fantasy-net.2024.2.22.nupkg.sha512" + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "path": "fantasy-net.config/2024.1.4", + "hashPath": "fantasy-net.config.2024.1.4.nupkg.sha512" + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "path": "fantasy-net.configtable/2024.2.0", + "hashPath": "fantasy-net.configtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hashPath": "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hashPath": "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OwmvCXYTttrxV3qT7QKDkoQP4/DB4RWjTwEqV+dNfb2opHn29WGDzoF+r4BVFQVy+BDYMhRlhIp8g3jSyJd+4Q==", + "path": "microsoft.identitymodel.abstractions/8.6.1", + "hashPath": "microsoft.identitymodel.abstractions.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BdWlVgJYdmcR9TMUOhaZ3vJyaRO7zr7xgK+cRT4R2q59Xl7JMmTB4ctb/VOsyDhxXb497jDNNvLwldp+2ZVBEg==", + "path": "microsoft.identitymodel.logging/8.6.1", + "hashPath": "microsoft.identitymodel.logging.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FvED2com8LIFl9yFXneiX0uxNf9fuf8jKDFcvxC93qXOAfFa8fdLkCiur1vWF+PvgQHhsHVBe6CtDZHzsN8nCQ==", + "path": "microsoft.identitymodel.tokens/8.6.1", + "hashPath": "microsoft.identitymodel.tokens.8.6.1.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/bin/Release/net9.0/APlugins.dll b/GameServer/Server/APlugins/bin/Release/net9.0/APlugins.dll new file mode 100644 index 00000000..cc1491d5 Binary files /dev/null and b/GameServer/Server/APlugins/bin/Release/net9.0/APlugins.dll differ diff --git a/GameServer/Server/APlugins/bin/Release/net9.0/APlugins.pdb b/GameServer/Server/APlugins/bin/Release/net9.0/APlugins.pdb new file mode 100644 index 00000000..1045ce75 Binary files /dev/null and b/GameServer/Server/APlugins/bin/Release/net9.0/APlugins.pdb differ diff --git a/GameServer/Server/APlugins/obj/APlugins.csproj.nuget.dgspec.json b/GameServer/Server/APlugins/obj/APlugins.csproj.nuget.dgspec.json new file mode 100644 index 00000000..e08151ba --- /dev/null +++ b/GameServer/Server/APlugins/obj/APlugins.csproj.nuget.dgspec.json @@ -0,0 +1,95 @@ +{ + "format": 1, + "restore": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": {} + }, + "projects": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "projectName": "APlugins", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net.Config": { + "target": "Package", + "version": "[2024.1.4, )" + }, + "Fantasy-Net.ConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol": { + "target": "Package", + "version": "[2024.2.24, )" + }, + "Microsoft.IdentityModel.Tokens": { + "target": "Package", + "version": "[8.7.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/APlugins.csproj.nuget.g.props b/GameServer/Server/APlugins/obj/APlugins.csproj.nuget.g.props new file mode 100644 index 00000000..2571d6c1 --- /dev/null +++ b/GameServer/Server/APlugins/obj/APlugins.csproj.nuget.g.props @@ -0,0 +1,21 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\qq137\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 6.12.2 + + + + + + + C:\Users\qq137\.nuget\packages\fantasy-net.tools.exporternetworkprotocol\2024.2.24 + C:\Users\qq137\.nuget\packages\fantasy-net.tools.exporterconfigtable\2024.2.0 + C:\Users\qq137\.nuget\packages\fantasy-net.config\2024.1.4 + + \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/APlugins.csproj.nuget.g.targets b/GameServer/Server/APlugins/obj/APlugins.csproj.nuget.g.targets new file mode 100644 index 00000000..ba22e8fa --- /dev/null +++ b/GameServer/Server/APlugins/obj/APlugins.csproj.nuget.g.targets @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Server/APlugins/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.AssemblyInfo.cs b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.AssemblyInfo.cs new file mode 100644 index 00000000..5d780dc9 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("APlugins")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+93d69c1ff6fc3ec58a9401445592c13d80a5e8fc")] +[assembly: System.Reflection.AssemblyProductAttribute("APlugins")] +[assembly: System.Reflection.AssemblyTitleAttribute("APlugins")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.AssemblyInfoInputs.cache b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.AssemblyInfoInputs.cache new file mode 100644 index 00000000..317efc2e --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +e921ce1fc41926ac48960caf7a6b4f93b4fa3ac39e90c5379537c824ab3c0aef diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..dd74ff68 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Plugins +build_property.ProjectDir = D:\UnityProject\EintooAR\GameServer\Server\APlugins\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.GlobalUsings.g.cs b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.assets.cache b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.assets.cache new file mode 100644 index 00000000..e25bed0e Binary files /dev/null and b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.assets.cache differ diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.csproj.AssemblyReference.cache b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.csproj.AssemblyReference.cache new file mode 100644 index 00000000..45f611dd Binary files /dev/null and b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.csproj.AssemblyReference.cache differ diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.csproj.CoreCompileInputs.cache b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.csproj.CoreCompileInputs.cache new file mode 100644 index 00000000..021eaaf1 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +be82aedd3948869fc82be9e73832f5c0595a3ccdf2e06cd509dd95ec85df4810 diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.csproj.FileListAbsolute.txt b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.csproj.FileListAbsolute.txt new file mode 100644 index 00000000..e5b7cf49 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.csproj.FileListAbsolute.txt @@ -0,0 +1,60 @@ +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.deps.json +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.pdb +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.AssemblyReference.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.GeneratedMSBuildEditorConfig.editorconfig +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfoInputs.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfo.cs +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.CoreCompileInputs.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\refint\APlugins.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.pdb +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\ref\APlugins.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.deps.json +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.AssemblyReference.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfoInputs.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfo.cs +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.CoreCompileInputs.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\refint\APlugins.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\ref\APlugins.dll +D:\UGit\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.deps.json +D:\UGit\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.dll +D:\UGit\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.pdb +D:\UGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.AssemblyReference.cache +D:\UGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.GeneratedMSBuildEditorConfig.editorconfig +D:\UGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfoInputs.cache +D:\UGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfo.cs +D:\UGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.CoreCompileInputs.cache +D:\UGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.dll +D:\UGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\refint\APlugins.dll +D:\UGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.pdb +D:\UGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\ref\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.deps.json +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.pdb +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.AssemblyReference.cache +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.GeneratedMSBuildEditorConfig.editorconfig +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfoInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfo.cs +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.CoreCompileInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\refint\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.pdb +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\ref\APlugins.dll +D:\UnityProject\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.deps.json +D:\UnityProject\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.dll +D:\UnityProject\EintooAR\GameServer\Server\APlugins\bin\Debug\net9.0\APlugins.pdb +D:\UnityProject\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.AssemblyReference.cache +D:\UnityProject\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.GeneratedMSBuildEditorConfig.editorconfig +D:\UnityProject\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfoInputs.cache +D:\UnityProject\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.AssemblyInfo.cs +D:\UnityProject\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.csproj.CoreCompileInputs.cache +D:\UnityProject\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.dll +D:\UnityProject\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\refint\APlugins.dll +D:\UnityProject\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\APlugins.pdb +D:\UnityProject\EintooAR\GameServer\Server\APlugins\obj\Debug\net9.0\ref\APlugins.dll diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.dll b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.dll new file mode 100644 index 00000000..ed581911 Binary files /dev/null and b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.dll differ diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.pdb b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.pdb new file mode 100644 index 00000000..7e866004 Binary files /dev/null and b/GameServer/Server/APlugins/obj/Debug/net9.0/APlugins.pdb differ diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.AssemblyInfo.cs b/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.AssemblyInfo.cs new file mode 100644 index 00000000..4d468e3a --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Plugins")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c77ba7871ef90e86cce47a22e875f550d637f257")] +[assembly: System.Reflection.AssemblyProductAttribute("Plugins")] +[assembly: System.Reflection.AssemblyTitleAttribute("Plugins")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.AssemblyInfoInputs.cache b/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.AssemblyInfoInputs.cache new file mode 100644 index 00000000..dad86660 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +e8c012a9c80905c36e58f0e459caa9c32f63a4eab1da93888f4a9ab91a67aca5 diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..b37257b5 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Plugins +build_property.ProjectDir = E:\Game\unity\TE_AR\GameServer\Plugins\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.GlobalUsings.g.cs b/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Debug/net9.0/Plugins.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/ref/APlugins.dll b/GameServer/Server/APlugins/obj/Debug/net9.0/ref/APlugins.dll new file mode 100644 index 00000000..bf6ccc21 Binary files /dev/null and b/GameServer/Server/APlugins/obj/Debug/net9.0/ref/APlugins.dll differ diff --git a/GameServer/Server/APlugins/obj/Debug/net9.0/refint/APlugins.dll b/GameServer/Server/APlugins/obj/Debug/net9.0/refint/APlugins.dll new file mode 100644 index 00000000..bf6ccc21 Binary files /dev/null and b/GameServer/Server/APlugins/obj/Debug/net9.0/refint/APlugins.dll differ diff --git a/GameServer/Server/APlugins/obj/Plugins.csproj.nuget.dgspec.json b/GameServer/Server/APlugins/obj/Plugins.csproj.nuget.dgspec.json new file mode 100644 index 00000000..10fa6da8 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Plugins.csproj.nuget.dgspec.json @@ -0,0 +1,78 @@ +{ + "format": 1, + "restore": { + "E:\\Game\\unity\\TE_AR\\GameServer\\Plugins\\Plugins.csproj": {} + }, + "projects": { + "E:\\Game\\unity\\TE_AR\\GameServer\\Plugins\\Plugins.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "E:\\Game\\unity\\TE_AR\\GameServer\\Plugins\\Plugins.csproj", + "projectName": "Plugins", + "projectPath": "E:\\Game\\unity\\TE_AR\\GameServer\\Plugins\\Plugins.csproj", + "packagesPath": "C:\\Users\\Administrator\\.nuget\\packages\\", + "outputPath": "E:\\Game\\unity\\TE_AR\\GameServer\\Plugins\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\Administrator\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "all" + } + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.Net.Sdk.Compilers.Toolset", + "version": "[9.0.102, 9.0.102]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.102/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/Plugins.csproj.nuget.g.props b/GameServer/Server/APlugins/obj/Plugins.csproj.nuget.g.props new file mode 100644 index 00000000..d62c82ee --- /dev/null +++ b/GameServer/Server/APlugins/obj/Plugins.csproj.nuget.g.props @@ -0,0 +1,16 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\Administrator\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 6.11.1 + + + + + + \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/Plugins.csproj.nuget.g.targets b/GameServer/Server/APlugins/obj/Plugins.csproj.nuget.g.targets new file mode 100644 index 00000000..3dc06ef3 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Plugins.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Server/APlugins/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Server/APlugins/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.AssemblyInfo.cs b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.AssemblyInfo.cs new file mode 100644 index 00000000..8b845c79 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("APlugins")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4710d1c9d412b6a31c2ed97fac4853f5c41daeb1")] +[assembly: System.Reflection.AssemblyProductAttribute("APlugins")] +[assembly: System.Reflection.AssemblyTitleAttribute("APlugins")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.AssemblyInfoInputs.cache b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.AssemblyInfoInputs.cache new file mode 100644 index 00000000..f6c04519 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +0da5c3e0b61732a0c63cb05ca63bcd1ccf962f8247d97f42f809d44e15117361 diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..9b2d5be9 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Plugins +build_property.ProjectDir = D:\TecentUGit\EintooAR\GameServer\Server\APlugins\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.GlobalUsings.g.cs b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.assets.cache b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.assets.cache new file mode 100644 index 00000000..101dc7ec Binary files /dev/null and b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.assets.cache differ diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.csproj.AssemblyReference.cache b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.csproj.AssemblyReference.cache new file mode 100644 index 00000000..8d516fbd Binary files /dev/null and b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.csproj.AssemblyReference.cache differ diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.csproj.CoreCompileInputs.cache b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.csproj.CoreCompileInputs.cache new file mode 100644 index 00000000..47e2e713 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +920b3c0a8dde3074bf4b59373f23c57018290d079e57ad750d0b9fa46a861176 diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.csproj.FileListAbsolute.txt b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.csproj.FileListAbsolute.txt new file mode 100644 index 00000000..ef400102 --- /dev/null +++ b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.csproj.FileListAbsolute.txt @@ -0,0 +1,12 @@ +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\bin\Release\net9.0\APlugins.deps.json +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\bin\Release\net9.0\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\bin\Release\net9.0\APlugins.pdb +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Release\net9.0\APlugins.csproj.AssemblyReference.cache +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Release\net9.0\APlugins.GeneratedMSBuildEditorConfig.editorconfig +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Release\net9.0\APlugins.AssemblyInfoInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Release\net9.0\APlugins.AssemblyInfo.cs +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Release\net9.0\APlugins.csproj.CoreCompileInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Release\net9.0\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Release\net9.0\refint\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Release\net9.0\APlugins.pdb +D:\TecentUGit\EintooAR\GameServer\Server\APlugins\obj\Release\net9.0\ref\APlugins.dll diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.dll b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.dll new file mode 100644 index 00000000..cc1491d5 Binary files /dev/null and b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.dll differ diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.pdb b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.pdb new file mode 100644 index 00000000..1045ce75 Binary files /dev/null and b/GameServer/Server/APlugins/obj/Release/net9.0/APlugins.pdb differ diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/ref/APlugins.dll b/GameServer/Server/APlugins/obj/Release/net9.0/ref/APlugins.dll new file mode 100644 index 00000000..902789f0 Binary files /dev/null and b/GameServer/Server/APlugins/obj/Release/net9.0/ref/APlugins.dll differ diff --git a/GameServer/Server/APlugins/obj/Release/net9.0/refint/APlugins.dll b/GameServer/Server/APlugins/obj/Release/net9.0/refint/APlugins.dll new file mode 100644 index 00000000..902789f0 Binary files /dev/null and b/GameServer/Server/APlugins/obj/Release/net9.0/refint/APlugins.dll differ diff --git a/GameServer/Server/APlugins/obj/project.assets.json b/GameServer/Server/APlugins/obj/project.assets.json new file mode 100644 index 00000000..c5524262 --- /dev/null +++ b/GameServer/Server/APlugins/obj/project.assets.json @@ -0,0 +1,1335 @@ +{ + "version": 3, + "targets": { + "net9.0": { + "CommandLineParser/2.9.1": { + "type": "package", + "compile": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + } + }, + "DnsClient/1.6.1": { + "type": "package", + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "compile": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + } + }, + "Fantasy-Net/2024.2.22": { + "type": "package", + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "compile": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "frameworkReferences": [ + "Microsoft.AspNetCore.App" + ], + "build": { + "buildTransitive/Fantasy-Net.targets": {} + } + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Config.targets": {} + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "dependencies": { + "Fantasy-Net": "2024.2.22" + }, + "compile": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets": {} + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets": {} + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "compile": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + }, + "compile": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets": {} + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "2.0.0", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "compile": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "protobuf-net/3.2.45": { + "type": "package", + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "compile": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + } + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + } + }, + "SharpCompress/0.30.1": { + "type": "package", + "compile": { + "lib/net5.0/SharpCompress.dll": {} + }, + "runtime": { + "lib/net5.0/SharpCompress.dll": {} + } + }, + "Snappier/1.0.0": { + "type": "package", + "compile": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "compile": { + "ref/netcoreapp2.0/_._": {} + }, + "runtime": { + "lib/netcoreapp2.0/_._": {} + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "compile": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "System.Memory/4.5.5": { + "type": "package", + "compile": { + "ref/netcoreapp2.1/_._": {} + }, + "runtime": { + "lib/netcoreapp2.1/_._": {} + } + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "compile": { + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "unix" + }, + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "compile": { + "lib/net7.0/ZstdSharp.dll": {} + }, + "runtime": { + "lib/net7.0/ZstdSharp.dll": {} + } + } + } + }, + "libraries": { + "CommandLineParser/2.9.1": { + "sha512": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "type": "package", + "path": "commandlineparser/2.9.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "CommandLine20.png", + "License.md", + "README.md", + "commandlineparser.2.9.1.nupkg.sha512", + "commandlineparser.nuspec", + "lib/net40/CommandLine.dll", + "lib/net40/CommandLine.xml", + "lib/net45/CommandLine.dll", + "lib/net45/CommandLine.xml", + "lib/net461/CommandLine.dll", + "lib/net461/CommandLine.xml", + "lib/netstandard2.0/CommandLine.dll", + "lib/netstandard2.0/CommandLine.xml" + ] + }, + "DnsClient/1.6.1": { + "sha512": "4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "type": "package", + "path": "dnsclient/1.6.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "dnsclient.1.6.1.nupkg.sha512", + "dnsclient.nuspec", + "icon.png", + "lib/net45/DnsClient.dll", + "lib/net45/DnsClient.xml", + "lib/net471/DnsClient.dll", + "lib/net471/DnsClient.xml", + "lib/net5.0/DnsClient.dll", + "lib/net5.0/DnsClient.xml", + "lib/netstandard1.3/DnsClient.dll", + "lib/netstandard1.3/DnsClient.xml", + "lib/netstandard2.0/DnsClient.dll", + "lib/netstandard2.0/DnsClient.xml", + "lib/netstandard2.1/DnsClient.dll", + "lib/netstandard2.1/DnsClient.xml" + ] + }, + "Fantasy-Net/2024.2.22": { + "sha512": "cT6B0YJ5JmbPHBLYgLeVgg2WbXYxxa1tudoIase88uMzAuqU9t7EQ7dFZGSWjP41c5JOQ/0f1q9lzGWTh/hskw==", + "type": "package", + "path": "fantasy-net/2024.2.22", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE", + "README.md", + "buildTransitive/Fantasy-Net.targets", + "fantasy-net.2024.2.22.nupkg.sha512", + "fantasy-net.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.dll", + "lib/net9.0/Fantasy-Net.dll" + ] + }, + "Fantasy-Net.Config/2024.1.4": { + "sha512": "zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "type": "package", + "path": "fantasy-net.config/2024.1.4", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "buildTransitive/Fantasy-Net.Config.targets", + "fantasy-net.config.2024.1.4.nupkg.sha512", + "fantasy-net.config.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.Config.dll", + "tools/output/Excel/Custom.txt", + "tools/output/Excel/Server/MachineConfig.xlsx", + "tools/output/Excel/Server/ProcessConfig.xlsx", + "tools/output/Excel/Server/SceneConfig.xlsx", + "tools/output/Excel/Server/WorldConfig.xlsx", + "tools/output/Excel/Version.txt", + "tools/output/Json/Server/MachineConfigData.Json", + "tools/output/Json/Server/ProcessConfigData.Json", + "tools/output/Json/Server/SceneConfigData.Json", + "tools/output/Json/Server/WorldConfigData.Json", + "tools/output/NetworkProtocol/Inner/InnerMessage.proto", + "tools/output/NetworkProtocol/OpCode.Cache", + "tools/output/NetworkProtocol/Outer/OuterMessage.proto", + "tools/output/NetworkProtocol/RouteType.Config", + "tools/output/README.md" + ] + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "sha512": "TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "type": "package", + "path": "fantasy-net.configtable/2024.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "fantasy-net.configtable.2024.2.0.nupkg.sha512", + "fantasy-net.configtable.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.ConfigTable.dll" + ] + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "sha512": "jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "type": "package", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets", + "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512", + "fantasy-net.tools.exporterconfigtable.nuspec", + "icon.png", + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll", + "tools/output/CommandLine.dll", + "tools/output/EPPlus.Interfaces.dll", + "tools/output/EPPlus.System.Drawing.dll", + "tools/output/EPPlus.dll", + "tools/output/ExporterSettings.json", + "tools/output/Fantasy.Tools.ConfigTable", + "tools/output/Fantasy.Tools.ConfigTable.deps.json", + "tools/output/Fantasy.Tools.ConfigTable.dll", + "tools/output/Fantasy.Tools.ConfigTable.pdb", + "tools/output/Fantasy.Tools.ConfigTable.runtimeconfig.json", + "tools/output/Microsoft.CodeAnalysis.CSharp.dll", + "tools/output/Microsoft.CodeAnalysis.dll", + "tools/output/Microsoft.Extensions.Configuration.Abstractions.dll", + "tools/output/Microsoft.Extensions.Configuration.FileExtensions.dll", + "tools/output/Microsoft.Extensions.Configuration.Json.dll", + "tools/output/Microsoft.Extensions.Configuration.dll", + "tools/output/Microsoft.Extensions.FileProviders.Abstractions.dll", + "tools/output/Microsoft.Extensions.FileProviders.Physical.dll", + "tools/output/Microsoft.Extensions.FileSystemGlobbing.dll", + "tools/output/Microsoft.Extensions.Primitives.dll", + "tools/output/Microsoft.IO.RecyclableMemoryStream.dll", + "tools/output/Microsoft.Win32.SystemEvents.dll", + "tools/output/Newtonsoft.Json.dll", + "tools/output/Run.bat", + "tools/output/Run.sh", + "tools/output/System.Drawing.Common.dll", + "tools/output/System.Security.Cryptography.Pkcs.dll", + "tools/output/protobuf-net.Core.dll", + "tools/output/protobuf-net.dll", + "tools/output/runtimes/win/lib/net7.0/Microsoft.Win32.SystemEvents.dll", + "tools/output/runtimes/win/lib/net7.0/System.Drawing.Common.dll", + "tools/output/runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll" + ] + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "sha512": "gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "type": "package", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets", + "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512", + "fantasy-net.tools.exporternetworkprotocol.nuspec", + "icon.png", + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll", + "tools/output/CommandLine.dll", + "tools/output/ExporterSettings.json", + "tools/output/Fantasy.Tools.NetworkProtocol", + "tools/output/Fantasy.Tools.NetworkProtocol.deps.json", + "tools/output/Fantasy.Tools.NetworkProtocol.dll", + "tools/output/Fantasy.Tools.NetworkProtocol.pdb", + "tools/output/Fantasy.Tools.NetworkProtocol.runtimeconfig.json", + "tools/output/Microsoft.Extensions.Configuration.Abstractions.dll", + "tools/output/Microsoft.Extensions.Configuration.FileExtensions.dll", + "tools/output/Microsoft.Extensions.Configuration.Json.dll", + "tools/output/Microsoft.Extensions.Configuration.dll", + "tools/output/Microsoft.Extensions.FileProviders.Abstractions.dll", + "tools/output/Microsoft.Extensions.FileProviders.Physical.dll", + "tools/output/Microsoft.Extensions.FileSystemGlobbing.dll", + "tools/output/Microsoft.Extensions.Primitives.dll", + "tools/output/Newtonsoft.Json.dll", + "tools/output/Run.bat", + "tools/output/Run.sh" + ] + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "sha512": "3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "type": "package", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", + "microsoft.extensions.dependencyinjection.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "sha512": "nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "type": "package", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn3.11/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn3.11/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.0/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "buildTransitive/net461/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net462/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.xml", + "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", + "microsoft.extensions.logging.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "sha512": "OQd5aVepYvh5evOmBMeAYjMIpEcTf1ZCBZaU7Nh/RlhhdXefjFDJeP1L2F2zeNT1unFr+wUu/h3Ac2Xb4BXU6w==", + "type": "package", + "path": "microsoft.identitymodel.abstractions/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Abstractions.dll", + "lib/net462/Microsoft.IdentityModel.Abstractions.xml", + "lib/net472/Microsoft.IdentityModel.Abstractions.dll", + "lib/net472/Microsoft.IdentityModel.Abstractions.xml", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net9.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.xml", + "microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512", + "microsoft.identitymodel.abstractions.nuspec" + ] + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "sha512": "Bs0TznPAu+nxa9rAVHJ+j3CYECHJkT3tG8AyBfhFYlT5ldsDhoxFT7J+PKxJHLf+ayqWfvDZHHc4639W2FQCxA==", + "type": "package", + "path": "microsoft.identitymodel.logging/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Logging.dll", + "lib/net462/Microsoft.IdentityModel.Logging.xml", + "lib/net472/Microsoft.IdentityModel.Logging.dll", + "lib/net472/Microsoft.IdentityModel.Logging.xml", + "lib/net6.0/Microsoft.IdentityModel.Logging.dll", + "lib/net6.0/Microsoft.IdentityModel.Logging.xml", + "lib/net8.0/Microsoft.IdentityModel.Logging.dll", + "lib/net8.0/Microsoft.IdentityModel.Logging.xml", + "lib/net9.0/Microsoft.IdentityModel.Logging.dll", + "lib/net9.0/Microsoft.IdentityModel.Logging.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.xml", + "microsoft.identitymodel.logging.8.7.0.nupkg.sha512", + "microsoft.identitymodel.logging.nuspec" + ] + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "sha512": "5Z6voXjRXAnGklhmZd1mKz89UhcF5ZQQZaZc2iKrOuL4Li1UihG2vlJx8IbiFAOIxy/xdbsAm0A+WZEaH5fxng==", + "type": "package", + "path": "microsoft.identitymodel.tokens/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Tokens.dll", + "lib/net462/Microsoft.IdentityModel.Tokens.xml", + "lib/net472/Microsoft.IdentityModel.Tokens.dll", + "lib/net472/Microsoft.IdentityModel.Tokens.xml", + "lib/net6.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net6.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net8.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net9.0/Microsoft.IdentityModel.Tokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.xml", + "microsoft.identitymodel.tokens.8.7.0.nupkg.sha512", + "microsoft.identitymodel.tokens.nuspec" + ] + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "type": "package", + "path": "microsoft.netcore.platforms/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.5.0.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Microsoft.Win32.Registry/5.0.0": { + "sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "type": "package", + "path": "microsoft.win32.registry/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.xml", + "lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "microsoft.win32.registry.5.0.0.nupkg.sha512", + "microsoft.win32.registry.nuspec", + "ref/net46/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/Microsoft.Win32.Registry.dll", + "ref/netstandard1.3/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/de/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/es/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/fr/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/it/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ja/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ko/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ru/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hans/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml", + "ref/netstandard2.0/Microsoft.Win32.Registry.dll", + "ref/netstandard2.0/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/net46/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "MongoDB.Bson/3.1.0": { + "sha512": "3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "type": "package", + "path": "mongodb.bson/3.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net472/MongoDB.Bson.dll", + "lib/net472/MongoDB.Bson.xml", + "lib/net6.0/MongoDB.Bson.dll", + "lib/net6.0/MongoDB.Bson.xml", + "lib/netstandard2.1/MongoDB.Bson.dll", + "lib/netstandard2.1/MongoDB.Bson.xml", + "mongodb.bson.3.1.0.nupkg.sha512", + "mongodb.bson.nuspec", + "packageIcon.png" + ] + }, + "MongoDB.Driver/3.1.0": { + "sha512": "+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "type": "package", + "path": "mongodb.driver/3.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net472/MongoDB.Driver.dll", + "lib/net472/MongoDB.Driver.xml", + "lib/net6.0/MongoDB.Driver.dll", + "lib/net6.0/MongoDB.Driver.xml", + "lib/netstandard2.1/MongoDB.Driver.dll", + "lib/netstandard2.1/MongoDB.Driver.xml", + "mongodb.driver.3.1.0.nupkg.sha512", + "mongodb.driver.nuspec", + "packageIcon.png" + ] + }, + "Newtonsoft.Json/13.0.3": { + "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "type": "package", + "path": "newtonsoft.json/13.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "README.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/net6.0/Newtonsoft.Json.dll", + "lib/net6.0/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "newtonsoft.json.13.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, + "protobuf-net/3.2.45": { + "sha512": "5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "type": "package", + "path": "protobuf-net/3.2.45", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net462/protobuf-net.dll", + "lib/net462/protobuf-net.xml", + "lib/net6.0/protobuf-net.dll", + "lib/net6.0/protobuf-net.xml", + "lib/netstandard2.0/protobuf-net.dll", + "lib/netstandard2.0/protobuf-net.xml", + "lib/netstandard2.1/protobuf-net.dll", + "lib/netstandard2.1/protobuf-net.xml", + "protobuf-net.3.2.45.nupkg.sha512", + "protobuf-net.nuspec", + "protobuf-net.png", + "readme.md" + ] + }, + "protobuf-net.Core/3.2.45": { + "sha512": "PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "type": "package", + "path": "protobuf-net.core/3.2.45", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net462/protobuf-net.Core.dll", + "lib/net462/protobuf-net.Core.xml", + "lib/net6.0/protobuf-net.Core.dll", + "lib/net6.0/protobuf-net.Core.xml", + "lib/netstandard2.0/protobuf-net.Core.dll", + "lib/netstandard2.0/protobuf-net.Core.xml", + "lib/netstandard2.1/protobuf-net.Core.dll", + "lib/netstandard2.1/protobuf-net.Core.xml", + "protobuf-net.core.3.2.45.nupkg.sha512", + "protobuf-net.core.nuspec", + "protobuf-net.png", + "readme.md" + ] + }, + "SharpCompress/0.30.1": { + "sha512": "XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "type": "package", + "path": "sharpcompress/0.30.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/SharpCompress.dll", + "lib/net5.0/SharpCompress.dll", + "lib/netcoreapp3.1/SharpCompress.dll", + "lib/netstandard2.0/SharpCompress.dll", + "lib/netstandard2.1/SharpCompress.dll", + "sharpcompress.0.30.1.nupkg.sha512", + "sharpcompress.nuspec" + ] + }, + "Snappier/1.0.0": { + "sha512": "rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "type": "package", + "path": "snappier/1.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "COPYING.txt", + "lib/net5.0/Snappier.dll", + "lib/net5.0/Snappier.xml", + "lib/netcoreapp3.0/Snappier.dll", + "lib/netcoreapp3.0/Snappier.xml", + "lib/netstandard2.0/Snappier.dll", + "lib/netstandard2.0/Snappier.xml", + "lib/netstandard2.1/Snappier.dll", + "lib/netstandard2.1/Snappier.xml", + "snappier.1.0.0.nupkg.sha512", + "snappier.nuspec" + ] + }, + "System.Buffers/4.5.1": { + "sha512": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "type": "package", + "path": "system.buffers/4.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Buffers.dll", + "lib/net461/System.Buffers.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.1/System.Buffers.dll", + "lib/netstandard1.1/System.Buffers.xml", + "lib/netstandard2.0/System.Buffers.dll", + "lib/netstandard2.0/System.Buffers.xml", + "lib/uap10.0.16299/_._", + "ref/net45/System.Buffers.dll", + "ref/net45/System.Buffers.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.1/System.Buffers.dll", + "ref/netstandard1.1/System.Buffers.xml", + "ref/netstandard2.0/System.Buffers.dll", + "ref/netstandard2.0/System.Buffers.xml", + "ref/uap10.0.16299/_._", + "system.buffers.4.5.1.nupkg.sha512", + "system.buffers.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Collections.Immutable/7.0.0": { + "sha512": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "type": "package", + "path": "system.collections.immutable/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "README.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Collections.Immutable.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Collections.Immutable.targets", + "lib/net462/System.Collections.Immutable.dll", + "lib/net462/System.Collections.Immutable.xml", + "lib/net6.0/System.Collections.Immutable.dll", + "lib/net6.0/System.Collections.Immutable.xml", + "lib/net7.0/System.Collections.Immutable.dll", + "lib/net7.0/System.Collections.Immutable.xml", + "lib/netstandard2.0/System.Collections.Immutable.dll", + "lib/netstandard2.0/System.Collections.Immutable.xml", + "system.collections.immutable.7.0.0.nupkg.sha512", + "system.collections.immutable.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Memory/4.5.5": { + "sha512": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "type": "package", + "path": "system.memory/4.5.5", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Memory.dll", + "lib/net461/System.Memory.xml", + "lib/netcoreapp2.1/_._", + "lib/netstandard1.1/System.Memory.dll", + "lib/netstandard1.1/System.Memory.xml", + "lib/netstandard2.0/System.Memory.dll", + "lib/netstandard2.0/System.Memory.xml", + "ref/netcoreapp2.1/_._", + "system.memory.4.5.5.nupkg.sha512", + "system.memory.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "sha512": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "type": "package", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net45/System.Runtime.CompilerServices.Unsafe.dll", + "lib/net45/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/net461/System.Runtime.CompilerServices.Unsafe.dll", + "ref/net461/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.xml", + "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", + "system.runtime.compilerservices.unsafe.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.AccessControl/5.0.0": { + "sha512": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "type": "package", + "path": "system.security.accesscontrol/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.xml", + "lib/netstandard1.3/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.xml", + "ref/netstandard1.3/System.Security.AccessControl.dll", + "ref/netstandard1.3/System.Security.AccessControl.xml", + "ref/netstandard1.3/de/System.Security.AccessControl.xml", + "ref/netstandard1.3/es/System.Security.AccessControl.xml", + "ref/netstandard1.3/fr/System.Security.AccessControl.xml", + "ref/netstandard1.3/it/System.Security.AccessControl.xml", + "ref/netstandard1.3/ja/System.Security.AccessControl.xml", + "ref/netstandard1.3/ko/System.Security.AccessControl.xml", + "ref/netstandard1.3/ru/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hans/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hant/System.Security.AccessControl.xml", + "ref/netstandard2.0/System.Security.AccessControl.dll", + "ref/netstandard2.0/System.Security.AccessControl.xml", + "ref/uap10.0.16299/_._", + "runtimes/win/lib/net46/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.xml", + "runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.accesscontrol.5.0.0.nupkg.sha512", + "system.security.accesscontrol.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Principal.Windows/5.0.0": { + "sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "type": "package", + "path": "system.security.principal.windows/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.xml", + "lib/netstandard1.3/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.xml", + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll", + "ref/netcoreapp3.0/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/System.Security.Principal.Windows.dll", + "ref/netstandard1.3/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/de/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/es/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/fr/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/it/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ja/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ko/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ru/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml", + "ref/netstandard2.0/System.Security.Principal.Windows.dll", + "ref/netstandard2.0/System.Security.Principal.Windows.xml", + "ref/uap10.0.16299/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/net46/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.principal.windows.5.0.0.nupkg.sha512", + "system.security.principal.windows.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "ZstdSharp.Port/0.7.3": { + "sha512": "U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "type": "package", + "path": "zstdsharp.port/0.7.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/ZstdSharp.dll", + "lib/net5.0/ZstdSharp.dll", + "lib/net6.0/ZstdSharp.dll", + "lib/net7.0/ZstdSharp.dll", + "lib/netcoreapp3.1/ZstdSharp.dll", + "lib/netstandard2.0/ZstdSharp.dll", + "lib/netstandard2.1/ZstdSharp.dll", + "zstdsharp.port.0.7.3.nupkg.sha512", + "zstdsharp.port.nuspec" + ] + } + }, + "projectFileDependencyGroups": { + "net9.0": [ + "Fantasy-Net.Config >= 2024.1.4", + "Fantasy-Net.ConfigTable >= 2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable >= 2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol >= 2024.2.24", + "Microsoft.IdentityModel.Tokens >= 8.7.0" + ] + }, + "packageFolders": { + "C:\\Users\\qq137\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "projectName": "APlugins", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net.Config": { + "target": "Package", + "version": "[2024.1.4, )" + }, + "Fantasy-Net.ConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol": { + "target": "Package", + "version": "[2024.2.24, )" + }, + "Microsoft.IdentityModel.Tokens": { + "target": "Package", + "version": "[8.7.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/project.nuget.cache b/GameServer/Server/APlugins/obj/project.nuget.cache new file mode 100644 index 00000000..761610ae --- /dev/null +++ b/GameServer/Server/APlugins/obj/project.nuget.cache @@ -0,0 +1,37 @@ +{ + "version": 2, + "dgSpecHash": "W5My88bd6G0=", + "success": true, + "projectFilePath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "expectedPackageFiles": [ + "C:\\Users\\qq137\\.nuget\\packages\\commandlineparser\\2.9.1\\commandlineparser.2.9.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\dnsclient\\1.6.1\\dnsclient.1.6.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net\\2024.2.22\\fantasy-net.2024.2.22.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.config\\2024.1.4\\fantasy-net.config.2024.1.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.configtable\\2024.2.0\\fantasy-net.configtable.2024.2.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.tools.exporterconfigtable\\2024.2.0\\fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.tools.exporternetworkprotocol\\2024.2.24\\fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\8.0.2\\microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\8.0.2\\microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.abstractions\\8.7.0\\microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.logging\\8.7.0\\microsoft.identitymodel.logging.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.tokens\\8.7.0\\microsoft.identitymodel.tokens.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\mongodb.bson\\3.1.0\\mongodb.bson.3.1.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\mongodb.driver\\3.1.0\\mongodb.driver.3.1.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\newtonsoft.json\\13.0.3\\newtonsoft.json.13.0.3.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\protobuf-net\\3.2.45\\protobuf-net.3.2.45.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\protobuf-net.core\\3.2.45\\protobuf-net.core.3.2.45.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\sharpcompress\\0.30.1\\sharpcompress.0.30.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\snappier\\1.0.0\\snappier.1.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.collections.immutable\\7.0.0\\system.collections.immutable.7.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/project.packagespec.json b/GameServer/Server/APlugins/obj/project.packagespec.json new file mode 100644 index 00000000..b232294a --- /dev/null +++ b/GameServer/Server/APlugins/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj","projectName":"APlugins","projectPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj","outputPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\obj\\","projectStyle":"PackageReference","fallbackFolders":["C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"],"originalTargetFrameworks":["net9.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"targetAlias":"net9.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.200"}"frameworks":{"net9.0":{"targetAlias":"net9.0","dependencies":{"Fantasy-Net.Config":{"target":"Package","version":"[2024.1.4, )"},"Fantasy-Net.ConfigTable":{"target":"Package","version":"[2024.2.0, )"},"Fantasy-Net.Tools.ExporterConfigTable":{"target":"Package","version":"[2024.2.0, )"},"Fantasy-Net.Tools.ExporterNetworkProtocol":{"target":"Package","version":"[2024.2.24, )"},"Microsoft.IdentityModel.Tokens":{"target":"Package","version":"[8.7.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/rider.project.model.nuget.info b/GameServer/Server/APlugins/obj/rider.project.model.nuget.info new file mode 100644 index 00000000..9b22325a --- /dev/null +++ b/GameServer/Server/APlugins/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17446243488696810 \ No newline at end of file diff --git a/GameServer/Server/APlugins/obj/rider.project.restore.info b/GameServer/Server/APlugins/obj/rider.project.restore.info new file mode 100644 index 00000000..9b22325a --- /dev/null +++ b/GameServer/Server/APlugins/obj/rider.project.restore.info @@ -0,0 +1 @@ +17446243488696810 \ No newline at end of file diff --git a/GameServer/Server/Entity/AssemblyHelper.cs b/GameServer/Server/Entity/AssemblyHelper.cs new file mode 100644 index 00000000..cac01c5d --- /dev/null +++ b/GameServer/Server/Entity/AssemblyHelper.cs @@ -0,0 +1,41 @@ +using System.Reflection; +using System.Runtime.Loader; + +namespace Fantasy +{ + public static class AssemblyHelper + { + private const string HotfixDll = "Hotfix"; + private static AssemblyLoadContext? _assemblyLoadContext = null; + + public static System.Reflection.Assembly[] Assemblies + { + get + { + var assemblies = new System.Reflection.Assembly[2]; + assemblies[0] = LoadEntityAssembly(); + assemblies[1] = LoadHotfixAssembly(); + return assemblies; + } + } + + private static System.Reflection.Assembly LoadEntityAssembly() + { + return typeof(AssemblyHelper).Assembly; + } + + private static System.Reflection.Assembly LoadHotfixAssembly() + { + if (_assemblyLoadContext != null) + { + _assemblyLoadContext.Unload(); + System.GC.Collect(); + } + + _assemblyLoadContext = new AssemblyLoadContext(HotfixDll, true); + var dllBytes = File.ReadAllBytes(Path.Combine(Environment.CurrentDirectory, $"{HotfixDll}.dll")); + var pdbBytes = File.ReadAllBytes(Path.Combine(Environment.CurrentDirectory, $"{HotfixDll}.pdb")); + return _assemblyLoadContext.LoadFromStream(new MemoryStream(dllBytes), new MemoryStream(pdbBytes)); + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Common/GameErrorCode.cs b/GameServer/Server/Entity/Common/GameErrorCode.cs new file mode 100644 index 00000000..dc6ee5d5 --- /dev/null +++ b/GameServer/Server/Entity/Common/GameErrorCode.cs @@ -0,0 +1,34 @@ +using Fantasy.Async; + +public static class GameErrorCode +{ + public static uint Failed = 0; + public static uint Success = 1; // 成功 + public static uint UsernameOrPasswordCannotBeEmpty = 2; // 用户名不能为空 + public static uint PasswordIncorrect = 3; // 密码不正确 + public static uint UserAlreadyExists = 4; // 用户已存在 + public static uint UserNotFound = 5; // 用户不存在 + public static uint InvalidToken = 6; + public static uint UserNotFoundOrPasswordIsNotCorrect = 7; //用户名不存在 或者 密码 不正确 + public static uint UserAlreadyLogin = 8; // 用户已登录 + + // 无效的身份验证令牌 + public static uint AccessDenied = 10; // 访问被拒绝 + public static uint ServerError = 11; // 服务器内部错误 + public static uint InvalidInput = 12; // 输入不合法 + public static uint TooManyRequests = 13; // 请求过多(防止刷接口) + public static uint UnauthorizedServer = 14; // 用户不属于该鉴权服务器 + + + // Token验证状态码 + public static uint GateTokenValidSuccess = 20; // Gate Token有效 + public static uint GateTokenExpired = 21; //Gate Token已过期 + public static uint GateTokenInvalidSignature = 22; //Gate Token签名无效 + public static uint GateTokenGeneralError = 23; // Gate Token验证一般错误 + public static uint GateTokenValidFailed = 24; // Gate Token校验失败 无效 + public static uint GateLoginSuccess = 25; + public static uint GateRepeatedLogin = 26; //多次重复登录请求 + + public static uint GateUpdateGameNameSuccess = 27; // 修改用户名称成功 + public static uint GateUpdateGameNameFailed = 28; // 修改用户名称失败 +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Entity.csproj b/GameServer/Server/Entity/Entity.csproj new file mode 100644 index 00000000..8530f36e --- /dev/null +++ b/GameServer/Server/Entity/Entity.csproj @@ -0,0 +1,19 @@ + + + + net9.0 + enable + enable + + + + + + + + + + + + + diff --git a/GameServer/Server/Entity/Enum/Commom/ELockType.cs b/GameServer/Server/Entity/Enum/Commom/ELockType.cs new file mode 100644 index 00000000..f487e9d8 --- /dev/null +++ b/GameServer/Server/Entity/Enum/Commom/ELockType.cs @@ -0,0 +1,10 @@ + + +public enum ELockType +{ + AuthenticationRegister = 1 , + AuthenticationLogin = 2, + + GateGetGameAccount = 3, + GateLoadGameAccount = 5, +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Generate/ConfigTable/Entity/UnitConfig.cs b/GameServer/Server/Entity/Generate/ConfigTable/Entity/UnitConfig.cs new file mode 100644 index 00000000..c0f11d93 --- /dev/null +++ b/GameServer/Server/Entity/Generate/ConfigTable/Entity/UnitConfig.cs @@ -0,0 +1,99 @@ +using System; +using ProtoBuf; +using Fantasy; +using System.Linq; +using System.Reflection; +using System.Collections.Generic; +using System.Collections.Concurrent; +using Fantasy.ConfigTable; +using Fantasy.Serialize; +// ReSharper disable CollectionNeverUpdated.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#pragma warning disable CS0169 +#pragma warning disable CS8618 +#pragma warning disable CS8625 +#pragma warning disable CS8603 + +namespace Fantasy +{ + [ProtoContract] + public sealed partial class UnitConfigData : ASerialize, IConfigTable, IProto + { + [ProtoMember(1)] + public List List { get; set; } = new List(); +#if FANTASY_NET + [ProtoIgnore] + private readonly ConcurrentDictionary _configs = new ConcurrentDictionary(); +#else + [ProtoIgnore] + private readonly Dictionary _configs = new Dictionary(); +#endif + private static UnitConfigData _instance = null; + + public static UnitConfigData Instance + { + get { return _instance ??= ConfigTableHelper.Load(); } + private set => _instance = value; + } + + public UnitConfig Get(uint id, bool check = true) + { + if (_configs.ContainsKey(id)) + { + return _configs[id]; + } + + if (check) + { + throw new Exception($"UnitConfig not find {id} Id"); + } + + return null; + } + public bool TryGet(uint id, out UnitConfig config) + { + config = null; + + if (!_configs.ContainsKey(id)) + { + return false; + } + + config = _configs[id]; + return true; + } + public override void AfterDeserialization() + { + foreach (var config in List) + { +#if FANTASY_NET + _configs.TryAdd(config.Id, config); +#else + _configs.Add(config.Id, config); +#endif + config.AfterDeserialization(); + } + + EndInit(); + } + + public override void Dispose() + { + Instance = null; + } + } + + [ProtoContract] + public sealed partial class UnitConfig : ASerialize, IProto + { + [ProtoMember(1)] + public uint Id { get; set; } // Id + [ProtoMember(2)] + public string Name { get; set; } // 名称 + [ProtoMember(3)] + public string Model { get; set; } // 数据库类型 + [ProtoMember(4)] + public StringDictionaryConfig Dic { get; set; } // 字典类型 + } +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Generate/CustomExport/SceneType.cs b/GameServer/Server/Entity/Generate/CustomExport/SceneType.cs new file mode 100644 index 00000000..de34ed92 --- /dev/null +++ b/GameServer/Server/Entity/Generate/CustomExport/SceneType.cs @@ -0,0 +1,27 @@ +namespace Fantasy +{ + // 生成器自动生成,请不要手动编辑。 + public static class SceneType + { + public const int Authentication = 1; + public const int Addressable = 2; + public const int Gate = 3; + public const int Map = 4; + public const int CopyDispatcher = 5; + public const int CopyManager = 6; + public const int Copy = 7; + public const int Chat = 8; + + public static readonly Dictionary SceneTypeDic = new Dictionary() + { + { "Authentication", 1 }, + { "Addressable", 2 }, + { "Gate", 3 }, + { "Map", 4 }, + { "CopyDispatcher", 5 }, + { "CopyManager", 6 }, + { "Copy", 7 }, + { "Chat", 8 }, + }; + } +} diff --git a/GameServer/Server/Entity/Generate/NetworkProtocol/InnerMessage.cs b/GameServer/Server/Entity/Generate/NetworkProtocol/InnerMessage.cs new file mode 100644 index 00000000..5214065c --- /dev/null +++ b/GameServer/Server/Entity/Generate/NetworkProtocol/InnerMessage.cs @@ -0,0 +1,408 @@ +using ProtoBuf; + +using System.Collections.Generic; +using MongoDB.Bson.Serialization.Attributes; +using Fantasy; +using Fantasy.Network.Interface; +using Fantasy.Serialize; +// ReSharper disable InconsistentNaming +// ReSharper disable RedundantUsingDirective +// ReSharper disable RedundantOverriddenMember +// ReSharper disable PartialTypeWithSinglePart +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable CheckNamespace +#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. +#pragma warning disable CS8618 + +namespace Fantasy +{ + [ProtoContract] + public partial class G2Chat_LoginRequest : AMessage, IRouteRequest, IProto + { + public static G2Chat_LoginRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + GameName = default; + AccountId = default; + GateRoutedId = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public Chat2G_LoginResponse ResponseType { get; set; } + public uint OpCode() { return InnerOpcode.G2Chat_LoginRequest; } + [ProtoMember(1)] + public string GameName { get; set; } + [ProtoMember(2)] + public long AccountId { get; set; } + [ProtoMember(3)] + public long GateRoutedId { get; set; } + } + [ProtoContract] + public partial class Chat2G_LoginResponse : AMessage, IRouteResponse, IProto + { + public static Chat2G_LoginResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + ChatRouteId = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.Chat2G_LoginResponse; } + [ProtoMember(1)] + public long ChatRouteId { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class G2Chat_OfflineRequest : AMessage, IRouteRequest, IProto + { + public static G2Chat_OfflineRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public Chat2G_OfflineResponse ResponseType { get; set; } + public uint OpCode() { return InnerOpcode.G2Chat_OfflineRequest; } + } + [ProtoContract] + public partial class Chat2G_OfflineResponse : AMessage, IRouteResponse, IProto + { + public static Chat2G_OfflineResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.Chat2G_OfflineResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class Chat2G_BoardMessage : AMessage, IRouteMessage, IProto + { + public static Chat2G_BoardMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Message = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.Chat2G_BoardMessage; } + [ProtoMember(1)] + public string Message { get; set; } + } + [ProtoContract] + public partial class G2A_TestMessage : AMessage, IRouteMessage, IProto + { + public static G2A_TestMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.G2A_TestMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class G2A_TestRequest : AMessage, IRouteRequest, IProto + { + public static G2A_TestRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2A_TestResponse ResponseType { get; set; } + public uint OpCode() { return InnerOpcode.G2A_TestRequest; } + } + [ProtoContract] + public partial class G2A_TestResponse : AMessage, IRouteResponse, IProto + { + public static G2A_TestResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.G2A_TestResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class G2M_RequestAddressableId : AMessage, IRouteRequest, IProto + { + public static G2M_RequestAddressableId Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public M2G_ResponseAddressableId ResponseType { get; set; } + public uint OpCode() { return InnerOpcode.G2M_RequestAddressableId; } + } + [ProtoContract] + public partial class M2G_ResponseAddressableId : AMessage, IRouteResponse, IProto + { + public static M2G_ResponseAddressableId Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + AddressableId = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.M2G_ResponseAddressableId; } + [ProtoMember(1)] + public long AddressableId { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + /// + /// 通知Chat服务器创建一个RouteId + /// + [ProtoContract] + public partial class G2Chat_CreateRouteRequest : AMessage, IRouteRequest, IProto + { + public static G2Chat_CreateRouteRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + GateRouteId = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public Chat2G_CreateRouteResponse ResponseType { get; set; } + public uint OpCode() { return InnerOpcode.G2Chat_CreateRouteRequest; } + [ProtoMember(1)] + public long GateRouteId { get; set; } + } + [ProtoContract] + public partial class Chat2G_CreateRouteResponse : AMessage, IRouteResponse, IProto + { + public static Chat2G_CreateRouteResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + ChatRouteId = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.Chat2G_CreateRouteResponse; } + [ProtoMember(1)] + public long ChatRouteId { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + /// + /// Map给另外一个Map发送Unit数据 + /// + public partial class M2M_SendUnitRequest : AMessage, IRouteRequest + { + public static M2M_SendUnitRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [BsonIgnore] + public M2M_SendUnitResponse ResponseType { get; set; } + public uint OpCode() { return InnerOpcode.M2M_SendUnitRequest; } + } + public partial class M2M_SendUnitResponse : AMessage, IRouteResponse + { + public static M2M_SendUnitResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.M2M_SendUnitResponse; } + public uint ErrorCode { get; set; } + } + /// + /// Gate发送Addressable消息给MAP + /// + [ProtoContract] + public partial class G2M_SendAddressableMessage : AMessage, IAddressableRouteMessage, IProto + { + public static G2M_SendAddressableMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.G2M_SendAddressableMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class G2M_CreateSubSceneRequest : AMessage, IRouteRequest, IProto + { + public static G2M_CreateSubSceneRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public M2G_CreateSubSceneResponse ResponseType { get; set; } + public uint OpCode() { return InnerOpcode.G2M_CreateSubSceneRequest; } + } + [ProtoContract] + public partial class M2G_CreateSubSceneResponse : AMessage, IRouteResponse, IProto + { + public static M2G_CreateSubSceneResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + SubSceneRouteId = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.M2G_CreateSubSceneResponse; } + [ProtoMember(1)] + public long SubSceneRouteId { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class G2SubScene_SentMessage : AMessage, IRouteMessage, IProto + { + public static G2SubScene_SentMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.G2SubScene_SentMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } + /// + /// Gate通知SubScene创建一个Addressable消息 + /// + [ProtoContract] + public partial class G2SubScene_AddressableIdRequest : AMessage, IRouteRequest, IProto + { + public static G2SubScene_AddressableIdRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public SubScene2G_AddressableIdResponse ResponseType { get; set; } + public uint OpCode() { return InnerOpcode.G2SubScene_AddressableIdRequest; } + } + [ProtoContract] + public partial class SubScene2G_AddressableIdResponse : AMessage, IRouteResponse, IProto + { + public static SubScene2G_AddressableIdResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + AddressableId = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return InnerOpcode.SubScene2G_AddressableIdResponse; } + [ProtoMember(1)] + public long AddressableId { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } +} diff --git a/GameServer/Server/Entity/Generate/NetworkProtocol/InnerOpcode.cs b/GameServer/Server/Entity/Generate/NetworkProtocol/InnerOpcode.cs new file mode 100644 index 00000000..1abaea6a --- /dev/null +++ b/GameServer/Server/Entity/Generate/NetworkProtocol/InnerOpcode.cs @@ -0,0 +1,26 @@ +namespace Fantasy +{ + public static partial class InnerOpcode + { + public const uint G2Chat_LoginRequest = 1073751825; + public const uint Chat2G_LoginResponse = 1207969553; + public const uint G2Chat_OfflineRequest = 1073751826; + public const uint Chat2G_OfflineResponse = 1207969554; + public const uint Chat2G_BoardMessage = 939534097; + public const uint G2A_TestMessage = 939534098; + public const uint G2A_TestRequest = 1073751827; + public const uint G2A_TestResponse = 1207969555; + public const uint G2M_RequestAddressableId = 1073751828; + public const uint M2G_ResponseAddressableId = 1207969556; + public const uint G2Chat_CreateRouteRequest = 1073751829; + public const uint Chat2G_CreateRouteResponse = 1207969557; + public const uint M2M_SendUnitRequest = 1082140438; + public const uint M2M_SendUnitResponse = 1216358166; + public const uint G2M_SendAddressableMessage = 1744840465; + public const uint G2M_CreateSubSceneRequest = 1073751831; + public const uint M2G_CreateSubSceneResponse = 1207969559; + public const uint G2SubScene_SentMessage = 939534099; + public const uint G2SubScene_AddressableIdRequest = 1073751832; + public const uint SubScene2G_AddressableIdResponse = 1207969560; + } +} diff --git a/GameServer/Server/Entity/Generate/NetworkProtocol/OuterMessage.cs b/GameServer/Server/Entity/Generate/NetworkProtocol/OuterMessage.cs new file mode 100644 index 00000000..b1533ed6 --- /dev/null +++ b/GameServer/Server/Entity/Generate/NetworkProtocol/OuterMessage.cs @@ -0,0 +1,912 @@ +using ProtoBuf; + +using System.Collections.Generic; +using MongoDB.Bson.Serialization.Attributes; +using Fantasy; +using Fantasy.Network.Interface; +using Fantasy.Serialize; +// ReSharper disable InconsistentNaming +// ReSharper disable RedundantUsingDirective +// ReSharper disable RedundantOverriddenMember +// ReSharper disable PartialTypeWithSinglePart +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable CheckNamespace +#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. +#pragma warning disable CS8618 + +namespace Fantasy +{ + [ProtoContract] + public partial class C2A_RegisterRequest : AMessage, IRequest, IProto + { + public static C2A_RegisterRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Username = default; + Password = default; + Source = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public A2C_RegisterResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2A_RegisterRequest; } + [ProtoMember(1)] + public string Username { get; set; } + [ProtoMember(2)] + public string Password { get; set; } + [ProtoMember(3)] + public string Source { get; set; } + } + [ProtoContract] + public partial class A2C_RegisterResponse : AMessage, IResponse, IProto + { + public static A2C_RegisterResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.A2C_RegisterResponse; } + [ProtoMember(1)] + public string Tag { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class C2A_LoginRequest : AMessage, IRequest, IProto + { + public static C2A_LoginRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Username = default; + Password = default; + Source = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public A2C_LoginResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2A_LoginRequest; } + [ProtoMember(1)] + public string Username { get; set; } + [ProtoMember(2)] + public string Password { get; set; } + [ProtoMember(3)] + public string Source { get; set; } + } + [ProtoContract] + public partial class A2C_LoginResponse : AMessage, IResponse, IProto + { + public static A2C_LoginResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Token = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.A2C_LoginResponse; } + [ProtoMember(1)] + public string Token { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class C2G_LoginRequest : AMessage, IRequest, IProto + { + public static C2G_LoginRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Token = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_LoginResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_LoginRequest; } + [ProtoMember(1)] + public string Token { get; set; } + } + [ProtoContract] + public partial class G2C_LoginResponse : AMessage, IResponse, IProto + { + public static G2C_LoginResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Tag = default; + GameAccount = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_LoginResponse; } + [ProtoMember(1)] + public string Tag { get; set; } + [ProtoMember(2)] + public GameAccountInfo GameAccount { get; set; } + [ProtoMember(3)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class G2C_LoginRepeatedMessage : AMessage, IMessage, IProto + { + public static G2C_LoginRepeatedMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_LoginRepeatedMessage; } + } + [ProtoContract] + public partial class C2G_GetGameAccountInfo : AMessage, IRequest, IProto + { + public static C2G_GetGameAccountInfo Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + AccountId = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_GetGameAccountInfo ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_GetGameAccountInfo; } + [ProtoMember(1)] + public long AccountId { get; set; } + } + [ProtoContract] + public partial class G2C_GetGameAccountInfo : AMessage, IResponse, IProto + { + public static G2C_GetGameAccountInfo Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + AccountInfo = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_GetGameAccountInfo; } + [ProtoMember(1)] + public GameAccountInfo AccountInfo { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class GameAccountInfo : AMessage, IProto + { + public static GameAccountInfo Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + CreateTime = default; + LoginTime = default; + GameName = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoMember(1)] + public long CreateTime { get; set; } + [ProtoMember(2)] + public long LoginTime { get; set; } + [ProtoMember(3)] + public string GameName { get; set; } + } + [ProtoContract] + public partial class G2C_OpenGameNameInputWindowsMessage : AMessage, IMessage, IProto + { + public static G2C_OpenGameNameInputWindowsMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_OpenGameNameInputWindowsMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class C2G_UpdateAndSaveGameNameRequest : AMessage, IRequest, IProto + { + public static C2G_UpdateAndSaveGameNameRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + AccountId = default; + GameName = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_UpdateAndSaveGameNameResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_UpdateAndSaveGameNameRequest; } + [ProtoMember(1)] + public long AccountId { get; set; } + [ProtoMember(2)] + public string GameName { get; set; } + } + [ProtoContract] + public partial class G2C_UpdateAndSaveGameNameResponse : AMessage, IResponse, IProto + { + public static G2C_UpdateAndSaveGameNameResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_UpdateAndSaveGameNameResponse; } + [ProtoMember(1)] + public string Tag { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class C2Chat_BoardMessageRequest : AMessage, ICustomRouteRequest, IProto + { + public static C2Chat_BoardMessageRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Message = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public Chat2C_BoardMessageResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2Chat_BoardMessageRequest; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.ChatRoute; + [ProtoMember(1)] + public string Message { get; set; } + } + [ProtoContract] + public partial class Chat2C_BoardMessageResponse : AMessage, ICustomRouteResponse, IProto + { + public static Chat2C_BoardMessageResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.Chat2C_BoardMessageResponse; } + /// + /// string Message = 2; + /// + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class Chat2C_BoardMessage : AMessage, ICustomRouteMessage, IProto + { + public static Chat2C_BoardMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Message = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.Chat2C_BoardMessage; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.ChatRoute; + [ProtoMember(1)] + public string Message { get; set; } + } + [ProtoContract] + public partial class C2Chat_TestRequest : AMessage, ICustomRouteRequest, IProto + { + public static C2Chat_TestRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public Chat2C_TestResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2Chat_TestRequest; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.ChatRoute; + } + [ProtoContract] + public partial class Chat2C_TestResponse : AMessage, ICustomRouteResponse, IProto + { + public static Chat2C_TestResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.Chat2C_TestResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class C2G_TestMessage : AMessage, IMessage, IProto + { + public static C2G_TestMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2G_TestMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class C2G_TestRequest : AMessage, IRequest, IProto + { + public static C2G_TestRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_TestResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_TestRequest; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class G2C_TestResponse : AMessage, IResponse, IProto + { + public static G2C_TestResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_TestResponse; } + [ProtoMember(1)] + public string Tag { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class C2G_TestRequestPushMessage : AMessage, IMessage, IProto + { + public static C2G_TestRequestPushMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2G_TestRequestPushMessage; } + } + /// + /// Gate服务器推送一个消息给客户端 + /// + [ProtoContract] + public partial class G2C_PushMessage : AMessage, IMessage, IProto + { + public static G2C_PushMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_PushMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class C2G_CreateAddressableRequest : AMessage, IRequest, IProto + { + public static C2G_CreateAddressableRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_CreateAddressableResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_CreateAddressableRequest; } + } + [ProtoContract] + public partial class G2C_CreateAddressableResponse : AMessage, IResponse, IProto + { + public static G2C_CreateAddressableResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_CreateAddressableResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + [ProtoContract] + public partial class C2M_TestMessage : AMessage, IAddressableRouteMessage, IProto + { + public static C2M_TestMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2M_TestMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class C2M_TestRequest : AMessage, IAddressableRouteRequest, IProto + { + public static C2M_TestRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public M2C_TestResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2M_TestRequest; } + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class M2C_TestResponse : AMessage, IAddressableRouteResponse, IProto + { + public static M2C_TestResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.M2C_TestResponse; } + [ProtoMember(1)] + public string Tag { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + /// + /// 通知Gate服务器创建一个Chat的Route连接 + /// + [ProtoContract] + public partial class C2G_CreateChatRouteRequest : AMessage, IRequest, IProto + { + public static C2G_CreateChatRouteRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_CreateChatRouteResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_CreateChatRouteRequest; } + } + [ProtoContract] + public partial class G2C_CreateChatRouteResponse : AMessage, IResponse, IProto + { + public static G2C_CreateChatRouteResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_CreateChatRouteResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 发送一个Route消息给Chat + /// + [ProtoContract] + public partial class C2Chat_TestMessage : AMessage, ICustomRouteMessage, IProto + { + public static C2Chat_TestMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2Chat_TestMessage; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.ChatRoute; + [ProtoMember(1)] + public string Tag { get; set; } + } + /// + /// 发送一个RPCRoute消息给Chat + /// + [ProtoContract] + public partial class C2Chat_TestMessageRequest : AMessage, ICustomRouteRequest, IProto + { + public static C2Chat_TestMessageRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public Chat2C_TestMessageResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2Chat_TestMessageRequest; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.ChatRoute; + [ProtoMember(1)] + public string Tag { get; set; } + } + [ProtoContract] + public partial class Chat2C_TestMessageResponse : AMessage, ICustomRouteResponse, IProto + { + public static Chat2C_TestMessageResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.Chat2C_TestMessageResponse; } + [ProtoMember(1)] + public string Tag { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + /// + /// 发送一个RPC消息给Map,让Map里的Entity转移到另外一个Map上 + /// + [ProtoContract] + public partial class C2M_MoveToMapRequest : AMessage, IAddressableRouteRequest, IProto + { + public static C2M_MoveToMapRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public M2C_MoveToMapResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2M_MoveToMapRequest; } + } + [ProtoContract] + public partial class M2C_MoveToMapResponse : AMessage, IAddressableRouteResponse, IProto + { + public static M2C_MoveToMapResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.M2C_MoveToMapResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 发送一个消息给Gate,让Gate发送一个Addressable消息给MAP + /// + [ProtoContract] + public partial class C2G_SendAddressableToMap : AMessage, IMessage, IProto + { + public static C2G_SendAddressableToMap Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2G_SendAddressableToMap; } + [ProtoMember(1)] + public string Tag { get; set; } + } + /// + /// 发送一个消息给Chat,让Chat服务器主动推送一个RouteMessage消息给客户端 + /// + [ProtoContract] + public partial class C2Chat_TestRequestPushMessage : AMessage, ICustomRouteMessage, IProto + { + public static C2Chat_TestRequestPushMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2Chat_TestRequestPushMessage; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.ChatRoute; + } + /// + /// Chat服务器主动推送一个消息给客户端 + /// + [ProtoContract] + public partial class Chat2C_PushMessage : AMessage, ICustomRouteMessage, IProto + { + public static Chat2C_PushMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.Chat2C_PushMessage; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.ChatRoute; + [ProtoMember(1)] + public string Tag { get; set; } + } + /// + /// 客户端发送给Gate服务器通知map服务器创建一个SubScene + /// + [ProtoContract] + public partial class C2G_CreateSubSceneRequest : AMessage, IRequest, IProto + { + public static C2G_CreateSubSceneRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_CreateSubSceneResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_CreateSubSceneRequest; } + } + [ProtoContract] + public partial class G2C_CreateSubSceneResponse : AMessage, IResponse, IProto + { + public static G2C_CreateSubSceneResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_CreateSubSceneResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 客户端通知Gate服务器给SubScene发送一个消息 + /// + [ProtoContract] + public partial class C2G_SendToSubSceneMessage : AMessage, IMessage, IProto + { + public static C2G_SendToSubSceneMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2G_SendToSubSceneMessage; } + } + /// + /// 客户端通知Gate服务器创建一个SubScene的Address消息 + /// + [ProtoContract] + public partial class C2G_CreateSubSceneAddressableRequest : AMessage, IRequest, IProto + { + public static C2G_CreateSubSceneAddressableRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public G2C_CreateSubSceneAddressableResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2G_CreateSubSceneAddressableRequest; } + } + [ProtoContract] + public partial class G2C_CreateSubSceneAddressableResponse : AMessage, IResponse, IProto + { + public static G2C_CreateSubSceneAddressableResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.G2C_CreateSubSceneAddressableResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 客户端向SubScene发送一个测试消息 + /// + [ProtoContract] + public partial class C2SubScene_TestMessage : AMessage, IAddressableRouteMessage, IProto + { + public static C2SubScene_TestMessage Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Tag = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2SubScene_TestMessage; } + [ProtoMember(1)] + public string Tag { get; set; } + } +} diff --git a/GameServer/Server/Entity/Generate/NetworkProtocol/OuterOpcode.cs b/GameServer/Server/Entity/Generate/NetworkProtocol/OuterOpcode.cs new file mode 100644 index 00000000..f5b1c64b --- /dev/null +++ b/GameServer/Server/Entity/Generate/NetworkProtocol/OuterOpcode.cs @@ -0,0 +1,49 @@ +namespace Fantasy +{ + public static partial class OuterOpcode + { + public const uint C2A_RegisterRequest = 268445457; + public const uint A2C_RegisterResponse = 402663185; + public const uint C2A_LoginRequest = 268445458; + public const uint A2C_LoginResponse = 402663186; + public const uint C2G_LoginRequest = 268445459; + public const uint G2C_LoginResponse = 402663187; + public const uint G2C_LoginRepeatedMessage = 134227729; + public const uint C2G_GetGameAccountInfo = 268445460; + public const uint G2C_GetGameAccountInfo = 402663188; + public const uint G2C_OpenGameNameInputWindowsMessage = 134227730; + public const uint C2G_UpdateAndSaveGameNameRequest = 268445461; + public const uint G2C_UpdateAndSaveGameNameResponse = 402663189; + public const uint C2Chat_BoardMessageRequest = 2281711377; + public const uint Chat2C_BoardMessageResponse = 2415929105; + public const uint Chat2C_BoardMessage = 2147493649; + public const uint C2Chat_TestRequest = 2281711378; + public const uint Chat2C_TestResponse = 2415929106; + public const uint C2G_TestMessage = 134227731; + public const uint C2G_TestRequest = 268445462; + public const uint G2C_TestResponse = 402663190; + public const uint C2G_TestRequestPushMessage = 134227732; + public const uint G2C_PushMessage = 134227733; + public const uint C2G_CreateAddressableRequest = 268445463; + public const uint G2C_CreateAddressableResponse = 402663191; + public const uint C2M_TestMessage = 1342187281; + public const uint C2M_TestRequest = 1476405009; + public const uint M2C_TestResponse = 1610622737; + public const uint C2G_CreateChatRouteRequest = 268445464; + public const uint G2C_CreateChatRouteResponse = 402663192; + public const uint C2Chat_TestMessage = 2147493650; + public const uint C2Chat_TestMessageRequest = 2281711379; + public const uint Chat2C_TestMessageResponse = 2415929107; + public const uint C2M_MoveToMapRequest = 1476405010; + public const uint M2C_MoveToMapResponse = 1610622738; + public const uint C2G_SendAddressableToMap = 134227734; + public const uint C2Chat_TestRequestPushMessage = 2147493651; + public const uint Chat2C_PushMessage = 2147493652; + public const uint C2G_CreateSubSceneRequest = 268445465; + public const uint G2C_CreateSubSceneResponse = 402663193; + public const uint C2G_SendToSubSceneMessage = 134227735; + public const uint C2G_CreateSubSceneAddressableRequest = 268445466; + public const uint G2C_CreateSubSceneAddressableResponse = 402663194; + public const uint C2SubScene_TestMessage = 1342187282; + } +} diff --git a/GameServer/Server/Entity/Generate/NetworkProtocol/RouteType.cs b/GameServer/Server/Entity/Generate/NetworkProtocol/RouteType.cs new file mode 100644 index 00000000..cdd0df00 --- /dev/null +++ b/GameServer/Server/Entity/Generate/NetworkProtocol/RouteType.cs @@ -0,0 +1,9 @@ +namespace Fantasy +{ + // Route协议定义(需要定义1000以上、因为1000以内的框架预留) + public static class RouteType + { + public const int GateRoute = 1001; // Gate + public const int ChatRoute = 1002; // Chat + } +} diff --git a/GameServer/Server/Entity/Model/Authentication/Account/Account.cs b/GameServer/Server/Entity/Model/Authentication/Account/Account.cs new file mode 100644 index 00000000..55d2cf5f --- /dev/null +++ b/GameServer/Server/Entity/Model/Authentication/Account/Account.cs @@ -0,0 +1,9 @@ +using Fantasy.Entitas; + +public class Account : Entity +{ + public string Username = string.Empty; + public string Password = string.Empty; + public long CreateTime; + public long LoginTime; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Authentication/Account/AccountCacheInfo.cs b/GameServer/Server/Entity/Model/Authentication/Account/AccountCacheInfo.cs new file mode 100644 index 00000000..fbb46fa3 --- /dev/null +++ b/GameServer/Server/Entity/Model/Authentication/Account/AccountCacheInfo.cs @@ -0,0 +1,8 @@ + + +using Fantasy.Entitas; + +public class AccountCacheInfo : Entity +{ + +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Authentication/AuthenticationComponent.cs b/GameServer/Server/Entity/Model/Authentication/AuthenticationComponent.cs new file mode 100644 index 00000000..c2873e09 --- /dev/null +++ b/GameServer/Server/Entity/Model/Authentication/AuthenticationComponent.cs @@ -0,0 +1,11 @@ + +public class AuthenticationComponent : Fantasy.Entitas.Entity +{ + public Dictionary RegisterAccounts = new Dictionary(); + public Dictionary LoginAccounts = new Dictionary(); + + + public int Position; + public int AuthenticationCount; + +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Authentication/JWT/AuthenticationJWTComponent.cs b/GameServer/Server/Entity/Model/Authentication/JWT/AuthenticationJWTComponent.cs new file mode 100644 index 00000000..be03307e --- /dev/null +++ b/GameServer/Server/Entity/Model/Authentication/JWT/AuthenticationJWTComponent.cs @@ -0,0 +1,54 @@ + + +using System.IdentityModel.Tokens.Jwt; +using Fantasy.Entitas; +using Microsoft.IdentityModel.Tokens; + +public class AuthenticationJWTComponent : Entity +{ + #region RSA2048 base64 公钥和私钥 + + public string PublicKey = "-----BEGIN PUBLIC KEY-----" + + "\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArLVBnJ4W3JY+miBIBE4J" + + "\nMKnRatQC7EgtUco+mzDzxSWKiBVe3SjNe7fp2EzoOfhG762nQG8wFjPOamqo+Qd5" + + "\nTToSR7q9B5/kivNzWyeYldAbV4LzT8fRkDmRhTA7/I2UCcRPhBD1Z9byY6ivLR0C" + + "\n3wxVsSF7tYR2/sQXvZKtsfT8myl0W0ts11/y278fCSdTPZR6i+zV1lnUiLRjAIhy" + + "\nOwgROiVUH0YUHX39DJ3D3m03e9n5xuvBFGr57w04d7fSef1OdeFLPwnTK5DxJ79N" + + "\nqJwhmVzNBKHI9tkd/Un6MKHdwdzDiWlLUPsXlhtFs84eMAGU+BaGVdjln2S/OOtm" + + "\nzQIDAQAB" + + "\n-----END PUBLIC KEY-----"; + public string PrivateKey = "-----BEGIN PRIVATE KEY-----" + "\n" + + "MIIEugIBADANBgkqhkiG9w0BAQEFAASCBKQwggSgAgEAAoIBAQCstUGcnhbclj6a\n" + + "IEgETgkwqdFq1ALsSC1Ryj6bMPPFJYqIFV7dKM17t+nYTOg5+EbvradAbzAWM85q\n" + + "aqj5B3lNOhJHur0Hn+SK83NbJ5iV0BtXgvNPx9GQOZGFMDv8jZQJxE+EEPVn1vJj\n" + + "qK8tHQLfDFWxIXu1hHb+xBe9kq2x9PybKXRbS2zXX/Lbvx8JJ1M9lHqL7NXWWdSI\n" + + "tGMAiHI7CBE6JVQfRhQdff0MncPebTd72fnG68EUavnvDTh3t9J5/U514Us/CdMr\n" + + "kPEnv02onCGZXM0Eocj22R39Sfowod3B3MOJaUtQ+xeWG0Wzzh4wAZT4FoZV2OWf\n" + + "ZL8462bNAgMBAAECggEAYss4og+owjxLyTyoFZZSGX065yIqHeFX006eq4XAHElS\n" + + "Sm/3GQnLKXdWFD5CJU8JvPcYEnrIBhtSe3tR90o4MF4EsPV4RlFHmdiTZ1RqK2Cl\n" + + "E1U8O6nxDdBwlsC1v815HnEmj0RoLSM++pU2x9atmsvihPXDX11L+IZRkkbCh2XL\n" + + "3BA32dl8hoTpFjAnPng3EJgwGiuXN0eDuv4Hckah9NJpiQ5/5hou+Vp2ajs90wDY\n" + + "K7KTh33B9Yf2wgkRizMGwWGDUIfUYtPlGPvfJ4/Wm81avBPbArc9DC/C3ryuSCJb\n" + + "pFAOChaVcpVwS3jCQmrtlmgnj9vx9FgC/jVtMS394QKBgQDqDKPfKw/WFRwiLRFh\n" + + "dN/azJQO3TnNAt4RXQYkJ9HMEF95k1Xu557w3VtRkcPFm6OKMJcGYCLeBJziECj0\n" + + "FV1wuLIWdbXXFCuxg94CKOUzAcmNkHpvWzp8zuCkjmhzDfCYByIJxZAeCaK4mBuT\n" + + "Xc1rIQCthYGZ/1nE+hqpgYac1QKBgQC859qbbCprR9nnunobJDJ0e2nkOfqfpR5d\n" + + "2aZEQLTtOsBQED6bfo+sgoxPmiuPsHxeTZXCsTAc5gqbYI/9lSzJgdALl/FZZQMM\n" + + "Oj/O3tiWREV+iPxuJ+jkwqXqU//jVKWK0TtgGMdyLAgDGXFgFVq8RKh8l6vuJT+a\n" + + "3RqksOC+GQKBgB5TvPgx8D9hRN/4zwO9zTPgxl6Ws+KouHWvhBgzQLAcfwKV4NCw\n" + + "GpxDUo3jQWbdn/dMDIW690mld16jkWrvSchNZmYaopFX/8FkwOOuwOQ3GxLI4dSE\n" + + "EbQSanFoMoiWCdLpObPicaYywW8B5rDVusRi5l+VqRF3UP6BGetU6UhxAoGANkmj\n" + + "R1s0bZQ+iRvMD5S9c0AsVExdPBflvC7aW28FD8/8iIXCmEks3PS/gfjaX/bmJuvB\n" + + "CCyHmSZ7EeAUQVnnfxlxQoOt9nTTBWaQA9GDCNwh5JVVhgquIV/W8pqlRR2EXXp3\n" + + "x8wXNTZ2Lv3W2TgJ1WUdzoCABnZp6wVzrLSwQbECf2TqyMJhOPTxysXSNi6S7d9G\n" + + "T2irqMhqQYtojVS2zswqAQoe0itJI0EhbBQPfI+3tmjU28QPOTADUkcyz6sMIa6x\n" + + "cgcKGrP5pseLkVTe/KwJ3dVDnS4Yvq2MG6bQISIh7GL9amJZOBREdwtidgRjT8ys\n" + + "S0NfjTIbhJu1o7cPlSw=\n" + + "-----END PRIVATE KEY-----"; + + #endregion + + public SigningCredentials JwtSigningCredentials; + + public JwtHeader JwtHeader; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Authentication/TimeOut/AccountInfoTimeOuterComponent.cs b/GameServer/Server/Entity/Model/Authentication/TimeOut/AccountInfoTimeOuterComponent.cs new file mode 100644 index 00000000..14d493b4 --- /dev/null +++ b/GameServer/Server/Entity/Model/Authentication/TimeOut/AccountInfoTimeOuterComponent.cs @@ -0,0 +1,9 @@ + + +using Fantasy.Entitas; + +public class AccountInfoTimeOuterComponent : Entity +{ + public long TimeId; + public string Key; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Authentication/TimeOut/AccountTimeOuterComponent.cs b/GameServer/Server/Entity/Model/Authentication/TimeOut/AccountTimeOuterComponent.cs new file mode 100644 index 00000000..b402ec50 --- /dev/null +++ b/GameServer/Server/Entity/Model/Authentication/TimeOut/AccountTimeOuterComponent.cs @@ -0,0 +1,9 @@ + + +using Fantasy.Entitas; + +public class AccountTimeOuterComponent : Entity +{ + public long TimeId; + public long UserCode; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Chat/ChatChannel/ChatChannel.cs b/GameServer/Server/Entity/Model/Chat/ChatChannel/ChatChannel.cs new file mode 100644 index 00000000..ba17bff1 --- /dev/null +++ b/GameServer/Server/Entity/Model/Chat/ChatChannel/ChatChannel.cs @@ -0,0 +1,8 @@ + + +using Fantasy.Entitas; + +public class ChatChannel : Entity +{ + public readonly HashSet ChatUnits = new HashSet(); +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Chat/ChatChannel/ChatChannelCenterComponent.cs b/GameServer/Server/Entity/Model/Chat/ChatChannel/ChatChannelCenterComponent.cs new file mode 100644 index 00000000..822ec506 --- /dev/null +++ b/GameServer/Server/Entity/Model/Chat/ChatChannel/ChatChannelCenterComponent.cs @@ -0,0 +1,8 @@ + + +using Fantasy.Entitas; + +public class ChatChannelCenterComponent : Entity +{ + public Dictionary ChatChannels = new Dictionary(); +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Chat/ChatManageComponent.cs b/GameServer/Server/Entity/Model/Chat/ChatManageComponent.cs new file mode 100644 index 00000000..b8142262 --- /dev/null +++ b/GameServer/Server/Entity/Model/Chat/ChatManageComponent.cs @@ -0,0 +1,8 @@ + + +using Fantasy.Entitas; + +public class ChatManageComponent : Entity +{ + public readonly Dictionary ChatUnits = new Dictionary(); +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Chat/ChatUnit.cs b/GameServer/Server/Entity/Model/Chat/ChatUnit.cs new file mode 100644 index 00000000..1c36879e --- /dev/null +++ b/GameServer/Server/Entity/Model/Chat/ChatUnit.cs @@ -0,0 +1,9 @@ + + +using Fantasy.Entitas; + +public class ChatUnit : Entity +{ + public string GameName; + public long AccountId; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Gate/GameAccount/GameAccount.cs b/GameServer/Server/Entity/Model/Gate/GameAccount/GameAccount.cs new file mode 100644 index 00000000..c8e4cd84 --- /dev/null +++ b/GameServer/Server/Entity/Model/Gate/GameAccount/GameAccount.cs @@ -0,0 +1,16 @@ +using Fantasy.Entitas; +using MongoDB.Bson.Serialization.Attributes; + +namespace Fantasy; + +public class GameAccount : Entity +{ + public long CreateTime; + public long LoginTime; + + public string GameName; + + [BsonIgnore]public long SessionRuntimeId; + + [BsonIgnore]public Dictionary Routes = new Dictionary(); +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Gate/GameAccount/GameAccountFlagComponent.cs b/GameServer/Server/Entity/Model/Gate/GameAccount/GameAccountFlagComponent.cs new file mode 100644 index 00000000..68ec0cf4 --- /dev/null +++ b/GameServer/Server/Entity/Model/Gate/GameAccount/GameAccountFlagComponent.cs @@ -0,0 +1,11 @@ +using Fantasy; +using Fantasy.Entitas; + +namespace Hotfix; + +public class GameAccountFlagComponent : Entity +{ + public long AccountId; + public long AccountRuntimeId; + public EntityReference Account; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Gate/GameAccount/GameAccountManageComponent.cs b/GameServer/Server/Entity/Model/Gate/GameAccount/GameAccountManageComponent.cs new file mode 100644 index 00000000..7f0fc5fe --- /dev/null +++ b/GameServer/Server/Entity/Model/Gate/GameAccount/GameAccountManageComponent.cs @@ -0,0 +1,8 @@ +using Fantasy.Entitas; + +namespace Fantasy; + +public class GameAccountManageComponent : Entity +{ + public Dictionary Accounts = new Dictionary(); +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Gate/GateComponent.cs b/GameServer/Server/Entity/Model/Gate/GateComponent.cs new file mode 100644 index 00000000..e3bc36e9 --- /dev/null +++ b/GameServer/Server/Entity/Model/Gate/GateComponent.cs @@ -0,0 +1,8 @@ +using Fantasy.Entitas; + +namespace Fantasy; + +public class GateComponent : Entity +{ + +} diff --git a/GameServer/Server/Entity/Model/Gate/JWT/GateJWTComponent.cs b/GameServer/Server/Entity/Model/Gate/JWT/GateJWTComponent.cs new file mode 100644 index 00000000..f3af28ea --- /dev/null +++ b/GameServer/Server/Entity/Model/Gate/JWT/GateJWTComponent.cs @@ -0,0 +1,20 @@ +using Fantasy.Entitas; +using Microsoft.IdentityModel.Tokens; + +namespace Fantasy; + +public class GateJWTComponent : Entity +{ + + public string PublicKey = "-----BEGIN PUBLIC KEY-----" + + "\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArLVBnJ4W3JY+miBIBE4J" + + "\nMKnRatQC7EgtUco+mzDzxSWKiBVe3SjNe7fp2EzoOfhG762nQG8wFjPOamqo+Qd5" + + "\nTToSR7q9B5/kivNzWyeYldAbV4LzT8fRkDmRhTA7/I2UCcRPhBD1Z9byY6ivLR0C" + + "\n3wxVsSF7tYR2/sQXvZKtsfT8myl0W0ts11/y278fCSdTPZR6i+zV1lnUiLRjAIhy" + + "\nOwgROiVUH0YUHX39DJ3D3m03e9n5xuvBFGr57w04d7fSef1OdeFLPwnTK5DxJ79N" + + "\nqJwhmVzNBKHI9tkd/Un6MKHdwdzDiWlLUPsXlhtFs84eMAGU+BaGVdjln2S/OOtm" + + "\nzQIDAQAB" + + "\n-----END PUBLIC KEY-----"; + + public TokenValidationParameters ValidationParameters; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Model/Session/EntityTimeOutComponent.cs b/GameServer/Server/Entity/Model/Session/EntityTimeOutComponent.cs new file mode 100644 index 00000000..4ef582fc --- /dev/null +++ b/GameServer/Server/Entity/Model/Session/EntityTimeOutComponent.cs @@ -0,0 +1,10 @@ + + +using Fantasy.Entitas; + +public class EntityTimeOutComponent : Entity +{ + public long Interval; + public long NextTime; + public long TimeId; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Custom.txt b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Custom.txt new file mode 100644 index 00000000..fd90a9bf --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Custom.txt @@ -0,0 +1 @@ +// 自定义导出配置文件,用于配置自定义导出自定义程序的路径 diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx new file mode 100644 index 00000000..999e9390 Binary files /dev/null and b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx differ diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx new file mode 100644 index 00000000..001235a8 Binary files /dev/null and b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx differ diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx new file mode 100644 index 00000000..a4ca05e3 Binary files /dev/null and b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx differ diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx new file mode 100644 index 00000000..8194c9a5 Binary files /dev/null and b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx differ diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Version.txt b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Version.txt new file mode 100644 index 00000000..1877ad88 --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Excel/Version.txt @@ -0,0 +1 @@ +{"WorksheetNames":["MachineConfig","ProcessConfig","WorldConfig","SceneConfig","SceneTypeConfig"],"Tables":{"MachineConfig":1725984682557,"SceneConfig":1726083372000,"WorldConfig":1724007858627,"ProcessConfig":1725195494442}} \ No newline at end of file diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json new file mode 100644 index 00000000..f56f98e9 --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"OuterIP":"127.0.0.1","OuterBindIP":"127.0.0.1","InnerBindIP":"127.0.0.1"} +]} diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json new file mode 100644 index 00000000..a05a13c8 --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"MachineId":1,"StartupGroup":0} +]} diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json new file mode 100644 index 00000000..44996e72 --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json @@ -0,0 +1,6 @@ +{"List":[ +{"Id":1001,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Addressable","NetworkProtocol":null,"OuterPort":0,"InnerPort":11001,"SceneType":2}, +{"Id":1002,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":20000,"InnerPort":11002,"SceneType":3}, +{"Id":1003,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11003,"SceneType":4}, +{"Id":1004,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Chat","NetworkProtocol":null,"OuterPort":0,"InnerPort":11004,"SceneType":8} +]} diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json new file mode 100644 index 00000000..60dd0908 --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"WorldName":"测试服","DbConnection":null,"DbName":"fantasy_main","DbType":"MongoDB"} +]} diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto new file mode 100644 index 00000000..a8b51b85 --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package Sining.Message; +message G2A_TestRequest // IRouteRequest,G2A_TestResponse +{ + +} +message G2A_TestResponse // IRouteResponse +{ + +} +message G2M_RequestAddressableId // IRouteRequest,M2G_ResponseAddressableId +{ + +} +message M2G_ResponseAddressableId // IRouteResponse +{ + int64 AddressableId = 1; // Map服务器返回的AddressableId +} +/// 通知Chat服务器创建一个RouteId +message G2Chat_CreateRouteRequest // IRouteRequest,Chat2G_CreateRouteResponse +{ + int64 GateRouteId = 1; +} +message Chat2G_CreateRouteResponse // IRouteResponse +{ + int64 ChatRouteId = 1; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto new file mode 100644 index 00000000..b036a74e --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package Fantasy.Network.Message; +// 协议分为: +// ProtoBuf:可以在Outer和Inner文件里使用。 +// MemoryPack:可以在Outer和Inner文件里使用。 +// Bson:仅支持在Inner文件里使用。 +// 使用方式: +// 在message协议上方添加// Protocol+空格+协议名字 +// 例如:// Protocol ProtoBuf 或 // Protocol MemoryPack +message C2G_TestMessage // IMessage +{ + string Tag = 1; +} +message C2G_TestRequest // IRequest,G2C_TestResponse +{ + string Tag = 1; +} +message G2C_TestResponse // IResponse +{ + string Tag = 1; +} +message C2G_CreateAddressableRequest // IRequest,G2C_CreateAddressableResponse +{ + +} +message G2C_CreateAddressableResponse // IResponse +{ + +} +message C2M_TestMessage // IAddressableRouteMessage +{ + string Tag = 1; +} +message C2M_TestRequest // IAddressableRouteRequest,M2C_TestResponse +{ + string Tag = 1; +} +message M2C_TestResponse // IAddressableRouteResponse +{ + string Tag = 1; +} +/// 通知Gate服务器创建一个Chat的Route连接 +message C2G_CreateChatRouteRequest // IRequest,G2C_CreateChatRouteResponse +{ + +} +message G2C_CreateChatRouteResponse // IResponse +{ + +} +/// 发送一个Route消息给Chat +message C2Chat_TestMessage // ICustomRouteMessage,ChatRoute +{ + string Tag = 1; +} +/// 发送一个RPCRoute消息给Chat +message C2Chat_TestMessageRequest // ICustomRouteRequest,Chat2C_TestMessageResponse,ChatRoute +{ + string Tag = 1; +} +message Chat2C_TestMessageResponse // ICustomRouteResponse +{ + string Tag = 1; +} \ No newline at end of file diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config new file mode 100644 index 00000000..66082cf9 --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config @@ -0,0 +1,3 @@ +// Route协议定义(需要定义1000以上、因为1000以内的框架预留) +GateRoute = 1001 // Gate +ChatRoute = 1002 // Chat \ No newline at end of file diff --git a/GameServer/Server/Entity/Tools/Exporter/ConfigTable/README.md b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/README.md new file mode 100644 index 00000000..697ec052 --- /dev/null +++ b/GameServer/Server/Entity/Tools/Exporter/ConfigTable/README.md @@ -0,0 +1,16 @@ +# Fantasy-Net.Config +在Config文件夹中,存放着Fantasy所需的各种配置文件。这些文件涵盖了多个方面。每个配置文件都有其特定的格式和功能,通过精心设计的这些配置文件,开发团队能够快速调整框架参数,以实现更好的游戏体验,从而提升Fantasy的整体质量。 +## Excel文件夹 +里面存放了Fantasy.Net所需的四个Excel配置文件。用户可以利用Fantasy-Net.Exporter工具,依据这四个Excel文件生成相应的JSON文件,以供框架使用。这一过程不仅简化了数据处理,还确保了不同组件之间的无缝对接,使得工作流程更加高效。请确保在导出之前,Excel文件的格式和内容符合要求,以避免产生错误。 +## Json文件夹 +在该目录中存放了Fantasy.Net所需的四个JSON配置文件。用户可以根据这四个文件的模板进行添加或修改配置,以满足具体需求。每个项目的功能说明在相应的Excel文件中有详细描述,方便用户理解和使用这些配置文件。我们建议用户仔细阅读Excel文件中的说明,以确保配置的正确性和有效性。 +## NetworkProtocol文件夹 +存放框架所需定义网络协议的模版和文件夹 +### Inner文件夹 +定义服务器之间的网络协议 +### Outer文件夹 +定义客户端和服务器之间的网络协议 +### RouteType.Config +定义自定义Route协议的配置文件 +## 交流与讨论: +__讨论QQ群 : Fantasy服务器开发交流群 569888673 __ \ No newline at end of file diff --git a/GameServer/Server/Entity/bin/Debug/net9.0/APlugins.dll b/GameServer/Server/Entity/bin/Debug/net9.0/APlugins.dll new file mode 100644 index 00000000..ed581911 Binary files /dev/null and b/GameServer/Server/Entity/bin/Debug/net9.0/APlugins.dll differ diff --git a/GameServer/Server/Entity/bin/Debug/net9.0/APlugins.pdb b/GameServer/Server/Entity/bin/Debug/net9.0/APlugins.pdb new file mode 100644 index 00000000..7e866004 Binary files /dev/null and b/GameServer/Server/Entity/bin/Debug/net9.0/APlugins.pdb differ diff --git a/GameServer/Server/Entity/bin/Debug/net9.0/Entity.deps.json b/GameServer/Server/Entity/bin/Debug/net9.0/Entity.deps.json new file mode 100644 index 00000000..e7103c82 --- /dev/null +++ b/GameServer/Server/Entity/bin/Debug/net9.0/Entity.deps.json @@ -0,0 +1,509 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Entity/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.7.0", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "runtime": { + "Entity.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.24": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Config/2024.1.4": { + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "dependencies": { + "Fantasy-Net": "2024.2.24" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {}, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.Formats.Asn1/5.0.0": {}, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.7.0", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "APlugins/1.0.0": { + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "APlugins.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Entity/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "path": "fantasy-net/2024.2.24", + "hashPath": "fantasy-net.2024.2.24.nupkg.sha512" + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "path": "fantasy-net.config/2024.1.4", + "hashPath": "fantasy-net.config.2024.1.4.nupkg.sha512" + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "path": "fantasy-net.configtable/2024.2.0", + "hashPath": "fantasy-net.configtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hashPath": "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hashPath": "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OQd5aVepYvh5evOmBMeAYjMIpEcTf1ZCBZaU7Nh/RlhhdXefjFDJeP1L2F2zeNT1unFr+wUu/h3Ac2Xb4BXU6w==", + "path": "microsoft.identitymodel.abstractions/8.7.0", + "hashPath": "microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uzsSAWhNhbrkWbQKBTE8QhzviU6sr3bJ1Bkv7gERlhswfSKOp7HsxTRLTPBpx/whQ/GRRHEwMg8leRIPbMrOgw==", + "path": "microsoft.identitymodel.jsonwebtokens/8.7.0", + "hashPath": "microsoft.identitymodel.jsonwebtokens.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Bs0TznPAu+nxa9rAVHJ+j3CYECHJkT3tG8AyBfhFYlT5ldsDhoxFT7J+PKxJHLf+ayqWfvDZHHc4639W2FQCxA==", + "path": "microsoft.identitymodel.logging/8.7.0", + "hashPath": "microsoft.identitymodel.logging.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5Z6voXjRXAnGklhmZd1mKz89UhcF5ZQQZaZc2iKrOuL4Li1UihG2vlJx8IbiFAOIxy/xdbsAm0A+WZEaH5fxng==", + "path": "microsoft.identitymodel.tokens/8.7.0", + "hashPath": "microsoft.identitymodel.tokens.8.7.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "path": "system.formats.asn1/5.0.0", + "hashPath": "system.formats.asn1.5.0.0.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-8dKL3A9pVqYCJIXHd4H2epQqLxSvKeNxGonR0e5g89yMchyvsM/NLuB06otx29BicUd6+LUJZgNZmvYjjPsPGg==", + "path": "system.identitymodel.tokens.jwt/8.7.0", + "hashPath": "system.identitymodel.tokens.jwt.8.7.0.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "path": "system.security.cryptography.cng/5.0.0", + "hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + }, + "APlugins/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Entity/bin/Debug/net9.0/Entity.dll b/GameServer/Server/Entity/bin/Debug/net9.0/Entity.dll new file mode 100644 index 00000000..bc3b8c64 Binary files /dev/null and b/GameServer/Server/Entity/bin/Debug/net9.0/Entity.dll differ diff --git a/GameServer/Server/Entity/bin/Debug/net9.0/Entity.pdb b/GameServer/Server/Entity/bin/Debug/net9.0/Entity.pdb new file mode 100644 index 00000000..af19b177 Binary files /dev/null and b/GameServer/Server/Entity/bin/Debug/net9.0/Entity.pdb differ diff --git a/GameServer/Server/Entity/bin/Release/net9.0/APlugins.dll b/GameServer/Server/Entity/bin/Release/net9.0/APlugins.dll new file mode 100644 index 00000000..cc1491d5 Binary files /dev/null and b/GameServer/Server/Entity/bin/Release/net9.0/APlugins.dll differ diff --git a/GameServer/Server/Entity/bin/Release/net9.0/APlugins.pdb b/GameServer/Server/Entity/bin/Release/net9.0/APlugins.pdb new file mode 100644 index 00000000..1045ce75 Binary files /dev/null and b/GameServer/Server/Entity/bin/Release/net9.0/APlugins.pdb differ diff --git a/GameServer/Server/Entity/bin/Release/net9.0/Entity.deps.json b/GameServer/Server/Entity/bin/Release/net9.0/Entity.deps.json new file mode 100644 index 00000000..d4d6159e --- /dev/null +++ b/GameServer/Server/Entity/bin/Release/net9.0/Entity.deps.json @@ -0,0 +1,509 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Entity/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.6.1", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "runtime": { + "Entity.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.24": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Config/2024.1.4": { + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "dependencies": { + "Fantasy-Net": "2024.2.24" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {}, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + } + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.Formats.Asn1/5.0.0": {}, + "System.IdentityModel.Tokens.Jwt/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.6.1", + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "APlugins/1.0.0": { + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "APlugins.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Entity/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "path": "fantasy-net/2024.2.24", + "hashPath": "fantasy-net.2024.2.24.nupkg.sha512" + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "path": "fantasy-net.config/2024.1.4", + "hashPath": "fantasy-net.config.2024.1.4.nupkg.sha512" + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "path": "fantasy-net.configtable/2024.2.0", + "hashPath": "fantasy-net.configtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hashPath": "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hashPath": "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OwmvCXYTttrxV3qT7QKDkoQP4/DB4RWjTwEqV+dNfb2opHn29WGDzoF+r4BVFQVy+BDYMhRlhIp8g3jSyJd+4Q==", + "path": "microsoft.identitymodel.abstractions/8.6.1", + "hashPath": "microsoft.identitymodel.abstractions.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CAu9DWsPZVtnyE3bOJ83rlPWpahY37sP/0bIOdRlxS90W88zSI4V3FyoCDlXxV8+gloT+a247pwPXfSNjYyAxw==", + "path": "microsoft.identitymodel.jsonwebtokens/8.6.1", + "hashPath": "microsoft.identitymodel.jsonwebtokens.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BdWlVgJYdmcR9TMUOhaZ3vJyaRO7zr7xgK+cRT4R2q59Xl7JMmTB4ctb/VOsyDhxXb497jDNNvLwldp+2ZVBEg==", + "path": "microsoft.identitymodel.logging/8.6.1", + "hashPath": "microsoft.identitymodel.logging.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FvED2com8LIFl9yFXneiX0uxNf9fuf8jKDFcvxC93qXOAfFa8fdLkCiur1vWF+PvgQHhsHVBe6CtDZHzsN8nCQ==", + "path": "microsoft.identitymodel.tokens/8.6.1", + "hashPath": "microsoft.identitymodel.tokens.8.6.1.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "path": "system.formats.asn1/5.0.0", + "hashPath": "system.formats.asn1.5.0.0.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-EXL1Tj+pizswtHHPiQyNumrTo8XOLX7SoTm7Bz00/DyiIoG2H/kQItoajSvr1MYtvDNXveqULsoWDoJFI3aHzQ==", + "path": "system.identitymodel.tokens.jwt/8.6.1", + "hashPath": "system.identitymodel.tokens.jwt.8.6.1.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "path": "system.security.cryptography.cng/5.0.0", + "hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + }, + "APlugins/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Entity/bin/Release/net9.0/Entity.dll b/GameServer/Server/Entity/bin/Release/net9.0/Entity.dll new file mode 100644 index 00000000..c362e995 Binary files /dev/null and b/GameServer/Server/Entity/bin/Release/net9.0/Entity.dll differ diff --git a/GameServer/Server/Entity/bin/Release/net9.0/Entity.pdb b/GameServer/Server/Entity/bin/Release/net9.0/Entity.pdb new file mode 100644 index 00000000..3976e226 Binary files /dev/null and b/GameServer/Server/Entity/bin/Release/net9.0/Entity.pdb differ diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Server/Entity/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Server/Entity/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.AssemblyInfo.cs b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.AssemblyInfo.cs new file mode 100644 index 00000000..eeef3a48 --- /dev/null +++ b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Entity")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+93d69c1ff6fc3ec58a9401445592c13d80a5e8fc")] +[assembly: System.Reflection.AssemblyProductAttribute("Entity")] +[assembly: System.Reflection.AssemblyTitleAttribute("Entity")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.AssemblyInfoInputs.cache b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.AssemblyInfoInputs.cache new file mode 100644 index 00000000..50c251fa --- /dev/null +++ b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +9be4d22e32a3ffa9d6c641e983868b53bbfa8e5b7da48cd1ff9ebc76bff7099d diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..2abfc8ee --- /dev/null +++ b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Entity +build_property.ProjectDir = D:\UnityProject\EintooAR\GameServer\Server\Entity\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.GlobalUsings.g.cs b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.assets.cache b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.assets.cache new file mode 100644 index 00000000..2a32c750 Binary files /dev/null and b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.assets.cache differ diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.AssemblyReference.cache b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.AssemblyReference.cache new file mode 100644 index 00000000..c9638d68 Binary files /dev/null and b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.AssemblyReference.cache differ diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.CoreCompileInputs.cache b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.CoreCompileInputs.cache new file mode 100644 index 00000000..7261b1a2 --- /dev/null +++ b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +57f88ddec4d03f770012adec9657ae3040d3736ca41d413e6c10a5eab67a88a3 diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.FileListAbsolute.txt b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.FileListAbsolute.txt new file mode 100644 index 00000000..6de0a0ae --- /dev/null +++ b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.FileListAbsolute.txt @@ -0,0 +1,108 @@ +E:\Game\unity\TE_AR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.deps.json +E:\Game\unity\TE_AR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.dll +E:\Game\unity\TE_AR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.pdb +E:\Game\unity\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.AssemblyReference.cache +E:\Game\unity\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.GeneratedMSBuildEditorConfig.editorconfig +E:\Game\unity\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfoInputs.cache +E:\Game\unity\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfo.cs +E:\Game\unity\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.CoreCompileInputs.cache +E:\Game\unity\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.dll +E:\Game\unity\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\refint\Entity.dll +E:\Game\unity\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.pdb +E:\Game\unity\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\ref\Entity.dll +E:\UnityProject\TE_AR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.deps.json +E:\UnityProject\TE_AR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.dll +E:\UnityProject\TE_AR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.pdb +E:\UnityProject\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.AssemblyReference.cache +E:\UnityProject\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfoInputs.cache +E:\UnityProject\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfo.cs +E:\UnityProject\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.CoreCompileInputs.cache +E:\UnityProject\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.dll +E:\UnityProject\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\refint\Entity.dll +E:\UnityProject\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.pdb +E:\UnityProject\TE_AR\GameServer\Server\Entity\obj\Debug\net9.0\ref\Entity.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\bin\Debug\net9.0\Entity.deps.json +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\bin\Debug\net9.0\Entity.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\bin\Debug\net9.0\Entity.pdb +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.AssemblyReference.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\obj\Debug\net9.0\Entity.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfoInputs.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfo.cs +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.CoreCompileInputs.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\obj\Debug\net9.0\Entity.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\obj\Debug\net9.0\refint\Entity.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\obj\Debug\net9.0\Entity.pdb +E:\UnityProject\TE_ARMain\GameServer\Server\Entity\obj\Debug\net9.0\ref\Entity.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.deps.json +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.pdb +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.AssemblyReference.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.GeneratedMSBuildEditorConfig.editorconfig +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfoInputs.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfo.cs +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.CoreCompileInputs.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\refint\Entity.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.pdb +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\ref\Entity.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.AssemblyReference.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfoInputs.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfo.cs +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.CoreCompileInputs.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\refint\Entity.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.deps.json +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\APlugins.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\APlugins.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.Up2Date +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\ref\Entity.dll +D:\UGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.deps.json +D:\UGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.dll +D:\UGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.pdb +D:\UGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\APlugins.dll +D:\UGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\APlugins.pdb +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.AssemblyReference.cache +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.GeneratedMSBuildEditorConfig.editorconfig +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfoInputs.cache +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfo.cs +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.CoreCompileInputs.cache +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.Up2Date +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.dll +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\refint\Entity.dll +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.pdb +D:\UGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\ref\Entity.dll +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.deps.json +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.dll +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\APlugins.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.AssemblyReference.cache +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.GeneratedMSBuildEditorConfig.editorconfig +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfoInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfo.cs +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.CoreCompileInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.Up2Date +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.dll +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\refint\Entity.dll +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\ref\Entity.dll +D:\UnityProject\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.deps.json +D:\UnityProject\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.dll +D:\UnityProject\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\Entity.pdb +D:\UnityProject\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\APlugins.dll +D:\UnityProject\EintooAR\GameServer\Server\Entity\bin\Debug\net9.0\APlugins.pdb +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.AssemblyReference.cache +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.GeneratedMSBuildEditorConfig.editorconfig +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfoInputs.cache +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.AssemblyInfo.cs +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.CoreCompileInputs.cache +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.csproj.Up2Date +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.dll +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\refint\Entity.dll +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\Entity.pdb +D:\UnityProject\EintooAR\GameServer\Server\Entity\obj\Debug\net9.0\ref\Entity.dll diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.Up2Date b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.csproj.Up2Date new file mode 100644 index 00000000..e69de29b diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.dll b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.dll new file mode 100644 index 00000000..bc3b8c64 Binary files /dev/null and b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.dll differ diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/Entity.pdb b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.pdb new file mode 100644 index 00000000..af19b177 Binary files /dev/null and b/GameServer/Server/Entity/obj/Debug/net9.0/Entity.pdb differ diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/ref/Entity.dll b/GameServer/Server/Entity/obj/Debug/net9.0/ref/Entity.dll new file mode 100644 index 00000000..6406d82f Binary files /dev/null and b/GameServer/Server/Entity/obj/Debug/net9.0/ref/Entity.dll differ diff --git a/GameServer/Server/Entity/obj/Debug/net9.0/refint/Entity.dll b/GameServer/Server/Entity/obj/Debug/net9.0/refint/Entity.dll new file mode 100644 index 00000000..6406d82f Binary files /dev/null and b/GameServer/Server/Entity/obj/Debug/net9.0/refint/Entity.dll differ diff --git a/GameServer/Server/Entity/obj/Entity.csproj.nuget.dgspec.json b/GameServer/Server/Entity/obj/Entity.csproj.nuget.dgspec.json new file mode 100644 index 00000000..b42d3be7 --- /dev/null +++ b/GameServer/Server/Entity/obj/Entity.csproj.nuget.dgspec.json @@ -0,0 +1,178 @@ +{ + "format": 1, + "restore": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj": {} + }, + "projects": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "projectName": "APlugins", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net.Config": { + "target": "Package", + "version": "[2024.1.4, )" + }, + "Fantasy-Net.ConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol": { + "target": "Package", + "version": "[2024.2.24, )" + }, + "Microsoft.IdentityModel.Tokens": { + "target": "Package", + "version": "[8.7.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj", + "projectName": "Entity", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net": { + "target": "Package", + "version": "[2024.2.24, )" + }, + "System.IdentityModel.Tokens.Jwt": { + "target": "Package", + "version": "[8.7.0, )" + }, + "System.Security.Cryptography.Cng": { + "target": "Package", + "version": "[5.0.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Entity/obj/Entity.csproj.nuget.g.props b/GameServer/Server/Entity/obj/Entity.csproj.nuget.g.props new file mode 100644 index 00000000..2571d6c1 --- /dev/null +++ b/GameServer/Server/Entity/obj/Entity.csproj.nuget.g.props @@ -0,0 +1,21 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\qq137\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 6.12.2 + + + + + + + C:\Users\qq137\.nuget\packages\fantasy-net.tools.exporternetworkprotocol\2024.2.24 + C:\Users\qq137\.nuget\packages\fantasy-net.tools.exporterconfigtable\2024.2.0 + C:\Users\qq137\.nuget\packages\fantasy-net.config\2024.1.4 + + \ No newline at end of file diff --git a/GameServer/Server/Entity/obj/Entity.csproj.nuget.g.targets b/GameServer/Server/Entity/obj/Entity.csproj.nuget.g.targets new file mode 100644 index 00000000..6ea4e19c --- /dev/null +++ b/GameServer/Server/Entity/obj/Entity.csproj.nuget.g.targets @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/Entity/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Server/Entity/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Server/Entity/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.AssemblyInfo.cs b/GameServer/Server/Entity/obj/Release/net9.0/Entity.AssemblyInfo.cs new file mode 100644 index 00000000..f92426d5 --- /dev/null +++ b/GameServer/Server/Entity/obj/Release/net9.0/Entity.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Entity")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4710d1c9d412b6a31c2ed97fac4853f5c41daeb1")] +[assembly: System.Reflection.AssemblyProductAttribute("Entity")] +[assembly: System.Reflection.AssemblyTitleAttribute("Entity")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.AssemblyInfoInputs.cache b/GameServer/Server/Entity/obj/Release/net9.0/Entity.AssemblyInfoInputs.cache new file mode 100644 index 00000000..fad9f964 --- /dev/null +++ b/GameServer/Server/Entity/obj/Release/net9.0/Entity.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +960e6c799fdb33011484dafbf7157f8becce2deef1e1921983a340fab7c89724 diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/Entity/obj/Release/net9.0/Entity.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..d6b7d98f --- /dev/null +++ b/GameServer/Server/Entity/obj/Release/net9.0/Entity.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Entity +build_property.ProjectDir = D:\TecentUGit\EintooAR\GameServer\Server\Entity\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.GlobalUsings.g.cs b/GameServer/Server/Entity/obj/Release/net9.0/Entity.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/Entity/obj/Release/net9.0/Entity.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.assets.cache b/GameServer/Server/Entity/obj/Release/net9.0/Entity.assets.cache new file mode 100644 index 00000000..b87ed740 Binary files /dev/null and b/GameServer/Server/Entity/obj/Release/net9.0/Entity.assets.cache differ diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.AssemblyReference.cache b/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.AssemblyReference.cache new file mode 100644 index 00000000..644bf928 Binary files /dev/null and b/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.AssemblyReference.cache differ diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.CoreCompileInputs.cache b/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.CoreCompileInputs.cache new file mode 100644 index 00000000..a03b6c22 --- /dev/null +++ b/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +8b42d207e22e7f219222bb539b796465245934225abb2f5c3409fb15f7d82248 diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.FileListAbsolute.txt b/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.FileListAbsolute.txt new file mode 100644 index 00000000..50fe0213 --- /dev/null +++ b/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Release\net9.0\Entity.deps.json +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Release\net9.0\Entity.dll +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Release\net9.0\Entity.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Release\net9.0\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\Entity\bin\Release\net9.0\APlugins.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\Entity.csproj.AssemblyReference.cache +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\Entity.GeneratedMSBuildEditorConfig.editorconfig +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\Entity.AssemblyInfoInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\Entity.AssemblyInfo.cs +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\Entity.csproj.CoreCompileInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\Entity.csproj.Up2Date +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\Entity.dll +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\refint\Entity.dll +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\Entity.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Entity\obj\Release\net9.0\ref\Entity.dll diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.Up2Date b/GameServer/Server/Entity/obj/Release/net9.0/Entity.csproj.Up2Date new file mode 100644 index 00000000..e69de29b diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.dll b/GameServer/Server/Entity/obj/Release/net9.0/Entity.dll new file mode 100644 index 00000000..c362e995 Binary files /dev/null and b/GameServer/Server/Entity/obj/Release/net9.0/Entity.dll differ diff --git a/GameServer/Server/Entity/obj/Release/net9.0/Entity.pdb b/GameServer/Server/Entity/obj/Release/net9.0/Entity.pdb new file mode 100644 index 00000000..3976e226 Binary files /dev/null and b/GameServer/Server/Entity/obj/Release/net9.0/Entity.pdb differ diff --git a/GameServer/Server/Entity/obj/Release/net9.0/ref/Entity.dll b/GameServer/Server/Entity/obj/Release/net9.0/ref/Entity.dll new file mode 100644 index 00000000..da675044 Binary files /dev/null and b/GameServer/Server/Entity/obj/Release/net9.0/ref/Entity.dll differ diff --git a/GameServer/Server/Entity/obj/Release/net9.0/refint/Entity.dll b/GameServer/Server/Entity/obj/Release/net9.0/refint/Entity.dll new file mode 100644 index 00000000..da675044 Binary files /dev/null and b/GameServer/Server/Entity/obj/Release/net9.0/refint/Entity.dll differ diff --git a/GameServer/Server/Entity/obj/project.assets.json b/GameServer/Server/Entity/obj/project.assets.json new file mode 100644 index 00000000..32622fa8 --- /dev/null +++ b/GameServer/Server/Entity/obj/project.assets.json @@ -0,0 +1,1569 @@ +{ + "version": 3, + "targets": { + "net9.0": { + "CommandLineParser/2.9.1": { + "type": "package", + "compile": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + } + }, + "DnsClient/1.6.1": { + "type": "package", + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "compile": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + } + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "compile": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "frameworkReferences": [ + "Microsoft.AspNetCore.App" + ], + "build": { + "buildTransitive/Fantasy-Net.targets": {} + } + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Config.targets": {} + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "dependencies": { + "Fantasy-Net": "2024.2.22" + }, + "compile": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets": {} + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets": {} + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "compile": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + }, + "compile": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets": {} + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "2.0.0", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "compile": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "protobuf-net/3.2.45": { + "type": "package", + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "compile": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + } + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + } + }, + "SharpCompress/0.30.1": { + "type": "package", + "compile": { + "lib/net5.0/SharpCompress.dll": {} + }, + "runtime": { + "lib/net5.0/SharpCompress.dll": {} + } + }, + "Snappier/1.0.0": { + "type": "package", + "compile": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "compile": { + "ref/netcoreapp2.0/_._": {} + }, + "runtime": { + "lib/netcoreapp2.0/_._": {} + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "compile": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Formats.Asn1.dll": { + "related": ".xml" + } + } + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.7.0", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + } + }, + "System.Memory/4.5.5": { + "type": "package", + "compile": { + "ref/netcoreapp2.1/_._": {} + }, + "runtime": { + "lib/netcoreapp2.1/_._": {} + } + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "compile": { + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "dependencies": { + "System.Formats.Asn1": "5.0.0" + }, + "compile": { + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "unix" + }, + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "compile": { + "lib/net7.0/ZstdSharp.dll": {} + }, + "runtime": { + "lib/net7.0/ZstdSharp.dll": {} + } + }, + "APlugins/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "bin/placeholder/APlugins.dll": {} + }, + "runtime": { + "bin/placeholder/APlugins.dll": {} + } + } + } + }, + "libraries": { + "CommandLineParser/2.9.1": { + "sha512": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "type": "package", + "path": "commandlineparser/2.9.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "CommandLine20.png", + "License.md", + "README.md", + "commandlineparser.2.9.1.nupkg.sha512", + "commandlineparser.nuspec", + "lib/net40/CommandLine.dll", + "lib/net40/CommandLine.xml", + "lib/net45/CommandLine.dll", + "lib/net45/CommandLine.xml", + "lib/net461/CommandLine.dll", + "lib/net461/CommandLine.xml", + "lib/netstandard2.0/CommandLine.dll", + "lib/netstandard2.0/CommandLine.xml" + ] + }, + "DnsClient/1.6.1": { + "sha512": "4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "type": "package", + "path": "dnsclient/1.6.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "dnsclient.1.6.1.nupkg.sha512", + "dnsclient.nuspec", + "icon.png", + "lib/net45/DnsClient.dll", + "lib/net45/DnsClient.xml", + "lib/net471/DnsClient.dll", + "lib/net471/DnsClient.xml", + "lib/net5.0/DnsClient.dll", + "lib/net5.0/DnsClient.xml", + "lib/netstandard1.3/DnsClient.dll", + "lib/netstandard1.3/DnsClient.xml", + "lib/netstandard2.0/DnsClient.dll", + "lib/netstandard2.0/DnsClient.xml", + "lib/netstandard2.1/DnsClient.dll", + "lib/netstandard2.1/DnsClient.xml" + ] + }, + "Fantasy-Net/2024.2.24": { + "sha512": "5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "type": "package", + "path": "fantasy-net/2024.2.24", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE", + "README.md", + "buildTransitive/Fantasy-Net.targets", + "fantasy-net.2024.2.24.nupkg.sha512", + "fantasy-net.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.dll", + "lib/net9.0/Fantasy-Net.dll" + ] + }, + "Fantasy-Net.Config/2024.1.4": { + "sha512": "zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "type": "package", + "path": "fantasy-net.config/2024.1.4", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "buildTransitive/Fantasy-Net.Config.targets", + "fantasy-net.config.2024.1.4.nupkg.sha512", + "fantasy-net.config.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.Config.dll", + "tools/output/Excel/Custom.txt", + "tools/output/Excel/Server/MachineConfig.xlsx", + "tools/output/Excel/Server/ProcessConfig.xlsx", + "tools/output/Excel/Server/SceneConfig.xlsx", + "tools/output/Excel/Server/WorldConfig.xlsx", + "tools/output/Excel/Version.txt", + "tools/output/Json/Server/MachineConfigData.Json", + "tools/output/Json/Server/ProcessConfigData.Json", + "tools/output/Json/Server/SceneConfigData.Json", + "tools/output/Json/Server/WorldConfigData.Json", + "tools/output/NetworkProtocol/Inner/InnerMessage.proto", + "tools/output/NetworkProtocol/OpCode.Cache", + "tools/output/NetworkProtocol/Outer/OuterMessage.proto", + "tools/output/NetworkProtocol/RouteType.Config", + "tools/output/README.md" + ] + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "sha512": "TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "type": "package", + "path": "fantasy-net.configtable/2024.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "fantasy-net.configtable.2024.2.0.nupkg.sha512", + "fantasy-net.configtable.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.ConfigTable.dll" + ] + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "sha512": "jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "type": "package", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets", + "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512", + "fantasy-net.tools.exporterconfigtable.nuspec", + "icon.png", + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll", + "tools/output/CommandLine.dll", + "tools/output/EPPlus.Interfaces.dll", + "tools/output/EPPlus.System.Drawing.dll", + "tools/output/EPPlus.dll", + "tools/output/ExporterSettings.json", + "tools/output/Fantasy.Tools.ConfigTable", + "tools/output/Fantasy.Tools.ConfigTable.deps.json", + "tools/output/Fantasy.Tools.ConfigTable.dll", + "tools/output/Fantasy.Tools.ConfigTable.pdb", + "tools/output/Fantasy.Tools.ConfigTable.runtimeconfig.json", + "tools/output/Microsoft.CodeAnalysis.CSharp.dll", + "tools/output/Microsoft.CodeAnalysis.dll", + "tools/output/Microsoft.Extensions.Configuration.Abstractions.dll", + "tools/output/Microsoft.Extensions.Configuration.FileExtensions.dll", + "tools/output/Microsoft.Extensions.Configuration.Json.dll", + "tools/output/Microsoft.Extensions.Configuration.dll", + "tools/output/Microsoft.Extensions.FileProviders.Abstractions.dll", + "tools/output/Microsoft.Extensions.FileProviders.Physical.dll", + "tools/output/Microsoft.Extensions.FileSystemGlobbing.dll", + "tools/output/Microsoft.Extensions.Primitives.dll", + "tools/output/Microsoft.IO.RecyclableMemoryStream.dll", + "tools/output/Microsoft.Win32.SystemEvents.dll", + "tools/output/Newtonsoft.Json.dll", + "tools/output/Run.bat", + "tools/output/Run.sh", + "tools/output/System.Drawing.Common.dll", + "tools/output/System.Security.Cryptography.Pkcs.dll", + "tools/output/protobuf-net.Core.dll", + "tools/output/protobuf-net.dll", + "tools/output/runtimes/win/lib/net7.0/Microsoft.Win32.SystemEvents.dll", + "tools/output/runtimes/win/lib/net7.0/System.Drawing.Common.dll", + "tools/output/runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll" + ] + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "sha512": "gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "type": "package", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets", + "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512", + "fantasy-net.tools.exporternetworkprotocol.nuspec", + "icon.png", + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll", + "tools/output/CommandLine.dll", + "tools/output/ExporterSettings.json", + "tools/output/Fantasy.Tools.NetworkProtocol", + "tools/output/Fantasy.Tools.NetworkProtocol.deps.json", + "tools/output/Fantasy.Tools.NetworkProtocol.dll", + "tools/output/Fantasy.Tools.NetworkProtocol.pdb", + "tools/output/Fantasy.Tools.NetworkProtocol.runtimeconfig.json", + "tools/output/Microsoft.Extensions.Configuration.Abstractions.dll", + "tools/output/Microsoft.Extensions.Configuration.FileExtensions.dll", + "tools/output/Microsoft.Extensions.Configuration.Json.dll", + "tools/output/Microsoft.Extensions.Configuration.dll", + "tools/output/Microsoft.Extensions.FileProviders.Abstractions.dll", + "tools/output/Microsoft.Extensions.FileProviders.Physical.dll", + "tools/output/Microsoft.Extensions.FileSystemGlobbing.dll", + "tools/output/Microsoft.Extensions.Primitives.dll", + "tools/output/Newtonsoft.Json.dll", + "tools/output/Run.bat", + "tools/output/Run.sh" + ] + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "sha512": "3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "type": "package", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", + "microsoft.extensions.dependencyinjection.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "sha512": "nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "type": "package", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn3.11/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn3.11/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.0/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "buildTransitive/net461/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net462/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.xml", + "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", + "microsoft.extensions.logging.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "sha512": "OQd5aVepYvh5evOmBMeAYjMIpEcTf1ZCBZaU7Nh/RlhhdXefjFDJeP1L2F2zeNT1unFr+wUu/h3Ac2Xb4BXU6w==", + "type": "package", + "path": "microsoft.identitymodel.abstractions/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Abstractions.dll", + "lib/net462/Microsoft.IdentityModel.Abstractions.xml", + "lib/net472/Microsoft.IdentityModel.Abstractions.dll", + "lib/net472/Microsoft.IdentityModel.Abstractions.xml", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net9.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.xml", + "microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512", + "microsoft.identitymodel.abstractions.nuspec" + ] + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "sha512": "uzsSAWhNhbrkWbQKBTE8QhzviU6sr3bJ1Bkv7gERlhswfSKOp7HsxTRLTPBpx/whQ/GRRHEwMg8leRIPbMrOgw==", + "type": "package", + "path": "microsoft.identitymodel.jsonwebtokens/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "microsoft.identitymodel.jsonwebtokens.8.7.0.nupkg.sha512", + "microsoft.identitymodel.jsonwebtokens.nuspec" + ] + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "sha512": "Bs0TznPAu+nxa9rAVHJ+j3CYECHJkT3tG8AyBfhFYlT5ldsDhoxFT7J+PKxJHLf+ayqWfvDZHHc4639W2FQCxA==", + "type": "package", + "path": "microsoft.identitymodel.logging/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Logging.dll", + "lib/net462/Microsoft.IdentityModel.Logging.xml", + "lib/net472/Microsoft.IdentityModel.Logging.dll", + "lib/net472/Microsoft.IdentityModel.Logging.xml", + "lib/net6.0/Microsoft.IdentityModel.Logging.dll", + "lib/net6.0/Microsoft.IdentityModel.Logging.xml", + "lib/net8.0/Microsoft.IdentityModel.Logging.dll", + "lib/net8.0/Microsoft.IdentityModel.Logging.xml", + "lib/net9.0/Microsoft.IdentityModel.Logging.dll", + "lib/net9.0/Microsoft.IdentityModel.Logging.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.xml", + "microsoft.identitymodel.logging.8.7.0.nupkg.sha512", + "microsoft.identitymodel.logging.nuspec" + ] + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "sha512": "5Z6voXjRXAnGklhmZd1mKz89UhcF5ZQQZaZc2iKrOuL4Li1UihG2vlJx8IbiFAOIxy/xdbsAm0A+WZEaH5fxng==", + "type": "package", + "path": "microsoft.identitymodel.tokens/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Tokens.dll", + "lib/net462/Microsoft.IdentityModel.Tokens.xml", + "lib/net472/Microsoft.IdentityModel.Tokens.dll", + "lib/net472/Microsoft.IdentityModel.Tokens.xml", + "lib/net6.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net6.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net8.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net9.0/Microsoft.IdentityModel.Tokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.xml", + "microsoft.identitymodel.tokens.8.7.0.nupkg.sha512", + "microsoft.identitymodel.tokens.nuspec" + ] + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "type": "package", + "path": "microsoft.netcore.platforms/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.5.0.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Microsoft.Win32.Registry/5.0.0": { + "sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "type": "package", + "path": "microsoft.win32.registry/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.xml", + "lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "microsoft.win32.registry.5.0.0.nupkg.sha512", + "microsoft.win32.registry.nuspec", + "ref/net46/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/Microsoft.Win32.Registry.dll", + "ref/netstandard1.3/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/de/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/es/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/fr/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/it/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ja/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ko/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ru/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hans/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml", + "ref/netstandard2.0/Microsoft.Win32.Registry.dll", + "ref/netstandard2.0/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/net46/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "MongoDB.Bson/3.1.0": { + "sha512": "3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "type": "package", + "path": "mongodb.bson/3.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net472/MongoDB.Bson.dll", + "lib/net472/MongoDB.Bson.xml", + "lib/net6.0/MongoDB.Bson.dll", + "lib/net6.0/MongoDB.Bson.xml", + "lib/netstandard2.1/MongoDB.Bson.dll", + "lib/netstandard2.1/MongoDB.Bson.xml", + "mongodb.bson.3.1.0.nupkg.sha512", + "mongodb.bson.nuspec", + "packageIcon.png" + ] + }, + "MongoDB.Driver/3.1.0": { + "sha512": "+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "type": "package", + "path": "mongodb.driver/3.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net472/MongoDB.Driver.dll", + "lib/net472/MongoDB.Driver.xml", + "lib/net6.0/MongoDB.Driver.dll", + "lib/net6.0/MongoDB.Driver.xml", + "lib/netstandard2.1/MongoDB.Driver.dll", + "lib/netstandard2.1/MongoDB.Driver.xml", + "mongodb.driver.3.1.0.nupkg.sha512", + "mongodb.driver.nuspec", + "packageIcon.png" + ] + }, + "Newtonsoft.Json/13.0.3": { + "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "type": "package", + "path": "newtonsoft.json/13.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "README.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/net6.0/Newtonsoft.Json.dll", + "lib/net6.0/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "newtonsoft.json.13.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, + "protobuf-net/3.2.45": { + "sha512": "5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "type": "package", + "path": "protobuf-net/3.2.45", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net462/protobuf-net.dll", + "lib/net462/protobuf-net.xml", + "lib/net6.0/protobuf-net.dll", + "lib/net6.0/protobuf-net.xml", + "lib/netstandard2.0/protobuf-net.dll", + "lib/netstandard2.0/protobuf-net.xml", + "lib/netstandard2.1/protobuf-net.dll", + "lib/netstandard2.1/protobuf-net.xml", + "protobuf-net.3.2.45.nupkg.sha512", + "protobuf-net.nuspec", + "protobuf-net.png", + "readme.md" + ] + }, + "protobuf-net.Core/3.2.45": { + "sha512": "PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "type": "package", + "path": "protobuf-net.core/3.2.45", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net462/protobuf-net.Core.dll", + "lib/net462/protobuf-net.Core.xml", + "lib/net6.0/protobuf-net.Core.dll", + "lib/net6.0/protobuf-net.Core.xml", + "lib/netstandard2.0/protobuf-net.Core.dll", + "lib/netstandard2.0/protobuf-net.Core.xml", + "lib/netstandard2.1/protobuf-net.Core.dll", + "lib/netstandard2.1/protobuf-net.Core.xml", + "protobuf-net.core.3.2.45.nupkg.sha512", + "protobuf-net.core.nuspec", + "protobuf-net.png", + "readme.md" + ] + }, + "SharpCompress/0.30.1": { + "sha512": "XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "type": "package", + "path": "sharpcompress/0.30.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/SharpCompress.dll", + "lib/net5.0/SharpCompress.dll", + "lib/netcoreapp3.1/SharpCompress.dll", + "lib/netstandard2.0/SharpCompress.dll", + "lib/netstandard2.1/SharpCompress.dll", + "sharpcompress.0.30.1.nupkg.sha512", + "sharpcompress.nuspec" + ] + }, + "Snappier/1.0.0": { + "sha512": "rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "type": "package", + "path": "snappier/1.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "COPYING.txt", + "lib/net5.0/Snappier.dll", + "lib/net5.0/Snappier.xml", + "lib/netcoreapp3.0/Snappier.dll", + "lib/netcoreapp3.0/Snappier.xml", + "lib/netstandard2.0/Snappier.dll", + "lib/netstandard2.0/Snappier.xml", + "lib/netstandard2.1/Snappier.dll", + "lib/netstandard2.1/Snappier.xml", + "snappier.1.0.0.nupkg.sha512", + "snappier.nuspec" + ] + }, + "System.Buffers/4.5.1": { + "sha512": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "type": "package", + "path": "system.buffers/4.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Buffers.dll", + "lib/net461/System.Buffers.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.1/System.Buffers.dll", + "lib/netstandard1.1/System.Buffers.xml", + "lib/netstandard2.0/System.Buffers.dll", + "lib/netstandard2.0/System.Buffers.xml", + "lib/uap10.0.16299/_._", + "ref/net45/System.Buffers.dll", + "ref/net45/System.Buffers.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.1/System.Buffers.dll", + "ref/netstandard1.1/System.Buffers.xml", + "ref/netstandard2.0/System.Buffers.dll", + "ref/netstandard2.0/System.Buffers.xml", + "ref/uap10.0.16299/_._", + "system.buffers.4.5.1.nupkg.sha512", + "system.buffers.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Collections.Immutable/7.0.0": { + "sha512": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "type": "package", + "path": "system.collections.immutable/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "README.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Collections.Immutable.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Collections.Immutable.targets", + "lib/net462/System.Collections.Immutable.dll", + "lib/net462/System.Collections.Immutable.xml", + "lib/net6.0/System.Collections.Immutable.dll", + "lib/net6.0/System.Collections.Immutable.xml", + "lib/net7.0/System.Collections.Immutable.dll", + "lib/net7.0/System.Collections.Immutable.xml", + "lib/netstandard2.0/System.Collections.Immutable.dll", + "lib/netstandard2.0/System.Collections.Immutable.xml", + "system.collections.immutable.7.0.0.nupkg.sha512", + "system.collections.immutable.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Formats.Asn1/5.0.0": { + "sha512": "MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "type": "package", + "path": "system.formats.asn1/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Formats.Asn1.dll", + "lib/net461/System.Formats.Asn1.xml", + "lib/netstandard2.0/System.Formats.Asn1.dll", + "lib/netstandard2.0/System.Formats.Asn1.xml", + "system.formats.asn1.5.0.0.nupkg.sha512", + "system.formats.asn1.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "sha512": "8dKL3A9pVqYCJIXHd4H2epQqLxSvKeNxGonR0e5g89yMchyvsM/NLuB06otx29BicUd6+LUJZgNZmvYjjPsPGg==", + "type": "package", + "path": "system.identitymodel.tokens.jwt/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/System.IdentityModel.Tokens.Jwt.dll", + "lib/net462/System.IdentityModel.Tokens.Jwt.xml", + "lib/net472/System.IdentityModel.Tokens.Jwt.dll", + "lib/net472/System.IdentityModel.Tokens.Jwt.xml", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net9.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.xml", + "system.identitymodel.tokens.jwt.8.7.0.nupkg.sha512", + "system.identitymodel.tokens.jwt.nuspec" + ] + }, + "System.Memory/4.5.5": { + "sha512": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "type": "package", + "path": "system.memory/4.5.5", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Memory.dll", + "lib/net461/System.Memory.xml", + "lib/netcoreapp2.1/_._", + "lib/netstandard1.1/System.Memory.dll", + "lib/netstandard1.1/System.Memory.xml", + "lib/netstandard2.0/System.Memory.dll", + "lib/netstandard2.0/System.Memory.xml", + "ref/netcoreapp2.1/_._", + "system.memory.4.5.5.nupkg.sha512", + "system.memory.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "sha512": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "type": "package", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net45/System.Runtime.CompilerServices.Unsafe.dll", + "lib/net45/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/net461/System.Runtime.CompilerServices.Unsafe.dll", + "ref/net461/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.xml", + "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", + "system.runtime.compilerservices.unsafe.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.AccessControl/5.0.0": { + "sha512": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "type": "package", + "path": "system.security.accesscontrol/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.xml", + "lib/netstandard1.3/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.xml", + "ref/netstandard1.3/System.Security.AccessControl.dll", + "ref/netstandard1.3/System.Security.AccessControl.xml", + "ref/netstandard1.3/de/System.Security.AccessControl.xml", + "ref/netstandard1.3/es/System.Security.AccessControl.xml", + "ref/netstandard1.3/fr/System.Security.AccessControl.xml", + "ref/netstandard1.3/it/System.Security.AccessControl.xml", + "ref/netstandard1.3/ja/System.Security.AccessControl.xml", + "ref/netstandard1.3/ko/System.Security.AccessControl.xml", + "ref/netstandard1.3/ru/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hans/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hant/System.Security.AccessControl.xml", + "ref/netstandard2.0/System.Security.AccessControl.dll", + "ref/netstandard2.0/System.Security.AccessControl.xml", + "ref/uap10.0.16299/_._", + "runtimes/win/lib/net46/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.xml", + "runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.accesscontrol.5.0.0.nupkg.sha512", + "system.security.accesscontrol.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Cryptography.Cng/5.0.0": { + "sha512": "jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "type": "package", + "path": "system.security.cryptography.cng/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Security.Cryptography.Cng.dll", + "lib/net461/System.Security.Cryptography.Cng.dll", + "lib/net461/System.Security.Cryptography.Cng.xml", + "lib/net462/System.Security.Cryptography.Cng.dll", + "lib/net462/System.Security.Cryptography.Cng.xml", + "lib/net47/System.Security.Cryptography.Cng.dll", + "lib/net47/System.Security.Cryptography.Cng.xml", + "lib/netcoreapp2.1/System.Security.Cryptography.Cng.dll", + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll", + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.xml", + "lib/netstandard1.3/System.Security.Cryptography.Cng.dll", + "lib/netstandard1.4/System.Security.Cryptography.Cng.dll", + "lib/netstandard1.6/System.Security.Cryptography.Cng.dll", + "lib/netstandard2.0/System.Security.Cryptography.Cng.dll", + "lib/netstandard2.0/System.Security.Cryptography.Cng.xml", + "lib/netstandard2.1/System.Security.Cryptography.Cng.dll", + "lib/netstandard2.1/System.Security.Cryptography.Cng.xml", + "lib/uap10.0.16299/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Security.Cryptography.Cng.dll", + "ref/net461/System.Security.Cryptography.Cng.dll", + "ref/net461/System.Security.Cryptography.Cng.xml", + "ref/net462/System.Security.Cryptography.Cng.dll", + "ref/net462/System.Security.Cryptography.Cng.xml", + "ref/net47/System.Security.Cryptography.Cng.dll", + "ref/net47/System.Security.Cryptography.Cng.xml", + "ref/netcoreapp2.0/System.Security.Cryptography.Cng.dll", + "ref/netcoreapp2.0/System.Security.Cryptography.Cng.xml", + "ref/netcoreapp2.1/System.Security.Cryptography.Cng.dll", + "ref/netcoreapp2.1/System.Security.Cryptography.Cng.xml", + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.dll", + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.xml", + "ref/netstandard1.3/System.Security.Cryptography.Cng.dll", + "ref/netstandard1.4/System.Security.Cryptography.Cng.dll", + "ref/netstandard1.6/System.Security.Cryptography.Cng.dll", + "ref/netstandard2.0/System.Security.Cryptography.Cng.dll", + "ref/netstandard2.0/System.Security.Cryptography.Cng.xml", + "ref/netstandard2.1/System.Security.Cryptography.Cng.dll", + "ref/netstandard2.1/System.Security.Cryptography.Cng.xml", + "ref/uap10.0.16299/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/win/lib/net46/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net461/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net461/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/net462/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net462/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/net47/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net47/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netcoreapp2.1/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/netstandard1.4/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netstandard1.6/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.cryptography.cng.5.0.0.nupkg.sha512", + "system.security.cryptography.cng.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Principal.Windows/5.0.0": { + "sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "type": "package", + "path": "system.security.principal.windows/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.xml", + "lib/netstandard1.3/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.xml", + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll", + "ref/netcoreapp3.0/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/System.Security.Principal.Windows.dll", + "ref/netstandard1.3/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/de/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/es/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/fr/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/it/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ja/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ko/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ru/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml", + "ref/netstandard2.0/System.Security.Principal.Windows.dll", + "ref/netstandard2.0/System.Security.Principal.Windows.xml", + "ref/uap10.0.16299/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/net46/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.principal.windows.5.0.0.nupkg.sha512", + "system.security.principal.windows.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "ZstdSharp.Port/0.7.3": { + "sha512": "U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "type": "package", + "path": "zstdsharp.port/0.7.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/ZstdSharp.dll", + "lib/net5.0/ZstdSharp.dll", + "lib/net6.0/ZstdSharp.dll", + "lib/net7.0/ZstdSharp.dll", + "lib/netcoreapp3.1/ZstdSharp.dll", + "lib/netstandard2.0/ZstdSharp.dll", + "lib/netstandard2.1/ZstdSharp.dll", + "zstdsharp.port.0.7.3.nupkg.sha512", + "zstdsharp.port.nuspec" + ] + }, + "APlugins/1.0.0": { + "type": "project", + "path": "../APlugins/APlugins.csproj", + "msbuildProject": "../APlugins/APlugins.csproj" + } + }, + "projectFileDependencyGroups": { + "net9.0": [ + "APlugins >= 1.0.0", + "Fantasy-Net >= 2024.2.24", + "System.IdentityModel.Tokens.Jwt >= 8.7.0", + "System.Security.Cryptography.Cng >= 5.0.0" + ] + }, + "packageFolders": { + "C:\\Users\\qq137\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj", + "projectName": "Entity", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net": { + "target": "Package", + "version": "[2024.2.24, )" + }, + "System.IdentityModel.Tokens.Jwt": { + "target": "Package", + "version": "[8.7.0, )" + }, + "System.Security.Cryptography.Cng": { + "target": "Package", + "version": "[5.0.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Entity/obj/project.nuget.cache b/GameServer/Server/Entity/obj/project.nuget.cache new file mode 100644 index 00000000..64d2b278 --- /dev/null +++ b/GameServer/Server/Entity/obj/project.nuget.cache @@ -0,0 +1,41 @@ +{ + "version": 2, + "dgSpecHash": "lq0jqGeNNzM=", + "success": true, + "projectFilePath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj", + "expectedPackageFiles": [ + "C:\\Users\\qq137\\.nuget\\packages\\commandlineparser\\2.9.1\\commandlineparser.2.9.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\dnsclient\\1.6.1\\dnsclient.1.6.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net\\2024.2.24\\fantasy-net.2024.2.24.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.config\\2024.1.4\\fantasy-net.config.2024.1.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.configtable\\2024.2.0\\fantasy-net.configtable.2024.2.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.tools.exporterconfigtable\\2024.2.0\\fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.tools.exporternetworkprotocol\\2024.2.24\\fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\8.0.2\\microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\8.0.2\\microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.abstractions\\8.7.0\\microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\8.7.0\\microsoft.identitymodel.jsonwebtokens.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.logging\\8.7.0\\microsoft.identitymodel.logging.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.tokens\\8.7.0\\microsoft.identitymodel.tokens.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\mongodb.bson\\3.1.0\\mongodb.bson.3.1.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\mongodb.driver\\3.1.0\\mongodb.driver.3.1.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\newtonsoft.json\\13.0.3\\newtonsoft.json.13.0.3.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\protobuf-net\\3.2.45\\protobuf-net.3.2.45.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\protobuf-net.core\\3.2.45\\protobuf-net.core.3.2.45.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\sharpcompress\\0.30.1\\sharpcompress.0.30.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\snappier\\1.0.0\\snappier.1.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.collections.immutable\\7.0.0\\system.collections.immutable.7.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.formats.asn1\\5.0.0\\system.formats.asn1.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.identitymodel.tokens.jwt\\8.7.0\\system.identitymodel.tokens.jwt.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.cryptography.cng\\5.0.0\\system.security.cryptography.cng.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/GameServer/Server/Entity/obj/project.packagespec.json b/GameServer/Server/Entity/obj/project.packagespec.json new file mode 100644 index 00000000..4e26180b --- /dev/null +++ b/GameServer/Server/Entity/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj","projectName":"Entity","projectPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj","outputPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\obj\\","projectStyle":"PackageReference","fallbackFolders":["C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"],"originalTargetFrameworks":["net9.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"targetAlias":"net9.0","projectReferences":{"D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj":{"projectPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.200"}"frameworks":{"net9.0":{"targetAlias":"net9.0","dependencies":{"Fantasy-Net":{"target":"Package","version":"[2024.2.24, )"},"System.IdentityModel.Tokens.Jwt":{"target":"Package","version":"[8.7.0, )"},"System.Security.Cryptography.Cng":{"target":"Package","version":"[5.0.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/GameServer/Server/Entity/obj/rider.project.model.nuget.info b/GameServer/Server/Entity/obj/rider.project.model.nuget.info new file mode 100644 index 00000000..39f97ac1 --- /dev/null +++ b/GameServer/Server/Entity/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17446243488702004 \ No newline at end of file diff --git a/GameServer/Server/Entity/obj/rider.project.restore.info b/GameServer/Server/Entity/obj/rider.project.restore.info new file mode 100644 index 00000000..39f97ac1 --- /dev/null +++ b/GameServer/Server/Entity/obj/rider.project.restore.info @@ -0,0 +1 @@ +17446243488702004 \ No newline at end of file diff --git a/GameServer/Server/GameServer.sln b/GameServer/Server/GameServer.sln new file mode 100644 index 00000000..30231f09 --- /dev/null +++ b/GameServer/Server/GameServer.sln @@ -0,0 +1,42 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{3F74BEF5-E9A6-4F83-95E7-01634D23A8F7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Main", "Main\Main.csproj", "{293E71D8-167F-4934-8D5D-456632DD8383}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hotfix", "Hotfix\Hotfix.csproj", "{C383FA16-D927-4FC3-91F9-8B7604A308A2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Entity", "Entity\Entity.csproj", "{CBCECEEF-8051-40C2-909F-E206B857FA56}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APlugins", "APlugins\APlugins.csproj", "{A5F7D669-7DA0-4F87-98F5-82442327B844}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {293E71D8-167F-4934-8D5D-456632DD8383} = {3F74BEF5-E9A6-4F83-95E7-01634D23A8F7} + {C383FA16-D927-4FC3-91F9-8B7604A308A2} = {3F74BEF5-E9A6-4F83-95E7-01634D23A8F7} + {CBCECEEF-8051-40C2-909F-E206B857FA56} = {3F74BEF5-E9A6-4F83-95E7-01634D23A8F7} + {A5F7D669-7DA0-4F87-98F5-82442327B844} = {3F74BEF5-E9A6-4F83-95E7-01634D23A8F7} + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {293E71D8-167F-4934-8D5D-456632DD8383}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {293E71D8-167F-4934-8D5D-456632DD8383}.Debug|Any CPU.Build.0 = Debug|Any CPU + {293E71D8-167F-4934-8D5D-456632DD8383}.Release|Any CPU.ActiveCfg = Release|Any CPU + {293E71D8-167F-4934-8D5D-456632DD8383}.Release|Any CPU.Build.0 = Release|Any CPU + {C383FA16-D927-4FC3-91F9-8B7604A308A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C383FA16-D927-4FC3-91F9-8B7604A308A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C383FA16-D927-4FC3-91F9-8B7604A308A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C383FA16-D927-4FC3-91F9-8B7604A308A2}.Release|Any CPU.Build.0 = Release|Any CPU + {CBCECEEF-8051-40C2-909F-E206B857FA56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CBCECEEF-8051-40C2-909F-E206B857FA56}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CBCECEEF-8051-40C2-909F-E206B857FA56}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CBCECEEF-8051-40C2-909F-E206B857FA56}.Release|Any CPU.Build.0 = Release|Any CPU + {A5F7D669-7DA0-4F87-98F5-82442327B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5F7D669-7DA0-4F87-98F5-82442327B844}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5F7D669-7DA0-4F87-98F5-82442327B844}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5F7D669-7DA0-4F87-98F5-82442327B844}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/GameServer/Server/GameServer.sln.DotSettings.user b/GameServer/Server/GameServer.sln.DotSettings.user new file mode 100644 index 00000000..6dc02852 --- /dev/null +++ b/GameServer/Server/GameServer.sln.DotSettings.user @@ -0,0 +1,12 @@ + + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Hotfix.csproj b/GameServer/Server/Hotfix/Hotfix.csproj new file mode 100644 index 00000000..0cba9075 --- /dev/null +++ b/GameServer/Server/Hotfix/Hotfix.csproj @@ -0,0 +1,17 @@ + + + + net9.0 + enable + enable + + + + + + + + + + + diff --git a/GameServer/Server/Hotfix/OnCreateScene_InitEvent.cs b/GameServer/Server/Hotfix/OnCreateScene_InitEvent.cs new file mode 100644 index 00000000..96be4385 --- /dev/null +++ b/GameServer/Server/Hotfix/OnCreateScene_InitEvent.cs @@ -0,0 +1,33 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Event; + + +public class OnCreateScene_InitEvent : AsyncEventSystem +{ + protected override async FTask Handler(OnCreateScene self) + { + var scene = self.Scene; + switch (scene.SceneType) + { + case SceneType.Authentication: + scene.AddComponent(); + scene.AddComponent(); + Log.Debug("初始化鉴权服务器组件"); + break; + case SceneType.Gate: + scene.AddComponent(); + scene.AddComponent(); + Log.Debug("初始网关(Gate)服务器组件"); + break; + + case SceneType.Chat: + scene.AddComponent(); + scene.AddComponent(); + break; + } + + await FTask.CompletedTask; + + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Authentication/Account/AccountSystem.cs b/GameServer/Server/Hotfix/Outter/Authentication/Account/AccountSystem.cs new file mode 100644 index 00000000..d7edeeff --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Authentication/Account/AccountSystem.cs @@ -0,0 +1,30 @@ +using Fantasy.Entitas.Interface; + +namespace Hotfix; + +public class AccountSystem +{ + +} + +public class AccountAwakeSystem : AwakeSystem +{ + protected override void Awake(Account self) + { + self.CreateTime = 0; + self.LoginTime = 0; + self.Username = string.Empty; + self.Password = string.Empty; + } +} +public class AccountDestroySystem : DestroySystem +{ + protected override void Destroy(Account self) + { + self.CreateTime = 0; + self.LoginTime = 0; + self.Username = string.Empty; + self.Password = string.Empty; + } +} + diff --git a/GameServer/Server/Hotfix/Outter/Authentication/Account/TimeOut/AccountInfoTimeOuterComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Authentication/Account/TimeOut/AccountInfoTimeOuterComponentSystem.cs new file mode 100644 index 00000000..e43610dc --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Authentication/Account/TimeOut/AccountInfoTimeOuterComponentSystem.cs @@ -0,0 +1,39 @@ + + +using Fantasy.Entitas.Interface; + +namespace Hotfix; + +public static class AccountInfoTimeOuterComponentSystem +{ + public static void TimeOut(this AccountInfoTimeOuterComponent self,int time) + { + var scene = self.Scene; + var parentRunTimeId = self.Parent.RuntimeId; + + self.TimeId = scene.TimerComponent.Net.OnceTimer(time, () => + { + if (parentRunTimeId != self.Parent.RuntimeId) + { + return; + } + + self.TimeId = 0; + AuthenticationHelper.RemoveCacheAccountInfo(scene,self.Key); + }); + } +} + + +public class AccountInfoTimeOuterComponentDestroySystem : DestroySystem +{ + protected override void Destroy(AccountInfoTimeOuterComponent self) + { + if (self.TimeId != 0) + { + self.Scene.TimerComponent.Net.Remove(self.TimeId); + } + self.TimeId = 0; + self.Key = string.Empty; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Authentication/Account/TimeOut/AccountTimeOuterComponent.cs b/GameServer/Server/Hotfix/Outter/Authentication/Account/TimeOut/AccountTimeOuterComponent.cs new file mode 100644 index 00000000..2c3b227c --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Authentication/Account/TimeOut/AccountTimeOuterComponent.cs @@ -0,0 +1,33 @@ +using Fantasy; +using Fantasy.Entitas.Interface; + +namespace Hotfix; + +public static class AccountTimeOuterComponentSystem +{ + + public static void TimeOut(this AccountTimeOuterComponent self, long timer) + { + var scene = self.Scene; + self.TimeId = scene.TimerComponent.Net.OnceTimer(timer, () => + { + + var account = self.Parent as Account; + self.TimeId = 0; + AuthenticationHelper.RemoveCacheAccount(scene, account.Username.GetHashCode()); + }); + } +} + +public class AccountTimeOuterComponentDestroySystem : DestroySystem +{ + protected override void Destroy(AccountTimeOuterComponent self) + { + if (self.TimeId != 0) + { + self.Scene.TimerComponent.Net.Remove(self.TimeId); + } + self.TimeId = 0; + self.UserCode = 0; + } +} diff --git a/GameServer/Server/Hotfix/Outter/Authentication/AuthenticationComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Authentication/AuthenticationComponentSystem.cs new file mode 100644 index 00000000..6029e8a7 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Authentication/AuthenticationComponentSystem.cs @@ -0,0 +1,187 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Entitas; +using Fantasy.Entitas.Interface; +using Fantasy.Helper; +using Fantasy.Platform.Net; + + +namespace Hotfix; +public static class AuthenticationComponentSystem +{ + #region 注册 + + + /// + /// 注册 + /// + /// + /// + /// + /// + /// + public static async FTask Register(this AuthenticationComponent self,string username, string password,string source) + { + if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) + { + return GameErrorCode.UsernameOrPasswordCannotBeEmpty; + } + + var position = HashCodeHelper.MurmurHash3(username) % self.AuthenticationCount; + if (position != self.Position) + { + return GameErrorCode.UnauthorizedServer; + } + + var scene = self.Scene; + var database = scene.World.DataBase; + var userCode = (long)username.GetHashCode(); + using (await scene.CoroutineLockComponent.Wait((int)ELockType.AuthenticationRegister,userCode)) + { + if (self.RegisterAccounts.ContainsKey(userCode)) + { + Log.Debug($"Authentication:RegisterAccount Fail(注册失败),username:{username} 已存在缓存中"); + return GameErrorCode.UserAlreadyExists; + } + + var isExist = await database.Exist(x=>x.Username == username); + if (isExist) + { + Log.Debug($"Authentication:RegisterAccount Fail(注册失败),username:{username} 已存在数据库中"); + return GameErrorCode.UserAlreadyExists; + } + + var account = Entity.Create(scene,true,false); + account.Username = username; + account.Password = password; + account.CreateTime = DateTime.Now.Ticks; + + var timerOutCom = account.AddComponent(); + timerOutCom.TimeOut(5000); + self.RegisterAccounts.Add(userCode,account); + + database.Save(account); + Log.Debug($"Authentication:RegisterAccount Success(注册成功),username:{username},password:{password},source:{source},Position:{self.Scene.SceneConfigId}"); + return GameErrorCode.Success; + } + } + + /// + /// 移除注册缓存 + /// + /// + /// + /// + public static void RemoveRegisterCacheAccount(this AuthenticationComponent self,long userCode,bool isDispose) + { + if (!self.RegisterAccounts.Remove(userCode,out var account)) + { + return; + } + + if (isDispose) + { + Log.Debug($"Authentication:账号{ account.Username}超时,移除缓存"); + account.Dispose(); + } + + } + + + + public static async FTask<(uint error,long accountId)> Login(this AuthenticationComponent self,string username, string password,string source) + { + if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) + { + return (GameErrorCode.UsernameOrPasswordCannotBeEmpty,0); + } + var position = HashCodeHelper.MurmurHash3(username) % self.AuthenticationCount; + if (position != self.Position) + { + return (GameErrorCode.UnauthorizedServer,0); + } + + var scene = self.Scene; + var database = scene.World.DataBase; + var userCode = (long)username.GetHashCode(); + using (await scene.CoroutineLockComponent.Wait((int)ELockType.AuthenticationLogin,userCode)) + { + (uint,long) result = (0,0); + if (self.LoginAccounts.TryGetValue(username,out var accountInfoCache)) + { + var accountCache = accountInfoCache.GetComponent(); + Log.Debug($"Authentication:Login 缓存中已存在,username:{username},password:{password},source:{source} 缓存中查看,Position:{self.Scene.SceneConfigId}"); + return accountCache != null ? (GameErrorCode.UserAlreadyExists,accountCache.Id):(GameErrorCode.UserNotFoundOrPasswordIsNotCorrect,0); + } + + var account = await database.First(x=>x.Username == username && x.Password == password); + if (account == null) + { + result = (GameErrorCode.UserNotFoundOrPasswordIsNotCorrect, 0); + Log.Debug($"Authentication:Login 失败(账号不存在或者密码不正确),username:{username},password:{password},source:{source} 数据库中查看,Position:{self.Scene.SceneConfigId}"); + } + + var accountInfo = Entity.Create(scene,true,false); + if (account !=null) + { + account.Deserialize(scene); + accountInfo.AddComponent(account); + result = (GameErrorCode.Success,account.Id); + Log.Debug($"Authentication: Login Success(登录成功),username:{username},password:{password},source:{source},Position:{self.Scene.SceneConfigId}"); + } + var timerOutCom = accountInfo.AddComponent(); + timerOutCom.Key = username; + timerOutCom.TimeOut(6000); + self.LoginAccounts.Add(username,accountInfo); + return result; + } + } + + + public static void RemoveCacheAccountInfo(this AuthenticationComponent self,string key, bool isDispose) + { + if (!self.LoginAccounts.Remove(key,out var accountCacheInfo)) + { + return; + } + + if (isDispose) + { + Log.Debug($"Authentication:Login:username:{key} 用户移除成功 从缓存中"); + accountCacheInfo.Dispose(); + } + } + + + public static void UpdatePosition(this AuthenticationComponent self) + { + + var authenticationScenes = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Authentication); + var sceneConfig = SceneConfigData.Instance.Get(self.Scene.SceneConfigId); + self.Position = authenticationScenes.IndexOf(sceneConfig); + self.AuthenticationCount = authenticationScenes.Count; + } + + #endregion +} + + +public class AuthenticationComponentAwakeSystem : AwakeSystem +{ + protected override void Awake(AuthenticationComponent self) + { + self.UpdatePosition(); + } +} + +public class AuthenticationComponentDestroySystem : DestroySystem +{ + protected override void Destroy(AuthenticationComponent self) + { + foreach (var account in self.RegisterAccounts.Values.ToArray()) + { + account.Dispose(); + } + self.RegisterAccounts.Clear(); + } +} diff --git a/GameServer/Server/Hotfix/Outter/Authentication/Handler/C2A_LoginRequestHandler.cs b/GameServer/Server/Hotfix/Outter/Authentication/Handler/C2A_LoginRequestHandler.cs new file mode 100644 index 00000000..4754ac4a --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Authentication/Handler/C2A_LoginRequestHandler.cs @@ -0,0 +1,33 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Network; +using Fantasy.Network.Interface; + +namespace Hotfix; + +public class C2A_LoginRequestHandler : MessageRPC +{ + protected override async FTask Run(Session session, C2A_LoginRequest request, A2C_LoginResponse response, Action reply) + { + + if (!session.CheckInterval(2000)) + { + response.ErrorCode = GameErrorCode.TooManyRequests; + return; + } + session.SetTimeout(1000 * 10); + + var scene = session.Scene; + var username = request.Username; + var password = request.Password; + var source = request.Source; + + var result = await AuthenticationHelper.Login(scene,username, password,source); + response.ErrorCode = result.error; + if (result.acountId == 0) return; + + string token = AuthenticationJWTComponentHelper.GeneratorToken(scene,result.acountId); + response.Token = token; + await FTask.CompletedTask; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Authentication/Handler/C2A_RegisterRequestHandler.cs b/GameServer/Server/Hotfix/Outter/Authentication/Handler/C2A_RegisterRequestHandler.cs new file mode 100644 index 00000000..bcda019b --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Authentication/Handler/C2A_RegisterRequestHandler.cs @@ -0,0 +1,28 @@ + +using Fantasy; +using Fantasy.Async; +using Fantasy.Network; +using Fantasy.Network.Interface; + +namespace Hotfix; +public class C2A_RegisterRequestHandler : MessageRPC +{ + protected override async FTask Run(Session session, C2A_RegisterRequest request, A2C_RegisterResponse response, Action reply) + { + if (!EntityTimeOutHelper.CheckInterval(session, 2000)) + { + response.ErrorCode = GameErrorCode.TooManyRequests; + return; + } + session.SetTimeout(10000); + // /SessionTimeOutHelper.SetTimeout(session,10000); + + var scene = session.Scene; + var username = request.Username; + var password = request.Password; + var source = request.Source; + var code = await AuthenticationHelper.RegisterAccount(scene,username,password,source); + response.ErrorCode = code; + return; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Authentication/Helper/AuthenticationHelper.cs b/GameServer/Server/Hotfix/Outter/Authentication/Helper/AuthenticationHelper.cs new file mode 100644 index 00000000..3c2c8d25 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Authentication/Helper/AuthenticationHelper.cs @@ -0,0 +1,28 @@ +using Fantasy; +using Fantasy.Async; + +namespace Hotfix; + +public static class AuthenticationHelper +{ + public static async FTask RegisterAccount(Scene scene,string username, string password,string source) + { + return await scene.GetComponent().Register(username,password,source); + } + + + public static async FTask<(uint error,long acountId)> Login(Scene scene,string username, string password,string source) + { + return await scene.GetComponent().Login(username,password,source); + } + + public static void RemoveCacheAccount(Scene scene, long userCode,bool isDispose = true) + { + scene.GetComponent().RemoveRegisterCacheAccount(userCode,isDispose); + } + + public static void RemoveCacheAccountInfo(Scene scene, string key,bool isDispose = true) + { + scene.GetComponent().RemoveCacheAccountInfo(key,isDispose); + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Authentication/JWT/AuthenticationJWTComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Authentication/JWT/AuthenticationJWTComponentSystem.cs new file mode 100644 index 00000000..a1c0771b --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Authentication/JWT/AuthenticationJWTComponentSystem.cs @@ -0,0 +1,83 @@ +using System.ComponentModel; +using System.IdentityModel.Tokens.Jwt; +using System.Security.Cryptography; +using Fantasy; +using Fantasy.Async; +using Fantasy.Entitas.Interface; +using Fantasy.Helper; +using Microsoft.IdentityModel.Tokens; + +namespace Hotfix; + +public class AuthenticationJWTComponentAwakeSystem : AwakeSystem +{ + protected override void Awake(AuthenticationJWTComponent self) + { + try + { + var rsa = RSA.Create(2048); + + // 处理公钥 - 使用您提供的格式 + string publicKeyData = self.PublicKey + .Replace("-----BEGIN PUBLIC KEY-----", "") + .Replace("-----END PUBLIC KEY-----", "") + .Replace("\n", "") + .Trim(); + + // 处理私钥 - 使用您提供的格式 + string privateKeyData = self.PrivateKey + .Replace("-----BEGIN PRIVATE KEY-----", "") + .Replace("-----END PRIVATE KEY-----", "") + .Replace("\n", "") + .Trim(); + + var publicKeyByte = Convert.FromBase64String(publicKeyData); + var privateKeyByte = Convert.FromBase64String(privateKeyData); + + // 根据您提供的密钥格式,尝试正确的导入方法 + rsa.ImportSubjectPublicKeyInfo(publicKeyByte, out _); + rsa.ImportPkcs8PrivateKey(privateKeyByte, out _); + + var rsaSecurityKey = new RsaSecurityKey(rsa); + self.JwtSigningCredentials = new SigningCredentials(rsaSecurityKey, SecurityAlgorithms.RsaSha256); + + Log.Info("RSA密钥导入成功"); + } + catch (Exception ex) + { + Log.Error($"RSA密钥处理错误: {ex.Message}"); + if (ex.InnerException != null) + Log.Error($"内部错误: {ex.InnerException.Message}"); + } + + } +} + +public static class AuthenticationJWTComponentSystem +{ + public static string GenerateToken(this AuthenticationJWTComponent self,long accountId) + { + + var header = new JwtHeader(self.JwtSigningCredentials); + + var serverGatesAddress = ServerDataConfigHelper.GateAllServerData(SceneType.Gate); + var gateAddress = serverGatesAddress[(int)(accountId % serverGatesAddress.Count)] ; + var payload = new JwtPayload() + { + {"aid",accountId}, + {"gateAddress",gateAddress}, + {"sceneId",self.Scene.SceneConfigId} + }; + var jwt = new JwtSecurityToken( + issuer: "July", // 令牌发行者 + audience: "gameUser", // 令牌接收者 + claims: payload.Claims, // 令牌声明(包含自定义数据) + expires: DateTime.UtcNow.AddSeconds(10), // 令牌过期时间(24小时后) + notBefore: DateTime.UtcNow, // 令牌生效时间(立即生效) + signingCredentials: self.JwtSigningCredentials // 签名凭证(使用RSA加密) + ); + + var tokenHandler = new JwtSecurityTokenHandler(); + return tokenHandler.WriteToken(jwt); + } +} diff --git a/GameServer/Server/Hotfix/Outter/Authentication/JWT/Helper/AuthenticationJWTComponentHelper.cs b/GameServer/Server/Hotfix/Outter/Authentication/JWT/Helper/AuthenticationJWTComponentHelper.cs new file mode 100644 index 00000000..3770dc65 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Authentication/JWT/Helper/AuthenticationJWTComponentHelper.cs @@ -0,0 +1,11 @@ +using Fantasy; + +namespace Hotfix; + +public static class AuthenticationJWTComponentHelper +{ + public static string GeneratorToken(Scene scene,long accountId) + { + return scene.GetComponent().GenerateToken(accountId); + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/ChatChannel/ChatChannelCenterComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Chat/ChatChannel/ChatChannelCenterComponentSystem.cs new file mode 100644 index 00000000..bea13cad --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/ChatChannel/ChatChannelCenterComponentSystem.cs @@ -0,0 +1,46 @@ +using Fantasy.Entitas; +using Fantasy.Entitas.Interface; + +namespace Hotfix; + + +public class ChatChannelCenterComponentDestroySystem : DestroySystem +{ + protected override void Destroy(ChatChannelCenterComponent self) + { + foreach (var channel in self.ChatChannels.Values.ToArray()) + { + channel.Dispose(); + } + self.ChatChannels.Clear(); + } +} + +public static class ChatChannelCenterComponentSystem +{ + public static ChatChannel Apply(this ChatChannelCenterComponent self, long chatChannelId) + { + if (self.ChatChannels.TryGetValue(chatChannelId, out var channel)) + { + return channel; + } + + channel = Entity.Create(self.Scene,chatChannelId,true,true); + return channel; + } + + public static bool TryGetChannel(this ChatChannelCenterComponent self, long chatChannelId, out ChatChannel channel) + { + return self.ChatChannels.TryGetValue(chatChannelId, out channel); + } + + public static bool RemoveChannel(this ChatChannelCenterComponent self, long chatChannelId) + { + if (!self.ChatChannels.Remove(chatChannelId, out var channel)) + { + return false; + } + channel.Dispose(); + return true; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/ChatChannel/ChatChannelSystem.cs b/GameServer/Server/Hotfix/Outter/Chat/ChatChannel/ChatChannelSystem.cs new file mode 100644 index 00000000..468a7466 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/ChatChannel/ChatChannelSystem.cs @@ -0,0 +1,58 @@ +using Fantasy; + +namespace Hotfix; + + + + +public static class ChatChannelSystem +{ + + public static void SendMessage(this ChatChannel self, string message) + { + var chatUnitManage = self.Scene.GetComponent(); + + + } + + /// + /// 进入聊天频道 + /// + /// + /// + /// + public static bool JoinChatChannel(this ChatChannel self, long chatUnitId) + { + var chatUnitManage = self.Scene.GetComponent(); + + if (!chatUnitManage.ChatUnits.TryGetValue(chatUnitId,out _)) + { + return false; + } + + self.ChatUnits.Add(chatUnitId); + return true; + } + + /// + /// 退出聊天频道 + /// + /// + /// + public static void ExitChatChannel(this ChatChannel self, long chatUnitId) + { + var chatUnitManage = self.Scene.GetComponent(); + + if (!self.ChatUnits.Contains(chatUnitId)) + { + return; + } + self.ChatUnits.Remove(chatUnitId); + + if (self.ChatUnits.Count == 0) + { + self.Dispose(); + } + } + +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/ChatManageComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Chat/ChatManageComponentSystem.cs new file mode 100644 index 00000000..7fee08dd --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/ChatManageComponentSystem.cs @@ -0,0 +1,39 @@ +using Fantasy; +using Fantasy.Entitas.Interface; + +namespace Hotfix; +public class ChatManageComponentDestroySystem : DestroySystem +{ + protected override void Destroy(ChatManageComponent self) + { + foreach (var chatUnit in self.ChatUnits.Values.ToArray()) + { + chatUnit.Dispose(); + } + + self.ChatUnits.Clear(); + } +} + +public static class ChatManageComponentSystem +{ + public static void AddChatUnit(this ChatManageComponent self,ChatUnit chatUnit) + { + if (self.ChatUnits.ContainsKey(chatUnit.RuntimeId)) + { + Log.Debug($" chat unit already added: {chatUnit.AccountId} {chatUnit.GameName} "); + return; + } + self.ChatUnits.Add(chatUnit.RuntimeId, chatUnit); + } + + public static void RemoveChatUnit(this ChatManageComponent self, long accountId) + { + if (!self.ChatUnits.Remove(accountId,out var chatUnit)) + { + Log.Debug($" chat unit is not exist: {accountId} "); + return; + } + chatUnit.Dispose(); + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/Handler/Inner/G2Chat_LoginRequestHandler.cs b/GameServer/Server/Hotfix/Outter/Chat/Handler/Inner/G2Chat_LoginRequestHandler.cs new file mode 100644 index 00000000..b2922f14 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/Handler/Inner/G2Chat_LoginRequestHandler.cs @@ -0,0 +1,26 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Entitas; +using Fantasy.Network.Interface; + +namespace Hotfix; + +public class G2Chat_LoginRequestHandler : RouteRPC +{ + protected override async FTask Run(Scene scene, G2Chat_LoginRequest request, Chat2G_LoginResponse response, Action reply) + { + + var chatUnit = Entity.Create(scene,request.GateRoutedId,false,false); + chatUnit.AccountId = request.AccountId; + chatUnit.GameName = request.GameName; + response.ErrorCode = GameErrorCode.Success; + + response.ChatRouteId = chatUnit.RuntimeId; + + + + Log.Info($"登录聊天服务器成功 {request.GameName} AccountId {request.AccountId } GateRoutedId { request.GateRoutedId}"); + ChatComponentHelper.AddChatUnit(scene,chatUnit); + await FTask.CompletedTask; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/Handler/Inner/G2Chat_OfflineRequestHandler.cs b/GameServer/Server/Hotfix/Outter/Chat/Handler/Inner/G2Chat_OfflineRequestHandler.cs new file mode 100644 index 00000000..8137fd7e --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/Handler/Inner/G2Chat_OfflineRequestHandler.cs @@ -0,0 +1,18 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Network.Interface; + +namespace Hotfix; + +public class G2Chat_OfflineRequestHandler : RouteRPC +{ + protected override async FTask Run(ChatUnit chatUnit, G2Chat_OfflineRequest request, Chat2G_OfflineResponse response, Action reply) + { + Log.Debug($"chat : 聊天服务器{chatUnit.GameName} 下线"); + chatUnit.Dispose(); + + response.ErrorCode = GameErrorCode.Success; + ChatComponentHelper.RemoveChatUnit(chatUnit.Scene,chatUnit.RuntimeId); + await FTask.CompletedTask; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/Handler/Outer/C2Chat_BoardRequestMessageHandler.cs b/GameServer/Server/Hotfix/Outter/Chat/Handler/Outer/C2Chat_BoardRequestMessageHandler.cs new file mode 100644 index 00000000..ccb0c5f8 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/Handler/Outer/C2Chat_BoardRequestMessageHandler.cs @@ -0,0 +1,16 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Network.Interface; + +namespace Hotfix; + +public class C2Chat_BoardRequestMessageHandler : RouteRPC +{ + protected override async FTask Run(ChatUnit chatUnit, C2Chat_BoardMessageRequest request, Chat2C_BoardMessageResponse response, Action reply) + { + var scene = chatUnit.Scene; + Log.Debug(request.Message); + ChatHelper.BoardCast(scene, request.Message); + await FTask.CompletedTask; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/Handler/Outer/C2Chat_TestRequestHandler.cs b/GameServer/Server/Hotfix/Outter/Chat/Handler/Outer/C2Chat_TestRequestHandler.cs new file mode 100644 index 00000000..2ab7b72a --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/Handler/Outer/C2Chat_TestRequestHandler.cs @@ -0,0 +1,15 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Network.Interface; + +namespace Hotfix; + +public class C2Chat_TestRequestHandler : RouteRPC +{ + protected override async FTask Run(ChatUnit chatUnit, C2Chat_TestRequest request, Chat2C_TestResponse response, Action reply) + { + Log.Info($"chatUnit{chatUnit.GameName} AccountId:{chatUnit.AccountId}"); + await FTask.CompletedTask; + + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/Helper/ChatChannelCenterComponentHelper.cs b/GameServer/Server/Hotfix/Outter/Chat/Helper/ChatChannelCenterComponentHelper.cs new file mode 100644 index 00000000..4cc15a6e --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/Helper/ChatChannelCenterComponentHelper.cs @@ -0,0 +1,22 @@ +using Fantasy; + +namespace Hotfix; + +public static class ChatChannelCenterComponentHelper +{ + public static ChatChannel Apply(Scene scene, long chatChannelId) + { + return scene.GetComponent().Apply(chatChannelId); + } + + + public static bool TryGetChannel(Scene scene, long chatChannelId,out ChatChannel channel) + { + return scene.GetComponent().TryGetChannel(chatChannelId,out channel); + } + + public static bool RemoveChannel(Scene scene, long chatChannelId) + { + return scene.GetComponent().RemoveChannel(chatChannelId); + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/Helper/ChatComponentHelper.cs b/GameServer/Server/Hotfix/Outter/Chat/Helper/ChatComponentHelper.cs new file mode 100644 index 00000000..aa425e67 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/Helper/ChatComponentHelper.cs @@ -0,0 +1,17 @@ +using Fantasy; + +namespace Hotfix; + +public class ChatComponentHelper +{ + public static void AddChatUnit(Scene scene,ChatUnit chatUnit) + { + scene.GetComponent().AddChatUnit(chatUnit); + } + + public static void RemoveChatUnit(Scene scene,long accountId) + { + scene.GetComponent().RemoveChatUnit(accountId); + } + +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Chat/Helper/ChatHelper.cs b/GameServer/Server/Hotfix/Outter/Chat/Helper/ChatHelper.cs new file mode 100644 index 00000000..b1442596 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Chat/Helper/ChatHelper.cs @@ -0,0 +1,28 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Platform.Net; + +namespace Hotfix; + +public static class ChatHelper +{ + + /// + /// 全服广播 + /// + /// + /// + public static void BoardCast(Scene scene,string message) + { + var gateConfigs = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Gate); + var netMessageComponent = scene.NetworkMessagingComponent; + foreach (var gateConfig in gateConfigs) + { + Log.Debug(gateConfig.RouteId.ToString()); + netMessageComponent.SendInnerRoute(gateConfig.RouteId, new Chat2G_BoardMessage() + { + Message = message + }); + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Common/Data/ServerDataHelper.cs b/GameServer/Server/Hotfix/Outter/Common/Data/ServerDataHelper.cs new file mode 100644 index 00000000..bf069c6a --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Common/Data/ServerDataHelper.cs @@ -0,0 +1,21 @@ +using Fantasy; +using Fantasy.Platform.Net; + +namespace Hotfix; + +public static class ServerDataConfigHelper +{ + public static List GateAllServerData(int sceneType) + { + var sceneConfigs = SceneConfigData.Instance.GetSceneBySceneType(sceneType); + List serverAddresses = new List(); + foreach (var sceneConfig in sceneConfigs) + { + var worldId = sceneConfig.WorldConfigId; + var machine = MachineConfigData.Instance.Get(worldId); + var address = $"{machine.OuterBindIP}:{sceneConfig.OuterPort}"; + serverAddresses.Add(address); + } + return serverAddresses; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Entity/EntityTimeOutComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Entity/EntityTimeOutComponentSystem.cs new file mode 100644 index 00000000..a2bfea3e --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Entity/EntityTimeOutComponentSystem.cs @@ -0,0 +1,77 @@ +using System.Runtime.CompilerServices; +using Fantasy; +using Fantasy.Async; +using Fantasy.Entitas.Interface; +using Fantasy.Helper; + +namespace Hotfix; + +public static class EntityTimeOutComponentSystem +{ + public static void SetInterval(this EntityTimeOutComponent self, int interval) + { + self.Interval = interval; + //self.NextTime = TimeHelper.Now + interval; + } + + public static bool CheckInterval(this EntityTimeOutComponent self) + { + if (TimeHelper.Now < self.NextTime) + { + Log.Warning("请求过于频繁" + self.NextTime +"TimeOut" + TimeHelper.Now); + return false; + } + + self.NextTime = TimeHelper.Now + self.Interval; + return true; + } + + public static void TimeOut(this EntityTimeOutComponent self, long time,Func? callback = null) + { + var scene = self.Scene; + var parentRunTimeId = self.Parent.RuntimeId; + self.TimeId = scene.TimerComponent.Net.OnceTimer(time, () => + { + self.Handler(parentRunTimeId,callback).Coroutine(); + }); + } + + public static async FTask Handler(this EntityTimeOutComponent self,long parentRunTimeId , Func? callback) + { + var selfParent = self.Parent; + if (self.Parent == null || parentRunTimeId != self.Parent.RuntimeId ) + { + return; + } + if (callback != null) + { + await callback(); + } + self.TimeId = 0; + selfParent.Dispose(); + Log.Debug($"session : {selfParent.RuntimeId} Dispose"); + } + +} + +public class SessionTimeOutComponentAwakeSystem : AwakeSystem +{ + protected override void Awake(EntityTimeOutComponent self) + { + + } +} +public class SessionTimeOutComponentDestroySystem : DestroySystem +{ + protected override void Destroy(EntityTimeOutComponent self) + { + if (self.TimeId != 0) + { + self.Scene.TimerComponent.Net.Remove(self.TimeId); + } + + self.NextTime = 0; + self.Interval = 0; + + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Entity/EntityTimeOutHelper.cs b/GameServer/Server/Hotfix/Outter/Entity/EntityTimeOutHelper.cs new file mode 100644 index 00000000..14f51a6f --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Entity/EntityTimeOutHelper.cs @@ -0,0 +1,35 @@ +using Fantasy.Async; +using Fantasy.Entitas; +using Fantasy.Network; + +namespace Hotfix; + +public static class EntityTimeOutHelper +{ + public static bool CheckInterval(this Entity self, int interval) + { + var entityTimeOut = self.GetComponent(); + if (entityTimeOut == null) + { + entityTimeOut = self.AddComponent(); + entityTimeOut.SetInterval(interval); + } + return entityTimeOut.CheckInterval(); + } + + public static void SetTimeout(this Entity self, long timeout,Func? callback = null) + { + var entityTimeOut = self.GetComponent(); + if (entityTimeOut == null) + { + entityTimeOut = self.AddComponent(); + } + entityTimeOut.TimeOut(timeout,callback); + } + + public static bool IsHasTimeout(this Entity self) + { + return self.GetComponent() != null; + } + +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountFactory.cs b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountFactory.cs new file mode 100644 index 00000000..0b723904 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountFactory.cs @@ -0,0 +1,23 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Entitas; +using Fantasy.Helper; + +namespace Hotfix; + +public static class GameAccountFactory +{ + public static async FTask Create(Scene scene, long accountId, bool isSaveToDatabase = true) + { + var gameAccount = Entity.Create(scene,accountId,false,false); + gameAccount.CreateTime = TimeHelper.Now; + + if (isSaveToDatabase) + { + await gameAccount.SaveToDatabase(scene); + } + + return gameAccount; + } + +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountFlagComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountFlagComponentSystem.cs new file mode 100644 index 00000000..718f323d --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountFlagComponentSystem.cs @@ -0,0 +1,17 @@ +using Fantasy; +using Fantasy.Entitas.Interface; + +namespace Hotfix; + +public class GameAccountFlagComponentDestroySystem : DestroySystem +{ + protected override void Destroy(GameAccountFlagComponent self) + { + if (self.AccountId != 0) + { + GateComponentHelper.Disconnect(self.Scene,self.AccountId,1000 * 10).Coroutine(); + self.AccountId = 0; + } + self.Account = null; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountManageComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountManageComponentSystem.cs new file mode 100644 index 00000000..024aec35 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountManageComponentSystem.cs @@ -0,0 +1,188 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Entitas.Interface; +using Fantasy.Helper; +using Fantasy.Network; +using Hotfix.Helper; + +namespace Hotfix; + +public static class GameAccountManageComponentSystem +{ + public static void Add(this GameAccountManageComponent self,long accountId, GameAccount gameAccount) + { + if (!self.Accounts.ContainsKey(accountId)) + { + self.Accounts.Add(accountId, gameAccount); + } + else + { + self.Accounts[accountId] = gameAccount; + } + } + + public static GameAccount? Get(this GameAccountManageComponent self,long accountId) + { + return self.Accounts.GetValueOrDefault(accountId); + } + + public static bool TryGet(this GameAccountManageComponent self,long accountId,out GameAccount account) + { + return self.Accounts.TryGetValue(accountId,out account); + } + + public static async FTask Remove(this GameAccountManageComponent self, long accountId, bool isDispose = true) + { + if (!self.TryGet(accountId, out var account)) + { + return false; + } + var errorCode = await GateLoginHelper.Offline(account); + + if (errorCode!= GameErrorCode.Success) + { + return false; + } + + if (!self.Accounts.Remove(accountId,out var gameAccount)) + { + return false; + } + + if (isDispose) + { + gameAccount.Dispose(); + } + return true; + } + + + public static async FTask<(uint error,GameAccount gameAccount)> LoginAccountGame(this GameAccountManageComponent self,Session session,long accountId) + { + var scene = self.Scene; + //GameAccount gameAccount = null; + using (await scene.CoroutineLockComponent.Wait((int)ELockType.GateGetGameAccount,accountId)) + { + // gameAccount = self.Get(accountId); + if (!self.TryGet(accountId,out var gameAccount)) + { + gameAccount = await GameAccountHelper.LoadGameAccountFromDatabase(scene,accountId); + if (gameAccount == null) + { + Log.Debug("Gate创建新的账号(account)并保存到数据库"); + gameAccount = await GameAccountFactory.Create(scene, accountId); + } + self.Add(accountId, gameAccount); + } + else + { + Log.Debug("Gate account already exists(账号已存在缓存中)"); + if ( gameAccount.SessionRuntimeId == session.RuntimeId) + { + return (GameErrorCode.GateRepeatedLogin,gameAccount); + } + + Log.Debug($"Gate 检测当前帐号和当前Session 不是同一个,{gameAccount.SessionRuntimeId},${session.RuntimeId}"); + if (scene.TryGetEntity( gameAccount.SessionRuntimeId,out var oldSession)) + { + Log.Debug($"Gate 如果当前Session 存在 需要 发送 给 oldSession 一个 重复登录的消息 ,并且要断开这个Session"); + + oldSession.GetComponent().AccountId = 0; + + oldSession.Send(new G2C_LoginRepeatedMessage()); + oldSession.SetTimeout(3000); + + } + } + + var flagCom = session.AddComponent(); + flagCom.AccountId = accountId; + flagCom.Account = gameAccount; + gameAccount.LoginTime = TimeHelper.Now; + Log.Debug($"Gate 当前缓存中的 SessionID {session.RuntimeId}"); + gameAccount.SessionRuntimeId = session.RuntimeId; + return (GameErrorCode.GateLoginSuccess,gameAccount); + } + } + + public static async FTask DisConnect(this GameAccountManageComponent self, long accountId,long timeout = 1000 * 60 * 5 ) + { + + var scene = self?.Scene; + if (scene == null) + { + Log.Debug("scene is null"); + } + + if (!self.TryGet(accountId,out var gameAccount)) + { + Log.Warning("Gate:下线操作时失败,账号缓存库里面并不存在这个账号,逻辑出现错误了"); + return; + } + + if (!scene.TryGetEntity(gameAccount.SessionRuntimeId,out var session)) + { + Log.Warning("Gate:下线操作时失败,Session 未找到 已经实现了断开了逻辑,逻辑出现错误了"); + return; + } + + if (gameAccount.IsHasTimeout()) + { + Log.Debug("Gate 已经存在了销毁组件"); + return; + } + if (timeout < 0 ) + { + await gameAccount.DisConnect(); + return; + } + gameAccount.SetTimeout(timeout,gameAccount.DisConnect); + + } + + + public static async FTask UpdateAccountGameName(this GameAccountManageComponent self,Session session,long accountId,string gameName) + { + if (!self.TryGet(accountId,out var gameAccount)) + { + gameAccount = (await self.LoginAccountGame(session,accountId)).gameAccount; + + if (gameAccount == null) + { + Log.Debug("Gate 修改用户名称 失败 用户不存在"); + return GameErrorCode.GateUpdateGameNameFailed; + } + } + Log.Debug($"Gate 修改用户名成功 用户名{gameName}"); + gameAccount.GameName = gameName; + return GameErrorCode.GateUpdateGameNameSuccess; + } + public static async FTask GetGameAccount(this GameAccountManageComponent self,Session session,long accountId) + { + if (!self.TryGet(accountId,out var gameAccount)) + { + gameAccount = (await self.LoginAccountGame(session,accountId)).gameAccount; + + if (gameAccount == null) + { + Log.Debug("Gate 修改用户名称 失败 用户不存在"); + return null; + } + } + return gameAccount; + } + + +} + +public class GameAccountManageComponentDestroySystem : DestroySystem +{ + protected override void Destroy(GameAccountManageComponent self) + { + foreach (var (_,account) in self.Accounts.ToArray()) + { + account.Dispose(); + } + self.Accounts.Clear(); + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountSystem.cs b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountSystem.cs new file mode 100644 index 00000000..38bd4faf --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/GameAccountSystem.cs @@ -0,0 +1,45 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Entitas.Interface; +using Fantasy.Network; + +namespace Hotfix; + +public static class GameAccountSystem +{ + public static async FTask SaveToDatabase(this GameAccount self,Scene scene) + { + await scene.World.DataBase.Save(self); + } + + public static GameAccountInfo GetGameAccountInfo(this GameAccount self) + { + return new GameAccountInfo() + { + CreateTime = self.CreateTime, + LoginTime = self.LoginTime, + GameName = self.GameName, + }; + } + + public static async FTask DisConnect(this GameAccount self) + { + var scene = self.Scene; + var accountId = self.Id; + Log.Debug("Gate gameAccount 下线前 保存数据到 数据库中"); + await self.SaveToDatabase(scene); + await GateComponentHelper.GetGameAccountManageComponent(scene).Remove(accountId); + } + +} + +public class GameAccountDestroy : DestroySystem +{ + protected override void Destroy(GameAccount self) + { + self.DisConnect().Coroutine(); + self.CreateTime = 0; + self.LoginTime = 0; + self.SessionRuntimeId = 0; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/GameAccount/Helper/GameAccountHelper.cs b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/Helper/GameAccountHelper.cs new file mode 100644 index 00000000..8e06d3f1 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/GameAccount/Helper/GameAccountHelper.cs @@ -0,0 +1,20 @@ +using Fantasy; +using Fantasy.Async; + +namespace Hotfix.Helper; + +public static class GameAccountHelper +{ + public static async FTask LoadGameAccountFromDatabase(Scene scene,long accountId) + { + + var gameCount = await scene.World.DataBase.First(x=> x.Id == accountId); + + if (gameCount == null) return null; + + gameCount.Deserialize(scene); + + return gameCount; + + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/GateComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Gate/GateComponentSystem.cs new file mode 100644 index 00000000..5167af37 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/GateComponentSystem.cs @@ -0,0 +1,19 @@ +using Fantasy; +using Fantasy.Entitas; +using Fantasy.Entitas.Interface; + +namespace Hotfix; + + +public class GateComponentAwakeSystem : AwakeSystem +{ + protected override void Awake(GateComponent self) + { + self.AddComponent(); + } +} + +public static class GateComponentSystem +{ + +} diff --git a/GameServer/Server/Hotfix/Outter/Gate/Handler/C2G_LoginRequestHandler.cs b/GameServer/Server/Hotfix/Outter/Gate/Handler/C2G_LoginRequestHandler.cs new file mode 100644 index 00000000..33c62309 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/Handler/C2G_LoginRequestHandler.cs @@ -0,0 +1,57 @@ +using Fantasy.Async; +using Fantasy.Network; +using Fantasy.Network.Interface; +using Hotfix; + +namespace Fantasy; + +public class C2G_LoginRequestHandler : MessageRPC +{ + protected override async FTask Run(Session session, C2G_LoginRequest request, G2C_LoginResponse response, Action reply) + { + var token = request.Token; + var scene = session.Scene; + if (string.IsNullOrEmpty(token)) + { + Log.Debug("令牌为空,恶意攻击"); + session.Dispose(); + response.ErrorCode = GameErrorCode.GateTokenValidFailed; + return; + } + + if (!GateJwtComponentHelper.ValidateToken(scene,token,out var accountId) ) + { + Log.Debug("Token校验失败,恶意攻击"); + response.ErrorCode = GameErrorCode.GateTokenValidFailed; + session.Dispose(); + return; + } + + response.ErrorCode = GameErrorCode.GateTokenValidSuccess; + Log.Debug($"Gate校验登录成功用户{accountId}"); + + var result = await GateComponentHelper.LoginAccountGame(session,accountId); + + if (result.error == GameErrorCode.GateRepeatedLogin) + { + response.ErrorCode = GameErrorCode.GateRepeatedLogin; + return; + } + + response.GameAccount = result.gameAccount.GetGameAccountInfo(); + + Log.Debug($"Gate : Login 登录成功GameAccount:session{session.RuntimeId} AccountId:{accountId} "); + // var result = GateJwtComponentHelper.ValidateToken(scene, token); + // response.ErrorCode = result; + // if (result != GameErrorCode.GateTokenValidSuccess) return; + // Log.Debug("Gate校验登录令牌成功"); + if (string.IsNullOrEmpty(result.gameAccount.GameName) || result.gameAccount.GameName.Length == 0) + { + session.Send(new G2C_OpenGameNameInputWindowsMessage()); + } + + await GateLoginHelper.Online(session, result.gameAccount, session.RuntimeId); + + await FTask.CompletedTask; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/Handler/C2G_UpdateAndSaveGameNameRequestHandler.cs b/GameServer/Server/Hotfix/Outter/Gate/Handler/C2G_UpdateAndSaveGameNameRequestHandler.cs new file mode 100644 index 00000000..1fd060c4 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/Handler/C2G_UpdateAndSaveGameNameRequestHandler.cs @@ -0,0 +1,25 @@ +using Fantasy.Async; +using Fantasy.Network; +using Fantasy.Network.Interface; +using Hotfix; + +namespace Fantasy; + +public class C2G_UpdateAndSaveGameNameRequestHandler : MessageRPC +{ + protected override async FTask Run(Session session, C2G_UpdateAndSaveGameNameRequest request, G2C_UpdateAndSaveGameNameResponse response, Action reply) + { + + var scene = session.Scene; + + if (string.IsNullOrEmpty(request.GameName) || request.AccountId == 0) + { + Log.Debug($"Gate 登录 失败用户名 和 账号 ID 不能为空 "); + return; + } + Log.Debug($"Gate 修改游戏名 account{request.AccountId} 游戏名称 :{request.GameName} "); + var result = await GateComponentHelper.UpdateAccountGameName(scene,session, request.AccountId, request.GameName); + + response.ErrorCode = result; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/Handler/G2C_GetGameAccountInfoHandler.cs b/GameServer/Server/Hotfix/Outter/Gate/Handler/G2C_GetGameAccountInfoHandler.cs new file mode 100644 index 00000000..7fc0e42d --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/Handler/G2C_GetGameAccountInfoHandler.cs @@ -0,0 +1,41 @@ +using System.Diagnostics; +using Fantasy.Async; +using Fantasy.Network; +using Fantasy.Network.Interface; +using Hotfix; + +namespace Fantasy; + +public class G2C_GetGameAccountInfoHandler : MessageRPC +{ + protected override async FTask Run(Session session, C2G_GetGameAccountInfo request, G2C_GetGameAccountInfo response, Action reply) + { + // var flagCom = session.GetComponent(); + // + // if (flagCom == null) + // { + // Log.Debug("Gate : 请先登录在访问这个接口"); + // session.Dispose(); + // return; + // } + // GameAccount gameAccount = flagCom.Account; + // + // if (gameAccount == null) + // { + // Log.Debug("Gate :gameaccount 已经被销毁掉了 并不是我们 想要的"); + // return; + // } + var scene = session.Scene; + + var gameAccount = await GateComponentHelper.GetGameAccount(scene,session,request.AccountId); + if (gameAccount == null) + { + Log.Debug("Gate :gameaccount 并不存在 并不是我们 想要的"); + return; + } + response.AccountInfo = gameAccount.GetGameAccountInfo(); + Log.Debug($"Gate: 获取账号信息 AccountId {response.AccountInfo.GameName} "); + + } + +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/Handler/Inner/Chat2G_BoardMessageHandler.cs b/GameServer/Server/Hotfix/Outter/Gate/Handler/Inner/Chat2G_BoardMessageHandler.cs new file mode 100644 index 00000000..15b9728f --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/Handler/Inner/Chat2G_BoardMessageHandler.cs @@ -0,0 +1,29 @@ +using Fantasy.Async; +using Fantasy.Network; +using Fantasy.Network.Interface; +using Hotfix; + +namespace Fantasy; + +public class Chat2G_BoardMessageHandler : Route +{ + protected override async FTask Run(Scene scene, Chat2G_BoardMessage message) + { + var gameAccountManager = GateComponentHelper.GetGameAccountManageComponent(scene); + //var chatMessage = new chat2c + + var chatMessage = new Chat2C_BoardMessage() + { + Message = message.Message + }; + foreach (var account in gameAccountManager.Accounts.Values) + { + + if (scene.TryGetEntity(account.SessionRuntimeId, out var session)) + { + session.Send(chatMessage ); + } + } + await FTask.CompletedTask; + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/Helper/GateComponentHelper.cs b/GameServer/Server/Hotfix/Outter/Gate/Helper/GateComponentHelper.cs new file mode 100644 index 00000000..8aeae87e --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/Helper/GateComponentHelper.cs @@ -0,0 +1,42 @@ +using System.Runtime.InteropServices; +using Fantasy; +using Fantasy.Async; +using Fantasy.Network; + +namespace Hotfix; + +public static class GateComponentHelper +{ + public static FTask<(uint error, GameAccount gameAccount)> LoginAccountGame(Session session,long accountId) + { + var scene = session.Scene; + var gate = scene.GetComponent(); + var gameAccountManage = gate.GetComponent(); + if (gameAccountManage == null) + { + gameAccountManage.AddComponent(); + } + + return gameAccountManage.LoginAccountGame(session,accountId); + } + + public static GameAccountManageComponent GetGameAccountManageComponent(Scene scene) + { + return scene.GetComponent().GetComponent(); + } + + public static async FTask Disconnect(Scene scene,long accountId,long timeout) + { + await scene.GetComponent().GetComponent().DisConnect(accountId,timeout); + } + + public static async FTask UpdateAccountGameName(Scene scene, Session session, long accountId, string gameName) + { + return await scene.GetComponent().GetComponent().UpdateAccountGameName(session,accountId,gameName); + } + + public static async FTask GetGameAccount(Scene scene,Session session,long accountId) + { + return await scene.GetComponent().GetComponent().GetGameAccount(session,accountId); + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/Helper/GateLoginHelper.cs b/GameServer/Server/Hotfix/Outter/Gate/Helper/GateLoginHelper.cs new file mode 100644 index 00000000..8db5d37a --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/Helper/GateLoginHelper.cs @@ -0,0 +1,64 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Network; +using Fantasy.Platform.Net; + +namespace Hotfix; + +public static class GateLoginHelper +{ + private static List>> scenes = + new List>>() + { + OnlineChat + }; + + /// + /// 上线 + /// + /// + /// + /// + public static async FTask Online(Session session, GameAccount account,long gateRouteId) + { + foreach (var scene in scenes) + { + var result = await scene(session.Scene, account, gateRouteId); + if (result.error != GameErrorCode.Success) return; + var routeComponent = session.GetOrAddComponent(); + routeComponent.AddAddress(result.routeType,result.chatRouteId); + account.Routes[result.routeType] = result.chatRouteId; + } + Log.Debug("OLine Gate"+GateComponentHelper.GetGameAccountManageComponent(session.Scene).Accounts.Count.ToString()); + } + + public static async FTask Offline(GameAccount account) + { + var netComponent = account.Scene.NetworkMessagingComponent; + foreach (var (routeType,routeId) in account.Routes) + { + switch (routeType) + { + case RouteType.ChatRoute: + var response = await netComponent.CallInnerRoute(routeId, new G2Chat_OfflineRequest()); + if (response.ErrorCode != GameErrorCode.Success) return response.ErrorCode; + Log.Debug($"Gate : chat聊天服务器下线成功"); + break; + } + } + account.Routes.Clear(); + return GameErrorCode.Success; + } + + public static async FTask<(uint error, long chatRouteId, int routeType)> OnlineChat(Scene scene, GameAccount account,long gateRouteId) + { + var chat = SceneConfigData.Instance.GetSceneBySceneType(scene.World.Id, SceneType.Chat)[0]; + var response = (Chat2G_LoginResponse)await scene.NetworkMessagingComponent.CallInnerRoute(chat.RouteId, new G2Chat_LoginRequest() + { + GameName = account.GameName, + AccountId = account.Id, + GateRoutedId = gateRouteId, + }); + return (response.ErrorCode, response.ChatRouteId,RouteType.ChatRoute); + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/JWT/GateJWTComponentSystem.cs b/GameServer/Server/Hotfix/Outter/Gate/JWT/GateJWTComponentSystem.cs new file mode 100644 index 00000000..6cf0ba53 --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/JWT/GateJWTComponentSystem.cs @@ -0,0 +1,72 @@ +using System.IdentityModel.Tokens.Jwt; +using System.Security.Cryptography; +using Fantasy; +using Fantasy.Async; +using Fantasy.Entitas.Interface; +using Microsoft.IdentityModel.Tokens; + +namespace Hotfix; + + + +public class GateJWTComponentAwakeSystem : AwakeSystem +{ + protected override void Awake(GateJWTComponent self) + { + RSA rsa = RSA.Create(2048); + string publicKeyData = self.PublicKey + .Replace("-----BEGIN PUBLIC KEY-----", "") + .Replace("-----END PUBLIC KEY-----", "") + .Replace("\n", "") + .Trim(); + var publicKeyBytes = Convert.FromBase64String(publicKeyData); + rsa.ImportSubjectPublicKeyInfo(publicKeyBytes,out _); + RsaSecurityKey securityKey = new RsaSecurityKey(rsa); + + // 创建验证参数 + self.ValidationParameters = new TokenValidationParameters + { + ValidateIssuer = false, // 是否验证发行者 + ValidateAudience = false, // 是否验证接收者 + ValidateLifetime = true, // 是否验证过期时间 + ValidateIssuerSigningKey = true, // 是否验证签名密钥 + IssuerSigningKey = new RsaSecurityKey(rsa) + }; + } +} +public static class GateJWTComponentSystem +{ + public static bool ValidateToken(this GateJWTComponent self,string token,out JwtPayload payload ) + { + + var tokenHandler = new JwtSecurityTokenHandler(); + payload = null; + try + { + tokenHandler.ValidateToken(token,self.ValidationParameters, out SecurityToken validatedToken); + Log.Warning($"Gate:Token签名校验成功"); + payload = tokenHandler.ReadJwtToken(token).Payload; + //return GameErrorCode.GateTokenValidSuccess; + return true; + } + catch (SecurityTokenExpiredException) + { + Log.Warning($"Gate:Token已过期"); + return false; + //return GameErrorCode.GateTokenExpired; + } + catch (SecurityTokenInvalidSignatureException) + { + Log.Warning($"Gate:Token签名无效"); + return false; + //return GameErrorCode.GateTokenInvalidSignature; + } + catch (Exception e) + { + Log.Error($"Gate:Token验证失败: {e.Message}"); + return false; + //return GameErrorCode.GateTokenGeneralError; + } + + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Outter/Gate/JWT/Helper/GateJwtComponentHelper.cs b/GameServer/Server/Hotfix/Outter/Gate/JWT/Helper/GateJwtComponentHelper.cs new file mode 100644 index 00000000..1e4724cf --- /dev/null +++ b/GameServer/Server/Hotfix/Outter/Gate/JWT/Helper/GateJwtComponentHelper.cs @@ -0,0 +1,37 @@ +using System.IdentityModel.Tokens.Jwt; +using Fantasy; + +namespace Hotfix; + +public static class GateJwtComponentHelper +{ + private static bool ValidateToken(Scene scene, string token,out JwtPayload payload) + { + return scene.GetComponent().ValidateToken(token, out payload); + } + + public static bool ValidateToken(Scene scene, string token, out long accountId) + { + accountId = 0; + if (!ValidateToken(scene, token, out JwtPayload payload)) + { + return false; + } + + try + { + var sceneConfigId = Convert.ToInt64(payload["sceneId"]); + accountId = Convert.ToInt64(payload["aid"]); + if (sceneConfigId == scene.SceneConfigId) + { + return false; + } + return true; + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Custom.txt b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Custom.txt new file mode 100644 index 00000000..fd90a9bf --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Custom.txt @@ -0,0 +1 @@ +// 自定义导出配置文件,用于配置自定义导出自定义程序的路径 diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx new file mode 100644 index 00000000..999e9390 Binary files /dev/null and b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx differ diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx new file mode 100644 index 00000000..001235a8 Binary files /dev/null and b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx differ diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx new file mode 100644 index 00000000..a4ca05e3 Binary files /dev/null and b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx differ diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx new file mode 100644 index 00000000..8194c9a5 Binary files /dev/null and b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx differ diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Version.txt b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Version.txt new file mode 100644 index 00000000..1877ad88 --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Excel/Version.txt @@ -0,0 +1 @@ +{"WorksheetNames":["MachineConfig","ProcessConfig","WorldConfig","SceneConfig","SceneTypeConfig"],"Tables":{"MachineConfig":1725984682557,"SceneConfig":1726083372000,"WorldConfig":1724007858627,"ProcessConfig":1725195494442}} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json new file mode 100644 index 00000000..f56f98e9 --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"OuterIP":"127.0.0.1","OuterBindIP":"127.0.0.1","InnerBindIP":"127.0.0.1"} +]} diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json new file mode 100644 index 00000000..a05a13c8 --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"MachineId":1,"StartupGroup":0} +]} diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json new file mode 100644 index 00000000..44996e72 --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json @@ -0,0 +1,6 @@ +{"List":[ +{"Id":1001,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Addressable","NetworkProtocol":null,"OuterPort":0,"InnerPort":11001,"SceneType":2}, +{"Id":1002,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":20000,"InnerPort":11002,"SceneType":3}, +{"Id":1003,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11003,"SceneType":4}, +{"Id":1004,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Chat","NetworkProtocol":null,"OuterPort":0,"InnerPort":11004,"SceneType":8} +]} diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json new file mode 100644 index 00000000..60dd0908 --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"WorldName":"测试服","DbConnection":null,"DbName":"fantasy_main","DbType":"MongoDB"} +]} diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto new file mode 100644 index 00000000..a8b51b85 --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package Sining.Message; +message G2A_TestRequest // IRouteRequest,G2A_TestResponse +{ + +} +message G2A_TestResponse // IRouteResponse +{ + +} +message G2M_RequestAddressableId // IRouteRequest,M2G_ResponseAddressableId +{ + +} +message M2G_ResponseAddressableId // IRouteResponse +{ + int64 AddressableId = 1; // Map服务器返回的AddressableId +} +/// 通知Chat服务器创建一个RouteId +message G2Chat_CreateRouteRequest // IRouteRequest,Chat2G_CreateRouteResponse +{ + int64 GateRouteId = 1; +} +message Chat2G_CreateRouteResponse // IRouteResponse +{ + int64 ChatRouteId = 1; +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto new file mode 100644 index 00000000..b036a74e --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package Fantasy.Network.Message; +// 协议分为: +// ProtoBuf:可以在Outer和Inner文件里使用。 +// MemoryPack:可以在Outer和Inner文件里使用。 +// Bson:仅支持在Inner文件里使用。 +// 使用方式: +// 在message协议上方添加// Protocol+空格+协议名字 +// 例如:// Protocol ProtoBuf 或 // Protocol MemoryPack +message C2G_TestMessage // IMessage +{ + string Tag = 1; +} +message C2G_TestRequest // IRequest,G2C_TestResponse +{ + string Tag = 1; +} +message G2C_TestResponse // IResponse +{ + string Tag = 1; +} +message C2G_CreateAddressableRequest // IRequest,G2C_CreateAddressableResponse +{ + +} +message G2C_CreateAddressableResponse // IResponse +{ + +} +message C2M_TestMessage // IAddressableRouteMessage +{ + string Tag = 1; +} +message C2M_TestRequest // IAddressableRouteRequest,M2C_TestResponse +{ + string Tag = 1; +} +message M2C_TestResponse // IAddressableRouteResponse +{ + string Tag = 1; +} +/// 通知Gate服务器创建一个Chat的Route连接 +message C2G_CreateChatRouteRequest // IRequest,G2C_CreateChatRouteResponse +{ + +} +message G2C_CreateChatRouteResponse // IResponse +{ + +} +/// 发送一个Route消息给Chat +message C2Chat_TestMessage // ICustomRouteMessage,ChatRoute +{ + string Tag = 1; +} +/// 发送一个RPCRoute消息给Chat +message C2Chat_TestMessageRequest // ICustomRouteRequest,Chat2C_TestMessageResponse,ChatRoute +{ + string Tag = 1; +} +message Chat2C_TestMessageResponse // ICustomRouteResponse +{ + string Tag = 1; +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config new file mode 100644 index 00000000..66082cf9 --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config @@ -0,0 +1,3 @@ +// Route协议定义(需要定义1000以上、因为1000以内的框架预留) +GateRoute = 1001 // Gate +ChatRoute = 1002 // Chat \ No newline at end of file diff --git a/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/README.md b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/README.md new file mode 100644 index 00000000..697ec052 --- /dev/null +++ b/GameServer/Server/Hotfix/Tools/Exporter/ConfigTable/README.md @@ -0,0 +1,16 @@ +# Fantasy-Net.Config +在Config文件夹中,存放着Fantasy所需的各种配置文件。这些文件涵盖了多个方面。每个配置文件都有其特定的格式和功能,通过精心设计的这些配置文件,开发团队能够快速调整框架参数,以实现更好的游戏体验,从而提升Fantasy的整体质量。 +## Excel文件夹 +里面存放了Fantasy.Net所需的四个Excel配置文件。用户可以利用Fantasy-Net.Exporter工具,依据这四个Excel文件生成相应的JSON文件,以供框架使用。这一过程不仅简化了数据处理,还确保了不同组件之间的无缝对接,使得工作流程更加高效。请确保在导出之前,Excel文件的格式和内容符合要求,以避免产生错误。 +## Json文件夹 +在该目录中存放了Fantasy.Net所需的四个JSON配置文件。用户可以根据这四个文件的模板进行添加或修改配置,以满足具体需求。每个项目的功能说明在相应的Excel文件中有详细描述,方便用户理解和使用这些配置文件。我们建议用户仔细阅读Excel文件中的说明,以确保配置的正确性和有效性。 +## NetworkProtocol文件夹 +存放框架所需定义网络协议的模版和文件夹 +### Inner文件夹 +定义服务器之间的网络协议 +### Outer文件夹 +定义客户端和服务器之间的网络协议 +### RouteType.Config +定义自定义Route协议的配置文件 +## 交流与讨论: +__讨论QQ群 : Fantasy服务器开发交流群 569888673 __ \ No newline at end of file diff --git a/GameServer/Server/Hotfix/bin/Debug/net9.0/APlugins.dll b/GameServer/Server/Hotfix/bin/Debug/net9.0/APlugins.dll new file mode 100644 index 00000000..ed581911 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Debug/net9.0/APlugins.dll differ diff --git a/GameServer/Server/Hotfix/bin/Debug/net9.0/APlugins.pdb b/GameServer/Server/Hotfix/bin/Debug/net9.0/APlugins.pdb new file mode 100644 index 00000000..7e866004 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Debug/net9.0/APlugins.pdb differ diff --git a/GameServer/Server/Hotfix/bin/Debug/net9.0/Entity.dll b/GameServer/Server/Hotfix/bin/Debug/net9.0/Entity.dll new file mode 100644 index 00000000..bc3b8c64 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Debug/net9.0/Entity.dll differ diff --git a/GameServer/Server/Hotfix/bin/Debug/net9.0/Entity.pdb b/GameServer/Server/Hotfix/bin/Debug/net9.0/Entity.pdb new file mode 100644 index 00000000..af19b177 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Debug/net9.0/Entity.pdb differ diff --git a/GameServer/Server/Hotfix/bin/Debug/net9.0/Hotfix.deps.json b/GameServer/Server/Hotfix/bin/Debug/net9.0/Hotfix.deps.json new file mode 100644 index 00000000..ee785c95 --- /dev/null +++ b/GameServer/Server/Hotfix/bin/Debug/net9.0/Hotfix.deps.json @@ -0,0 +1,525 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Hotfix/1.0.0": { + "dependencies": { + "Entity": "1.0.0" + }, + "runtime": { + "Hotfix.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.24": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Config/2024.1.4": { + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "dependencies": { + "Fantasy-Net": "2024.2.24" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {}, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.Formats.Asn1/5.0.0": {}, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.7.0", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "8.7.0.0", + "fileVersion": "8.7.0.60321" + } + } + }, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "APlugins/1.0.0": { + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "runtime": { + "APlugins.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Entity/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.7.0", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "runtime": { + "Entity.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Hotfix/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "path": "fantasy-net/2024.2.24", + "hashPath": "fantasy-net.2024.2.24.nupkg.sha512" + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "path": "fantasy-net.config/2024.1.4", + "hashPath": "fantasy-net.config.2024.1.4.nupkg.sha512" + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "path": "fantasy-net.configtable/2024.2.0", + "hashPath": "fantasy-net.configtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hashPath": "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hashPath": "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OQd5aVepYvh5evOmBMeAYjMIpEcTf1ZCBZaU7Nh/RlhhdXefjFDJeP1L2F2zeNT1unFr+wUu/h3Ac2Xb4BXU6w==", + "path": "microsoft.identitymodel.abstractions/8.7.0", + "hashPath": "microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uzsSAWhNhbrkWbQKBTE8QhzviU6sr3bJ1Bkv7gERlhswfSKOp7HsxTRLTPBpx/whQ/GRRHEwMg8leRIPbMrOgw==", + "path": "microsoft.identitymodel.jsonwebtokens/8.7.0", + "hashPath": "microsoft.identitymodel.jsonwebtokens.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Bs0TznPAu+nxa9rAVHJ+j3CYECHJkT3tG8AyBfhFYlT5ldsDhoxFT7J+PKxJHLf+ayqWfvDZHHc4639W2FQCxA==", + "path": "microsoft.identitymodel.logging/8.7.0", + "hashPath": "microsoft.identitymodel.logging.8.7.0.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5Z6voXjRXAnGklhmZd1mKz89UhcF5ZQQZaZc2iKrOuL4Li1UihG2vlJx8IbiFAOIxy/xdbsAm0A+WZEaH5fxng==", + "path": "microsoft.identitymodel.tokens/8.7.0", + "hashPath": "microsoft.identitymodel.tokens.8.7.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "path": "system.formats.asn1/5.0.0", + "hashPath": "system.formats.asn1.5.0.0.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-8dKL3A9pVqYCJIXHd4H2epQqLxSvKeNxGonR0e5g89yMchyvsM/NLuB06otx29BicUd6+LUJZgNZmvYjjPsPGg==", + "path": "system.identitymodel.tokens.jwt/8.7.0", + "hashPath": "system.identitymodel.tokens.jwt.8.7.0.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "path": "system.security.cryptography.cng/5.0.0", + "hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + }, + "APlugins/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Entity/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/bin/Debug/net9.0/Hotfix.dll b/GameServer/Server/Hotfix/bin/Debug/net9.0/Hotfix.dll new file mode 100644 index 00000000..a9b53977 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Debug/net9.0/Hotfix.dll differ diff --git a/GameServer/Server/Hotfix/bin/Debug/net9.0/Hotfix.pdb b/GameServer/Server/Hotfix/bin/Debug/net9.0/Hotfix.pdb new file mode 100644 index 00000000..6cacedb2 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Debug/net9.0/Hotfix.pdb differ diff --git a/GameServer/Server/Hotfix/bin/Release/net9.0/APlugins.dll b/GameServer/Server/Hotfix/bin/Release/net9.0/APlugins.dll new file mode 100644 index 00000000..cc1491d5 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Release/net9.0/APlugins.dll differ diff --git a/GameServer/Server/Hotfix/bin/Release/net9.0/APlugins.pdb b/GameServer/Server/Hotfix/bin/Release/net9.0/APlugins.pdb new file mode 100644 index 00000000..1045ce75 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Release/net9.0/APlugins.pdb differ diff --git a/GameServer/Server/Hotfix/bin/Release/net9.0/Entity.dll b/GameServer/Server/Hotfix/bin/Release/net9.0/Entity.dll new file mode 100644 index 00000000..c362e995 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Release/net9.0/Entity.dll differ diff --git a/GameServer/Server/Hotfix/bin/Release/net9.0/Entity.pdb b/GameServer/Server/Hotfix/bin/Release/net9.0/Entity.pdb new file mode 100644 index 00000000..3976e226 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Release/net9.0/Entity.pdb differ diff --git a/GameServer/Server/Hotfix/bin/Release/net9.0/Hotfix.deps.json b/GameServer/Server/Hotfix/bin/Release/net9.0/Hotfix.deps.json new file mode 100644 index 00000000..ff5b5d15 --- /dev/null +++ b/GameServer/Server/Hotfix/bin/Release/net9.0/Hotfix.deps.json @@ -0,0 +1,525 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Hotfix/1.0.0": { + "dependencies": { + "Entity": "1.0.0" + }, + "runtime": { + "Hotfix.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.24": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Config/2024.1.4": { + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "dependencies": { + "Fantasy-Net": "2024.2.24" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {}, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + } + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.6.1" + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.Formats.Asn1/5.0.0": {}, + "System.IdentityModel.Tokens.Jwt/8.6.1": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.6.1", + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "8.6.1.0", + "fileVersion": "8.6.1.60307" + } + } + }, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "APlugins/1.0.0": { + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.6.1" + }, + "runtime": { + "APlugins.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Entity/1.0.0": { + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.6.1", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "runtime": { + "Entity.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Hotfix/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "path": "fantasy-net/2024.2.24", + "hashPath": "fantasy-net.2024.2.24.nupkg.sha512" + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "path": "fantasy-net.config/2024.1.4", + "hashPath": "fantasy-net.config.2024.1.4.nupkg.sha512" + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "path": "fantasy-net.configtable/2024.2.0", + "hashPath": "fantasy-net.configtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hashPath": "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hashPath": "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OwmvCXYTttrxV3qT7QKDkoQP4/DB4RWjTwEqV+dNfb2opHn29WGDzoF+r4BVFQVy+BDYMhRlhIp8g3jSyJd+4Q==", + "path": "microsoft.identitymodel.abstractions/8.6.1", + "hashPath": "microsoft.identitymodel.abstractions.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CAu9DWsPZVtnyE3bOJ83rlPWpahY37sP/0bIOdRlxS90W88zSI4V3FyoCDlXxV8+gloT+a247pwPXfSNjYyAxw==", + "path": "microsoft.identitymodel.jsonwebtokens/8.6.1", + "hashPath": "microsoft.identitymodel.jsonwebtokens.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BdWlVgJYdmcR9TMUOhaZ3vJyaRO7zr7xgK+cRT4R2q59Xl7JMmTB4ctb/VOsyDhxXb497jDNNvLwldp+2ZVBEg==", + "path": "microsoft.identitymodel.logging/8.6.1", + "hashPath": "microsoft.identitymodel.logging.8.6.1.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FvED2com8LIFl9yFXneiX0uxNf9fuf8jKDFcvxC93qXOAfFa8fdLkCiur1vWF+PvgQHhsHVBe6CtDZHzsN8nCQ==", + "path": "microsoft.identitymodel.tokens/8.6.1", + "hashPath": "microsoft.identitymodel.tokens.8.6.1.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "path": "system.formats.asn1/5.0.0", + "hashPath": "system.formats.asn1.5.0.0.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/8.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-EXL1Tj+pizswtHHPiQyNumrTo8XOLX7SoTm7Bz00/DyiIoG2H/kQItoajSvr1MYtvDNXveqULsoWDoJFI3aHzQ==", + "path": "system.identitymodel.tokens.jwt/8.6.1", + "hashPath": "system.identitymodel.tokens.jwt.8.6.1.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "path": "system.security.cryptography.cng/5.0.0", + "hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + }, + "APlugins/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Entity/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/bin/Release/net9.0/Hotfix.dll b/GameServer/Server/Hotfix/bin/Release/net9.0/Hotfix.dll new file mode 100644 index 00000000..7cc2cb57 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Release/net9.0/Hotfix.dll differ diff --git a/GameServer/Server/Hotfix/bin/Release/net9.0/Hotfix.pdb b/GameServer/Server/Hotfix/bin/Release/net9.0/Hotfix.pdb new file mode 100644 index 00000000..0fbc1833 Binary files /dev/null and b/GameServer/Server/Hotfix/bin/Release/net9.0/Hotfix.pdb differ diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Server/Hotfix/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.AssemblyInfo.cs b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.AssemblyInfo.cs new file mode 100644 index 00000000..96d675b4 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Hotfix")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+93d69c1ff6fc3ec58a9401445592c13d80a5e8fc")] +[assembly: System.Reflection.AssemblyProductAttribute("Hotfix")] +[assembly: System.Reflection.AssemblyTitleAttribute("Hotfix")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.AssemblyInfoInputs.cache b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.AssemblyInfoInputs.cache new file mode 100644 index 00000000..0d95c5f9 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +2b7041311f6a19a8b5d2fe00eaac9f6a3f66d84a1851b263ef47c61f4c5c28b9 diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..6b63853a --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Hotfix +build_property.ProjectDir = D:\UnityProject\EintooAR\GameServer\Server\Hotfix\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.GlobalUsings.g.cs b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.assets.cache b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.assets.cache new file mode 100644 index 00000000..7b0152fb Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.assets.cache differ diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.AssemblyReference.cache b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.AssemblyReference.cache new file mode 100644 index 00000000..fdeed505 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.AssemblyReference.cache differ diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.CoreCompileInputs.cache b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.CoreCompileInputs.cache new file mode 100644 index 00000000..b8975049 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +e8e5ecd9894f99fad37f207ba55cd246e71c04d78d27961aa0171903849ce7de diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.FileListAbsolute.txt b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.FileListAbsolute.txt new file mode 100644 index 00000000..6127851c --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.FileListAbsolute.txt @@ -0,0 +1,128 @@ +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.deps.json +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.dll +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.pdb +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.dll +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.pdb +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.AssemblyReference.cache +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.GeneratedMSBuildEditorConfig.editorconfig +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfoInputs.cache +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfo.cs +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.CoreCompileInputs.cache +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.Up2Date +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.dll +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\refint\Hotfix.dll +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.pdb +E:\Game\unity\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\ref\Hotfix.dll +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.deps.json +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.dll +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.pdb +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.dll +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.pdb +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.AssemblyReference.cache +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfoInputs.cache +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfo.cs +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.CoreCompileInputs.cache +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.Up2Date +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.dll +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\refint\Hotfix.dll +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.pdb +E:\UnityProject\TE_AR\GameServer\Server\Hotfix\obj\Debug\net9.0\ref\Hotfix.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.deps.json +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.pdb +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.pdb +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.AssemblyReference.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfoInputs.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfo.cs +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.CoreCompileInputs.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.Up2Date +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\refint\Hotfix.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.pdb +E:\UnityProject\TE_ARMain\GameServer\Server\Hotfix\obj\Debug\net9.0\ref\Hotfix.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.deps.json +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.pdb +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.pdb +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.AssemblyReference.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.GeneratedMSBuildEditorConfig.editorconfig +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfoInputs.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfo.cs +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.CoreCompileInputs.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.Up2Date +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\refint\Hotfix.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.pdb +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\ref\Hotfix.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.deps.json +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\APlugins.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\APlugins.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.AssemblyReference.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfoInputs.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfo.cs +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.CoreCompileInputs.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.Up2Date +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\refint\Hotfix.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\ref\Hotfix.dll +D:\UGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.deps.json +D:\UGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.dll +D:\UGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.pdb +D:\UGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\APlugins.dll +D:\UGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.dll +D:\UGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.pdb +D:\UGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\APlugins.pdb +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.AssemblyReference.cache +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.GeneratedMSBuildEditorConfig.editorconfig +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfoInputs.cache +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfo.cs +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.CoreCompileInputs.cache +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.Up2Date +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.dll +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\refint\Hotfix.dll +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.pdb +D:\UGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\ref\Hotfix.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.deps.json +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\APlugins.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.AssemblyReference.cache +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.GeneratedMSBuildEditorConfig.editorconfig +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfoInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfo.cs +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.CoreCompileInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.Up2Date +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\refint\Hotfix.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\ref\Hotfix.dll +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.deps.json +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.dll +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Hotfix.pdb +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\APlugins.dll +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.dll +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\Entity.pdb +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\bin\Debug\net9.0\APlugins.pdb +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.AssemblyReference.cache +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.GeneratedMSBuildEditorConfig.editorconfig +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfoInputs.cache +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.AssemblyInfo.cs +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.CoreCompileInputs.cache +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.csproj.Up2Date +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.dll +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\refint\Hotfix.dll +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\Hotfix.pdb +D:\UnityProject\EintooAR\GameServer\Server\Hotfix\obj\Debug\net9.0\ref\Hotfix.dll diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.Up2Date b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.csproj.Up2Date new file mode 100644 index 00000000..e69de29b diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.dll b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.dll new file mode 100644 index 00000000..a9b53977 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.dll differ diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.pdb b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.pdb new file mode 100644 index 00000000..6cacedb2 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Debug/net9.0/Hotfix.pdb differ diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/ref/Hotfix.dll b/GameServer/Server/Hotfix/obj/Debug/net9.0/ref/Hotfix.dll new file mode 100644 index 00000000..25a03117 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Debug/net9.0/ref/Hotfix.dll differ diff --git a/GameServer/Server/Hotfix/obj/Debug/net9.0/refint/Hotfix.dll b/GameServer/Server/Hotfix/obj/Debug/net9.0/refint/Hotfix.dll new file mode 100644 index 00000000..25a03117 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Debug/net9.0/refint/Hotfix.dll differ diff --git a/GameServer/Server/Hotfix/obj/Hotfix.csproj.nuget.dgspec.json b/GameServer/Server/Hotfix/obj/Hotfix.csproj.nuget.dgspec.json new file mode 100644 index 00000000..9db5f1f4 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Hotfix.csproj.nuget.dgspec.json @@ -0,0 +1,247 @@ +{ + "format": 1, + "restore": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj": {} + }, + "projects": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "projectName": "APlugins", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net.Config": { + "target": "Package", + "version": "[2024.1.4, )" + }, + "Fantasy-Net.ConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol": { + "target": "Package", + "version": "[2024.2.24, )" + }, + "Microsoft.IdentityModel.Tokens": { + "target": "Package", + "version": "[8.7.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj", + "projectName": "Entity", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net": { + "target": "Package", + "version": "[2024.2.24, )" + }, + "System.IdentityModel.Tokens.Jwt": { + "target": "Package", + "version": "[8.7.0, )" + }, + "System.Security.Cryptography.Cng": { + "target": "Package", + "version": "[5.0.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj", + "projectName": "Hotfix", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/obj/Hotfix.csproj.nuget.g.props b/GameServer/Server/Hotfix/obj/Hotfix.csproj.nuget.g.props new file mode 100644 index 00000000..2571d6c1 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Hotfix.csproj.nuget.g.props @@ -0,0 +1,21 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\qq137\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 6.12.2 + + + + + + + C:\Users\qq137\.nuget\packages\fantasy-net.tools.exporternetworkprotocol\2024.2.24 + C:\Users\qq137\.nuget\packages\fantasy-net.tools.exporterconfigtable\2024.2.0 + C:\Users\qq137\.nuget\packages\fantasy-net.config\2024.1.4 + + \ No newline at end of file diff --git a/GameServer/Server/Hotfix/obj/Hotfix.csproj.nuget.g.targets b/GameServer/Server/Hotfix/obj/Hotfix.csproj.nuget.g.targets new file mode 100644 index 00000000..6ea4e19c --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Hotfix.csproj.nuget.g.targets @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Server/Hotfix/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.AssemblyInfo.cs b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.AssemblyInfo.cs new file mode 100644 index 00000000..84907f1a --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Hotfix")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4710d1c9d412b6a31c2ed97fac4853f5c41daeb1")] +[assembly: System.Reflection.AssemblyProductAttribute("Hotfix")] +[assembly: System.Reflection.AssemblyTitleAttribute("Hotfix")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.AssemblyInfoInputs.cache b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.AssemblyInfoInputs.cache new file mode 100644 index 00000000..7948e68d --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +5bbeb7c48c9076de4320a62afbfdc2373ea755708121be03991618c557e4416f diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..ecac3afb --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Hotfix +build_property.ProjectDir = D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.GlobalUsings.g.cs b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.assets.cache b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.assets.cache new file mode 100644 index 00000000..ef3597b7 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.assets.cache differ diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.AssemblyReference.cache b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.AssemblyReference.cache new file mode 100644 index 00000000..fc4410a8 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.AssemblyReference.cache differ diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.CoreCompileInputs.cache b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.CoreCompileInputs.cache new file mode 100644 index 00000000..12dcc48e --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +4f44e8a38f1ce11eb0c2a96075f5bf913bf32423af99b168deb0dd5e42e9832a diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.FileListAbsolute.txt b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.FileListAbsolute.txt new file mode 100644 index 00000000..27309fe0 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.FileListAbsolute.txt @@ -0,0 +1,17 @@ +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Release\net9.0\Hotfix.deps.json +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Release\net9.0\Hotfix.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Release\net9.0\Hotfix.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Release\net9.0\APlugins.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Release\net9.0\Entity.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Release\net9.0\Entity.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\bin\Release\net9.0\APlugins.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\Hotfix.csproj.AssemblyReference.cache +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\Hotfix.GeneratedMSBuildEditorConfig.editorconfig +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\Hotfix.AssemblyInfoInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\Hotfix.AssemblyInfo.cs +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\Hotfix.csproj.CoreCompileInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\Hotfix.csproj.Up2Date +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\Hotfix.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\refint\Hotfix.dll +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\Hotfix.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Hotfix\obj\Release\net9.0\ref\Hotfix.dll diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.Up2Date b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.csproj.Up2Date new file mode 100644 index 00000000..e69de29b diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.dll b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.dll new file mode 100644 index 00000000..7cc2cb57 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.dll differ diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.pdb b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.pdb new file mode 100644 index 00000000..0fbc1833 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Release/net9.0/Hotfix.pdb differ diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/ref/Hotfix.dll b/GameServer/Server/Hotfix/obj/Release/net9.0/ref/Hotfix.dll new file mode 100644 index 00000000..e999fbd0 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Release/net9.0/ref/Hotfix.dll differ diff --git a/GameServer/Server/Hotfix/obj/Release/net9.0/refint/Hotfix.dll b/GameServer/Server/Hotfix/obj/Release/net9.0/refint/Hotfix.dll new file mode 100644 index 00000000..e999fbd0 Binary files /dev/null and b/GameServer/Server/Hotfix/obj/Release/net9.0/refint/Hotfix.dll differ diff --git a/GameServer/Server/Hotfix/obj/project.assets.json b/GameServer/Server/Hotfix/obj/project.assets.json new file mode 100644 index 00000000..d73a45f5 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/project.assets.json @@ -0,0 +1,1573 @@ +{ + "version": 3, + "targets": { + "net9.0": { + "CommandLineParser/2.9.1": { + "type": "package", + "compile": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + } + }, + "DnsClient/1.6.1": { + "type": "package", + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "compile": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + } + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "compile": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "frameworkReferences": [ + "Microsoft.AspNetCore.App" + ], + "build": { + "buildTransitive/Fantasy-Net.targets": {} + } + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Config.targets": {} + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "dependencies": { + "Fantasy-Net": "2024.2.22" + }, + "compile": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets": {} + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets": {} + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "compile": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + }, + "compile": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets": {} + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "2.0.0", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "compile": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "protobuf-net/3.2.45": { + "type": "package", + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "compile": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + } + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + } + }, + "SharpCompress/0.30.1": { + "type": "package", + "compile": { + "lib/net5.0/SharpCompress.dll": {} + }, + "runtime": { + "lib/net5.0/SharpCompress.dll": {} + } + }, + "Snappier/1.0.0": { + "type": "package", + "compile": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "compile": { + "ref/netcoreapp2.0/_._": {} + }, + "runtime": { + "lib/netcoreapp2.0/_._": {} + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "compile": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Formats.Asn1.dll": { + "related": ".xml" + } + } + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.7.0", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + } + }, + "System.Memory/4.5.5": { + "type": "package", + "compile": { + "ref/netcoreapp2.1/_._": {} + }, + "runtime": { + "lib/netcoreapp2.1/_._": {} + } + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "compile": { + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "dependencies": { + "System.Formats.Asn1": "5.0.0" + }, + "compile": { + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "unix" + }, + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "compile": { + "lib/net7.0/ZstdSharp.dll": {} + }, + "runtime": { + "lib/net7.0/ZstdSharp.dll": {} + } + }, + "APlugins/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "bin/placeholder/APlugins.dll": {} + }, + "runtime": { + "bin/placeholder/APlugins.dll": {} + } + }, + "Entity/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.7.0", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "compile": { + "bin/placeholder/Entity.dll": {} + }, + "runtime": { + "bin/placeholder/Entity.dll": {} + } + } + } + }, + "libraries": { + "CommandLineParser/2.9.1": { + "sha512": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "type": "package", + "path": "commandlineparser/2.9.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "CommandLine20.png", + "License.md", + "README.md", + "commandlineparser.2.9.1.nupkg.sha512", + "commandlineparser.nuspec", + "lib/net40/CommandLine.dll", + "lib/net40/CommandLine.xml", + "lib/net45/CommandLine.dll", + "lib/net45/CommandLine.xml", + "lib/net461/CommandLine.dll", + "lib/net461/CommandLine.xml", + "lib/netstandard2.0/CommandLine.dll", + "lib/netstandard2.0/CommandLine.xml" + ] + }, + "DnsClient/1.6.1": { + "sha512": "4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "type": "package", + "path": "dnsclient/1.6.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "dnsclient.1.6.1.nupkg.sha512", + "dnsclient.nuspec", + "icon.png", + "lib/net45/DnsClient.dll", + "lib/net45/DnsClient.xml", + "lib/net471/DnsClient.dll", + "lib/net471/DnsClient.xml", + "lib/net5.0/DnsClient.dll", + "lib/net5.0/DnsClient.xml", + "lib/netstandard1.3/DnsClient.dll", + "lib/netstandard1.3/DnsClient.xml", + "lib/netstandard2.0/DnsClient.dll", + "lib/netstandard2.0/DnsClient.xml", + "lib/netstandard2.1/DnsClient.dll", + "lib/netstandard2.1/DnsClient.xml" + ] + }, + "Fantasy-Net/2024.2.24": { + "sha512": "5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "type": "package", + "path": "fantasy-net/2024.2.24", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE", + "README.md", + "buildTransitive/Fantasy-Net.targets", + "fantasy-net.2024.2.24.nupkg.sha512", + "fantasy-net.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.dll", + "lib/net9.0/Fantasy-Net.dll" + ] + }, + "Fantasy-Net.Config/2024.1.4": { + "sha512": "zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "type": "package", + "path": "fantasy-net.config/2024.1.4", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "buildTransitive/Fantasy-Net.Config.targets", + "fantasy-net.config.2024.1.4.nupkg.sha512", + "fantasy-net.config.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.Config.dll", + "tools/output/Excel/Custom.txt", + "tools/output/Excel/Server/MachineConfig.xlsx", + "tools/output/Excel/Server/ProcessConfig.xlsx", + "tools/output/Excel/Server/SceneConfig.xlsx", + "tools/output/Excel/Server/WorldConfig.xlsx", + "tools/output/Excel/Version.txt", + "tools/output/Json/Server/MachineConfigData.Json", + "tools/output/Json/Server/ProcessConfigData.Json", + "tools/output/Json/Server/SceneConfigData.Json", + "tools/output/Json/Server/WorldConfigData.Json", + "tools/output/NetworkProtocol/Inner/InnerMessage.proto", + "tools/output/NetworkProtocol/OpCode.Cache", + "tools/output/NetworkProtocol/Outer/OuterMessage.proto", + "tools/output/NetworkProtocol/RouteType.Config", + "tools/output/README.md" + ] + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "sha512": "TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "type": "package", + "path": "fantasy-net.configtable/2024.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "fantasy-net.configtable.2024.2.0.nupkg.sha512", + "fantasy-net.configtable.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.ConfigTable.dll" + ] + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "sha512": "jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "type": "package", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets", + "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512", + "fantasy-net.tools.exporterconfigtable.nuspec", + "icon.png", + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll", + "tools/output/CommandLine.dll", + "tools/output/EPPlus.Interfaces.dll", + "tools/output/EPPlus.System.Drawing.dll", + "tools/output/EPPlus.dll", + "tools/output/ExporterSettings.json", + "tools/output/Fantasy.Tools.ConfigTable", + "tools/output/Fantasy.Tools.ConfigTable.deps.json", + "tools/output/Fantasy.Tools.ConfigTable.dll", + "tools/output/Fantasy.Tools.ConfigTable.pdb", + "tools/output/Fantasy.Tools.ConfigTable.runtimeconfig.json", + "tools/output/Microsoft.CodeAnalysis.CSharp.dll", + "tools/output/Microsoft.CodeAnalysis.dll", + "tools/output/Microsoft.Extensions.Configuration.Abstractions.dll", + "tools/output/Microsoft.Extensions.Configuration.FileExtensions.dll", + "tools/output/Microsoft.Extensions.Configuration.Json.dll", + "tools/output/Microsoft.Extensions.Configuration.dll", + "tools/output/Microsoft.Extensions.FileProviders.Abstractions.dll", + "tools/output/Microsoft.Extensions.FileProviders.Physical.dll", + "tools/output/Microsoft.Extensions.FileSystemGlobbing.dll", + "tools/output/Microsoft.Extensions.Primitives.dll", + "tools/output/Microsoft.IO.RecyclableMemoryStream.dll", + "tools/output/Microsoft.Win32.SystemEvents.dll", + "tools/output/Newtonsoft.Json.dll", + "tools/output/Run.bat", + "tools/output/Run.sh", + "tools/output/System.Drawing.Common.dll", + "tools/output/System.Security.Cryptography.Pkcs.dll", + "tools/output/protobuf-net.Core.dll", + "tools/output/protobuf-net.dll", + "tools/output/runtimes/win/lib/net7.0/Microsoft.Win32.SystemEvents.dll", + "tools/output/runtimes/win/lib/net7.0/System.Drawing.Common.dll", + "tools/output/runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll" + ] + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "sha512": "gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "type": "package", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets", + "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512", + "fantasy-net.tools.exporternetworkprotocol.nuspec", + "icon.png", + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll", + "tools/output/CommandLine.dll", + "tools/output/ExporterSettings.json", + "tools/output/Fantasy.Tools.NetworkProtocol", + "tools/output/Fantasy.Tools.NetworkProtocol.deps.json", + "tools/output/Fantasy.Tools.NetworkProtocol.dll", + "tools/output/Fantasy.Tools.NetworkProtocol.pdb", + "tools/output/Fantasy.Tools.NetworkProtocol.runtimeconfig.json", + "tools/output/Microsoft.Extensions.Configuration.Abstractions.dll", + "tools/output/Microsoft.Extensions.Configuration.FileExtensions.dll", + "tools/output/Microsoft.Extensions.Configuration.Json.dll", + "tools/output/Microsoft.Extensions.Configuration.dll", + "tools/output/Microsoft.Extensions.FileProviders.Abstractions.dll", + "tools/output/Microsoft.Extensions.FileProviders.Physical.dll", + "tools/output/Microsoft.Extensions.FileSystemGlobbing.dll", + "tools/output/Microsoft.Extensions.Primitives.dll", + "tools/output/Newtonsoft.Json.dll", + "tools/output/Run.bat", + "tools/output/Run.sh" + ] + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "sha512": "3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "type": "package", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", + "microsoft.extensions.dependencyinjection.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "sha512": "nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "type": "package", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn3.11/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn3.11/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.0/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "buildTransitive/net461/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net462/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.xml", + "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", + "microsoft.extensions.logging.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "sha512": "OQd5aVepYvh5evOmBMeAYjMIpEcTf1ZCBZaU7Nh/RlhhdXefjFDJeP1L2F2zeNT1unFr+wUu/h3Ac2Xb4BXU6w==", + "type": "package", + "path": "microsoft.identitymodel.abstractions/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Abstractions.dll", + "lib/net462/Microsoft.IdentityModel.Abstractions.xml", + "lib/net472/Microsoft.IdentityModel.Abstractions.dll", + "lib/net472/Microsoft.IdentityModel.Abstractions.xml", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net9.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.xml", + "microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512", + "microsoft.identitymodel.abstractions.nuspec" + ] + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "sha512": "uzsSAWhNhbrkWbQKBTE8QhzviU6sr3bJ1Bkv7gERlhswfSKOp7HsxTRLTPBpx/whQ/GRRHEwMg8leRIPbMrOgw==", + "type": "package", + "path": "microsoft.identitymodel.jsonwebtokens/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "microsoft.identitymodel.jsonwebtokens.8.7.0.nupkg.sha512", + "microsoft.identitymodel.jsonwebtokens.nuspec" + ] + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "sha512": "Bs0TznPAu+nxa9rAVHJ+j3CYECHJkT3tG8AyBfhFYlT5ldsDhoxFT7J+PKxJHLf+ayqWfvDZHHc4639W2FQCxA==", + "type": "package", + "path": "microsoft.identitymodel.logging/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Logging.dll", + "lib/net462/Microsoft.IdentityModel.Logging.xml", + "lib/net472/Microsoft.IdentityModel.Logging.dll", + "lib/net472/Microsoft.IdentityModel.Logging.xml", + "lib/net6.0/Microsoft.IdentityModel.Logging.dll", + "lib/net6.0/Microsoft.IdentityModel.Logging.xml", + "lib/net8.0/Microsoft.IdentityModel.Logging.dll", + "lib/net8.0/Microsoft.IdentityModel.Logging.xml", + "lib/net9.0/Microsoft.IdentityModel.Logging.dll", + "lib/net9.0/Microsoft.IdentityModel.Logging.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.xml", + "microsoft.identitymodel.logging.8.7.0.nupkg.sha512", + "microsoft.identitymodel.logging.nuspec" + ] + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "sha512": "5Z6voXjRXAnGklhmZd1mKz89UhcF5ZQQZaZc2iKrOuL4Li1UihG2vlJx8IbiFAOIxy/xdbsAm0A+WZEaH5fxng==", + "type": "package", + "path": "microsoft.identitymodel.tokens/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Tokens.dll", + "lib/net462/Microsoft.IdentityModel.Tokens.xml", + "lib/net472/Microsoft.IdentityModel.Tokens.dll", + "lib/net472/Microsoft.IdentityModel.Tokens.xml", + "lib/net6.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net6.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net8.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net9.0/Microsoft.IdentityModel.Tokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.xml", + "microsoft.identitymodel.tokens.8.7.0.nupkg.sha512", + "microsoft.identitymodel.tokens.nuspec" + ] + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "type": "package", + "path": "microsoft.netcore.platforms/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.5.0.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Microsoft.Win32.Registry/5.0.0": { + "sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "type": "package", + "path": "microsoft.win32.registry/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.xml", + "lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "microsoft.win32.registry.5.0.0.nupkg.sha512", + "microsoft.win32.registry.nuspec", + "ref/net46/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/Microsoft.Win32.Registry.dll", + "ref/netstandard1.3/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/de/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/es/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/fr/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/it/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ja/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ko/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ru/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hans/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml", + "ref/netstandard2.0/Microsoft.Win32.Registry.dll", + "ref/netstandard2.0/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/net46/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "MongoDB.Bson/3.1.0": { + "sha512": "3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "type": "package", + "path": "mongodb.bson/3.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net472/MongoDB.Bson.dll", + "lib/net472/MongoDB.Bson.xml", + "lib/net6.0/MongoDB.Bson.dll", + "lib/net6.0/MongoDB.Bson.xml", + "lib/netstandard2.1/MongoDB.Bson.dll", + "lib/netstandard2.1/MongoDB.Bson.xml", + "mongodb.bson.3.1.0.nupkg.sha512", + "mongodb.bson.nuspec", + "packageIcon.png" + ] + }, + "MongoDB.Driver/3.1.0": { + "sha512": "+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "type": "package", + "path": "mongodb.driver/3.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net472/MongoDB.Driver.dll", + "lib/net472/MongoDB.Driver.xml", + "lib/net6.0/MongoDB.Driver.dll", + "lib/net6.0/MongoDB.Driver.xml", + "lib/netstandard2.1/MongoDB.Driver.dll", + "lib/netstandard2.1/MongoDB.Driver.xml", + "mongodb.driver.3.1.0.nupkg.sha512", + "mongodb.driver.nuspec", + "packageIcon.png" + ] + }, + "Newtonsoft.Json/13.0.3": { + "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "type": "package", + "path": "newtonsoft.json/13.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "README.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/net6.0/Newtonsoft.Json.dll", + "lib/net6.0/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "newtonsoft.json.13.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, + "protobuf-net/3.2.45": { + "sha512": "5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "type": "package", + "path": "protobuf-net/3.2.45", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net462/protobuf-net.dll", + "lib/net462/protobuf-net.xml", + "lib/net6.0/protobuf-net.dll", + "lib/net6.0/protobuf-net.xml", + "lib/netstandard2.0/protobuf-net.dll", + "lib/netstandard2.0/protobuf-net.xml", + "lib/netstandard2.1/protobuf-net.dll", + "lib/netstandard2.1/protobuf-net.xml", + "protobuf-net.3.2.45.nupkg.sha512", + "protobuf-net.nuspec", + "protobuf-net.png", + "readme.md" + ] + }, + "protobuf-net.Core/3.2.45": { + "sha512": "PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "type": "package", + "path": "protobuf-net.core/3.2.45", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net462/protobuf-net.Core.dll", + "lib/net462/protobuf-net.Core.xml", + "lib/net6.0/protobuf-net.Core.dll", + "lib/net6.0/protobuf-net.Core.xml", + "lib/netstandard2.0/protobuf-net.Core.dll", + "lib/netstandard2.0/protobuf-net.Core.xml", + "lib/netstandard2.1/protobuf-net.Core.dll", + "lib/netstandard2.1/protobuf-net.Core.xml", + "protobuf-net.core.3.2.45.nupkg.sha512", + "protobuf-net.core.nuspec", + "protobuf-net.png", + "readme.md" + ] + }, + "SharpCompress/0.30.1": { + "sha512": "XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "type": "package", + "path": "sharpcompress/0.30.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/SharpCompress.dll", + "lib/net5.0/SharpCompress.dll", + "lib/netcoreapp3.1/SharpCompress.dll", + "lib/netstandard2.0/SharpCompress.dll", + "lib/netstandard2.1/SharpCompress.dll", + "sharpcompress.0.30.1.nupkg.sha512", + "sharpcompress.nuspec" + ] + }, + "Snappier/1.0.0": { + "sha512": "rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "type": "package", + "path": "snappier/1.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "COPYING.txt", + "lib/net5.0/Snappier.dll", + "lib/net5.0/Snappier.xml", + "lib/netcoreapp3.0/Snappier.dll", + "lib/netcoreapp3.0/Snappier.xml", + "lib/netstandard2.0/Snappier.dll", + "lib/netstandard2.0/Snappier.xml", + "lib/netstandard2.1/Snappier.dll", + "lib/netstandard2.1/Snappier.xml", + "snappier.1.0.0.nupkg.sha512", + "snappier.nuspec" + ] + }, + "System.Buffers/4.5.1": { + "sha512": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "type": "package", + "path": "system.buffers/4.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Buffers.dll", + "lib/net461/System.Buffers.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.1/System.Buffers.dll", + "lib/netstandard1.1/System.Buffers.xml", + "lib/netstandard2.0/System.Buffers.dll", + "lib/netstandard2.0/System.Buffers.xml", + "lib/uap10.0.16299/_._", + "ref/net45/System.Buffers.dll", + "ref/net45/System.Buffers.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.1/System.Buffers.dll", + "ref/netstandard1.1/System.Buffers.xml", + "ref/netstandard2.0/System.Buffers.dll", + "ref/netstandard2.0/System.Buffers.xml", + "ref/uap10.0.16299/_._", + "system.buffers.4.5.1.nupkg.sha512", + "system.buffers.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Collections.Immutable/7.0.0": { + "sha512": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "type": "package", + "path": "system.collections.immutable/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "README.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Collections.Immutable.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Collections.Immutable.targets", + "lib/net462/System.Collections.Immutable.dll", + "lib/net462/System.Collections.Immutable.xml", + "lib/net6.0/System.Collections.Immutable.dll", + "lib/net6.0/System.Collections.Immutable.xml", + "lib/net7.0/System.Collections.Immutable.dll", + "lib/net7.0/System.Collections.Immutable.xml", + "lib/netstandard2.0/System.Collections.Immutable.dll", + "lib/netstandard2.0/System.Collections.Immutable.xml", + "system.collections.immutable.7.0.0.nupkg.sha512", + "system.collections.immutable.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Formats.Asn1/5.0.0": { + "sha512": "MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "type": "package", + "path": "system.formats.asn1/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Formats.Asn1.dll", + "lib/net461/System.Formats.Asn1.xml", + "lib/netstandard2.0/System.Formats.Asn1.dll", + "lib/netstandard2.0/System.Formats.Asn1.xml", + "system.formats.asn1.5.0.0.nupkg.sha512", + "system.formats.asn1.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "sha512": "8dKL3A9pVqYCJIXHd4H2epQqLxSvKeNxGonR0e5g89yMchyvsM/NLuB06otx29BicUd6+LUJZgNZmvYjjPsPGg==", + "type": "package", + "path": "system.identitymodel.tokens.jwt/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/System.IdentityModel.Tokens.Jwt.dll", + "lib/net462/System.IdentityModel.Tokens.Jwt.xml", + "lib/net472/System.IdentityModel.Tokens.Jwt.dll", + "lib/net472/System.IdentityModel.Tokens.Jwt.xml", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net9.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.xml", + "system.identitymodel.tokens.jwt.8.7.0.nupkg.sha512", + "system.identitymodel.tokens.jwt.nuspec" + ] + }, + "System.Memory/4.5.5": { + "sha512": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "type": "package", + "path": "system.memory/4.5.5", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Memory.dll", + "lib/net461/System.Memory.xml", + "lib/netcoreapp2.1/_._", + "lib/netstandard1.1/System.Memory.dll", + "lib/netstandard1.1/System.Memory.xml", + "lib/netstandard2.0/System.Memory.dll", + "lib/netstandard2.0/System.Memory.xml", + "ref/netcoreapp2.1/_._", + "system.memory.4.5.5.nupkg.sha512", + "system.memory.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "sha512": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "type": "package", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net45/System.Runtime.CompilerServices.Unsafe.dll", + "lib/net45/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/net461/System.Runtime.CompilerServices.Unsafe.dll", + "ref/net461/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.xml", + "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", + "system.runtime.compilerservices.unsafe.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.AccessControl/5.0.0": { + "sha512": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "type": "package", + "path": "system.security.accesscontrol/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.xml", + "lib/netstandard1.3/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.xml", + "ref/netstandard1.3/System.Security.AccessControl.dll", + "ref/netstandard1.3/System.Security.AccessControl.xml", + "ref/netstandard1.3/de/System.Security.AccessControl.xml", + "ref/netstandard1.3/es/System.Security.AccessControl.xml", + "ref/netstandard1.3/fr/System.Security.AccessControl.xml", + "ref/netstandard1.3/it/System.Security.AccessControl.xml", + "ref/netstandard1.3/ja/System.Security.AccessControl.xml", + "ref/netstandard1.3/ko/System.Security.AccessControl.xml", + "ref/netstandard1.3/ru/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hans/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hant/System.Security.AccessControl.xml", + "ref/netstandard2.0/System.Security.AccessControl.dll", + "ref/netstandard2.0/System.Security.AccessControl.xml", + "ref/uap10.0.16299/_._", + "runtimes/win/lib/net46/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.xml", + "runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.accesscontrol.5.0.0.nupkg.sha512", + "system.security.accesscontrol.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Cryptography.Cng/5.0.0": { + "sha512": "jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "type": "package", + "path": "system.security.cryptography.cng/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Security.Cryptography.Cng.dll", + "lib/net461/System.Security.Cryptography.Cng.dll", + "lib/net461/System.Security.Cryptography.Cng.xml", + "lib/net462/System.Security.Cryptography.Cng.dll", + "lib/net462/System.Security.Cryptography.Cng.xml", + "lib/net47/System.Security.Cryptography.Cng.dll", + "lib/net47/System.Security.Cryptography.Cng.xml", + "lib/netcoreapp2.1/System.Security.Cryptography.Cng.dll", + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll", + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.xml", + "lib/netstandard1.3/System.Security.Cryptography.Cng.dll", + "lib/netstandard1.4/System.Security.Cryptography.Cng.dll", + "lib/netstandard1.6/System.Security.Cryptography.Cng.dll", + "lib/netstandard2.0/System.Security.Cryptography.Cng.dll", + "lib/netstandard2.0/System.Security.Cryptography.Cng.xml", + "lib/netstandard2.1/System.Security.Cryptography.Cng.dll", + "lib/netstandard2.1/System.Security.Cryptography.Cng.xml", + "lib/uap10.0.16299/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Security.Cryptography.Cng.dll", + "ref/net461/System.Security.Cryptography.Cng.dll", + "ref/net461/System.Security.Cryptography.Cng.xml", + "ref/net462/System.Security.Cryptography.Cng.dll", + "ref/net462/System.Security.Cryptography.Cng.xml", + "ref/net47/System.Security.Cryptography.Cng.dll", + "ref/net47/System.Security.Cryptography.Cng.xml", + "ref/netcoreapp2.0/System.Security.Cryptography.Cng.dll", + "ref/netcoreapp2.0/System.Security.Cryptography.Cng.xml", + "ref/netcoreapp2.1/System.Security.Cryptography.Cng.dll", + "ref/netcoreapp2.1/System.Security.Cryptography.Cng.xml", + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.dll", + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.xml", + "ref/netstandard1.3/System.Security.Cryptography.Cng.dll", + "ref/netstandard1.4/System.Security.Cryptography.Cng.dll", + "ref/netstandard1.6/System.Security.Cryptography.Cng.dll", + "ref/netstandard2.0/System.Security.Cryptography.Cng.dll", + "ref/netstandard2.0/System.Security.Cryptography.Cng.xml", + "ref/netstandard2.1/System.Security.Cryptography.Cng.dll", + "ref/netstandard2.1/System.Security.Cryptography.Cng.xml", + "ref/uap10.0.16299/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/win/lib/net46/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net461/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net461/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/net462/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net462/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/net47/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net47/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netcoreapp2.1/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/netstandard1.4/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netstandard1.6/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.cryptography.cng.5.0.0.nupkg.sha512", + "system.security.cryptography.cng.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Principal.Windows/5.0.0": { + "sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "type": "package", + "path": "system.security.principal.windows/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.xml", + "lib/netstandard1.3/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.xml", + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll", + "ref/netcoreapp3.0/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/System.Security.Principal.Windows.dll", + "ref/netstandard1.3/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/de/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/es/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/fr/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/it/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ja/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ko/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ru/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml", + "ref/netstandard2.0/System.Security.Principal.Windows.dll", + "ref/netstandard2.0/System.Security.Principal.Windows.xml", + "ref/uap10.0.16299/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/net46/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.principal.windows.5.0.0.nupkg.sha512", + "system.security.principal.windows.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "ZstdSharp.Port/0.7.3": { + "sha512": "U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "type": "package", + "path": "zstdsharp.port/0.7.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/ZstdSharp.dll", + "lib/net5.0/ZstdSharp.dll", + "lib/net6.0/ZstdSharp.dll", + "lib/net7.0/ZstdSharp.dll", + "lib/netcoreapp3.1/ZstdSharp.dll", + "lib/netstandard2.0/ZstdSharp.dll", + "lib/netstandard2.1/ZstdSharp.dll", + "zstdsharp.port.0.7.3.nupkg.sha512", + "zstdsharp.port.nuspec" + ] + }, + "APlugins/1.0.0": { + "type": "project", + "path": "../APlugins/APlugins.csproj", + "msbuildProject": "../APlugins/APlugins.csproj" + }, + "Entity/1.0.0": { + "type": "project", + "path": "../Entity/Entity.csproj", + "msbuildProject": "../Entity/Entity.csproj" + } + }, + "projectFileDependencyGroups": { + "net9.0": [ + "Entity >= 1.0.0" + ] + }, + "packageFolders": { + "C:\\Users\\qq137\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj", + "projectName": "Hotfix", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/obj/project.nuget.cache b/GameServer/Server/Hotfix/obj/project.nuget.cache new file mode 100644 index 00000000..4dd62124 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/project.nuget.cache @@ -0,0 +1,41 @@ +{ + "version": 2, + "dgSpecHash": "TouK9+QjE6Q=", + "success": true, + "projectFilePath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj", + "expectedPackageFiles": [ + "C:\\Users\\qq137\\.nuget\\packages\\commandlineparser\\2.9.1\\commandlineparser.2.9.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\dnsclient\\1.6.1\\dnsclient.1.6.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net\\2024.2.24\\fantasy-net.2024.2.24.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.config\\2024.1.4\\fantasy-net.config.2024.1.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.configtable\\2024.2.0\\fantasy-net.configtable.2024.2.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.tools.exporterconfigtable\\2024.2.0\\fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.tools.exporternetworkprotocol\\2024.2.24\\fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\8.0.2\\microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\8.0.2\\microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.abstractions\\8.7.0\\microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\8.7.0\\microsoft.identitymodel.jsonwebtokens.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.logging\\8.7.0\\microsoft.identitymodel.logging.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.tokens\\8.7.0\\microsoft.identitymodel.tokens.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\mongodb.bson\\3.1.0\\mongodb.bson.3.1.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\mongodb.driver\\3.1.0\\mongodb.driver.3.1.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\newtonsoft.json\\13.0.3\\newtonsoft.json.13.0.3.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\protobuf-net\\3.2.45\\protobuf-net.3.2.45.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\protobuf-net.core\\3.2.45\\protobuf-net.core.3.2.45.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\sharpcompress\\0.30.1\\sharpcompress.0.30.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\snappier\\1.0.0\\snappier.1.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.collections.immutable\\7.0.0\\system.collections.immutable.7.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.formats.asn1\\5.0.0\\system.formats.asn1.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.identitymodel.tokens.jwt\\8.7.0\\system.identitymodel.tokens.jwt.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.cryptography.cng\\5.0.0\\system.security.cryptography.cng.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/obj/project.packagespec.json b/GameServer/Server/Hotfix/obj/project.packagespec.json new file mode 100644 index 00000000..502db0a6 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj","projectName":"Hotfix","projectPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj","outputPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\obj\\","projectStyle":"PackageReference","fallbackFolders":["C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"],"originalTargetFrameworks":["net9.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"targetAlias":"net9.0","projectReferences":{"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj":{"projectPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.200"}"frameworks":{"net9.0":{"targetAlias":"net9.0","imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/GameServer/Server/Hotfix/obj/rider.project.model.nuget.info b/GameServer/Server/Hotfix/obj/rider.project.model.nuget.info new file mode 100644 index 00000000..18de19b0 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17446243488709721 \ No newline at end of file diff --git a/GameServer/Server/Hotfix/obj/rider.project.restore.info b/GameServer/Server/Hotfix/obj/rider.project.restore.info new file mode 100644 index 00000000..18de19b0 --- /dev/null +++ b/GameServer/Server/Hotfix/obj/rider.project.restore.info @@ -0,0 +1 @@ +17446243488709721 \ No newline at end of file diff --git a/GameServer/Server/Main/Main.csproj b/GameServer/Server/Main/Main.csproj new file mode 100644 index 00000000..0569c959 --- /dev/null +++ b/GameServer/Server/Main/Main.csproj @@ -0,0 +1,29 @@ + + + + Exe + net9.0 + enable + enable + + + + ../../Bin/Debug/ + linux-x64;win-x64 + + + + ../../Bin/Release/ + linux-x64;win-x64 + + + + + + + + + + + + diff --git a/GameServer/Server/Main/NLog.config b/GameServer/Server/Main/NLog.config new file mode 100644 index 00000000..4df5ea1b --- /dev/null +++ b/GameServer/Server/Main/NLog.config @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/Main/NLog.xsd b/GameServer/Server/Main/NLog.xsd new file mode 100644 index 00000000..63c9a0cc --- /dev/null +++ b/GameServer/Server/Main/NLog.xsd @@ -0,0 +1,3483 @@ + + + + + + + + + + + + + + + Watch config file for changes and reload automatically. + + + + + Print internal NLog messages to the console. Default value is: false + + + + + Print internal NLog messages to the console error output. Default value is: false + + + + + Write internal NLog messages to the specified file. + + + + + Log level threshold for internal log messages. Default value is: Info. + + + + + Global log level threshold for application log messages. Messages below this level won't be logged. + + + + + Throw an exception when there is an internal error. Default value is: false. Not recommend to set to true in production! + + + + + Throw an exception when there is a configuration error. If not set, determined by throwExceptions. + + + + + Gets or sets a value indicating whether Variables should be kept on configuration reload. Default value is: false. + + + + + Write internal NLog messages to the System.Diagnostics.Trace. Default value is: false. + + + + + Write timestamps for internal NLog messages. Default value is: true. + + + + + Use InvariantCulture as default culture instead of CurrentCulture. Default value is: false. + + + + + Perform message template parsing and formatting of LogEvent messages (true = Always, false = Never, empty = Auto Detect). Default value is: empty. + + + + + + + + + + + + + + Make all targets within this section asynchronous (creates additional threads but the calling thread isn't blocked by any target writes). + + + + + + + + + + + + + + + + + Prefix for targets/layout renderers/filters/conditions loaded from this assembly. + + + + + Load NLog extensions from the specified file (*.dll) + + + + + Load NLog extensions from the specified assembly. Assembly name should be fully qualified. + + + + + + + + + + Filter on the name of the logger. May include wildcard characters ('*' or '?'). + + + + + Comma separated list of levels that this rule matches. + + + + + Minimum level that this rule matches. + + + + + Maximum level that this rule matches. + + + + + Level that this rule matches. + + + + + Comma separated list of target names. + + + + + Ignore further rules if this one matches. + + + + + Enable this rule. Note: disabled rules aren't available from the API. + + + + + Rule identifier to allow rule lookup with Configuration.FindRuleByName and Configuration.RemoveRuleByName. + + + + + Loggers matching will be restricted to specified minimum level for following rules. + + + + + + + + + + + + + + + Default action if none of the filters match. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the file to be included. You could use * wildcard. The name is relative to the name of the current config file. + + + + + Ignore any errors in the include file. + + + + + + + + Variable value. Note, the 'value' attribute has precedence over this one. + + + + + + Variable name. + + + + + Variable value. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Action to be taken when the lazy writer thread request queue count exceeds the set limit. + + + + + Limit on the number of requests in the lazy writer thread request queue. + + + + + Number of log events that should be processed in a batch by the lazy writer thread. + + + + + Whether to use the locking queue, instead of a lock-free concurrent queue + + + + + Number of batches of P:NLog.Targets.Wrappers.AsyncTargetWrapper.BatchSize to write before yielding into P:NLog.Targets.Wrappers.AsyncTargetWrapper.TimeToSleepBetweenBatches + + + + + Time in milliseconds to sleep between batches. (1 or less means trigger on new activity) + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Delay the flush until the LogEvent has been confirmed as written + + + + + Condition expression. Log events who meet this condition will cause a flush on the wrapped target. + + + + + Only flush when LogEvent matches condition. Ignore explicit-flush, config-reload-flush and shutdown-flush + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Number of log events to be buffered. + + + + + Action to take if the buffer overflows. + + + + + Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes. + + + + + Indicates whether to use sliding timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Viewer parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Whether an attribute with empty value should be included in the output + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-check if the console is available. - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + Enables output using ANSI Color Codes + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console has been redirected to file - Disables coloring logic when System.Console.IsOutputRedirected = true + + + + + Indicates whether to use default row highlighting rules. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background color. + + + + + Condition that must be met in order to set the specified foreground and background color. + + + + + Foreground color. + + + + + + + + + + + + + + + + + Background color. + + + + + Compile the P:NLog.Targets.ConsoleWordHighlightingRule.Regex? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used. + + + + + Condition that must be met before scanning the row for highlight of words + + + + + Foreground color. + + + + + Indicates whether to ignore case when comparing texts. + + + + + Regular expression to be matched. You must specify either text or regex. + + + + + Text to be matched. You must specify either text or regex. + + + + + Indicates whether to match whole words only. + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console is available - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Whether to activate internal buffering to allow batch writing, instead of using M:System.Console.WriteLine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. + + + + + Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. + + + + + Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. + + + + + Name of the connection string (as specified in <connectionStrings> configuration section. + + + + + Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. + + + + + Indicates whether to keep the database connection open between the log events. + + + + + Name of the database provider. + + + + + Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. + + + + + Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. + + + + + Configures isolated transaction batch writing. If supported by the database, then it will improve insert performance. + + + + + Text of the SQL command to be run on each log level. + + + + + Type of the SQL command to be run on each log level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Convert format of the property value + + + + + Culture used for parsing property string-value for type-conversion + + + + + Value to assign on the object-property + + + + + Name for the object-property + + + + + Type of the object-property + + + + + + + + + + + + + + Type of the command. + + + + + Connection string to run the command against. If not provided, connection string from the target is used. + + + + + Indicates whether to ignore failures. + + + + + Command text. + + + + + + + + + + + + + + + + + + + + Database parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Database parameter DbType. + + + + + Database parameter size. + + + + + Database parameter precision. + + + + + Database parameter scale. + + + + + Type of the parameter. + + + + + Fallback value when result value is not available + + + + + Convert format of the database parameter value. + + + + + Culture used for parsing parameter string-value for type-conversion + + + + + Whether empty value should translate into DbNull. Requires database column to allow NULL values. + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Layout that renders event Category. + + + + + Optional entry type. When not set, or when not convertible to T:System.Diagnostics.EventLogEntryType then determined by T:NLog.LogLevel + + + + + Layout that renders event ID. + + + + + Name of the Event Log to write to. This can be System, Application or any user-defined name. + + + + + Name of the machine on which Event Log service is running. + + + + + Maximum Event log size in kilobytes. + + + + + Message length limit to write to the Event Log. + + + + + Value to be used as the event Source. + + + + + Action to take if the message is larger than the P:NLog.Targets.EventLogTarget.MaxMessageLength option. + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to return to the first target after any successful write. + + + + + Whether to enable batching, but fallback will be handled individually + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Name of the file to write to. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether the footer should be written only when the file is archived. + + + + + Maximum number of archive files that should be kept. + + + + + Maximum days of archive files that should be kept. + + + + + Value of the file size threshold to archive old log file on startup. + + + + + Indicates whether to archive old log file on startup. + + + + + Indicates whether to compress archive files into the zip archive format. + + + + + Name of the file to be used for an archive. + + + + + Is the P:NLog.Targets.FileTarget.ArchiveFileName an absolute or relative path? + + + + + Indicates whether to automatically archive log files every time the specified time passes. + + + + + Value specifying the date format to use when archiving files. + + + + + Size in bytes above which log files will be automatically archived. + + + + + Way file archives are numbered. + + + + + Indicates whether to create directories if they do not exist. + + + + + Indicates whether file creation calls should be synchronized by a system global mutex. + + + + + Gets or set a value indicating whether a managed file stream is forced, instead of using the native implementation. + + + + + Is the P:NLog.Targets.FileTarget.FileName an absolute or relative path? + + + + + File attributes (Windows only). + + + + + Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong. + + + + + Indicates whether to write BOM (byte order mark) in created files. Defaults to true for UTF-16 and UTF-32 + + + + + Indicates whether to enable log file(s) to be deleted. + + + + + Indicates whether to delete old log file on startup. + + + + + File encoding. + + + + + Indicates whether to replace file contents on each write instead of appending log message at the end. + + + + + Line ending mode. + + + + + Number of times the write is appended on the file before NLog discards the log message. + + + + + Delay in milliseconds to wait before attempting to write to the file again. + + + + + Maximum number of seconds before open files are flushed. Zero or negative means disabled. + + + + + Maximum number of seconds that files are kept open. Zero or negative means disabled. + + + + + Indicates whether concurrent writes to the log file by multiple processes on different network hosts. + + + + + Log file buffer size in bytes. + + + + + Indicates whether to automatically flush the file buffers after each log message. + + + + + Indicates whether to keep log file open instead of opening and closing it on each logging event. + + + + + Indicates whether concurrent writes to the log file by multiple processes on the same host. + + + + + Whether or not this target should just discard all data that its asked to write. Mostly used for when testing NLog Stack except final write + + + + + Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Condition expression. Log events who meet this condition will be forwarded to the wrapped target. + + + + + + + + + + + + + + + Name of the target. + + + + + Identifier to perform group-by + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Windows domain name to change context to. + + + + + Required impersonation level. + + + + + Type of the logon provider. + + + + + Logon Type. + + + + + User account password. + + + + + Indicates whether to revert to the credentials of the process instead of impersonating another user. + + + + + Username to change context to. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Interval in which messages will be written up to the P:NLog.Targets.Wrappers.LimitingTargetWrapper.MessageLimit number of messages. + + + + + Maximum allowed number of messages written per P:NLog.Targets.Wrappers.LimitingTargetWrapper.Interval. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether NewLine characters in the body should be replaced with tags. + + + + + Priority used for sending mails. + + + + + Encoding to be used for sending e-mail. + + + + + BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Indicates whether to add new lines between log entries. + + + + + Indicates whether to send message as HTML instead of plain text. + + + + + Sender's email address (e.g. joe@domain.com). + + + + + Mail message body (repeated for each log message send in one mail). + + + + + Mail subject. + + + + + Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Specifies how outgoing email messages will be handled. + + + + + SMTP Server to be used for sending. + + + + + SMTP Authentication mode. + + + + + Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + + + + + Port number that SMTP Server is listening on. + + + + + Indicates whether the default Settings from System.Net.MailSettings should be used. + + + + + Folder where applications save mail messages to be processed by the local SMTP server. + + + + + Indicates the SMTP client timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Max number of items to have in memory + + + + + + + + + + + + + + + + + Name of the target. + + + + + Class name. + + + + + Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g. + + + + + + + + + + + + + + + Name of the parameter. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Fallback value when result value is not available + + + + + Type of the parameter. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Indicates whether to perform layout calculation. + + + + + + + + + + + + + + + + Name of the target. + + + + + Default filter to be applied when no specific rule matches. + + + + + + + + + + + + + Condition to be tested. + + + + + Resulting filter to be applied when the condition matches. + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + Name of the target. + + + + + Number of times to repeat each log message. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Whether to enable batching, and only apply single delay when a whole batch fails + + + + + Number of retries that should be attempted on the wrapped target in case of a failure. + + + + + Time to wait between retries in milliseconds. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Forward F:NLog.LogLevel.Fatal to M:System.Diagnostics.Trace.Fail(System.String) (Instead of M:System.Diagnostics.Trace.TraceError(System.String)) + + + + + Force use M:System.Diagnostics.Trace.WriteLine(System.String) independent of T:NLog.LogLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to pre-authenticate the HttpWebRequest (Requires 'Authorization' in P:NLog.Targets.WebServiceTarget.Headers parameters) + + + + + Value whether escaping be done according to Rfc3986 (Supports Internationalized Resource Identifiers - IRIs) + + + + + Value whether escaping be done according to the old NLog style (Very non-standard) + + + + + Value of the User-agent HTTP header. + + + + + Web service URL. + + + + + Proxy configuration when calling web service + + + + + Custom proxy address, include port separated by a colon + + + + + Protocol to be used when calling web service. + + + + + Web service namespace. Only used with Soap. + + + + + Web service method name. Only used with Soap. + + + + + Should we include the BOM (Byte-order-mark) for UTF? Influences the P:NLog.Targets.WebServiceTarget.Encoding property. This will only work for UTF-8. + + + + + Encoding. + + + + + Name of the root XML element, if POST of XML document chosen. If so, this property must not be null. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + (optional) root namespace of the XML document, if POST of XML document chosen. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom'). + + + + + Column delimiter. + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + Quote Character. + + + + + Quoting mode. + + + + + Indicates whether CVS should include header. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the column. + + + + + Layout of the column. + + + + + Override of Quoting mode + + + + + + + + + + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log event (as JSON) + + + + + Indicates whether to include contents of the T:NLog.GlobalDiagnosticsContext dictionary. + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Option to exclude null/empty properties from the log event (as JSON) + + + + + List of property names to exclude when P:NLog.Layouts.JsonLayout.IncludeAllProperties is true + + + + + How far should the JSON serializer follow object references before backing off + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Json encoded. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Indicates whether to escape non-ascii characters + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log events + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether the log4j:throwable xml-element should be written as CDATA + + + + + + + + + + + + + + Layout text. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the root XML element + + + + + Value inside the root XML element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + + + + + + + + + + + Name of the element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Value inside the element + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Condition expression. + + + + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Append FilterCount to the P:NLog.LogEventInfo.Message when an event is no longer filtered + + + + + Insert FilterCount value into P:NLog.LogEventInfo.Properties when an event is no longer filtered + + + + + Applies the configured action to the initial logevent that starts the timeout period. Used to configure that it should ignore all events until timeout. + + + + + Layout to be used to filter log messages. + + + + + Max length of filter values, will truncate if above limit + + + + + How long before a filter expires, and logging is accepted again + + + + + Default number of unique filter values to expect, will automatically increase if needed + + + + + Max number of unique filter values to expect simultaneously + + + + + Default buffer size for the internal buffers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/Main/Program.cs b/GameServer/Server/Main/Program.cs new file mode 100644 index 00000000..49365072 --- /dev/null +++ b/GameServer/Server/Main/Program.cs @@ -0,0 +1,34 @@ +using Fantasy; +using Fantasy.Assembly; +using Fantasy.ConfigTable; +using Fantasy.DataBase; +using Fantasy.Helper; +using Fantasy.IdFactory; +using Fantasy.Platform.Net; + + +ConfigTableHelper.Initialize("../../../Config/Binary"); +IdFactoryHelper.Initialize(IdFactoryType.World); +// 获取配置文件 +// 比如通过远程获取这个配置文件,这样可以多组服务器共享一套配置了 +var machineConfigText = await FileHelper.GetTextByRelativePath("../../../Config/Json/Server/MachineConfigData.Json"); +var processConfigText = await FileHelper.GetTextByRelativePath("../../../Config/Json/Server/ProcessConfigData.Json"); +var worldConfigText = await FileHelper.GetTextByRelativePath("../../../Config/Json/Server/WorldConfigData.Json"); +var sceneConfigText = await FileHelper.GetTextByRelativePath("../../../Config/Json/Server/SceneConfigData.Json"); +// 初始化配置文件 +// 如果重复初始化方法会覆盖掉上一次的数据,非常适合热重载时使用 +MachineConfigData.Initialize(machineConfigText); +ProcessConfigData.Initialize(processConfigText); +WorldConfigData.Initialize(worldConfigText); +SceneConfigData.Initialize(sceneConfigText); +// 注册日志模块到框架 +// 开发者可以自己注册日志系统到框架,只要实现Fantasy.ILog接口就可以。 +// 这里用的是NLog日志系统注册到框架中。 +Fantasy.Log.Register(new Fantasy.NLog("Server")); +// 初始化框架,添加程序集到框架中 +Fantasy.Platform.Net.Entry.Initialize(Fantasy.AssemblyHelper.Assemblies); +// 启动Fantasy.Net +await Fantasy.Platform.Net.Entry.Start(); +// 也可以使用下面的Start方法来初始化并且启动Fantasy.Net +// 使用下面这个方法就不用使用上面的两个方法了。 +// await Fantasy.Platform.Net.Entry.Start(Fantasy.AssemblyHelper.Assemblies); \ No newline at end of file diff --git a/GameServer/Server/Main/Properties/launchSettings.json b/GameServer/Server/Main/Properties/launchSettings.json new file mode 100644 index 00000000..20081a86 --- /dev/null +++ b/GameServer/Server/Main/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "Main": { + "commandName": "Project", + "environmentVariables": {}, + "commandLineArgs": "--m Develop" + } + } +} diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Custom.txt b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Custom.txt new file mode 100644 index 00000000..fd90a9bf --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Custom.txt @@ -0,0 +1 @@ +// 自定义导出配置文件,用于配置自定义导出自定义程序的路径 diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx new file mode 100644 index 00000000..999e9390 Binary files /dev/null and b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/MachineConfig.xlsx differ diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx new file mode 100644 index 00000000..001235a8 Binary files /dev/null and b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/ProcessConfig.xlsx differ diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx new file mode 100644 index 00000000..a4ca05e3 Binary files /dev/null and b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/SceneConfig.xlsx differ diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx new file mode 100644 index 00000000..8194c9a5 Binary files /dev/null and b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Server/WorldConfig.xlsx differ diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Version.txt b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Version.txt new file mode 100644 index 00000000..1877ad88 --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Excel/Version.txt @@ -0,0 +1 @@ +{"WorksheetNames":["MachineConfig","ProcessConfig","WorldConfig","SceneConfig","SceneTypeConfig"],"Tables":{"MachineConfig":1725984682557,"SceneConfig":1726083372000,"WorldConfig":1724007858627,"ProcessConfig":1725195494442}} \ No newline at end of file diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json new file mode 100644 index 00000000..f56f98e9 --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/MachineConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"OuterIP":"127.0.0.1","OuterBindIP":"127.0.0.1","InnerBindIP":"127.0.0.1"} +]} diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json new file mode 100644 index 00000000..a05a13c8 --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/ProcessConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"MachineId":1,"StartupGroup":0} +]} diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json new file mode 100644 index 00000000..44996e72 --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/SceneConfigData.Json @@ -0,0 +1,6 @@ +{"List":[ +{"Id":1001,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Addressable","NetworkProtocol":null,"OuterPort":0,"InnerPort":11001,"SceneType":2}, +{"Id":1002,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":20000,"InnerPort":11002,"SceneType":3}, +{"Id":1003,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11003,"SceneType":4}, +{"Id":1004,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Chat","NetworkProtocol":null,"OuterPort":0,"InnerPort":11004,"SceneType":8} +]} diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json new file mode 100644 index 00000000..60dd0908 --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/Json/Server/WorldConfigData.Json @@ -0,0 +1,3 @@ +{"List":[ +{"Id":1,"WorldName":"测试服","DbConnection":null,"DbName":"fantasy_main","DbType":"MongoDB"} +]} diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto b/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto new file mode 100644 index 00000000..a8b51b85 --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/Inner/InnerMessage.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package Sining.Message; +message G2A_TestRequest // IRouteRequest,G2A_TestResponse +{ + +} +message G2A_TestResponse // IRouteResponse +{ + +} +message G2M_RequestAddressableId // IRouteRequest,M2G_ResponseAddressableId +{ + +} +message M2G_ResponseAddressableId // IRouteResponse +{ + int64 AddressableId = 1; // Map服务器返回的AddressableId +} +/// 通知Chat服务器创建一个RouteId +message G2Chat_CreateRouteRequest // IRouteRequest,Chat2G_CreateRouteResponse +{ + int64 GateRouteId = 1; +} +message Chat2G_CreateRouteResponse // IRouteResponse +{ + int64 ChatRouteId = 1; +} \ No newline at end of file diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache b/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/OpCode.Cache @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto b/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto new file mode 100644 index 00000000..b036a74e --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/Outer/OuterMessage.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package Fantasy.Network.Message; +// 协议分为: +// ProtoBuf:可以在Outer和Inner文件里使用。 +// MemoryPack:可以在Outer和Inner文件里使用。 +// Bson:仅支持在Inner文件里使用。 +// 使用方式: +// 在message协议上方添加// Protocol+空格+协议名字 +// 例如:// Protocol ProtoBuf 或 // Protocol MemoryPack +message C2G_TestMessage // IMessage +{ + string Tag = 1; +} +message C2G_TestRequest // IRequest,G2C_TestResponse +{ + string Tag = 1; +} +message G2C_TestResponse // IResponse +{ + string Tag = 1; +} +message C2G_CreateAddressableRequest // IRequest,G2C_CreateAddressableResponse +{ + +} +message G2C_CreateAddressableResponse // IResponse +{ + +} +message C2M_TestMessage // IAddressableRouteMessage +{ + string Tag = 1; +} +message C2M_TestRequest // IAddressableRouteRequest,M2C_TestResponse +{ + string Tag = 1; +} +message M2C_TestResponse // IAddressableRouteResponse +{ + string Tag = 1; +} +/// 通知Gate服务器创建一个Chat的Route连接 +message C2G_CreateChatRouteRequest // IRequest,G2C_CreateChatRouteResponse +{ + +} +message G2C_CreateChatRouteResponse // IResponse +{ + +} +/// 发送一个Route消息给Chat +message C2Chat_TestMessage // ICustomRouteMessage,ChatRoute +{ + string Tag = 1; +} +/// 发送一个RPCRoute消息给Chat +message C2Chat_TestMessageRequest // ICustomRouteRequest,Chat2C_TestMessageResponse,ChatRoute +{ + string Tag = 1; +} +message Chat2C_TestMessageResponse // ICustomRouteResponse +{ + string Tag = 1; +} \ No newline at end of file diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config b/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config new file mode 100644 index 00000000..66082cf9 --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/NetworkProtocol/RouteType.Config @@ -0,0 +1,3 @@ +// Route协议定义(需要定义1000以上、因为1000以内的框架预留) +GateRoute = 1001 // Gate +ChatRoute = 1002 // Chat \ No newline at end of file diff --git a/GameServer/Server/Main/Tools/Exporter/ConfigTable/README.md b/GameServer/Server/Main/Tools/Exporter/ConfigTable/README.md new file mode 100644 index 00000000..697ec052 --- /dev/null +++ b/GameServer/Server/Main/Tools/Exporter/ConfigTable/README.md @@ -0,0 +1,16 @@ +# Fantasy-Net.Config +在Config文件夹中,存放着Fantasy所需的各种配置文件。这些文件涵盖了多个方面。每个配置文件都有其特定的格式和功能,通过精心设计的这些配置文件,开发团队能够快速调整框架参数,以实现更好的游戏体验,从而提升Fantasy的整体质量。 +## Excel文件夹 +里面存放了Fantasy.Net所需的四个Excel配置文件。用户可以利用Fantasy-Net.Exporter工具,依据这四个Excel文件生成相应的JSON文件,以供框架使用。这一过程不仅简化了数据处理,还确保了不同组件之间的无缝对接,使得工作流程更加高效。请确保在导出之前,Excel文件的格式和内容符合要求,以避免产生错误。 +## Json文件夹 +在该目录中存放了Fantasy.Net所需的四个JSON配置文件。用户可以根据这四个文件的模板进行添加或修改配置,以满足具体需求。每个项目的功能说明在相应的Excel文件中有详细描述,方便用户理解和使用这些配置文件。我们建议用户仔细阅读Excel文件中的说明,以确保配置的正确性和有效性。 +## NetworkProtocol文件夹 +存放框架所需定义网络协议的模版和文件夹 +### Inner文件夹 +定义服务器之间的网络协议 +### Outer文件夹 +定义客户端和服务器之间的网络协议 +### RouteType.Config +定义自定义Route协议的配置文件 +## 交流与讨论: +__讨论QQ群 : Fantasy服务器开发交流群 569888673 __ \ No newline at end of file diff --git a/GameServer/Server/Main/bin/Debug/net9.0/CommandLine.dll b/GameServer/Server/Main/bin/Debug/net9.0/CommandLine.dll new file mode 100644 index 00000000..3eab2be2 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/CommandLine.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/DnsClient.dll b/GameServer/Server/Main/bin/Debug/net9.0/DnsClient.dll new file mode 100644 index 00000000..39aa546a Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/DnsClient.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Entity.dll b/GameServer/Server/Main/bin/Debug/net9.0/Entity.dll new file mode 100644 index 00000000..23ee3941 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Entity.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Entity.pdb b/GameServer/Server/Main/bin/Debug/net9.0/Entity.pdb new file mode 100644 index 00000000..e2235447 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Entity.pdb differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Fantasy-Net.NLog.dll b/GameServer/Server/Main/bin/Debug/net9.0/Fantasy-Net.NLog.dll new file mode 100644 index 00000000..7ffbcb54 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Fantasy-Net.NLog.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Fantasy-Net.dll b/GameServer/Server/Main/bin/Debug/net9.0/Fantasy-Net.dll new file mode 100644 index 00000000..81ccd602 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Fantasy-Net.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Hotfix.dll b/GameServer/Server/Main/bin/Debug/net9.0/Hotfix.dll new file mode 100644 index 00000000..fe4ad966 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Hotfix.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Hotfix.pdb b/GameServer/Server/Main/bin/Debug/net9.0/Hotfix.pdb new file mode 100644 index 00000000..c36681cb Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Hotfix.pdb differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Main.deps.json b/GameServer/Server/Main/bin/Debug/net9.0/Main.deps.json new file mode 100644 index 00000000..e7df867f --- /dev/null +++ b/GameServer/Server/Main/bin/Debug/net9.0/Main.deps.json @@ -0,0 +1,379 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Main/1.0.0": { + "dependencies": { + "Entity": "1.0.0", + "Fantasy-Net.NLog": "2024.1.20", + "Hotfix": "1.0.0" + }, + "runtime": { + "Main.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "DnsClient/1.6.1": { + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "assemblyVersion": "1.6.1.0", + "fileVersion": "1.6.1.0" + } + } + }, + "Fantasy-Net/2024.2.20": { + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "System.IO.Pipelines": "9.0.0", + "protobuf-net": "3.2.45" + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Fantasy-Net.NLog/2024.1.20": { + "dependencies": { + "Fantasy-Net": "2024.2.20", + "NLog": "5.3.4" + }, + "runtime": { + "lib/net8.0/Fantasy-Net.NLog.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Microsoft.Extensions.Logging.Abstractions/2.0.0": {}, + "Microsoft.NETCore.Platforms/5.0.0": {}, + "Microsoft.Win32.Registry/5.0.0": { + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "MongoDB.Bson/3.1.0": { + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "MongoDB.Driver/3.1.0": { + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "2.0.0", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "assemblyVersion": "3.1.0.0", + "fileVersion": "3.1.0.0" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "protobuf-net/3.2.45": { + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "protobuf-net.Core/3.2.45": { + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.45.36865" + } + } + }, + "SharpCompress/0.30.1": { + "runtime": { + "lib/net5.0/SharpCompress.dll": { + "assemblyVersion": "0.30.1.0", + "fileVersion": "0.30.1.0" + } + } + }, + "Snappier/1.0.0": { + "runtime": { + "lib/net5.0/Snappier.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "System.Buffers/4.5.1": {}, + "System.Collections.Immutable/7.0.0": {}, + "System.IO.Pipelines/9.0.0": {}, + "System.Memory/4.5.5": {}, + "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, + "System.Security.AccessControl/5.0.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows/5.0.0": {}, + "ZstdSharp.Port/0.7.3": { + "runtime": { + "lib/net7.0/ZstdSharp.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "Entity/1.0.0": { + "dependencies": { + "Fantasy-Net": "2024.2.20" + }, + "runtime": { + "Entity.dll": { + "assemblyVersion": "1.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Hotfix/1.0.0": { + "dependencies": { + "Entity": "1.0.0" + }, + "runtime": { + "Hotfix.dll": { + "assemblyVersion": "1.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Main/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "DnsClient/1.6.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "path": "dnsclient/1.6.1", + "hashPath": "dnsclient.1.6.1.nupkg.sha512" + }, + "Fantasy-Net/2024.2.20": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ftlJJVOFDGAAR0kZa0X9HlcYozG/G7zm6H4qAaDEFQa/UBU89Z/5buh3cQ/IjwYkPWSBJTTDi3chICD99xt+GA==", + "path": "fantasy-net/2024.2.20", + "hashPath": "fantasy-net.2024.2.20.nupkg.sha512" + }, + "Fantasy-Net.NLog/2024.1.20": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HJuHfecWrD7tcQYEZezJzgayvG5leAbdWlgvo9ft/CUuwTtAB+tkeKP3e3VtbkCoPaAZO4VAUN0Y30Ute2/vrQ==", + "path": "fantasy-net.nlog/2024.1.20", + "hashPath": "fantasy-net.nlog.2024.1.20.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/2.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6ZCllUYGFukkymSTx3Yr0G/ajRxoNJp7/FqSxSB4fGISST54ifBhgu4Nc0ItGi3i6DqwuNd8SUyObmiC++AO2Q==", + "path": "microsoft.extensions.logging.abstractions/2.0.0", + "hashPath": "microsoft.extensions.logging.abstractions.2.0.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "path": "microsoft.netcore.platforms/5.0.0", + "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "path": "microsoft.win32.registry/5.0.0", + "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "path": "mongodb.bson/3.1.0", + "hashPath": "mongodb.bson.3.1.0.nupkg.sha512" + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "path": "mongodb.driver/3.1.0", + "hashPath": "mongodb.driver.3.1.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "protobuf-net/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "path": "protobuf-net/3.2.45", + "hashPath": "protobuf-net.3.2.45.nupkg.sha512" + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "path": "protobuf-net.core/3.2.45", + "hashPath": "protobuf-net.core.3.2.45.nupkg.sha512" + }, + "SharpCompress/0.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "path": "sharpcompress/0.30.1", + "hashPath": "sharpcompress.0.30.1.nupkg.sha512" + }, + "Snappier/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "path": "snappier/1.0.0", + "hashPath": "snappier.1.0.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "path": "system.collections.immutable/7.0.0", + "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" + }, + "System.IO.Pipelines/9.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-eA3cinogwaNB4jdjQHOP3Z3EuyiDII7MT35jgtnsA4vkn0LUrrSHsU0nzHTzFzmaFYeKV7MYyMxOocFzsBHpTw==", + "path": "system.io.pipelines/9.0.0", + "hashPath": "system.io.pipelines.9.0.0.nupkg.sha512" + }, + "System.Memory/4.5.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "path": "system.memory/4.5.5", + "hashPath": "system.memory.4.5.5.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "path": "system.security.accesscontrol/5.0.0", + "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "path": "system.security.principal.windows/5.0.0", + "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "path": "zstdsharp.port/0.7.3", + "hashPath": "zstdsharp.port.0.7.3.nupkg.sha512" + }, + "Entity/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Hotfix/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Main.dll b/GameServer/Server/Main/bin/Debug/net9.0/Main.dll new file mode 100644 index 00000000..2d02cb50 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Main.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Main.exe b/GameServer/Server/Main/bin/Debug/net9.0/Main.exe new file mode 100644 index 00000000..d9192bc0 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Main.exe differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Main.pdb b/GameServer/Server/Main/bin/Debug/net9.0/Main.pdb new file mode 100644 index 00000000..c04b2b4f Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Main.pdb differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Main.runtimeconfig.json b/GameServer/Server/Main/bin/Debug/net9.0/Main.runtimeconfig.json new file mode 100644 index 00000000..27e402f0 --- /dev/null +++ b/GameServer/Server/Main/bin/Debug/net9.0/Main.runtimeconfig.json @@ -0,0 +1,18 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "frameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + { + "name": "Microsoft.AspNetCore.App", + "version": "9.0.0" + } + ], + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Main/bin/Debug/net9.0/MongoDB.Bson.dll b/GameServer/Server/Main/bin/Debug/net9.0/MongoDB.Bson.dll new file mode 100644 index 00000000..c604c81a Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/MongoDB.Bson.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/MongoDB.Driver.dll b/GameServer/Server/Main/bin/Debug/net9.0/MongoDB.Driver.dll new file mode 100644 index 00000000..1308944b Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/MongoDB.Driver.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/NLog.config b/GameServer/Server/Main/bin/Debug/net9.0/NLog.config new file mode 100644 index 00000000..4df5ea1b --- /dev/null +++ b/GameServer/Server/Main/bin/Debug/net9.0/NLog.config @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/Main/bin/Debug/net9.0/NLog.dll b/GameServer/Server/Main/bin/Debug/net9.0/NLog.dll new file mode 100644 index 00000000..49604e19 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/NLog.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/NLog.xsd b/GameServer/Server/Main/bin/Debug/net9.0/NLog.xsd new file mode 100644 index 00000000..63c9a0cc --- /dev/null +++ b/GameServer/Server/Main/bin/Debug/net9.0/NLog.xsd @@ -0,0 +1,3483 @@ + + + + + + + + + + + + + + + Watch config file for changes and reload automatically. + + + + + Print internal NLog messages to the console. Default value is: false + + + + + Print internal NLog messages to the console error output. Default value is: false + + + + + Write internal NLog messages to the specified file. + + + + + Log level threshold for internal log messages. Default value is: Info. + + + + + Global log level threshold for application log messages. Messages below this level won't be logged. + + + + + Throw an exception when there is an internal error. Default value is: false. Not recommend to set to true in production! + + + + + Throw an exception when there is a configuration error. If not set, determined by throwExceptions. + + + + + Gets or sets a value indicating whether Variables should be kept on configuration reload. Default value is: false. + + + + + Write internal NLog messages to the System.Diagnostics.Trace. Default value is: false. + + + + + Write timestamps for internal NLog messages. Default value is: true. + + + + + Use InvariantCulture as default culture instead of CurrentCulture. Default value is: false. + + + + + Perform message template parsing and formatting of LogEvent messages (true = Always, false = Never, empty = Auto Detect). Default value is: empty. + + + + + + + + + + + + + + Make all targets within this section asynchronous (creates additional threads but the calling thread isn't blocked by any target writes). + + + + + + + + + + + + + + + + + Prefix for targets/layout renderers/filters/conditions loaded from this assembly. + + + + + Load NLog extensions from the specified file (*.dll) + + + + + Load NLog extensions from the specified assembly. Assembly name should be fully qualified. + + + + + + + + + + Filter on the name of the logger. May include wildcard characters ('*' or '?'). + + + + + Comma separated list of levels that this rule matches. + + + + + Minimum level that this rule matches. + + + + + Maximum level that this rule matches. + + + + + Level that this rule matches. + + + + + Comma separated list of target names. + + + + + Ignore further rules if this one matches. + + + + + Enable this rule. Note: disabled rules aren't available from the API. + + + + + Rule identifier to allow rule lookup with Configuration.FindRuleByName and Configuration.RemoveRuleByName. + + + + + Loggers matching will be restricted to specified minimum level for following rules. + + + + + + + + + + + + + + + Default action if none of the filters match. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the file to be included. You could use * wildcard. The name is relative to the name of the current config file. + + + + + Ignore any errors in the include file. + + + + + + + + Variable value. Note, the 'value' attribute has precedence over this one. + + + + + + Variable name. + + + + + Variable value. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Action to be taken when the lazy writer thread request queue count exceeds the set limit. + + + + + Limit on the number of requests in the lazy writer thread request queue. + + + + + Number of log events that should be processed in a batch by the lazy writer thread. + + + + + Whether to use the locking queue, instead of a lock-free concurrent queue + + + + + Number of batches of P:NLog.Targets.Wrappers.AsyncTargetWrapper.BatchSize to write before yielding into P:NLog.Targets.Wrappers.AsyncTargetWrapper.TimeToSleepBetweenBatches + + + + + Time in milliseconds to sleep between batches. (1 or less means trigger on new activity) + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Delay the flush until the LogEvent has been confirmed as written + + + + + Condition expression. Log events who meet this condition will cause a flush on the wrapped target. + + + + + Only flush when LogEvent matches condition. Ignore explicit-flush, config-reload-flush and shutdown-flush + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Number of log events to be buffered. + + + + + Action to take if the buffer overflows. + + + + + Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes. + + + + + Indicates whether to use sliding timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Viewer parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Whether an attribute with empty value should be included in the output + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-check if the console is available. - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + Enables output using ANSI Color Codes + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console has been redirected to file - Disables coloring logic when System.Console.IsOutputRedirected = true + + + + + Indicates whether to use default row highlighting rules. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background color. + + + + + Condition that must be met in order to set the specified foreground and background color. + + + + + Foreground color. + + + + + + + + + + + + + + + + + Background color. + + + + + Compile the P:NLog.Targets.ConsoleWordHighlightingRule.Regex? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used. + + + + + Condition that must be met before scanning the row for highlight of words + + + + + Foreground color. + + + + + Indicates whether to ignore case when comparing texts. + + + + + Regular expression to be matched. You must specify either text or regex. + + + + + Text to be matched. You must specify either text or regex. + + + + + Indicates whether to match whole words only. + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether to auto-flush after M:System.Console.WriteLine + + + + + Indicates whether to auto-check if the console is available - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + + + + The encoding for writing messages to the T:System.Console. + + + + + Indicates whether to send the log messages to the standard error instead of the standard output. + + + + + Whether to activate internal buffering to allow batch writing, instead of using M:System.Console.WriteLine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. + + + + + Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. + + + + + Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. + + + + + Name of the connection string (as specified in <connectionStrings> configuration section. + + + + + Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. + + + + + Indicates whether to keep the database connection open between the log events. + + + + + Name of the database provider. + + + + + Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. + + + + + Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. + + + + + Configures isolated transaction batch writing. If supported by the database, then it will improve insert performance. + + + + + Text of the SQL command to be run on each log level. + + + + + Type of the SQL command to be run on each log level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Convert format of the property value + + + + + Culture used for parsing property string-value for type-conversion + + + + + Value to assign on the object-property + + + + + Name for the object-property + + + + + Type of the object-property + + + + + + + + + + + + + + Type of the command. + + + + + Connection string to run the command against. If not provided, connection string from the target is used. + + + + + Indicates whether to ignore failures. + + + + + Command text. + + + + + + + + + + + + + + + + + + + + Database parameter name. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Database parameter DbType. + + + + + Database parameter size. + + + + + Database parameter precision. + + + + + Database parameter scale. + + + + + Type of the parameter. + + + + + Fallback value when result value is not available + + + + + Convert format of the database parameter value. + + + + + Culture used for parsing parameter string-value for type-conversion + + + + + Whether empty value should translate into DbNull. Requires database column to allow NULL values. + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Layout that renders event Category. + + + + + Optional entry type. When not set, or when not convertible to T:System.Diagnostics.EventLogEntryType then determined by T:NLog.LogLevel + + + + + Layout that renders event ID. + + + + + Name of the Event Log to write to. This can be System, Application or any user-defined name. + + + + + Name of the machine on which Event Log service is running. + + + + + Maximum Event log size in kilobytes. + + + + + Message length limit to write to the Event Log. + + + + + Value to be used as the event Source. + + + + + Action to take if the message is larger than the P:NLog.Targets.EventLogTarget.MaxMessageLength option. + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to return to the first target after any successful write. + + + + + Whether to enable batching, but fallback will be handled individually + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Name of the file to write to. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether the footer should be written only when the file is archived. + + + + + Maximum number of archive files that should be kept. + + + + + Maximum days of archive files that should be kept. + + + + + Value of the file size threshold to archive old log file on startup. + + + + + Indicates whether to archive old log file on startup. + + + + + Indicates whether to compress archive files into the zip archive format. + + + + + Name of the file to be used for an archive. + + + + + Is the P:NLog.Targets.FileTarget.ArchiveFileName an absolute or relative path? + + + + + Indicates whether to automatically archive log files every time the specified time passes. + + + + + Value specifying the date format to use when archiving files. + + + + + Size in bytes above which log files will be automatically archived. + + + + + Way file archives are numbered. + + + + + Indicates whether to create directories if they do not exist. + + + + + Indicates whether file creation calls should be synchronized by a system global mutex. + + + + + Gets or set a value indicating whether a managed file stream is forced, instead of using the native implementation. + + + + + Is the P:NLog.Targets.FileTarget.FileName an absolute or relative path? + + + + + File attributes (Windows only). + + + + + Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong. + + + + + Indicates whether to write BOM (byte order mark) in created files. Defaults to true for UTF-16 and UTF-32 + + + + + Indicates whether to enable log file(s) to be deleted. + + + + + Indicates whether to delete old log file on startup. + + + + + File encoding. + + + + + Indicates whether to replace file contents on each write instead of appending log message at the end. + + + + + Line ending mode. + + + + + Number of times the write is appended on the file before NLog discards the log message. + + + + + Delay in milliseconds to wait before attempting to write to the file again. + + + + + Maximum number of seconds before open files are flushed. Zero or negative means disabled. + + + + + Maximum number of seconds that files are kept open. Zero or negative means disabled. + + + + + Indicates whether concurrent writes to the log file by multiple processes on different network hosts. + + + + + Log file buffer size in bytes. + + + + + Indicates whether to automatically flush the file buffers after each log message. + + + + + Indicates whether to keep log file open instead of opening and closing it on each logging event. + + + + + Indicates whether concurrent writes to the log file by multiple processes on the same host. + + + + + Whether or not this target should just discard all data that its asked to write. Mostly used for when testing NLog Stack except final write + + + + + Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Condition expression. Log events who meet this condition will be forwarded to the wrapped target. + + + + + + + + + + + + + + + Name of the target. + + + + + Identifier to perform group-by + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Windows domain name to change context to. + + + + + Required impersonation level. + + + + + Type of the logon provider. + + + + + Logon Type. + + + + + User account password. + + + + + Indicates whether to revert to the credentials of the process instead of impersonating another user. + + + + + Username to change context to. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Interval in which messages will be written up to the P:NLog.Targets.Wrappers.LimitingTargetWrapper.MessageLimit number of messages. + + + + + Maximum allowed number of messages written per P:NLog.Targets.Wrappers.LimitingTargetWrapper.Interval. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Indicates whether NewLine characters in the body should be replaced with tags. + + + + + Priority used for sending mails. + + + + + Encoding to be used for sending e-mail. + + + + + BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Indicates whether to add new lines between log entries. + + + + + Indicates whether to send message as HTML instead of plain text. + + + + + Sender's email address (e.g. joe@domain.com). + + + + + Mail message body (repeated for each log message send in one mail). + + + + + Mail subject. + + + + + Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + Specifies how outgoing email messages will be handled. + + + + + SMTP Server to be used for sending. + + + + + SMTP Authentication mode. + + + + + Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + + + + + Port number that SMTP Server is listening on. + + + + + Indicates whether the default Settings from System.Net.MailSettings should be used. + + + + + Folder where applications save mail messages to be processed by the local SMTP server. + + + + + Indicates the SMTP client timeout. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Max number of items to have in memory + + + + + + + + + + + + + + + + + Name of the target. + + + + + Class name. + + + + + Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g. + + + + + + + + + + + + + + + Name of the parameter. + + + + + Layout that should be use to calculate the value for the parameter. + + + + + Fallback value when result value is not available + + + + + Type of the parameter. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Separator for T:NLog.ScopeContext operation-states-stack. + + + + + Stack separator for log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Renderer for log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Option to include all properties from the log events + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Instance of T:NLog.Layouts.Log4JXmlEventLayout that is used to format log messages. + + + + + Indicates whether to include NLog-specific extensions to log4j schema. + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network address. + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + Name of the target. + + + + + Layout used to format log messages. + + + + + Indicates whether to perform layout calculation. + + + + + + + + + + + + + + + + Name of the target. + + + + + Default filter to be applied when no specific rule matches. + + + + + + + + + + + + + Condition to be tested. + + + + + Resulting filter to be applied when the condition matches. + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + Name of the target. + + + + + Number of times to repeat each log message. + + + + + + + + + + + + + + + + + Name of the target. + + + + + Whether to enable batching, and only apply single delay when a whole batch fails + + + + + Number of retries that should be attempted on the wrapped target in case of a failure. + + + + + Time to wait between retries in milliseconds. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + Name of the target. + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Text to be rendered. + + + + + Header. + + + + + Footer. + + + + + Forward F:NLog.LogLevel.Fatal to M:System.Diagnostics.Trace.Fail(System.String) (Instead of M:System.Diagnostics.Trace.TraceError(System.String)) + + + + + Force use M:System.Diagnostics.Trace.WriteLine(System.String) independent of T:NLog.LogLevel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Indicates whether to pre-authenticate the HttpWebRequest (Requires 'Authorization' in P:NLog.Targets.WebServiceTarget.Headers parameters) + + + + + Value whether escaping be done according to Rfc3986 (Supports Internationalized Resource Identifiers - IRIs) + + + + + Value whether escaping be done according to the old NLog style (Very non-standard) + + + + + Value of the User-agent HTTP header. + + + + + Web service URL. + + + + + Proxy configuration when calling web service + + + + + Custom proxy address, include port separated by a colon + + + + + Protocol to be used when calling web service. + + + + + Web service namespace. Only used with Soap. + + + + + Web service method name. Only used with Soap. + + + + + Should we include the BOM (Byte-order-mark) for UTF? Influences the P:NLog.Targets.WebServiceTarget.Encoding property. This will only work for UTF-8. + + + + + Encoding. + + + + + Name of the root XML element, if POST of XML document chosen. If so, this property must not be null. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + (optional) root namespace of the XML document, if POST of XML document chosen. (see P:NLog.Targets.WebServiceTarget.Protocol and F:NLog.Targets.WebServiceProtocol.XmlPost). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom'). + + + + + Column delimiter. + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + Quote Character. + + + + + Quoting mode. + + + + + Indicates whether CVS should include header. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the column. + + + + + Layout of the column. + + + + + Override of Quoting mode + + + + + + + + + + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log event (as JSON) + + + + + Indicates whether to include contents of the T:NLog.GlobalDiagnosticsContext dictionary. + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Option to exclude null/empty properties from the log event (as JSON) + + + + + List of property names to exclude when P:NLog.Layouts.JsonLayout.IncludeAllProperties is true + + + + + How far should the JSON serializer follow object references before backing off + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json + + + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Json encoded. + + + + + Should forward slashes be escaped? If true, / will be converted to \/ + + + + + Indicates whether to escape non-ascii characters + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + Footer layout. + + + + + Header layout. + + + + + Body layout (can be repeated multiple times). + + + + + + + + + + + + + + + + + + + + + + + Option to include all properties from the log events + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include log4j:NDC in output from T:NLog.ScopeContext nested context. + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + Indicates whether to include source info (file name and line number) in the information sent over the network. + + + + + Log4j:event logger-xml-attribute (Default ${logger}) + + + + + Whether the log4j:throwable xml-element should be written as CDATA + + + + + + + + + + + + + + Layout text. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the root XML element + + + + + Value inside the root XML element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout that will be rendered as the attribute's value. + + + + + Fallback value when result value is not available + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + Whether an attribute with empty value should be included in the output + + + + + Result value type, for conversion of layout rendering output + + + + + + + + + + + + + + + + + + + + + + + + Name of the element + + + + + Whether to include the contents of the T:NLog.ScopeContext dictionary. + + + + + Value inside the element + + + + + Determines whether or not this attribute will be Xml encoded. + + + + + List of property names to exclude when P:NLog.Layouts.XmlElementBase.IncludeAllProperties is true + + + + + Whether a ElementValue with empty value should be included in the output + + + + + Auto indent and create new lines + + + + + How far should the XML serializer follow object references before backing off + + + + + XML element name to use for rendering IList-collections items + + + + + XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included + + + + + XML element name to use when rendering properties + + + + + XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value + + + + + Option to include all properties from the log event (as XML) + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Condition expression. + + + + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + Substring to be matched. + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + String to compare the layout to. + + + + + Indicates whether to ignore case when comparing strings. + + + + + Layout to be used to filter log messages. + + + + + + + + + + + + + + + + + + + + + + + Action to be taken when filter matches. + + + + + Append FilterCount to the P:NLog.LogEventInfo.Message when an event is no longer filtered + + + + + Insert FilterCount value into P:NLog.LogEventInfo.Properties when an event is no longer filtered + + + + + Applies the configured action to the initial logevent that starts the timeout period. Used to configure that it should ignore all events until timeout. + + + + + Layout to be used to filter log messages. + + + + + Max length of filter values, will truncate if above limit + + + + + How long before a filter expires, and logging is accepted again + + + + + Default number of unique filter values to expect, will automatically increase if needed + + + + + Max number of unique filter values to expect simultaneously + + + + + Default buffer size for the internal buffers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Newtonsoft.Json.dll b/GameServer/Server/Main/bin/Debug/net9.0/Newtonsoft.Json.dll new file mode 100644 index 00000000..d035c38b Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Newtonsoft.Json.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/SharpCompress.dll b/GameServer/Server/Main/bin/Debug/net9.0/SharpCompress.dll new file mode 100644 index 00000000..c1a7f074 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/SharpCompress.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/Snappier.dll b/GameServer/Server/Main/bin/Debug/net9.0/Snappier.dll new file mode 100644 index 00000000..9b68e856 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/Snappier.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/ZstdSharp.dll b/GameServer/Server/Main/bin/Debug/net9.0/ZstdSharp.dll new file mode 100644 index 00000000..5d93f7e5 Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/ZstdSharp.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/protobuf-net.Core.dll b/GameServer/Server/Main/bin/Debug/net9.0/protobuf-net.Core.dll new file mode 100644 index 00000000..b3e554dc Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/protobuf-net.Core.dll differ diff --git a/GameServer/Server/Main/bin/Debug/net9.0/protobuf-net.dll b/GameServer/Server/Main/bin/Debug/net9.0/protobuf-net.dll new file mode 100644 index 00000000..e75237bc Binary files /dev/null and b/GameServer/Server/Main/bin/Debug/net9.0/protobuf-net.dll differ diff --git a/GameServer/Server/Main/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Server/Main/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Server/Main/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.AssemblyInfo.cs b/GameServer/Server/Main/obj/Debug/net9.0/Main.AssemblyInfo.cs new file mode 100644 index 00000000..cea776ab --- /dev/null +++ b/GameServer/Server/Main/obj/Debug/net9.0/Main.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Main")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+93d69c1ff6fc3ec58a9401445592c13d80a5e8fc")] +[assembly: System.Reflection.AssemblyProductAttribute("Main")] +[assembly: System.Reflection.AssemblyTitleAttribute("Main")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.AssemblyInfoInputs.cache b/GameServer/Server/Main/obj/Debug/net9.0/Main.AssemblyInfoInputs.cache new file mode 100644 index 00000000..7893dd00 --- /dev/null +++ b/GameServer/Server/Main/obj/Debug/net9.0/Main.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +bdec6df185994b1af86f341a674c5f39711943f372014406b428ef851b556cbf diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/Main/obj/Debug/net9.0/Main.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..33f083a6 --- /dev/null +++ b/GameServer/Server/Main/obj/Debug/net9.0/Main.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Main +build_property.ProjectDir = D:\UnityProject\EintooAR\GameServer\Server\Main\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.GlobalUsings.g.cs b/GameServer/Server/Main/obj/Debug/net9.0/Main.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/Main/obj/Debug/net9.0/Main.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.assets.cache b/GameServer/Server/Main/obj/Debug/net9.0/Main.assets.cache new file mode 100644 index 00000000..3c89e778 Binary files /dev/null and b/GameServer/Server/Main/obj/Debug/net9.0/Main.assets.cache differ diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.AssemblyReference.cache b/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.AssemblyReference.cache new file mode 100644 index 00000000..1056973f Binary files /dev/null and b/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.AssemblyReference.cache differ diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.CoreCompileInputs.cache b/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.CoreCompileInputs.cache new file mode 100644 index 00000000..807dd411 --- /dev/null +++ b/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +19917914e91ef5941f3fdf471f3ec5e8b1005ae15818b7fbbf92e808c820d143 diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.FileListAbsolute.txt b/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.FileListAbsolute.txt new file mode 100644 index 00000000..4db1bc4f --- /dev/null +++ b/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.FileListAbsolute.txt @@ -0,0 +1,168 @@ +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Main.exe +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\NLog.config +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\NLog.xsd +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Main.deps.json +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Main.runtimeconfig.json +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Main.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Main.pdb +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\CommandLine.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\DnsClient.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Fantasy-Net.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Fantasy-Net.NLog.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\MongoDB.Bson.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\MongoDB.Driver.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Newtonsoft.Json.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\NLog.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\protobuf-net.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\protobuf-net.Core.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\SharpCompress.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Snappier.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\ZstdSharp.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Entity.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Hotfix.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Entity.pdb +E:\Game\unity\TE_AR\GameServer\Server\Main\bin\Debug\net9.0\Hotfix.pdb +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.AssemblyReference.cache +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.GeneratedMSBuildEditorConfig.editorconfig +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfoInputs.cache +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfo.cs +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.CoreCompileInputs.cache +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.Up2Date +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\refint\Main.dll +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.pdb +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.genruntimeconfig.cache +E:\Game\unity\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\ref\Main.dll +E:\Game\unity\TE_AR\GameServer\Bin\Debug\net9.0\Main.exe +E:\Game\unity\TE_AR\GameServer\Bin\Debug\net9.0\NLog.config +E:\Game\unity\TE_AR\GameServer\Bin\Debug\net9.0\NLog.xsd +E:\Game\unity\TE_AR\GameServer\Bin\Debug\net9.0\Main.deps.json +E:\Game\unity\TE_AR\GameServer\Bin\Debug\net9.0\Main.runtimeconfig.json +E:\Game\unity\TE_AR\GameServer\Bin\Debug\net9.0\Main.dll +E:\Game\unity\TE_AR\GameServer\Bin\Debug\net9.0\Main.pdb +E:\UnityProject\TE_AR\GameServer\Bin\Debug\net9.0\Main.exe +E:\UnityProject\TE_AR\GameServer\Bin\Debug\net9.0\NLog.config +E:\UnityProject\TE_AR\GameServer\Bin\Debug\net9.0\NLog.xsd +E:\UnityProject\TE_AR\GameServer\Bin\Debug\net9.0\Main.deps.json +E:\UnityProject\TE_AR\GameServer\Bin\Debug\net9.0\Main.runtimeconfig.json +E:\UnityProject\TE_AR\GameServer\Bin\Debug\net9.0\Main.dll +E:\UnityProject\TE_AR\GameServer\Bin\Debug\net9.0\Main.pdb +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.AssemblyReference.cache +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfoInputs.cache +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfo.cs +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.CoreCompileInputs.cache +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.Up2Date +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.dll +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\refint\Main.dll +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.pdb +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\Main.genruntimeconfig.cache +E:\UnityProject\TE_AR\GameServer\Server\Main\obj\Debug\net9.0\ref\Main.dll +E:\UnityProject\TE_ARMain\GameServer\Bin\Debug\net9.0\Main.exe +E:\UnityProject\TE_ARMain\GameServer\Bin\Debug\net9.0\NLog.config +E:\UnityProject\TE_ARMain\GameServer\Bin\Debug\net9.0\NLog.xsd +E:\UnityProject\TE_ARMain\GameServer\Bin\Debug\net9.0\Main.deps.json +E:\UnityProject\TE_ARMain\GameServer\Bin\Debug\net9.0\Main.runtimeconfig.json +E:\UnityProject\TE_ARMain\GameServer\Bin\Debug\net9.0\Main.dll +E:\UnityProject\TE_ARMain\GameServer\Bin\Debug\net9.0\Main.pdb +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.AssemblyReference.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\Main.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfoInputs.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfo.cs +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.CoreCompileInputs.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.Up2Date +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\Main.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\refint\Main.dll +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\Main.pdb +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\Main.genruntimeconfig.cache +E:\UnityProject\TE_ARMain\GameServer\Server\Main\obj\Debug\net9.0\ref\Main.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Bin\Debug\net9.0\Main.exe +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Bin\Debug\net9.0\NLog.config +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Bin\Debug\net9.0\NLog.xsd +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Bin\Debug\net9.0\Main.deps.json +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Bin\Debug\net9.0\Main.runtimeconfig.json +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Bin\Debug\net9.0\Main.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Bin\Debug\net9.0\Main.pdb +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.AssemblyReference.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.GeneratedMSBuildEditorConfig.editorconfig +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfoInputs.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfo.cs +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.CoreCompileInputs.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.Up2Date +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\refint\Main.dll +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.pdb +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.genruntimeconfig.cache +E:\TE_UnityProject\ARSelf\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\ref\Main.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Bin\Debug\net9.0\Main.exe +E:\UnityProject\NewAR\EintooAR\GameServer\Bin\Debug\net9.0\NLog.config +E:\UnityProject\NewAR\EintooAR\GameServer\Bin\Debug\net9.0\NLog.xsd +E:\UnityProject\NewAR\EintooAR\GameServer\Bin\Debug\net9.0\Main.deps.json +E:\UnityProject\NewAR\EintooAR\GameServer\Bin\Debug\net9.0\Main.runtimeconfig.json +E:\UnityProject\NewAR\EintooAR\GameServer\Bin\Debug\net9.0\Main.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Bin\Debug\net9.0\Main.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.AssemblyReference.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.GeneratedMSBuildEditorConfig.editorconfig +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfoInputs.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfo.cs +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.CoreCompileInputs.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.Up2Date +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\refint\Main.dll +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.pdb +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.genruntimeconfig.cache +E:\UnityProject\NewAR\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\ref\Main.dll +D:\UGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.exe +D:\UGit\EintooAR\GameServer\Bin\Debug\net9.0\NLog.config +D:\UGit\EintooAR\GameServer\Bin\Debug\net9.0\NLog.xsd +D:\UGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.deps.json +D:\UGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.runtimeconfig.json +D:\UGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.dll +D:\UGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.pdb +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.AssemblyReference.cache +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.GeneratedMSBuildEditorConfig.editorconfig +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfoInputs.cache +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfo.cs +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.CoreCompileInputs.cache +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.Up2Date +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.dll +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\refint\Main.dll +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.pdb +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.genruntimeconfig.cache +D:\UGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\ref\Main.dll +D:\TecentUGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.exe +D:\TecentUGit\EintooAR\GameServer\Bin\Debug\net9.0\NLog.config +D:\TecentUGit\EintooAR\GameServer\Bin\Debug\net9.0\NLog.xsd +D:\TecentUGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.deps.json +D:\TecentUGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.runtimeconfig.json +D:\TecentUGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.dll +D:\TecentUGit\EintooAR\GameServer\Bin\Debug\net9.0\Main.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.AssemblyReference.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.GeneratedMSBuildEditorConfig.editorconfig +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfoInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfo.cs +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.CoreCompileInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.Up2Date +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.dll +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\refint\Main.dll +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.genruntimeconfig.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\ref\Main.dll +D:\UnityProject\EintooAR\GameServer\Bin\Debug\net9.0\Main.exe +D:\UnityProject\EintooAR\GameServer\Bin\Debug\net9.0\NLog.config +D:\UnityProject\EintooAR\GameServer\Bin\Debug\net9.0\NLog.xsd +D:\UnityProject\EintooAR\GameServer\Bin\Debug\net9.0\Main.deps.json +D:\UnityProject\EintooAR\GameServer\Bin\Debug\net9.0\Main.runtimeconfig.json +D:\UnityProject\EintooAR\GameServer\Bin\Debug\net9.0\Main.dll +D:\UnityProject\EintooAR\GameServer\Bin\Debug\net9.0\Main.pdb +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.AssemblyReference.cache +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.GeneratedMSBuildEditorConfig.editorconfig +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfoInputs.cache +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.AssemblyInfo.cs +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.CoreCompileInputs.cache +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.csproj.Up2Date +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.dll +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\refint\Main.dll +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.pdb +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\Main.genruntimeconfig.cache +D:\UnityProject\EintooAR\GameServer\Server\Main\obj\Debug\net9.0\ref\Main.dll diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.Up2Date b/GameServer/Server/Main/obj/Debug/net9.0/Main.csproj.Up2Date new file mode 100644 index 00000000..e69de29b diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.dll b/GameServer/Server/Main/obj/Debug/net9.0/Main.dll new file mode 100644 index 00000000..f5df5de0 Binary files /dev/null and b/GameServer/Server/Main/obj/Debug/net9.0/Main.dll differ diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.genruntimeconfig.cache b/GameServer/Server/Main/obj/Debug/net9.0/Main.genruntimeconfig.cache new file mode 100644 index 00000000..63548a90 --- /dev/null +++ b/GameServer/Server/Main/obj/Debug/net9.0/Main.genruntimeconfig.cache @@ -0,0 +1 @@ +4fc2a9db1190f9d2ae310054b3fb1ec136ad731de02ca1ba8a94a1dbd18cc51d diff --git a/GameServer/Server/Main/obj/Debug/net9.0/Main.pdb b/GameServer/Server/Main/obj/Debug/net9.0/Main.pdb new file mode 100644 index 00000000..504f5178 Binary files /dev/null and b/GameServer/Server/Main/obj/Debug/net9.0/Main.pdb differ diff --git a/GameServer/Server/Main/obj/Debug/net9.0/apphost.exe b/GameServer/Server/Main/obj/Debug/net9.0/apphost.exe new file mode 100644 index 00000000..9f7efb20 Binary files /dev/null and b/GameServer/Server/Main/obj/Debug/net9.0/apphost.exe differ diff --git a/GameServer/Server/Main/obj/Debug/net9.0/ref/Main.dll b/GameServer/Server/Main/obj/Debug/net9.0/ref/Main.dll new file mode 100644 index 00000000..de3c4d86 Binary files /dev/null and b/GameServer/Server/Main/obj/Debug/net9.0/ref/Main.dll differ diff --git a/GameServer/Server/Main/obj/Debug/net9.0/refint/Main.dll b/GameServer/Server/Main/obj/Debug/net9.0/refint/Main.dll new file mode 100644 index 00000000..de3c4d86 Binary files /dev/null and b/GameServer/Server/Main/obj/Debug/net9.0/refint/Main.dll differ diff --git a/GameServer/Server/Main/obj/Main.csproj.nuget.dgspec.json b/GameServer/Server/Main/obj/Main.csproj.nuget.dgspec.json new file mode 100644 index 00000000..32ce1b67 --- /dev/null +++ b/GameServer/Server/Main/obj/Main.csproj.nuget.dgspec.json @@ -0,0 +1,362 @@ +{ + "format": 1, + "restore": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\Main.csproj": {} + }, + "projects": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "projectName": "APlugins", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net.Config": { + "target": "Package", + "version": "[2024.1.4, )" + }, + "Fantasy-Net.ConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterConfigTable": { + "target": "Package", + "version": "[2024.2.0, )" + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol": { + "target": "Package", + "version": "[2024.2.24, )" + }, + "Microsoft.IdentityModel.Tokens": { + "target": "Package", + "version": "[8.7.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj", + "projectName": "Entity", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net": { + "target": "Package", + "version": "[2024.2.24, )" + }, + "System.IdentityModel.Tokens.Jwt": { + "target": "Package", + "version": "[8.7.0, )" + }, + "System.Security.Cryptography.Cng": { + "target": "Package", + "version": "[5.0.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj", + "projectName": "Hotfix", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + } + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\Main.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\Main.csproj", + "projectName": "Main", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\Main.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj" + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj" + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net.NLog": { + "target": "Package", + "version": "[2024.1.20, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Runtime.linux-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.AspNetCore.App.Runtime.win-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.NETCore.App.Host.linux-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.NETCore.App.Runtime.linux-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.NETCore.App.Runtime.win-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.WindowsDesktop.App.Runtime.win-x64", + "version": "[9.0.4, 9.0.4]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + }, + "runtimes": { + "linux-x64": { + "#import": [] + }, + "win-x64": { + "#import": [] + } + } + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Main/obj/Main.csproj.nuget.g.props b/GameServer/Server/Main/obj/Main.csproj.nuget.g.props new file mode 100644 index 00000000..2571d6c1 --- /dev/null +++ b/GameServer/Server/Main/obj/Main.csproj.nuget.g.props @@ -0,0 +1,21 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\qq137\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 6.12.2 + + + + + + + C:\Users\qq137\.nuget\packages\fantasy-net.tools.exporternetworkprotocol\2024.2.24 + C:\Users\qq137\.nuget\packages\fantasy-net.tools.exporterconfigtable\2024.2.0 + C:\Users\qq137\.nuget\packages\fantasy-net.config\2024.1.4 + + \ No newline at end of file diff --git a/GameServer/Server/Main/obj/Main.csproj.nuget.g.targets b/GameServer/Server/Main/obj/Main.csproj.nuget.g.targets new file mode 100644 index 00000000..c6a817eb --- /dev/null +++ b/GameServer/Server/Main/obj/Main.csproj.nuget.g.targets @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/GameServer/Server/Main/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Server/Main/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.AssemblyInfo.cs b/GameServer/Server/Main/obj/Release/net9.0/Main.AssemblyInfo.cs new file mode 100644 index 00000000..3b7a6f8d --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/Main.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Main")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4710d1c9d412b6a31c2ed97fac4853f5c41daeb1")] +[assembly: System.Reflection.AssemblyProductAttribute("Main")] +[assembly: System.Reflection.AssemblyTitleAttribute("Main")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.AssemblyInfoInputs.cache b/GameServer/Server/Main/obj/Release/net9.0/Main.AssemblyInfoInputs.cache new file mode 100644 index 00000000..c02362d7 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/Main.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +ed94921245fe2bf9992c9b12a9eb049ed83f808ab42d9116136be673675e9640 diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/Main/obj/Release/net9.0/Main.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..c80a1109 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/Main.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Main +build_property.ProjectDir = D:\TecentUGit\EintooAR\GameServer\Server\Main\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.GlobalUsings.g.cs b/GameServer/Server/Main/obj/Release/net9.0/Main.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/Main.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.assets.cache b/GameServer/Server/Main/obj/Release/net9.0/Main.assets.cache new file mode 100644 index 00000000..8844469a Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/Main.assets.cache differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.AssemblyReference.cache b/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.AssemblyReference.cache new file mode 100644 index 00000000..dfc1b3a7 Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.AssemblyReference.cache differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.CoreCompileInputs.cache b/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.CoreCompileInputs.cache new file mode 100644 index 00000000..91be25f7 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +bc987d0cf41326c2882b1098ac2b6d2dc4156384cd94e1e27078c4a41f79edc0 diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.FileListAbsolute.txt b/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.FileListAbsolute.txt new file mode 100644 index 00000000..f7669a73 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.FileListAbsolute.txt @@ -0,0 +1,18 @@ +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\Main.exe +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\NLog.config +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\NLog.xsd +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\Main.deps.json +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\Main.runtimeconfig.json +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\Main.dll +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\Main.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\Main.csproj.AssemblyReference.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\Main.GeneratedMSBuildEditorConfig.editorconfig +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\Main.AssemblyInfoInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\Main.AssemblyInfo.cs +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\Main.csproj.CoreCompileInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\Main.csproj.Up2Date +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\Main.dll +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\refint\Main.dll +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\Main.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\Main.genruntimeconfig.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\ref\Main.dll diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.Up2Date b/GameServer/Server/Main/obj/Release/net9.0/Main.csproj.Up2Date new file mode 100644 index 00000000..e69de29b diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.dll b/GameServer/Server/Main/obj/Release/net9.0/Main.dll new file mode 100644 index 00000000..8615b5fc Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/Main.dll differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.genruntimeconfig.cache b/GameServer/Server/Main/obj/Release/net9.0/Main.genruntimeconfig.cache new file mode 100644 index 00000000..e0e4b98a --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/Main.genruntimeconfig.cache @@ -0,0 +1 @@ +e9d1ccdb08b22f1d3cf1151a5afbe6ee2d6a5ed19cab88d36a32235ee661f031 diff --git a/GameServer/Server/Main/obj/Release/net9.0/Main.pdb b/GameServer/Server/Main/obj/Release/net9.0/Main.pdb new file mode 100644 index 00000000..5807ecc4 Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/Main.pdb differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/apphost.exe b/GameServer/Server/Main/obj/Release/net9.0/apphost.exe new file mode 100644 index 00000000..df244ea1 Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/apphost.exe differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 00000000..feda5e9f --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.AssemblyInfo.cs b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.AssemblyInfo.cs new file mode 100644 index 00000000..3b7a6f8d --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Main")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4710d1c9d412b6a31c2ed97fac4853f5c41daeb1")] +[assembly: System.Reflection.AssemblyProductAttribute("Main")] +[assembly: System.Reflection.AssemblyTitleAttribute("Main")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// 由 MSBuild WriteCodeFragment 类生成。 + diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.AssemblyInfoInputs.cache b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.AssemblyInfoInputs.cache new file mode 100644 index 00000000..c02362d7 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +ed94921245fe2bf9992c9b12a9eb049ed83f808ab42d9116136be673675e9640 diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.GeneratedMSBuildEditorConfig.editorconfig b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..c80a1109 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Main +build_property.ProjectDir = D:\TecentUGit\EintooAR\GameServer\Server\Main\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.GlobalUsings.g.cs b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.GlobalUsings.g.cs new file mode 100644 index 00000000..8578f3d0 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.assets.cache b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.assets.cache new file mode 100644 index 00000000..5cbed39a Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.assets.cache differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.AssemblyReference.cache b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.AssemblyReference.cache new file mode 100644 index 00000000..7e2d8b4e Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.AssemblyReference.cache differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.CoreCompileInputs.cache b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.CoreCompileInputs.cache new file mode 100644 index 00000000..8ae990bf --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +248ed987415b7001052d7cd5d7be8c7174c9f47effb75c6ff32ffdea56ab4aa3 diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.FileListAbsolute.txt b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.FileListAbsolute.txt new file mode 100644 index 00000000..47123ede --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.FileListAbsolute.txt @@ -0,0 +1,18 @@ +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\linux-x64\Main +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\linux-x64\NLog.config +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\linux-x64\NLog.xsd +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\linux-x64\Main.deps.json +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\linux-x64\Main.runtimeconfig.json +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\linux-x64\Main.dll +D:\TecentUGit\EintooAR\GameServer\Bin\Release\net9.0\linux-x64\Main.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\Main.csproj.AssemblyReference.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\Main.GeneratedMSBuildEditorConfig.editorconfig +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\Main.AssemblyInfoInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\Main.AssemblyInfo.cs +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\Main.csproj.CoreCompileInputs.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\Main.csproj.Up2Date +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\Main.dll +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\refint\Main.dll +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\Main.pdb +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\Main.genruntimeconfig.cache +D:\TecentUGit\EintooAR\GameServer\Server\Main\obj\Release\net9.0\linux-x64\ref\Main.dll diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.Up2Date b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.csproj.Up2Date new file mode 100644 index 00000000..e69de29b diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.dll b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.dll new file mode 100644 index 00000000..f5a23d4f Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.dll differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.genruntimeconfig.cache b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.genruntimeconfig.cache new file mode 100644 index 00000000..10571a21 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.genruntimeconfig.cache @@ -0,0 +1 @@ +72a6cb33305cf68e8b013bad19fe47bf339422225a7f8df9a8d043c99f65d9d1 diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.pdb b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.pdb new file mode 100644 index 00000000..72b4315c Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/Main.pdb differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/PublishOutputs.2607d84ed1.txt b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/PublishOutputs.2607d84ed1.txt new file mode 100644 index 00000000..7ddfb6af --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/PublishOutputs.2607d84ed1.txt @@ -0,0 +1,35 @@ +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\NLog.config +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\NLog.xsd +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Main +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Main.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Main.deps.json +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Main.runtimeconfig.json +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Main.pdb +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\CommandLine.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\DnsClient.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Fantasy-Net.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Fantasy-Net.Config.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Fantasy-Net.ConfigTable.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Fantasy-Net.NLog.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Fantasy.Tools.ExporterConfigTable.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Fantasy.Tools.ExporterNetworkProtocol.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Microsoft.IdentityModel.Abstractions.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Microsoft.IdentityModel.JsonWebTokens.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Microsoft.IdentityModel.Logging.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Microsoft.IdentityModel.Tokens.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\MongoDB.Bson.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\MongoDB.Driver.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Newtonsoft.Json.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\NLog.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\protobuf-net.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\protobuf-net.Core.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\SharpCompress.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Snappier.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\System.IdentityModel.Tokens.Jwt.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\ZstdSharp.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\APlugins.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Entity.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Hotfix.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\APlugins.pdb +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Entity.pdb +C:\Users\qq137\AppData\Local\Temp\rider-publish3993345463128570183\Hotfix.pdb diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/PublishOutputs.45828c0e46.txt b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/PublishOutputs.45828c0e46.txt new file mode 100644 index 00000000..dfae3c83 --- /dev/null +++ b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/PublishOutputs.45828c0e46.txt @@ -0,0 +1,35 @@ +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\NLog.config +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\NLog.xsd +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Main +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Main.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Main.deps.json +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Main.runtimeconfig.json +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Main.pdb +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\CommandLine.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\DnsClient.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Fantasy-Net.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Fantasy-Net.Config.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Fantasy-Net.ConfigTable.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Fantasy-Net.NLog.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Fantasy.Tools.ExporterConfigTable.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Fantasy.Tools.ExporterNetworkProtocol.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Microsoft.IdentityModel.Abstractions.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Microsoft.IdentityModel.JsonWebTokens.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Microsoft.IdentityModel.Logging.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Microsoft.IdentityModel.Tokens.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\MongoDB.Bson.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\MongoDB.Driver.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Newtonsoft.Json.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\NLog.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\protobuf-net.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\protobuf-net.Core.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\SharpCompress.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Snappier.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\System.IdentityModel.Tokens.Jwt.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\ZstdSharp.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\APlugins.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Entity.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Hotfix.dll +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\APlugins.pdb +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Entity.pdb +C:\Users\qq137\AppData\Local\Temp\rider-publish10301759153733773359\Hotfix.pdb diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/apphost b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/apphost new file mode 100644 index 00000000..01a8ff7d Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/apphost differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/ref/Main.dll b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/ref/Main.dll new file mode 100644 index 00000000..f07bce0c Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/ref/Main.dll differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/linux-x64/refint/Main.dll b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/refint/Main.dll new file mode 100644 index 00000000..f07bce0c Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/linux-x64/refint/Main.dll differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/ref/Main.dll b/GameServer/Server/Main/obj/Release/net9.0/ref/Main.dll new file mode 100644 index 00000000..3b442578 Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/ref/Main.dll differ diff --git a/GameServer/Server/Main/obj/Release/net9.0/refint/Main.dll b/GameServer/Server/Main/obj/Release/net9.0/refint/Main.dll new file mode 100644 index 00000000..3b442578 Binary files /dev/null and b/GameServer/Server/Main/obj/Release/net9.0/refint/Main.dll differ diff --git a/GameServer/Server/Main/obj/project.assets.json b/GameServer/Server/Main/obj/project.assets.json new file mode 100644 index 00000000..986e3286 --- /dev/null +++ b/GameServer/Server/Main/obj/project.assets.json @@ -0,0 +1,2783 @@ +{ + "version": 3, + "targets": { + "net9.0": { + "CommandLineParser/2.9.1": { + "type": "package", + "compile": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + } + }, + "DnsClient/1.6.1": { + "type": "package", + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "compile": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + } + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "compile": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "frameworkReferences": [ + "Microsoft.AspNetCore.App" + ], + "build": { + "buildTransitive/Fantasy-Net.targets": {} + } + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Config.targets": {} + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "dependencies": { + "Fantasy-Net": "2024.2.22" + }, + "compile": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + } + }, + "Fantasy-Net.NLog/2024.1.20": { + "type": "package", + "dependencies": { + "Fantasy-Net": "2024.1.3", + "NLog": "5.3.4" + }, + "compile": { + "lib/net8.0/Fantasy-Net.NLog.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.NLog.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.NLog.targets": {} + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets": {} + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets": {} + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "compile": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + }, + "compile": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets": {} + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "2.0.0", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "compile": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "NLog/5.3.4": { + "type": "package", + "compile": { + "lib/netstandard2.0/NLog.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "related": ".xml" + } + } + }, + "protobuf-net/3.2.45": { + "type": "package", + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "compile": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + } + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + } + }, + "SharpCompress/0.30.1": { + "type": "package", + "compile": { + "lib/net5.0/SharpCompress.dll": {} + }, + "runtime": { + "lib/net5.0/SharpCompress.dll": {} + } + }, + "Snappier/1.0.0": { + "type": "package", + "compile": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "compile": { + "ref/netcoreapp2.0/_._": {} + }, + "runtime": { + "lib/netcoreapp2.0/_._": {} + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "compile": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Formats.Asn1.dll": { + "related": ".xml" + } + } + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.7.0", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + } + }, + "System.Memory/4.5.5": { + "type": "package", + "compile": { + "ref/netcoreapp2.1/_._": {} + }, + "runtime": { + "lib/netcoreapp2.1/_._": {} + } + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "compile": { + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "dependencies": { + "System.Formats.Asn1": "5.0.0" + }, + "compile": { + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "unix" + }, + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "compile": { + "lib/net7.0/ZstdSharp.dll": {} + }, + "runtime": { + "lib/net7.0/ZstdSharp.dll": {} + } + }, + "APlugins/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "bin/placeholder/APlugins.dll": {} + }, + "runtime": { + "bin/placeholder/APlugins.dll": {} + } + }, + "Entity/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.7.0", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "compile": { + "bin/placeholder/Entity.dll": {} + }, + "runtime": { + "bin/placeholder/Entity.dll": {} + } + }, + "Hotfix/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "Entity": "1.0.0" + }, + "compile": { + "bin/placeholder/Hotfix.dll": {} + }, + "runtime": { + "bin/placeholder/Hotfix.dll": {} + } + } + }, + "net9.0/linux-x64": { + "CommandLineParser/2.9.1": { + "type": "package", + "compile": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + } + }, + "DnsClient/1.6.1": { + "type": "package", + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "compile": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + } + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "compile": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "frameworkReferences": [ + "Microsoft.AspNetCore.App" + ], + "build": { + "buildTransitive/Fantasy-Net.targets": {} + } + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Config.targets": {} + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "dependencies": { + "Fantasy-Net": "2024.2.22" + }, + "compile": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + } + }, + "Fantasy-Net.NLog/2024.1.20": { + "type": "package", + "dependencies": { + "Fantasy-Net": "2024.1.3", + "NLog": "5.3.4" + }, + "compile": { + "lib/net8.0/Fantasy-Net.NLog.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.NLog.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.NLog.targets": {} + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets": {} + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets": {} + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "compile": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + }, + "compile": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets": {} + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "2.0.0", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "compile": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "NLog/5.3.4": { + "type": "package", + "compile": { + "lib/netstandard2.0/NLog.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "related": ".xml" + } + } + }, + "protobuf-net/3.2.45": { + "type": "package", + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "compile": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + } + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + } + }, + "SharpCompress/0.30.1": { + "type": "package", + "compile": { + "lib/net5.0/SharpCompress.dll": {} + }, + "runtime": { + "lib/net5.0/SharpCompress.dll": {} + } + }, + "Snappier/1.0.0": { + "type": "package", + "compile": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "compile": { + "ref/netcoreapp2.0/_._": {} + }, + "runtime": { + "lib/netcoreapp2.0/_._": {} + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "compile": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Formats.Asn1.dll": { + "related": ".xml" + } + } + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.7.0", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + } + }, + "System.Memory/4.5.5": { + "type": "package", + "compile": { + "ref/netcoreapp2.1/_._": {} + }, + "runtime": { + "lib/netcoreapp2.1/_._": {} + } + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "compile": { + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "dependencies": { + "System.Formats.Asn1": "5.0.0" + }, + "compile": { + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + } + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "compile": { + "lib/net7.0/ZstdSharp.dll": {} + }, + "runtime": { + "lib/net7.0/ZstdSharp.dll": {} + } + }, + "APlugins/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "bin/placeholder/APlugins.dll": {} + }, + "runtime": { + "bin/placeholder/APlugins.dll": {} + } + }, + "Entity/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.7.0", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "compile": { + "bin/placeholder/Entity.dll": {} + }, + "runtime": { + "bin/placeholder/Entity.dll": {} + } + }, + "Hotfix/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "Entity": "1.0.0" + }, + "compile": { + "bin/placeholder/Hotfix.dll": {} + }, + "runtime": { + "bin/placeholder/Hotfix.dll": {} + } + } + }, + "net9.0/win-x64": { + "CommandLineParser/2.9.1": { + "type": "package", + "compile": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "related": ".xml" + } + } + }, + "DnsClient/1.6.1": { + "type": "package", + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "compile": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + } + }, + "Fantasy-Net/2024.2.24": { + "type": "package", + "dependencies": { + "CommandLineParser": "2.9.1", + "MongoDB.Bson": "3.1.0", + "MongoDB.Driver": "3.1.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.45" + }, + "compile": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "runtime": { + "lib/net9.0/Fantasy-Net.dll": {} + }, + "frameworkReferences": [ + "Microsoft.AspNetCore.App" + ], + "build": { + "buildTransitive/Fantasy-Net.targets": {} + } + }, + "Fantasy-Net.Config/2024.1.4": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.Config.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Config.targets": {} + } + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "type": "package", + "dependencies": { + "Fantasy-Net": "2024.2.22" + }, + "compile": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.ConfigTable.dll": {} + } + }, + "Fantasy-Net.NLog/2024.1.20": { + "type": "package", + "dependencies": { + "Fantasy-Net": "2024.1.3", + "NLog": "5.3.4" + }, + "compile": { + "lib/net8.0/Fantasy-Net.NLog.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy-Net.NLog.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.NLog.targets": {} + } + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets": {} + } + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "type": "package", + "compile": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "runtime": { + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll": {} + }, + "build": { + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets": {} + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "type": "package", + "compile": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + }, + "compile": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets": {} + } + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "type": "package", + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "8.0.2", + "Microsoft.IdentityModel.Logging": "8.7.0" + }, + "compile": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Bson/3.1.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Bson.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Driver/3.1.0": { + "type": "package", + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "2.0.0", + "MongoDB.Bson": "3.1.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.7.3" + }, + "compile": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/MongoDB.Driver.dll": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "NLog/5.3.4": { + "type": "package", + "compile": { + "lib/netstandard2.0/NLog.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "related": ".xml" + } + } + }, + "protobuf-net/3.2.45": { + "type": "package", + "dependencies": { + "protobuf-net.Core": "3.2.45" + }, + "compile": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "related": ".xml" + } + } + }, + "protobuf-net.Core/3.2.45": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "related": ".xml" + } + } + }, + "SharpCompress/0.30.1": { + "type": "package", + "compile": { + "lib/net5.0/SharpCompress.dll": {} + }, + "runtime": { + "lib/net5.0/SharpCompress.dll": {} + } + }, + "Snappier/1.0.0": { + "type": "package", + "compile": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "compile": { + "ref/netcoreapp2.0/_._": {} + }, + "runtime": { + "lib/netcoreapp2.0/_._": {} + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "compile": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net7.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "System.Formats.Asn1/5.0.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Formats.Asn1.dll": { + "related": ".xml" + } + } + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "8.7.0", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + } + }, + "System.Memory/4.5.5": { + "type": "package", + "compile": { + "ref/netcoreapp2.1/_._": {} + }, + "runtime": { + "lib/netcoreapp2.1/_._": {} + } + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "type": "package", + "compile": { + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + } + }, + "System.Security.Cryptography.Cng/5.0.0": { + "type": "package", + "dependencies": { + "System.Formats.Asn1": "5.0.0" + }, + "compile": { + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll": { + "related": ".xml" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + } + }, + "ZstdSharp.Port/0.7.3": { + "type": "package", + "compile": { + "lib/net7.0/ZstdSharp.dll": {} + }, + "runtime": { + "lib/net7.0/ZstdSharp.dll": {} + } + }, + "APlugins/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "Fantasy-Net.Config": "2024.1.4", + "Fantasy-Net.ConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterConfigTable": "2024.2.0", + "Fantasy-Net.Tools.ExporterNetworkProtocol": "2024.2.24", + "Microsoft.IdentityModel.Tokens": "8.7.0" + }, + "compile": { + "bin/placeholder/APlugins.dll": {} + }, + "runtime": { + "bin/placeholder/APlugins.dll": {} + } + }, + "Entity/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "APlugins": "1.0.0", + "Fantasy-Net": "2024.2.24", + "System.IdentityModel.Tokens.Jwt": "8.7.0", + "System.Security.Cryptography.Cng": "5.0.0" + }, + "compile": { + "bin/placeholder/Entity.dll": {} + }, + "runtime": { + "bin/placeholder/Entity.dll": {} + } + }, + "Hotfix/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v9.0", + "dependencies": { + "Entity": "1.0.0" + }, + "compile": { + "bin/placeholder/Hotfix.dll": {} + }, + "runtime": { + "bin/placeholder/Hotfix.dll": {} + } + } + } + }, + "libraries": { + "CommandLineParser/2.9.1": { + "sha512": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "type": "package", + "path": "commandlineparser/2.9.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "CommandLine20.png", + "License.md", + "README.md", + "commandlineparser.2.9.1.nupkg.sha512", + "commandlineparser.nuspec", + "lib/net40/CommandLine.dll", + "lib/net40/CommandLine.xml", + "lib/net45/CommandLine.dll", + "lib/net45/CommandLine.xml", + "lib/net461/CommandLine.dll", + "lib/net461/CommandLine.xml", + "lib/netstandard2.0/CommandLine.dll", + "lib/netstandard2.0/CommandLine.xml" + ] + }, + "DnsClient/1.6.1": { + "sha512": "4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "type": "package", + "path": "dnsclient/1.6.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "dnsclient.1.6.1.nupkg.sha512", + "dnsclient.nuspec", + "icon.png", + "lib/net45/DnsClient.dll", + "lib/net45/DnsClient.xml", + "lib/net471/DnsClient.dll", + "lib/net471/DnsClient.xml", + "lib/net5.0/DnsClient.dll", + "lib/net5.0/DnsClient.xml", + "lib/netstandard1.3/DnsClient.dll", + "lib/netstandard1.3/DnsClient.xml", + "lib/netstandard2.0/DnsClient.dll", + "lib/netstandard2.0/DnsClient.xml", + "lib/netstandard2.1/DnsClient.dll", + "lib/netstandard2.1/DnsClient.xml" + ] + }, + "Fantasy-Net/2024.2.24": { + "sha512": "5u460iiB29NDwxIBV25WzuxUxW5fV0i8DJ2OE47fSJW1lWq+AP/LJ4KYqcH6zngyDFMOMOjh2S6hT3IZ/r4dwA==", + "type": "package", + "path": "fantasy-net/2024.2.24", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE", + "README.md", + "buildTransitive/Fantasy-Net.targets", + "fantasy-net.2024.2.24.nupkg.sha512", + "fantasy-net.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.dll", + "lib/net9.0/Fantasy-Net.dll" + ] + }, + "Fantasy-Net.Config/2024.1.4": { + "sha512": "zStTIJq91mx3VjCcU7eAtrExAcv1Zg+dAd8UdDvpHu7kTY8ldDQMp8sCmez2s+vUTmNyH1hlOgEE3rJILAijfQ==", + "type": "package", + "path": "fantasy-net.config/2024.1.4", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "buildTransitive/Fantasy-Net.Config.targets", + "fantasy-net.config.2024.1.4.nupkg.sha512", + "fantasy-net.config.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.Config.dll", + "tools/output/Excel/Custom.txt", + "tools/output/Excel/Server/MachineConfig.xlsx", + "tools/output/Excel/Server/ProcessConfig.xlsx", + "tools/output/Excel/Server/SceneConfig.xlsx", + "tools/output/Excel/Server/WorldConfig.xlsx", + "tools/output/Excel/Version.txt", + "tools/output/Json/Server/MachineConfigData.Json", + "tools/output/Json/Server/ProcessConfigData.Json", + "tools/output/Json/Server/SceneConfigData.Json", + "tools/output/Json/Server/WorldConfigData.Json", + "tools/output/NetworkProtocol/Inner/InnerMessage.proto", + "tools/output/NetworkProtocol/OpCode.Cache", + "tools/output/NetworkProtocol/Outer/OuterMessage.proto", + "tools/output/NetworkProtocol/RouteType.Config", + "tools/output/README.md" + ] + }, + "Fantasy-Net.ConfigTable/2024.2.0": { + "sha512": "TIpd7Cz5eTx5WlI0QPA/gLkTCNWW4DHFXG5ZXgLjkxgxC4AYpXzvktaU/merldPuccaebc7ld8oVxJ0fejKHEg==", + "type": "package", + "path": "fantasy-net.configtable/2024.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "fantasy-net.configtable.2024.2.0.nupkg.sha512", + "fantasy-net.configtable.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.ConfigTable.dll" + ] + }, + "Fantasy-Net.NLog/2024.1.20": { + "sha512": "HJuHfecWrD7tcQYEZezJzgayvG5leAbdWlgvo9ft/CUuwTtAB+tkeKP3e3VtbkCoPaAZO4VAUN0Y30Ute2/vrQ==", + "type": "package", + "path": "fantasy-net.nlog/2024.1.20", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "build/NLog.config", + "build/NLog.xsd", + "buildTransitive/Fantasy-Net.NLog.targets", + "fantasy-net.nlog.2024.1.20.nupkg.sha512", + "fantasy-net.nlog.nuspec", + "icon.png", + "lib/net8.0/Fantasy-Net.NLog.dll" + ] + }, + "Fantasy-Net.Tools.ExporterConfigTable/2024.2.0": { + "sha512": "jPL8qd+9WTsOAOhXVkAOHuwjoyFTGIg6Zr/zsSP+OB4G6sNklcHI0KDnMYWN0EW01fSycl/g1DyRyyDdwZ2iPQ==", + "type": "package", + "path": "fantasy-net.tools.exporterconfigtable/2024.2.0", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "buildTransitive/Fantasy-Net.Tools.ExporterConfigTable.targets", + "fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512", + "fantasy-net.tools.exporterconfigtable.nuspec", + "icon.png", + "lib/net8.0/Fantasy.Tools.ExporterConfigTable.dll", + "tools/output/CommandLine.dll", + "tools/output/EPPlus.Interfaces.dll", + "tools/output/EPPlus.System.Drawing.dll", + "tools/output/EPPlus.dll", + "tools/output/ExporterSettings.json", + "tools/output/Fantasy.Tools.ConfigTable", + "tools/output/Fantasy.Tools.ConfigTable.deps.json", + "tools/output/Fantasy.Tools.ConfigTable.dll", + "tools/output/Fantasy.Tools.ConfigTable.pdb", + "tools/output/Fantasy.Tools.ConfigTable.runtimeconfig.json", + "tools/output/Microsoft.CodeAnalysis.CSharp.dll", + "tools/output/Microsoft.CodeAnalysis.dll", + "tools/output/Microsoft.Extensions.Configuration.Abstractions.dll", + "tools/output/Microsoft.Extensions.Configuration.FileExtensions.dll", + "tools/output/Microsoft.Extensions.Configuration.Json.dll", + "tools/output/Microsoft.Extensions.Configuration.dll", + "tools/output/Microsoft.Extensions.FileProviders.Abstractions.dll", + "tools/output/Microsoft.Extensions.FileProviders.Physical.dll", + "tools/output/Microsoft.Extensions.FileSystemGlobbing.dll", + "tools/output/Microsoft.Extensions.Primitives.dll", + "tools/output/Microsoft.IO.RecyclableMemoryStream.dll", + "tools/output/Microsoft.Win32.SystemEvents.dll", + "tools/output/Newtonsoft.Json.dll", + "tools/output/Run.bat", + "tools/output/Run.sh", + "tools/output/System.Drawing.Common.dll", + "tools/output/System.Security.Cryptography.Pkcs.dll", + "tools/output/protobuf-net.Core.dll", + "tools/output/protobuf-net.dll", + "tools/output/runtimes/win/lib/net7.0/Microsoft.Win32.SystemEvents.dll", + "tools/output/runtimes/win/lib/net7.0/System.Drawing.Common.dll", + "tools/output/runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll" + ] + }, + "Fantasy-Net.Tools.ExporterNetworkProtocol/2024.2.24": { + "sha512": "gKbHZBgiTuERq4LCgctChvpYJGVoUbGNHoXq9x7Yz7aUoU7/M6DjuGdZE7XnsyNioddz1Gh992900RUAPwSpjQ==", + "type": "package", + "path": "fantasy-net.tools.exporternetworkprotocol/2024.2.24", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "buildTransitive/Fantasy-Net.Tools.ExporterNetworkProtocol.targets", + "fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512", + "fantasy-net.tools.exporternetworkprotocol.nuspec", + "icon.png", + "lib/net8.0/Fantasy.Tools.ExporterNetworkProtocol.dll", + "tools/output/CommandLine.dll", + "tools/output/ExporterSettings.json", + "tools/output/Fantasy.Tools.NetworkProtocol", + "tools/output/Fantasy.Tools.NetworkProtocol.deps.json", + "tools/output/Fantasy.Tools.NetworkProtocol.dll", + "tools/output/Fantasy.Tools.NetworkProtocol.pdb", + "tools/output/Fantasy.Tools.NetworkProtocol.runtimeconfig.json", + "tools/output/Microsoft.Extensions.Configuration.Abstractions.dll", + "tools/output/Microsoft.Extensions.Configuration.FileExtensions.dll", + "tools/output/Microsoft.Extensions.Configuration.Json.dll", + "tools/output/Microsoft.Extensions.Configuration.dll", + "tools/output/Microsoft.Extensions.FileProviders.Abstractions.dll", + "tools/output/Microsoft.Extensions.FileProviders.Physical.dll", + "tools/output/Microsoft.Extensions.FileSystemGlobbing.dll", + "tools/output/Microsoft.Extensions.Primitives.dll", + "tools/output/Newtonsoft.Json.dll", + "tools/output/Run.bat", + "tools/output/Run.sh" + ] + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": { + "sha512": "3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==", + "type": "package", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", + "microsoft.extensions.dependencyinjection.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.2": { + "sha512": "nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", + "type": "package", + "path": "microsoft.extensions.logging.abstractions/8.0.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn3.11/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn3.11/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.0/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "buildTransitive/net461/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net462/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.xml", + "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", + "microsoft.extensions.logging.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.IdentityModel.Abstractions/8.7.0": { + "sha512": "OQd5aVepYvh5evOmBMeAYjMIpEcTf1ZCBZaU7Nh/RlhhdXefjFDJeP1L2F2zeNT1unFr+wUu/h3Ac2Xb4BXU6w==", + "type": "package", + "path": "microsoft.identitymodel.abstractions/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Abstractions.dll", + "lib/net462/Microsoft.IdentityModel.Abstractions.xml", + "lib/net472/Microsoft.IdentityModel.Abstractions.dll", + "lib/net472/Microsoft.IdentityModel.Abstractions.xml", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net9.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net9.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.xml", + "microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512", + "microsoft.identitymodel.abstractions.nuspec" + ] + }, + "Microsoft.IdentityModel.JsonWebTokens/8.7.0": { + "sha512": "uzsSAWhNhbrkWbQKBTE8QhzviU6sr3bJ1Bkv7gERlhswfSKOp7HsxTRLTPBpx/whQ/GRRHEwMg8leRIPbMrOgw==", + "type": "package", + "path": "microsoft.identitymodel.jsonwebtokens/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "microsoft.identitymodel.jsonwebtokens.8.7.0.nupkg.sha512", + "microsoft.identitymodel.jsonwebtokens.nuspec" + ] + }, + "Microsoft.IdentityModel.Logging/8.7.0": { + "sha512": "Bs0TznPAu+nxa9rAVHJ+j3CYECHJkT3tG8AyBfhFYlT5ldsDhoxFT7J+PKxJHLf+ayqWfvDZHHc4639W2FQCxA==", + "type": "package", + "path": "microsoft.identitymodel.logging/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Logging.dll", + "lib/net462/Microsoft.IdentityModel.Logging.xml", + "lib/net472/Microsoft.IdentityModel.Logging.dll", + "lib/net472/Microsoft.IdentityModel.Logging.xml", + "lib/net6.0/Microsoft.IdentityModel.Logging.dll", + "lib/net6.0/Microsoft.IdentityModel.Logging.xml", + "lib/net8.0/Microsoft.IdentityModel.Logging.dll", + "lib/net8.0/Microsoft.IdentityModel.Logging.xml", + "lib/net9.0/Microsoft.IdentityModel.Logging.dll", + "lib/net9.0/Microsoft.IdentityModel.Logging.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.xml", + "microsoft.identitymodel.logging.8.7.0.nupkg.sha512", + "microsoft.identitymodel.logging.nuspec" + ] + }, + "Microsoft.IdentityModel.Tokens/8.7.0": { + "sha512": "5Z6voXjRXAnGklhmZd1mKz89UhcF5ZQQZaZc2iKrOuL4Li1UihG2vlJx8IbiFAOIxy/xdbsAm0A+WZEaH5fxng==", + "type": "package", + "path": "microsoft.identitymodel.tokens/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/Microsoft.IdentityModel.Tokens.dll", + "lib/net462/Microsoft.IdentityModel.Tokens.xml", + "lib/net472/Microsoft.IdentityModel.Tokens.dll", + "lib/net472/Microsoft.IdentityModel.Tokens.xml", + "lib/net6.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net6.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net8.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net9.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net9.0/Microsoft.IdentityModel.Tokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.xml", + "microsoft.identitymodel.tokens.8.7.0.nupkg.sha512", + "microsoft.identitymodel.tokens.nuspec" + ] + }, + "Microsoft.NETCore.Platforms/5.0.0": { + "sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", + "type": "package", + "path": "microsoft.netcore.platforms/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.5.0.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Microsoft.Win32.Registry/5.0.0": { + "sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "type": "package", + "path": "microsoft.win32.registry/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.xml", + "lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "microsoft.win32.registry.5.0.0.nupkg.sha512", + "microsoft.win32.registry.nuspec", + "ref/net46/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/Microsoft.Win32.Registry.dll", + "ref/netstandard1.3/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/de/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/es/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/fr/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/it/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ja/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ko/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ru/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hans/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml", + "ref/netstandard2.0/Microsoft.Win32.Registry.dll", + "ref/netstandard2.0/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/net46/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "MongoDB.Bson/3.1.0": { + "sha512": "3dhaZhz18B5vUoEP13o2j8A6zQfkHdZhwBvLZEjDJum4BTLLv1/Z8bt25UQEtpqvYwLgde4R6ekWZ7XAYUMxuw==", + "type": "package", + "path": "mongodb.bson/3.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net472/MongoDB.Bson.dll", + "lib/net472/MongoDB.Bson.xml", + "lib/net6.0/MongoDB.Bson.dll", + "lib/net6.0/MongoDB.Bson.xml", + "lib/netstandard2.1/MongoDB.Bson.dll", + "lib/netstandard2.1/MongoDB.Bson.xml", + "mongodb.bson.3.1.0.nupkg.sha512", + "mongodb.bson.nuspec", + "packageIcon.png" + ] + }, + "MongoDB.Driver/3.1.0": { + "sha512": "+O7lKaIl7VUHptE0hqTd7UY1G5KDp/o8S4upG7YL4uChMNKD/U6tz9i17nMGHaD/L2AiPLgaJcaDe2XACsegGA==", + "type": "package", + "path": "mongodb.driver/3.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net472/MongoDB.Driver.dll", + "lib/net472/MongoDB.Driver.xml", + "lib/net6.0/MongoDB.Driver.dll", + "lib/net6.0/MongoDB.Driver.xml", + "lib/netstandard2.1/MongoDB.Driver.dll", + "lib/netstandard2.1/MongoDB.Driver.xml", + "mongodb.driver.3.1.0.nupkg.sha512", + "mongodb.driver.nuspec", + "packageIcon.png" + ] + }, + "Newtonsoft.Json/13.0.3": { + "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "type": "package", + "path": "newtonsoft.json/13.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "README.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/net6.0/Newtonsoft.Json.dll", + "lib/net6.0/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "newtonsoft.json.13.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, + "NLog/5.3.4": { + "sha512": "gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "type": "package", + "path": "nlog/5.3.4", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "N.png", + "lib/net35/NLog.dll", + "lib/net35/NLog.xml", + "lib/net45/NLog.dll", + "lib/net45/NLog.xml", + "lib/net46/NLog.dll", + "lib/net46/NLog.xml", + "lib/netstandard1.3/NLog.dll", + "lib/netstandard1.3/NLog.xml", + "lib/netstandard1.5/NLog.dll", + "lib/netstandard1.5/NLog.xml", + "lib/netstandard2.0/NLog.dll", + "lib/netstandard2.0/NLog.xml", + "nlog.5.3.4.nupkg.sha512", + "nlog.nuspec" + ] + }, + "protobuf-net/3.2.45": { + "sha512": "5UZ/ukUHcGbFSl7vNMrHsfjqdxusdd9w7w0fCEXzf3UUtsrGNVCzV5SmF+sCHAbnRV2qPcD1ixiDP7Aj8lX/HA==", + "type": "package", + "path": "protobuf-net/3.2.45", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net462/protobuf-net.dll", + "lib/net462/protobuf-net.xml", + "lib/net6.0/protobuf-net.dll", + "lib/net6.0/protobuf-net.xml", + "lib/netstandard2.0/protobuf-net.dll", + "lib/netstandard2.0/protobuf-net.xml", + "lib/netstandard2.1/protobuf-net.dll", + "lib/netstandard2.1/protobuf-net.xml", + "protobuf-net.3.2.45.nupkg.sha512", + "protobuf-net.nuspec", + "protobuf-net.png", + "readme.md" + ] + }, + "protobuf-net.Core/3.2.45": { + "sha512": "PMWatW2NrT1uTXD7etJ4VdQ0wWZLFrIfdRGppD2QX7nzZ0+kIzqhq551u6ZiXJHWJgG4hWFEkSnUnt2aB6posg==", + "type": "package", + "path": "protobuf-net.core/3.2.45", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net462/protobuf-net.Core.dll", + "lib/net462/protobuf-net.Core.xml", + "lib/net6.0/protobuf-net.Core.dll", + "lib/net6.0/protobuf-net.Core.xml", + "lib/netstandard2.0/protobuf-net.Core.dll", + "lib/netstandard2.0/protobuf-net.Core.xml", + "lib/netstandard2.1/protobuf-net.Core.dll", + "lib/netstandard2.1/protobuf-net.Core.xml", + "protobuf-net.core.3.2.45.nupkg.sha512", + "protobuf-net.core.nuspec", + "protobuf-net.png", + "readme.md" + ] + }, + "SharpCompress/0.30.1": { + "sha512": "XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "type": "package", + "path": "sharpcompress/0.30.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/SharpCompress.dll", + "lib/net5.0/SharpCompress.dll", + "lib/netcoreapp3.1/SharpCompress.dll", + "lib/netstandard2.0/SharpCompress.dll", + "lib/netstandard2.1/SharpCompress.dll", + "sharpcompress.0.30.1.nupkg.sha512", + "sharpcompress.nuspec" + ] + }, + "Snappier/1.0.0": { + "sha512": "rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "type": "package", + "path": "snappier/1.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "COPYING.txt", + "lib/net5.0/Snappier.dll", + "lib/net5.0/Snappier.xml", + "lib/netcoreapp3.0/Snappier.dll", + "lib/netcoreapp3.0/Snappier.xml", + "lib/netstandard2.0/Snappier.dll", + "lib/netstandard2.0/Snappier.xml", + "lib/netstandard2.1/Snappier.dll", + "lib/netstandard2.1/Snappier.xml", + "snappier.1.0.0.nupkg.sha512", + "snappier.nuspec" + ] + }, + "System.Buffers/4.5.1": { + "sha512": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "type": "package", + "path": "system.buffers/4.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Buffers.dll", + "lib/net461/System.Buffers.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.1/System.Buffers.dll", + "lib/netstandard1.1/System.Buffers.xml", + "lib/netstandard2.0/System.Buffers.dll", + "lib/netstandard2.0/System.Buffers.xml", + "lib/uap10.0.16299/_._", + "ref/net45/System.Buffers.dll", + "ref/net45/System.Buffers.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.1/System.Buffers.dll", + "ref/netstandard1.1/System.Buffers.xml", + "ref/netstandard2.0/System.Buffers.dll", + "ref/netstandard2.0/System.Buffers.xml", + "ref/uap10.0.16299/_._", + "system.buffers.4.5.1.nupkg.sha512", + "system.buffers.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Collections.Immutable/7.0.0": { + "sha512": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "type": "package", + "path": "system.collections.immutable/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "README.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Collections.Immutable.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Collections.Immutable.targets", + "lib/net462/System.Collections.Immutable.dll", + "lib/net462/System.Collections.Immutable.xml", + "lib/net6.0/System.Collections.Immutable.dll", + "lib/net6.0/System.Collections.Immutable.xml", + "lib/net7.0/System.Collections.Immutable.dll", + "lib/net7.0/System.Collections.Immutable.xml", + "lib/netstandard2.0/System.Collections.Immutable.dll", + "lib/netstandard2.0/System.Collections.Immutable.xml", + "system.collections.immutable.7.0.0.nupkg.sha512", + "system.collections.immutable.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Formats.Asn1/5.0.0": { + "sha512": "MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==", + "type": "package", + "path": "system.formats.asn1/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Formats.Asn1.dll", + "lib/net461/System.Formats.Asn1.xml", + "lib/netstandard2.0/System.Formats.Asn1.dll", + "lib/netstandard2.0/System.Formats.Asn1.xml", + "system.formats.asn1.5.0.0.nupkg.sha512", + "system.formats.asn1.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.IdentityModel.Tokens.Jwt/8.7.0": { + "sha512": "8dKL3A9pVqYCJIXHd4H2epQqLxSvKeNxGonR0e5g89yMchyvsM/NLuB06otx29BicUd6+LUJZgNZmvYjjPsPGg==", + "type": "package", + "path": "system.identitymodel.tokens.jwt/8.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "lib/net462/System.IdentityModel.Tokens.Jwt.dll", + "lib/net462/System.IdentityModel.Tokens.Jwt.xml", + "lib/net472/System.IdentityModel.Tokens.Jwt.dll", + "lib/net472/System.IdentityModel.Tokens.Jwt.xml", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/net9.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net9.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.xml", + "system.identitymodel.tokens.jwt.8.7.0.nupkg.sha512", + "system.identitymodel.tokens.jwt.nuspec" + ] + }, + "System.Memory/4.5.5": { + "sha512": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "type": "package", + "path": "system.memory/4.5.5", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Memory.dll", + "lib/net461/System.Memory.xml", + "lib/netcoreapp2.1/_._", + "lib/netstandard1.1/System.Memory.dll", + "lib/netstandard1.1/System.Memory.xml", + "lib/netstandard2.0/System.Memory.dll", + "lib/netstandard2.0/System.Memory.xml", + "ref/netcoreapp2.1/_._", + "system.memory.4.5.5.nupkg.sha512", + "system.memory.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Runtime.CompilerServices.Unsafe/5.0.0": { + "sha512": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", + "type": "package", + "path": "system.runtime.compilerservices.unsafe/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net45/System.Runtime.CompilerServices.Unsafe.dll", + "lib/net45/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/net461/System.Runtime.CompilerServices.Unsafe.dll", + "ref/net461/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.xml", + "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", + "system.runtime.compilerservices.unsafe.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.AccessControl/5.0.0": { + "sha512": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "type": "package", + "path": "system.security.accesscontrol/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.xml", + "lib/netstandard1.3/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.xml", + "ref/netstandard1.3/System.Security.AccessControl.dll", + "ref/netstandard1.3/System.Security.AccessControl.xml", + "ref/netstandard1.3/de/System.Security.AccessControl.xml", + "ref/netstandard1.3/es/System.Security.AccessControl.xml", + "ref/netstandard1.3/fr/System.Security.AccessControl.xml", + "ref/netstandard1.3/it/System.Security.AccessControl.xml", + "ref/netstandard1.3/ja/System.Security.AccessControl.xml", + "ref/netstandard1.3/ko/System.Security.AccessControl.xml", + "ref/netstandard1.3/ru/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hans/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hant/System.Security.AccessControl.xml", + "ref/netstandard2.0/System.Security.AccessControl.dll", + "ref/netstandard2.0/System.Security.AccessControl.xml", + "ref/uap10.0.16299/_._", + "runtimes/win/lib/net46/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.xml", + "runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.accesscontrol.5.0.0.nupkg.sha512", + "system.security.accesscontrol.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Cryptography.Cng/5.0.0": { + "sha512": "jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "type": "package", + "path": "system.security.cryptography.cng/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Security.Cryptography.Cng.dll", + "lib/net461/System.Security.Cryptography.Cng.dll", + "lib/net461/System.Security.Cryptography.Cng.xml", + "lib/net462/System.Security.Cryptography.Cng.dll", + "lib/net462/System.Security.Cryptography.Cng.xml", + "lib/net47/System.Security.Cryptography.Cng.dll", + "lib/net47/System.Security.Cryptography.Cng.xml", + "lib/netcoreapp2.1/System.Security.Cryptography.Cng.dll", + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll", + "lib/netcoreapp3.0/System.Security.Cryptography.Cng.xml", + "lib/netstandard1.3/System.Security.Cryptography.Cng.dll", + "lib/netstandard1.4/System.Security.Cryptography.Cng.dll", + "lib/netstandard1.6/System.Security.Cryptography.Cng.dll", + "lib/netstandard2.0/System.Security.Cryptography.Cng.dll", + "lib/netstandard2.0/System.Security.Cryptography.Cng.xml", + "lib/netstandard2.1/System.Security.Cryptography.Cng.dll", + "lib/netstandard2.1/System.Security.Cryptography.Cng.xml", + "lib/uap10.0.16299/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Security.Cryptography.Cng.dll", + "ref/net461/System.Security.Cryptography.Cng.dll", + "ref/net461/System.Security.Cryptography.Cng.xml", + "ref/net462/System.Security.Cryptography.Cng.dll", + "ref/net462/System.Security.Cryptography.Cng.xml", + "ref/net47/System.Security.Cryptography.Cng.dll", + "ref/net47/System.Security.Cryptography.Cng.xml", + "ref/netcoreapp2.0/System.Security.Cryptography.Cng.dll", + "ref/netcoreapp2.0/System.Security.Cryptography.Cng.xml", + "ref/netcoreapp2.1/System.Security.Cryptography.Cng.dll", + "ref/netcoreapp2.1/System.Security.Cryptography.Cng.xml", + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.dll", + "ref/netcoreapp3.0/System.Security.Cryptography.Cng.xml", + "ref/netstandard1.3/System.Security.Cryptography.Cng.dll", + "ref/netstandard1.4/System.Security.Cryptography.Cng.dll", + "ref/netstandard1.6/System.Security.Cryptography.Cng.dll", + "ref/netstandard2.0/System.Security.Cryptography.Cng.dll", + "ref/netstandard2.0/System.Security.Cryptography.Cng.xml", + "ref/netstandard2.1/System.Security.Cryptography.Cng.dll", + "ref/netstandard2.1/System.Security.Cryptography.Cng.xml", + "ref/uap10.0.16299/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/win/lib/net46/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net461/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net461/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/net462/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net462/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/net47/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/net47/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netcoreapp2.1/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Cng.xml", + "runtimes/win/lib/netstandard1.4/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/netstandard1.6/System.Security.Cryptography.Cng.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.cryptography.cng.5.0.0.nupkg.sha512", + "system.security.cryptography.cng.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Principal.Windows/5.0.0": { + "sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "type": "package", + "path": "system.security.principal.windows/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.xml", + "lib/netstandard1.3/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.xml", + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll", + "ref/netcoreapp3.0/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/System.Security.Principal.Windows.dll", + "ref/netstandard1.3/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/de/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/es/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/fr/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/it/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ja/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ko/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ru/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml", + "ref/netstandard2.0/System.Security.Principal.Windows.dll", + "ref/netstandard2.0/System.Security.Principal.Windows.xml", + "ref/uap10.0.16299/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/net46/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.principal.windows.5.0.0.nupkg.sha512", + "system.security.principal.windows.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "ZstdSharp.Port/0.7.3": { + "sha512": "U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==", + "type": "package", + "path": "zstdsharp.port/0.7.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/ZstdSharp.dll", + "lib/net5.0/ZstdSharp.dll", + "lib/net6.0/ZstdSharp.dll", + "lib/net7.0/ZstdSharp.dll", + "lib/netcoreapp3.1/ZstdSharp.dll", + "lib/netstandard2.0/ZstdSharp.dll", + "lib/netstandard2.1/ZstdSharp.dll", + "zstdsharp.port.0.7.3.nupkg.sha512", + "zstdsharp.port.nuspec" + ] + }, + "APlugins/1.0.0": { + "type": "project", + "path": "../APlugins/APlugins.csproj", + "msbuildProject": "../APlugins/APlugins.csproj" + }, + "Entity/1.0.0": { + "type": "project", + "path": "../Entity/Entity.csproj", + "msbuildProject": "../Entity/Entity.csproj" + }, + "Hotfix/1.0.0": { + "type": "project", + "path": "../Hotfix/Hotfix.csproj", + "msbuildProject": "../Hotfix/Hotfix.csproj" + } + }, + "projectFileDependencyGroups": { + "net9.0": [ + "APlugins >= 1.0.0", + "Entity >= 1.0.0", + "Fantasy-Net.NLog >= 2024.1.20", + "Hotfix >= 1.0.0" + ] + }, + "packageFolders": { + "C:\\Users\\qq137\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\Main.csproj", + "projectName": "Main", + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\Main.csproj", + "packagesPath": "C:\\Users\\qq137\\.nuget\\packages\\", + "outputPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\qq137\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": { + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj" + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj" + }, + "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj": { + "projectPath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.200" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "dependencies": { + "Fantasy-Net.NLog": { + "target": "Package", + "version": "[2024.1.20, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Runtime.linux-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.AspNetCore.App.Runtime.win-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.NETCore.App.Host.linux-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.NETCore.App.Runtime.linux-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.NETCore.App.Runtime.win-x64", + "version": "[9.0.4, 9.0.4]" + }, + { + "name": "Microsoft.WindowsDesktop.App.Runtime.win-x64", + "version": "[9.0.4, 9.0.4]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json" + } + }, + "runtimes": { + "linux-x64": { + "#import": [] + }, + "win-x64": { + "#import": [] + } + } + } +} \ No newline at end of file diff --git a/GameServer/Server/Main/obj/project.nuget.cache b/GameServer/Server/Main/obj/project.nuget.cache new file mode 100644 index 00000000..7b4ad82d --- /dev/null +++ b/GameServer/Server/Main/obj/project.nuget.cache @@ -0,0 +1,49 @@ +{ + "version": 2, + "dgSpecHash": "YAbywGlPXtA=", + "success": true, + "projectFilePath": "D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\Main.csproj", + "expectedPackageFiles": [ + "C:\\Users\\qq137\\.nuget\\packages\\commandlineparser\\2.9.1\\commandlineparser.2.9.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\dnsclient\\1.6.1\\dnsclient.1.6.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net\\2024.2.24\\fantasy-net.2024.2.24.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.config\\2024.1.4\\fantasy-net.config.2024.1.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.configtable\\2024.2.0\\fantasy-net.configtable.2024.2.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.nlog\\2024.1.20\\fantasy-net.nlog.2024.1.20.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.tools.exporterconfigtable\\2024.2.0\\fantasy-net.tools.exporterconfigtable.2024.2.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\fantasy-net.tools.exporternetworkprotocol\\2024.2.24\\fantasy-net.tools.exporternetworkprotocol.2024.2.24.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\8.0.2\\microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\8.0.2\\microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.abstractions\\8.7.0\\microsoft.identitymodel.abstractions.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\8.7.0\\microsoft.identitymodel.jsonwebtokens.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.logging\\8.7.0\\microsoft.identitymodel.logging.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.identitymodel.tokens\\8.7.0\\microsoft.identitymodel.tokens.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\mongodb.bson\\3.1.0\\mongodb.bson.3.1.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\mongodb.driver\\3.1.0\\mongodb.driver.3.1.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\newtonsoft.json\\13.0.3\\newtonsoft.json.13.0.3.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\nlog\\5.3.4\\nlog.5.3.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\protobuf-net\\3.2.45\\protobuf-net.3.2.45.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\protobuf-net.core\\3.2.45\\protobuf-net.core.3.2.45.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\sharpcompress\\0.30.1\\sharpcompress.0.30.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\snappier\\1.0.0\\snappier.1.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.collections.immutable\\7.0.0\\system.collections.immutable.7.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.formats.asn1\\5.0.0\\system.formats.asn1.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.identitymodel.tokens.jwt\\8.7.0\\system.identitymodel.tokens.jwt.8.7.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.cryptography.cng\\5.0.0\\system.security.cryptography.cng.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.netcore.app.runtime.linux-x64\\9.0.4\\microsoft.netcore.app.runtime.linux-x64.9.0.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.netcore.app.runtime.win-x64\\9.0.4\\microsoft.netcore.app.runtime.win-x64.9.0.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.windowsdesktop.app.runtime.win-x64\\9.0.4\\microsoft.windowsdesktop.app.runtime.win-x64.9.0.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.aspnetcore.app.runtime.linux-x64\\9.0.4\\microsoft.aspnetcore.app.runtime.linux-x64.9.0.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.aspnetcore.app.runtime.win-x64\\9.0.4\\microsoft.aspnetcore.app.runtime.win-x64.9.0.4.nupkg.sha512", + "C:\\Users\\qq137\\.nuget\\packages\\microsoft.netcore.app.host.linux-x64\\9.0.4\\microsoft.netcore.app.host.linux-x64.9.0.4.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/GameServer/Server/Main/obj/project.packagespec.json b/GameServer/Server/Main/obj/project.packagespec.json new file mode 100644 index 00000000..843198af --- /dev/null +++ b/GameServer/Server/Main/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\Main.csproj","projectName":"Main","projectPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\Main.csproj","outputPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Main\\obj\\","projectStyle":"PackageReference","fallbackFolders":["C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"],"originalTargetFrameworks":["net9.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"targetAlias":"net9.0","projectReferences":{"D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj":{"projectPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\APlugins\\APlugins.csproj"},"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj":{"projectPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Entity\\Entity.csproj"},"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj":{"projectPath":"D:\\UnityProject\\EintooAR\\GameServer\\Server\\Hotfix\\Hotfix.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.200"}"frameworks":{"net9.0":{"targetAlias":"net9.0","dependencies":{"Fantasy-Net.NLog":{"target":"Package","version":"[2024.1.20, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"downloadDependencies":[{"name":"Microsoft.AspNetCore.App.Runtime.linux-x64","version":"[9.0.4, 9.0.4]"},{"name":"Microsoft.AspNetCore.App.Runtime.win-x64","version":"[9.0.4, 9.0.4]"},{"name":"Microsoft.NETCore.App.Host.linux-x64","version":"[9.0.4, 9.0.4]"},{"name":"Microsoft.NETCore.App.Runtime.linux-x64","version":"[9.0.4, 9.0.4]"},{"name":"Microsoft.NETCore.App.Runtime.win-x64","version":"[9.0.4, 9.0.4]"},{"name":"Microsoft.WindowsDesktop.App.Runtime.win-x64","version":"[9.0.4, 9.0.4]"}],"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json"}}"runtimes":{"linux-x64":{"#import":[]},"win-x64":{"#import":[]}} \ No newline at end of file diff --git a/GameServer/Server/Main/obj/rider.project.model.nuget.info b/GameServer/Server/Main/obj/rider.project.model.nuget.info new file mode 100644 index 00000000..18de19b0 --- /dev/null +++ b/GameServer/Server/Main/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17446243488709721 \ No newline at end of file diff --git a/GameServer/Server/Main/obj/rider.project.restore.info b/GameServer/Server/Main/obj/rider.project.restore.info new file mode 100644 index 00000000..18de19b0 --- /dev/null +++ b/GameServer/Server/Main/obj/rider.project.restore.info @@ -0,0 +1 @@ +17446243488709721 \ No newline at end of file diff --git a/GameServer/Tools/ConfigTable/CommandLine.dll b/GameServer/Tools/ConfigTable/CommandLine.dll new file mode 100644 index 00000000..3eab2be2 Binary files /dev/null and b/GameServer/Tools/ConfigTable/CommandLine.dll differ diff --git a/GameServer/Tools/ConfigTable/EPPlus.Interfaces.dll b/GameServer/Tools/ConfigTable/EPPlus.Interfaces.dll new file mode 100644 index 00000000..599a7671 Binary files /dev/null and b/GameServer/Tools/ConfigTable/EPPlus.Interfaces.dll differ diff --git a/GameServer/Tools/ConfigTable/EPPlus.System.Drawing.dll b/GameServer/Tools/ConfigTable/EPPlus.System.Drawing.dll new file mode 100644 index 00000000..8df125ea Binary files /dev/null and b/GameServer/Tools/ConfigTable/EPPlus.System.Drawing.dll differ diff --git a/GameServer/Tools/ConfigTable/EPPlus.dll b/GameServer/Tools/ConfigTable/EPPlus.dll new file mode 100644 index 00000000..b09ea77b Binary files /dev/null and b/GameServer/Tools/ConfigTable/EPPlus.dll differ diff --git a/GameServer/Tools/ConfigTable/ExporterSettings.json b/GameServer/Tools/ConfigTable/ExporterSettings.json new file mode 100644 index 00000000..19a045fb --- /dev/null +++ b/GameServer/Tools/ConfigTable/ExporterSettings.json @@ -0,0 +1,48 @@ +{ + "Export": { + "ExcelProgramPath": { + "Value": "../../Config/Excel/", + "Comment": "Excel文件夹的根目录" + }, + "ExcelVersionFile": { + "Value": "../../Config/Excel/Version.txt", + "Comment": "Excel的Version文件位置、这个文件用于记录每次导出对比是否需要再次导出的文件" + }, + "ExcelServerFileDirectory": { + "Value": "../../Server/Entity/Generate/ConfigTable/Entity/", + "Comment": "Excel生成的代码文件、在服务端文件夹位置" + }, + "ExcelClientFileDirectory": { + "Value": "../../../EintooAR/Assets/GameScripts/HotFix/GameProto/GameProtocol/Server/Generate/ConfigTable/Entity/", + "Comment": "Excel生成的代码文件、在客户端文件夹位置" + }, + "ExcelServerBinaryDirectory": { + "Value": "../../Config/Binary/", + "Comment": "Excel生成服务器二进制数据文件夹位置" + }, + "ExcelClientBinaryDirectory": { + "Value": ".../../../EintooAR/Assets/AssetRaw/Configs/", + "Comment": "Excel生成在客户端的二进制数据文件夹位置" + }, + "ExcelServerJsonDirectory": { + "Value": "../../Config/Json/Server/", + "Comment": "Excel生成在服务端的Json数据文件夹位置" + }, + "ExcelClientJsonDirectory": { + "Value": "../../Config/Json/Client/", + "Comment": "Excel生成在客户端的Json数据文件夹位置" + }, + "ExcelTemplatePath": { + "Value": "../../Config/Template/ExcelTemplate.txt", + "Comment": "Excel生成代码模版的文件位置" + }, + "ServerCustomExportDirectory": { + "Value": "../../Server/Entity/Generate/CustomExport/", + "Comment": "Excel在服务端生成自定义代码的文件夹位置" + }, + "ClientCustomExportDirectory": { + "Value": "../../../EintooAR/Assets/GameScripts/HotFix/GameProto/GameProtocol/Server/Generate/CustomExport", + "Comment": "Excel在客户端端生成自定义代码的文件夹位置" + } + } +} \ No newline at end of file diff --git a/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable new file mode 100644 index 00000000..351f187f Binary files /dev/null and b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable differ diff --git a/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.deps.json b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.deps.json new file mode 100644 index 00000000..a7025c33 --- /dev/null +++ b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.deps.json @@ -0,0 +1,508 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Fantasy.Tools.ConfigTable/1.0.0": { + "dependencies": { + "CommandLineParser": "2.9.1", + "EPPlus": "7.3.2", + "Microsoft.CodeAnalysis.CSharp": "4.11.0", + "Microsoft.Extensions.Configuration.Json": "8.0.0", + "Newtonsoft.Json": "13.0.3", + "protobuf-net": "3.2.30" + }, + "runtime": { + "Fantasy.Tools.ConfigTable.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "EPPlus/7.3.2": { + "dependencies": { + "EPPlus.System.Drawing": "6.1.1", + "Microsoft.Extensions.Configuration.Json": "8.0.0", + "Microsoft.IO.RecyclableMemoryStream": "3.0.1", + "System.ComponentModel.Annotations": "5.0.0", + "System.Formats.Asn1": "8.0.1", + "System.Security.Cryptography.Pkcs": "8.0.0", + "System.Text.Encoding.CodePages": "8.0.0", + "System.Text.Json": "8.0.4" + }, + "runtime": { + "lib/net8.0/EPPlus.dll": { + "assemblyVersion": "7.3.2.0", + "fileVersion": "7.3.2.0" + } + } + }, + "EPPlus.Interfaces/6.1.1": { + "runtime": { + "lib/net7.0/EPPlus.Interfaces.dll": { + "assemblyVersion": "6.1.1.0", + "fileVersion": "6.1.1.0" + } + } + }, + "EPPlus.System.Drawing/6.1.1": { + "dependencies": { + "EPPlus.Interfaces": "6.1.1", + "System.Drawing.Common": "7.0.0" + }, + "runtime": { + "lib/net7.0/EPPlus.System.Drawing.dll": { + "assemblyVersion": "6.1.1.0", + "fileVersion": "6.1.1.0" + } + } + }, + "Microsoft.CodeAnalysis.Analyzers/3.3.4": {}, + "Microsoft.CodeAnalysis.Common/4.11.0": { + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.3.4", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.CodeAnalysis.dll": { + "assemblyVersion": "4.11.0.0", + "fileVersion": "4.1100.24.37604" + } + } + }, + "Microsoft.CodeAnalysis.CSharp/4.11.0": { + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.3.4", + "Microsoft.CodeAnalysis.Common": "4.11.0", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.CodeAnalysis.CSharp.dll": { + "assemblyVersion": "4.11.0.0", + "fileVersion": "4.1100.24.37604" + } + } + }, + "Microsoft.Extensions.Configuration/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Configuration.Abstractions/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Configuration.FileExtensions/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "8.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "Microsoft.Extensions.FileProviders.Physical": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.FileExtensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Configuration.Json/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "8.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.Configuration.FileExtensions": "8.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "System.Text.Json": "8.0.4" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.Json.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.FileProviders.Abstractions/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.FileProviders.Abstractions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.FileProviders.Physical/8.0.0": { + "dependencies": { + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "Microsoft.Extensions.FileSystemGlobbing": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.FileProviders.Physical.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.FileSystemGlobbing/8.0.0": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.FileSystemGlobbing.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.IO.RecyclableMemoryStream/3.0.1": { + "runtime": { + "lib/net6.0/Microsoft.IO.RecyclableMemoryStream.dll": { + "assemblyVersion": "3.0.1.0", + "fileVersion": "3.0.1.0" + } + } + }, + "Microsoft.Win32.SystemEvents/7.0.0": { + "runtime": { + "lib/net7.0/Microsoft.Win32.SystemEvents.dll": { + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net7.0/Microsoft.Win32.SystemEvents.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "protobuf-net/3.2.30": { + "dependencies": { + "protobuf-net.Core": "3.2.30" + }, + "runtime": { + "lib/net6.0/protobuf-net.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.30.709" + } + } + }, + "protobuf-net.Core/3.2.30": { + "dependencies": { + "System.Collections.Immutable": "8.0.0" + }, + "runtime": { + "lib/net6.0/protobuf-net.Core.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.30.709" + } + } + }, + "System.Collections.Immutable/8.0.0": {}, + "System.ComponentModel.Annotations/5.0.0": {}, + "System.Drawing.Common/7.0.0": { + "dependencies": { + "Microsoft.Win32.SystemEvents": "7.0.0" + }, + "runtime": { + "lib/net7.0/System.Drawing.Common.dll": { + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net7.0/System.Drawing.Common.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + } + }, + "System.Formats.Asn1/8.0.1": {}, + "System.Reflection.Metadata/8.0.0": { + "dependencies": { + "System.Collections.Immutable": "8.0.0" + } + }, + "System.Security.Cryptography.Pkcs/8.0.0": { + "dependencies": { + "System.Formats.Asn1": "8.0.1" + }, + "runtime": { + "lib/net8.0/System.Security.Cryptography.Pkcs.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "System.Text.Encoding.CodePages/8.0.0": {}, + "System.Text.Encodings.Web/8.0.0": {}, + "System.Text.Json/8.0.4": { + "dependencies": { + "System.Text.Encodings.Web": "8.0.0" + } + } + } + }, + "libraries": { + "Fantasy.Tools.ConfigTable/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "EPPlus/7.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9DShQD2VuDZ7QLHp+map1r2HdI1G325YGkvRG+qs4N2fgeMF1Uq0TONCEL5gKCWMNDVGO0ZELJTAIzwNyOZQug==", + "path": "epplus/7.3.2", + "hashPath": "epplus.7.3.2.nupkg.sha512" + }, + "EPPlus.Interfaces/6.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-y7dkrOoE1ZR9Vgy1Jf2rEIaTf3SHlUjYt01NklP+F5Qh7S2ruPbzTcpYLRWMeXiG8XL8h2jqX4CyIkFt3NQGZw==", + "path": "epplus.interfaces/6.1.1", + "hashPath": "epplus.interfaces.6.1.1.nupkg.sha512" + }, + "EPPlus.System.Drawing/6.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lRF5gHYrmkHOOiLMI0t6q8zNYjUrzRgAM5BCXumv5xiqXko8fx3AWI+HCNZfhEqVFGOop+42KfR5GiUcCoyoMw==", + "path": "epplus.system.drawing/6.1.1", + "hashPath": "epplus.system.drawing.6.1.1.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.Analyzers/3.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AxkxcPR+rheX0SmvpLVIGLhOUXAKG56a64kV9VQZ4y9gR9ZmPXnqZvHJnmwLSwzrEP6junUF11vuc+aqo5r68g==", + "path": "microsoft.codeanalysis.analyzers/3.3.4", + "hashPath": "microsoft.codeanalysis.analyzers.3.3.4.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.Common/4.11.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-djf8ujmqYImFgB04UGtcsEhHrzVqzHowS+EEl/Yunc5LdrYrZhGBWUTXoCF0NzYXJxtfuD+UVQarWpvrNc94Qg==", + "path": "microsoft.codeanalysis.common/4.11.0", + "hashPath": "microsoft.codeanalysis.common.4.11.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.CSharp/4.11.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6XYi2EusI8JT4y2l/F3VVVS+ISoIX9nqHsZRaG6W5aFeJ5BEuBosHfT/ABb73FN0RZ1Z3cj2j7cL28SToJPXOw==", + "path": "microsoft.codeanalysis.csharp/4.11.0", + "hashPath": "microsoft.codeanalysis.csharp.4.11.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==", + "path": "microsoft.extensions.configuration/8.0.0", + "hashPath": "microsoft.extensions.configuration.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.Abstractions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==", + "path": "microsoft.extensions.configuration.abstractions/8.0.0", + "hashPath": "microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.FileExtensions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-McP+Lz/EKwvtCv48z0YImw+L1gi1gy5rHhNaNIY2CrjloV+XY8gydT8DjMR6zWeL13AFK+DioVpppwAuO1Gi1w==", + "path": "microsoft.extensions.configuration.fileextensions/8.0.0", + "hashPath": "microsoft.extensions.configuration.fileextensions.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.Json/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-C2wqUoh9OmRL1akaCcKSTmRU8z0kckfImG7zLNI8uyi47Lp+zd5LWAD17waPQEqCz3ioWOCrFUo+JJuoeZLOBw==", + "path": "microsoft.extensions.configuration.json/8.0.0", + "hashPath": "microsoft.extensions.configuration.json.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileProviders.Abstractions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZbaMlhJlpisjuWbvXr4LdAst/1XxH3vZ6A0BsgTphZ2L4PGuxRLz7Jr/S7mkAAnOn78Vu0fKhEgNF5JO3zfjqQ==", + "path": "microsoft.extensions.fileproviders.abstractions/8.0.0", + "hashPath": "microsoft.extensions.fileproviders.abstractions.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileProviders.Physical/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UboiXxpPUpwulHvIAVE36Knq0VSHaAmfrFkegLyBZeaADuKezJ/AIXYAW8F5GBlGk/VaibN2k/Zn1ca8YAfVdA==", + "path": "microsoft.extensions.fileproviders.physical/8.0.0", + "hashPath": "microsoft.extensions.fileproviders.physical.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileSystemGlobbing/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OK+670i7esqlQrPjdIKRbsyMCe9g5kSLpRRQGSr4Q58AOYEe/hCnfLZprh7viNisSUUQZmMrbbuDaIrP+V1ebQ==", + "path": "microsoft.extensions.filesystemglobbing/8.0.0", + "hashPath": "microsoft.extensions.filesystemglobbing.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==", + "path": "microsoft.extensions.primitives/8.0.0", + "hashPath": "microsoft.extensions.primitives.8.0.0.nupkg.sha512" + }, + "Microsoft.IO.RecyclableMemoryStream/3.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-s/s20YTVY9r9TPfTrN5g8zPF1YhwxyqO6PxUkrYTGI2B+OGPe9AdajWZrLhFqXIvqIW23fnUE4+ztrUWNU1+9g==", + "path": "microsoft.io.recyclablememorystream/3.0.1", + "hashPath": "microsoft.io.recyclablememorystream.3.0.1.nupkg.sha512" + }, + "Microsoft.Win32.SystemEvents/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ==", + "path": "microsoft.win32.systemevents/7.0.0", + "hashPath": "microsoft.win32.systemevents.7.0.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "protobuf-net/3.2.30": { + "type": "package", + "serviceable": true, + "sha512": "sha512-C/UTlmxEJHAHpqm8xQK1UyJKaIynVCSNG4mVrbLgnZ7ccH28nN49O8iMJvKEodTgVbnimvy+3mIiAdW6mATwnw==", + "path": "protobuf-net/3.2.30", + "hashPath": "protobuf-net.3.2.30.nupkg.sha512" + }, + "protobuf-net.Core/3.2.30": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v2ZxxYrz+X212ukSx+uqkLuPu414bvmSAnTyf+PBUKR9ENJxO4P/csorA/27456MCp1JNoMssDj/f91RDiwBfQ==", + "path": "protobuf-net.core/3.2.30", + "hashPath": "protobuf-net.core.3.2.30.nupkg.sha512" + }, + "System.Collections.Immutable/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==", + "path": "system.collections.immutable/8.0.0", + "hashPath": "system.collections.immutable.8.0.0.nupkg.sha512" + }, + "System.ComponentModel.Annotations/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg==", + "path": "system.componentmodel.annotations/5.0.0", + "hashPath": "system.componentmodel.annotations.5.0.0.nupkg.sha512" + }, + "System.Drawing.Common/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KIX+oBU38pxkKPxvLcLfIkOV5Ien8ReN78wro7OF5/erwcmortzeFx+iBswlh2Vz6gVne0khocQudGwaO1Ey6A==", + "path": "system.drawing.common/7.0.0", + "hashPath": "system.drawing.common.7.0.0.nupkg.sha512" + }, + "System.Formats.Asn1/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XqKba7Mm/koKSjKMfW82olQdmfbI5yqeoLV/tidRp7fbh5rmHAQ5raDI/7SU0swTzv+jgqtUGkzmFxuUg0it1A==", + "path": "system.formats.asn1/8.0.1", + "hashPath": "system.formats.asn1.8.0.1.nupkg.sha512" + }, + "System.Reflection.Metadata/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==", + "path": "system.reflection.metadata/8.0.0", + "hashPath": "system.reflection.metadata.8.0.0.nupkg.sha512" + }, + "System.Security.Cryptography.Pkcs/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ULmp3xoOwNYjOYp4JZ2NK/6NdTgiN1GQXzVVN1njQ7LOZ0d0B9vyMnhyqbIi9Qw4JXj1JgCsitkTShboHRx7Eg==", + "path": "system.security.cryptography.pkcs/8.0.0", + "hashPath": "system.security.cryptography.pkcs.8.0.0.nupkg.sha512" + }, + "System.Text.Encoding.CodePages/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==", + "path": "system.text.encoding.codepages/8.0.0", + "hashPath": "system.text.encoding.codepages.8.0.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==", + "path": "system.text.encodings.web/8.0.0", + "hashPath": "system.text.encodings.web.8.0.0.nupkg.sha512" + }, + "System.Text.Json/8.0.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==", + "path": "system.text.json/8.0.4", + "hashPath": "system.text.json.8.0.4.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.dll b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.dll new file mode 100644 index 00000000..816dfbb6 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.dll differ diff --git a/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.pdb b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.pdb new file mode 100644 index 00000000..17add897 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.pdb differ diff --git a/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.runtimeconfig.json b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.runtimeconfig.json new file mode 100644 index 00000000..becfaeac --- /dev/null +++ b/GameServer/Tools/ConfigTable/Fantasy.Tools.ConfigTable.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/GameServer/Tools/ConfigTable/Microsoft.CodeAnalysis.CSharp.dll b/GameServer/Tools/ConfigTable/Microsoft.CodeAnalysis.CSharp.dll new file mode 100644 index 00000000..c23db489 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.CodeAnalysis.CSharp.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.CodeAnalysis.dll b/GameServer/Tools/ConfigTable/Microsoft.CodeAnalysis.dll new file mode 100644 index 00000000..de7eadd9 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.CodeAnalysis.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.Abstractions.dll b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.Abstractions.dll new file mode 100644 index 00000000..a5ab3136 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.Abstractions.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.FileExtensions.dll b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.FileExtensions.dll new file mode 100644 index 00000000..4efc1a59 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.FileExtensions.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.Json.dll b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.Json.dll new file mode 100644 index 00000000..296db6a8 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.Json.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.dll b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.dll new file mode 100644 index 00000000..d3e5c229 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Configuration.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.Extensions.FileProviders.Abstractions.dll b/GameServer/Tools/ConfigTable/Microsoft.Extensions.FileProviders.Abstractions.dll new file mode 100644 index 00000000..f907206c Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.Extensions.FileProviders.Abstractions.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.Extensions.FileProviders.Physical.dll b/GameServer/Tools/ConfigTable/Microsoft.Extensions.FileProviders.Physical.dll new file mode 100644 index 00000000..6fb7f477 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.Extensions.FileProviders.Physical.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.Extensions.FileSystemGlobbing.dll b/GameServer/Tools/ConfigTable/Microsoft.Extensions.FileSystemGlobbing.dll new file mode 100644 index 00000000..e5907359 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.Extensions.FileSystemGlobbing.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.Extensions.Primitives.dll b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Primitives.dll new file mode 100644 index 00000000..c24f2a0b Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.Extensions.Primitives.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.IO.RecyclableMemoryStream.dll b/GameServer/Tools/ConfigTable/Microsoft.IO.RecyclableMemoryStream.dll new file mode 100644 index 00000000..6e0ea409 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.IO.RecyclableMemoryStream.dll differ diff --git a/GameServer/Tools/ConfigTable/Microsoft.Win32.SystemEvents.dll b/GameServer/Tools/ConfigTable/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 00000000..4f50adb0 Binary files /dev/null and b/GameServer/Tools/ConfigTable/Microsoft.Win32.SystemEvents.dll differ diff --git a/GameServer/Tools/ConfigTable/Newtonsoft.Json.dll b/GameServer/Tools/ConfigTable/Newtonsoft.Json.dll new file mode 100644 index 00000000..d035c38b Binary files /dev/null and b/GameServer/Tools/ConfigTable/Newtonsoft.Json.dll differ diff --git a/GameServer/Tools/ConfigTable/Run.bat b/GameServer/Tools/ConfigTable/Run.bat new file mode 100644 index 00000000..082d6b0a --- /dev/null +++ b/GameServer/Tools/ConfigTable/Run.bat @@ -0,0 +1,33 @@ +@echo off + +echo Please select an option: +echo 1. Client Increment +echo 2. Client all +echo 3. Server Increment +echo 4. Server all +echo 5. Client and Server Increment +echo 6. Client and Server all + +set /p choice=Please select an option: + +if "%choice%"=="1" ( + echo Client Increment + dotnet Fantasy.Tools.ConfigTable.dll --p 1 --e 1 +) else if "%choice%"=="2" ( + echo Client all + dotnet Fantasy.Tools.ConfigTable.dll --p 1 --e 2 +) else if "%choice%"=="3" ( + echo Server Increment + dotnet Fantasy.Tools.ConfigTable.dll --p 2 --e 1 +) else if "%choice%"=="4" ( + echo Server all + dotnet Fantasy.Tools.ConfigTable.dll --p 2 --e 2 +) else if "%choice%"=="5" ( + echo Client and Server Increment + dotnet Fantasy.Tools.ConfigTable.dll --p 3 --e 1 +) else if "%choice%"=="6" ( + echo Client and Server all + dotnet Fantasy.Tools.ConfigTable.dll --p 3 --e 2 +) else ( + echo Invalid option +) diff --git a/GameServer/Tools/ConfigTable/Run.sh b/GameServer/Tools/ConfigTable/Run.sh new file mode 100644 index 00000000..7ac9f52a --- /dev/null +++ b/GameServer/Tools/ConfigTable/Run.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +echo "1. Client Increment" +echo "2. Client all" +echo "3. Server Increment" +echo "4. Server all" +echo "5. Client and Server Increment" +echo "6. Client and Server all" + +read -n 1 -p "Please select an option:" choice +echo "" +case $choice in + 1) + dotnet Fantasy.Tools.ConfigTable.dll --p 1 --e 1 + ;; + 2) + dotnet Fantasy.Tools.ConfigTable.dll --p 1 --e 2 + ;; + 3) + dotnet Fantasy.Tools.ConfigTable.dll --p 2 --e 1 + ;; + 4) + dotnet Fantasy.Tools.ConfigTable.dll --p 2 --e 2 + ;; + 5) + dotnet Fantasy.Tools.ConfigTable.dll --p 3 --e 1 + ;; + 6) + dotnet Fantasy.Tools.ConfigTable.dll --p 3 --e 2 + ;; + *) + echo "Invalid option" + ;; +esac diff --git a/GameServer/Tools/ConfigTable/System.Drawing.Common.dll b/GameServer/Tools/ConfigTable/System.Drawing.Common.dll new file mode 100644 index 00000000..310d5e8b Binary files /dev/null and b/GameServer/Tools/ConfigTable/System.Drawing.Common.dll differ diff --git a/GameServer/Tools/ConfigTable/System.Formats.Asn1.dll b/GameServer/Tools/ConfigTable/System.Formats.Asn1.dll new file mode 100644 index 00000000..16cc849a Binary files /dev/null and b/GameServer/Tools/ConfigTable/System.Formats.Asn1.dll differ diff --git a/GameServer/Tools/ConfigTable/System.Security.Cryptography.Pkcs.dll b/GameServer/Tools/ConfigTable/System.Security.Cryptography.Pkcs.dll new file mode 100644 index 00000000..a76a14a8 Binary files /dev/null and b/GameServer/Tools/ConfigTable/System.Security.Cryptography.Pkcs.dll differ diff --git a/GameServer/Tools/ConfigTable/System.Text.Json.dll b/GameServer/Tools/ConfigTable/System.Text.Json.dll new file mode 100644 index 00000000..0c6d4065 Binary files /dev/null and b/GameServer/Tools/ConfigTable/System.Text.Json.dll differ diff --git a/GameServer/Tools/ConfigTable/protobuf-net.Core.dll b/GameServer/Tools/ConfigTable/protobuf-net.Core.dll new file mode 100644 index 00000000..845a8403 Binary files /dev/null and b/GameServer/Tools/ConfigTable/protobuf-net.Core.dll differ diff --git a/GameServer/Tools/ConfigTable/protobuf-net.dll b/GameServer/Tools/ConfigTable/protobuf-net.dll new file mode 100644 index 00000000..e4b68393 Binary files /dev/null and b/GameServer/Tools/ConfigTable/protobuf-net.dll differ diff --git a/GameServer/Tools/ConfigTable/runtimes/win/lib/net7.0/Microsoft.Win32.SystemEvents.dll b/GameServer/Tools/ConfigTable/runtimes/win/lib/net7.0/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 00000000..d40a926e Binary files /dev/null and b/GameServer/Tools/ConfigTable/runtimes/win/lib/net7.0/Microsoft.Win32.SystemEvents.dll differ diff --git a/GameServer/Tools/ConfigTable/runtimes/win/lib/net7.0/System.Drawing.Common.dll b/GameServer/Tools/ConfigTable/runtimes/win/lib/net7.0/System.Drawing.Common.dll new file mode 100644 index 00000000..39493b44 Binary files /dev/null and b/GameServer/Tools/ConfigTable/runtimes/win/lib/net7.0/System.Drawing.Common.dll differ diff --git a/GameServer/Tools/ConfigTable/runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll b/GameServer/Tools/ConfigTable/runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll new file mode 100644 index 00000000..cba73d07 Binary files /dev/null and b/GameServer/Tools/ConfigTable/runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll differ diff --git a/GameServer/Tools/NetworkProtocol/CommandLine.dll b/GameServer/Tools/NetworkProtocol/CommandLine.dll new file mode 100644 index 00000000..3eab2be2 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/CommandLine.dll differ diff --git a/GameServer/Tools/NetworkProtocol/ExporterSettings.json b/GameServer/Tools/NetworkProtocol/ExporterSettings.json new file mode 100644 index 00000000..d038a761 --- /dev/null +++ b/GameServer/Tools/NetworkProtocol/ExporterSettings.json @@ -0,0 +1,29 @@ +{ + "Export": { + "NetworkProtocolDirectory": { + "Value": "../../Config/NetworkProtocol/", + "Comment": "ProtoBuf文件所在的文件夹位置" + }, + "NetworkProtocolServerDirectory": { + "Value": "../../Server/Entity/Generate/NetworkProtocol/", + "Comment": "ProtoBuf生成到服务端的文件夹位置" + }, + "NetworkProtocolClientDirectory": { + "Value": "../../../EintooAR/Assets/GameScripts/HotFix/GameLogic/RPG/GameProtocol/Server/Generate/NetworkProtocol/", + "Comment": "ProtoBuf生成到客户端的文件夹位置" + }, + "Serializes": { + "Value": [ +// { +// "KeyIndex": 0, +// "NameSpace" : "MemoryPack", +// "SerializeName": "MemoryPack", +// "Attribute": "\t[MemoryPackable]", +// "Ignore": "\t\t[MemoryPackIgnore]", +// "Member": "MemoryPackOrder" +// } + ], + "Comment": "自定义序列化器" + } + } +} \ No newline at end of file diff --git a/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol new file mode 100644 index 00000000..25ceaf12 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol differ diff --git a/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.deps.json b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.deps.json new file mode 100644 index 00000000..3c053cb3 --- /dev/null +++ b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.deps.json @@ -0,0 +1,227 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Fantasy.Tools.NetworkProtocol/1.0.0": { + "dependencies": { + "CommandLineParser": "2.9.1", + "Microsoft.Extensions.Configuration.Json": "8.0.0", + "Newtonsoft.Json": "13.0.3" + }, + "runtime": { + "Fantasy.Tools.NetworkProtocol.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "Microsoft.Extensions.Configuration/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Configuration.Abstractions/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Configuration.FileExtensions/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "8.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "Microsoft.Extensions.FileProviders.Physical": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.FileExtensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Configuration.Json/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "8.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.Configuration.FileExtensions": "8.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "System.Text.Json": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Configuration.Json.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.FileProviders.Abstractions/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.FileProviders.Abstractions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.FileProviders.Physical/8.0.0": { + "dependencies": { + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "Microsoft.Extensions.FileSystemGlobbing": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.FileProviders.Physical.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.FileSystemGlobbing/8.0.0": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.FileSystemGlobbing.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "System.Text.Encodings.Web/8.0.0": {}, + "System.Text.Json/8.0.0": { + "dependencies": { + "System.Text.Encodings.Web": "8.0.0" + } + } + } + }, + "libraries": { + "Fantasy.Tools.NetworkProtocol/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==", + "path": "microsoft.extensions.configuration/8.0.0", + "hashPath": "microsoft.extensions.configuration.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.Abstractions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==", + "path": "microsoft.extensions.configuration.abstractions/8.0.0", + "hashPath": "microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.FileExtensions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-McP+Lz/EKwvtCv48z0YImw+L1gi1gy5rHhNaNIY2CrjloV+XY8gydT8DjMR6zWeL13AFK+DioVpppwAuO1Gi1w==", + "path": "microsoft.extensions.configuration.fileextensions/8.0.0", + "hashPath": "microsoft.extensions.configuration.fileextensions.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Configuration.Json/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-C2wqUoh9OmRL1akaCcKSTmRU8z0kckfImG7zLNI8uyi47Lp+zd5LWAD17waPQEqCz3ioWOCrFUo+JJuoeZLOBw==", + "path": "microsoft.extensions.configuration.json/8.0.0", + "hashPath": "microsoft.extensions.configuration.json.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileProviders.Abstractions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZbaMlhJlpisjuWbvXr4LdAst/1XxH3vZ6A0BsgTphZ2L4PGuxRLz7Jr/S7mkAAnOn78Vu0fKhEgNF5JO3zfjqQ==", + "path": "microsoft.extensions.fileproviders.abstractions/8.0.0", + "hashPath": "microsoft.extensions.fileproviders.abstractions.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileProviders.Physical/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UboiXxpPUpwulHvIAVE36Knq0VSHaAmfrFkegLyBZeaADuKezJ/AIXYAW8F5GBlGk/VaibN2k/Zn1ca8YAfVdA==", + "path": "microsoft.extensions.fileproviders.physical/8.0.0", + "hashPath": "microsoft.extensions.fileproviders.physical.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.FileSystemGlobbing/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OK+670i7esqlQrPjdIKRbsyMCe9g5kSLpRRQGSr4Q58AOYEe/hCnfLZprh7viNisSUUQZmMrbbuDaIrP+V1ebQ==", + "path": "microsoft.extensions.filesystemglobbing/8.0.0", + "hashPath": "microsoft.extensions.filesystemglobbing.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==", + "path": "microsoft.extensions.primitives/8.0.0", + "hashPath": "microsoft.extensions.primitives.8.0.0.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "System.Text.Encodings.Web/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==", + "path": "system.text.encodings.web/8.0.0", + "hashPath": "system.text.encodings.web.8.0.0.nupkg.sha512" + }, + "System.Text.Json/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OdrZO2WjkiEG6ajEFRABTRCi/wuXQPxeV6g8xvUJqdxMvvuCCEk86zPla8UiIQJz3durtUEbNyY/3lIhS0yZvQ==", + "path": "system.text.json/8.0.0", + "hashPath": "system.text.json.8.0.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.dll b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.dll new file mode 100644 index 00000000..918803d3 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.pdb b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.pdb new file mode 100644 index 00000000..39d574a4 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.pdb differ diff --git a/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.runtimeconfig.json b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.runtimeconfig.json new file mode 100644 index 00000000..becfaeac --- /dev/null +++ b/GameServer/Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.Abstractions.dll b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.Abstractions.dll new file mode 100644 index 00000000..a5ab3136 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.Abstractions.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.FileExtensions.dll b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.FileExtensions.dll new file mode 100644 index 00000000..4efc1a59 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.FileExtensions.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.Json.dll b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.Json.dll new file mode 100644 index 00000000..296db6a8 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.Json.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.dll b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.dll new file mode 100644 index 00000000..d3e5c229 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Configuration.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.FileProviders.Abstractions.dll b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.FileProviders.Abstractions.dll new file mode 100644 index 00000000..f907206c Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.FileProviders.Abstractions.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.FileProviders.Physical.dll b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.FileProviders.Physical.dll new file mode 100644 index 00000000..6fb7f477 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.FileProviders.Physical.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.FileSystemGlobbing.dll b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.FileSystemGlobbing.dll new file mode 100644 index 00000000..e5907359 Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.FileSystemGlobbing.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Primitives.dll b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Primitives.dll new file mode 100644 index 00000000..c24f2a0b Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Microsoft.Extensions.Primitives.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Newtonsoft.Json.dll b/GameServer/Tools/NetworkProtocol/Newtonsoft.Json.dll new file mode 100644 index 00000000..d035c38b Binary files /dev/null and b/GameServer/Tools/NetworkProtocol/Newtonsoft.Json.dll differ diff --git a/GameServer/Tools/NetworkProtocol/Run.bat b/GameServer/Tools/NetworkProtocol/Run.bat new file mode 100644 index 00000000..af6e9e9c --- /dev/null +++ b/GameServer/Tools/NetworkProtocol/Run.bat @@ -0,0 +1,21 @@ +@echo off + +echo Please select an option: +echo 1. Client +echo 2. Server +echo 3. All + +set /p choice=Please select an option: + +if "%choice%"=="1" ( + echo Client + dotnet Fantasy.Tools.NetworkProtocol.dll --p 1 +) else if "%choice%"=="2" ( + echo Server + dotnet Fantasy.Tools.NetworkProtocol.dll --p 2 +) else if "%choice%"=="3" ( + echo All + dotnet Fantasy.Tools.NetworkProtocol.dll --p 3 +) else ( + echo Invalid option +) diff --git a/GameServer/Tools/NetworkProtocol/Run.sh b/GameServer/Tools/NetworkProtocol/Run.sh new file mode 100644 index 00000000..015b1191 --- /dev/null +++ b/GameServer/Tools/NetworkProtocol/Run.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +echo "1. Client" +echo "2. Server" +echo "3. All" + +read -n 1 -p "Please select an option:" choice +echo "" +echo "" +case $choice in + 1) + dotnet Fantasy.Tools.NetworkProtocol.dll --p 1 + ;; + 2) + dotnet Fantasy.Tools.NetworkProtocol.dll --p 2 + ;; + 3) + dotnet Fantasy.Tools.NetworkProtocol.dll --p 3 + ;; + *) + echo "Invalid option" + ;; +esac diff --git a/Tools/FileServer/.gitignore b/Tools/FileServer/.gitignore new file mode 100644 index 00000000..a52d3c3c --- /dev/null +++ b/Tools/FileServer/.gitignore @@ -0,0 +1,8 @@ +node_modules +*.swap +.idea +.DS_Store +*.log +.vscode +*-lock.json +AssetsRoot \ No newline at end of file diff --git a/Tools/FileServer/README.md b/Tools/FileServer/README.md new file mode 100644 index 00000000..4f955671 --- /dev/null +++ b/Tools/FileServer/README.md @@ -0,0 +1,42 @@ +## 使用node搭建静态资源服务器 + +### 安装 + +```bash +npm install yumu-static-server -g +``` + +### 使用 + +```bash +server # 会在当前目录下启动一个静态资源服务器,默认端口为8080 + +server -p[port] 3000 # 会在当前目录下启动一个静态资源服务器,端口为3000 + +server -i[index] index.html # 设置文件夹在默认加载的文件 + +server -c[charset] UTF-8 # 设置文件默认加载的字符编码 + +server -cors # 开启文件跨域 + +server -h[https] # 开启https服务 + +server --openindex # 是否打开默认页面 + +server --no-openbrowser # 关闭自动打开浏览器 +``` + +### 基本功能 + +1. 启动静态资源服务器 +2. 端口可配置 +3. 字符编码可配置 +4. 文件夹下默认加载文件可配置 +5. 是否跨域可配置 +6. 开启https服务 + +### TODO + +- [x] 引入handlerbars编译模板 +- [x] 支持文件是否跨域 +- [x] 支持https服务 diff --git a/Tools/FileServer/bin/app.js b/Tools/FileServer/bin/app.js new file mode 100644 index 00000000..bc2a45d5 --- /dev/null +++ b/Tools/FileServer/bin/app.js @@ -0,0 +1,26 @@ +const StaticServer = require('../src/static-server'); + +const options = require('yargs') + .option('p', { alias: 'port', describe: '设置服务启动的端口号', type: 'number' }) + .option('i', { alias: 'index', describe: '设置默认打开的主页', type: 'string' }) + .option('c', { alias: 'charset', describe: '设置文件的默认字符集', type: 'string' }) + .option('o', { alias: 'openindex', describe: '是否打开默认页面', type: 'boolean' }) + .option('h', { alias: 'https', describe: '是否启用https服务', type: 'boolean' }) + .option('cors', { describe: '是否开启文件跨域', type: 'boolean' }) + .option('openbrowser', { describe: '是否默认打开浏览器', type: 'boolean' }) + + // 默认参数 + .default('openbrowser', true) + // .default('https', true) + .default('port', 8080) + .default('index', 'index.html') + .default('openindex', 'index.html') + .default('charset', 'UTF-8') + + .help() + .alias('?', 'help') + + .argv; + +const server = new StaticServer(options); +server.start(); \ No newline at end of file diff --git a/Tools/FileServer/index.js b/Tools/FileServer/index.js new file mode 100644 index 00000000..f113fe8b --- /dev/null +++ b/Tools/FileServer/index.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +module.exports = require('./bin/app.js'); diff --git a/Tools/FileServer/instal.bat b/Tools/FileServer/instal.bat new file mode 100644 index 00000000..ad36db1c --- /dev/null +++ b/Tools/FileServer/instal.bat @@ -0,0 +1 @@ +npm install yumu-static-server -g \ No newline at end of file diff --git a/Tools/FileServer/instal.sh b/Tools/FileServer/instal.sh new file mode 100644 index 00000000..650b59bf --- /dev/null +++ b/Tools/FileServer/instal.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +npm install yumu-static-server -g \ No newline at end of file diff --git a/Tools/FileServer/package.json b/Tools/FileServer/package.json new file mode 100644 index 00000000..73cdb9f0 --- /dev/null +++ b/Tools/FileServer/package.json @@ -0,0 +1,30 @@ +{ + "name": "static-server", + "version": "0.0.1", + "description": "使用node搭建静态资源服务器", + "main": "index.js", + "scripts": { + "dev": "supervisor bin/app.js", + "start": "npm run dev" + }, + "bin": { + "server": "index.js" + }, + "author": "Alex", + "license": "ISC", + "keywords": [ + "static-server", + "server" + ], + "dependencies": { + "chalk": "^2.3.2", + "handlebars": "^4.0.11", + "mime": "^2.2.0", + "open": "^7.1.0", + "pem": "^1.12.5", + "yargs": "^6.6.0" + }, + "devDependencies": { + "supervisor": "^0.12.0" + } +} \ No newline at end of file diff --git a/Tools/FileServer/src/mime.js b/Tools/FileServer/src/mime.js new file mode 100644 index 00000000..967897d5 --- /dev/null +++ b/Tools/FileServer/src/mime.js @@ -0,0 +1,12 @@ +const path = require('path'); +const mime = require('mime'); + +const lookup = (pathName) => { + let ext = path.extname(pathName); + ext = ext.split('.').pop(); + return mime.getType(ext) || mime.getType('txt'); +} + +module.exports = { + lookup +}; diff --git a/Tools/FileServer/src/static-server.js b/Tools/FileServer/src/static-server.js new file mode 100644 index 00000000..ca2c5113 --- /dev/null +++ b/Tools/FileServer/src/static-server.js @@ -0,0 +1,334 @@ +const http = require('http'); +const https = require('https'); +const path = require('path'); +const fs = require('fs'); +const url = require('url'); +const zlib = require('zlib'); +const chalk = require('chalk'); +const os = require('os'); +const open = require("open"); +const Handlebars = require('handlebars'); +const pem = require('pem'); +const mime = require('./mime'); +const Template = require('./templates'); + +const _defaultTemplate = Handlebars.compile(Template.page_dafault); +const _404TempLate = Handlebars.compile(Template.page_404); + +const hasTrailingSlash = url => url[url.length - 1] === '/'; + +const ifaces = os.networkInterfaces(); + +class StaticServer { + constructor(options) { + this.port = options.port; + this.indexPage = options.index; + this.openIndexPage = options.openindex; + this.openBrowser = options.openbrowser; + this.charset = options.charset; + this.cors = options.cors; + this.protocal = options.https ? 'https' : 'http'; + this.zipMatch = '^\\.(css|js|html)$'; + } + + /** + * 响应错误 + * + * @param {*} err + * @param {*} res + * @returns + * @memberof StaticServer + */ + respondError(err, res) { + res.writeHead(500); + return res.end(err); + } + + /** + * 响应404 + * + * @param {*} req + * @param {*} res + * @memberof StaticServer + */ + respondNotFound(req, res) { + res.writeHead(404, { + 'Content-Type': 'text/html' + }); + const html = _404TempLate(); + res.end(html); + } + + respond(pathName, req, res) { + fs.stat(pathName, (err, stat) => { + if (err) return respondError(err, res); + this.responseFile(stat, pathName, req, res); + }); + } + + /** + * 判断是否需要解压 + * + * @param {*} pathName + * @returns + * @memberof StaticServer + */ + shouldCompress(pathName) { + return path.extname(pathName).match(this.zipMatch); + } + + /** + * 解压文件 + * + * @param {*} readStream + * @param {*} req + * @param {*} res + * @returns + * @memberof StaticServer + */ + compressHandler(readStream, req, res) { + const acceptEncoding = req.headers['accept-encoding']; + if (!acceptEncoding || !acceptEncoding.match(/\b(gzip|deflate)\b/)) { + return readStream; + } else if (acceptEncoding.match(/\bgzip\b/)) { + res.setHeader('Content-Encoding', 'gzip'); + return readStream.pipe(zlib.createGzip()); + } + } + + /** + * 响应文件路径 + * + * @param {*} stat + * @param {*} pathName + * @param {*} req + * @param {*} res + * @memberof StaticServer + */ + responseFile(stat, pathName, req, res) { + // 设置响应头 + res.setHeader('Content-Type', `${mime.lookup(pathName)}; charset=${this.charset}`); + res.setHeader('Accept-Ranges', 'bytes'); + + // 添加跨域 + if (this.cors) res.setHeader('Access-Control-Allow-Origin', '*'); + + let readStream; + readStream = fs.createReadStream(pathName); + if (this.shouldCompress(pathName)) { // 判断是否需要解压 + readStream = this.compressHandler(readStream, req, res); + } + readStream.pipe(res); + } + + /** + * 响应重定向 + * + * @param {*} req + * @param {*} res + * @memberof StaticServer + */ + respondRedirect(req, res) { + const location = req.url + '/'; + res.writeHead(301, { + 'Location': location, + 'Content-Type': 'text/html' + }); + const html = _defaultTemplate({ + htmlStr: `Redirecting to ${location}`, + showFileList: false + }) + res.end(html); + } + + /** + * 响应文件夹路径 + * + * @param {*} pathName + * @param {*} req + * @param {*} res + * @memberof StaticServer + */ + respondDirectory(pathName, req, res) { + const indexPagePath = path.join(pathName, this.indexPage); + // 如果文件夹下存在index.html,则默认打开 + if (this.openIndexPage && fs.existsSync(indexPagePath)) { + this.respond(indexPagePath, req, res); + } else { + fs.readdir(pathName, (err, files) => { + if (err) { + respondError(err, res); + } + const requestPath = url.parse(req.url).pathname; + const fileList = []; + files.forEach(fileName => { + let itemLink = path.join(requestPath, fileName); + let isDirectory = false; + const stat = fs.statSync(path.join(pathName, fileName)); + if (stat && stat.isDirectory()) { + itemLink = path.join(itemLink, '/'); + isDirectory = true; + } + fileList.push({ + link: itemLink, + name: fileName, + isDirectory + }); + }); + // 排序,目录在前,文件在后 + fileList.sort((prev, next) => { + if (prev.isDirectory && !next.isDirectory) { + return -1; + } + return 1; + }); + res.writeHead(200, { + 'Content-Type': 'text/html' + }); + const html = _defaultTemplate({ + requestPath, + fileList, + showFileList: true + }) + res.end(html); + }); + } + } + + /** + * 路由处理 + * + * @param {*} pathName + * @param {*} req + * @param {*} res + * @memberof StaticServer + */ + routeHandler(pathName, req, res) { + const realPathName = pathName.split('?')[0]; + fs.stat(realPathName, (err, stat) => { + this.logGetInfo(err, pathName); + if (!err) { + const requestedPath = url.parse(req.url).pathname; + // 检查url + // 如果末尾有'/',且是文件夹,则读取文件夹 + // 如果是文件夹,但末尾没'/',则重定向至'xxx/' + // 如果是文件,则判断是否是压缩文件,是则解压,不是则读取文件 + if (hasTrailingSlash(requestedPath) && stat.isDirectory()) { + this.respondDirectory(realPathName, req, res); + } else if (stat.isDirectory()) { + this.respondRedirect(req, res); + } else { + this.respond(realPathName, req, res); + } + } else { + this.respondNotFound(req, res); + } + }); + } + + /** + * 打印ip地址 + * + * @memberof StaticServer + */ + logUsingPort() { + const me = this; + console.log(`${chalk.yellow(`Starting up your server\nAvailable on:`)}`); + Object.keys(ifaces).forEach(function (dev) { + ifaces[dev].forEach(function (details) { + if (details.family === 'IPv4') { + console.log(` ${me.protocal}://${details.address}:${chalk.green(me.port)}`); + } + }); + }); + console.log(`${chalk.cyan(Array(50).fill('-').join(''))}`); + } + + /** + * 打印占用端口 + * + * @param {*} oldPort + * @param {*} port + * @memberof StaticServer + */ + logUsedPort(oldPort, port) { + const me = this; + console.log(`${chalk.red(`The port ${oldPort} is being used, change to port `)}${chalk.green(me.port)} `); + } + + /** + * 打印https证书友好提示 + * + * @memberof StaticServer + */ + logHttpsTrusted() { + console.log(chalk.green('Currently is using HTTPS certificate (Manually trust it if necessary)')); + } + + + /** + * 打印路由路径输出 + * + * @param {*} isError + * @param {*} pathName + * @memberof StaticServer + */ + logGetInfo(isError, pathName) { + if (isError) { + console.log(chalk.red(`404 ${pathName}`)); + } else { + console.log(chalk.cyan(`200 ${pathName}`)); + } + } + + startServer(keys) { + const me = this; + let isPostBeUsed = false; + const oldPort = me.port; + const protocal = me.protocal === 'https' ? https : http; + const options = me.protocal === 'https' ? { key: keys.serviceKey, cert: keys.certificate } : null; + const callback = (req, res) => { + const pathName = path.join(process.cwd(), path.normalize(decodeURI(req.url))); + me.routeHandler(pathName, req, res); + }; + const params = [callback]; + if (me.protocal === 'https') params.unshift(options); + const server = protocal.createServer(...params).listen(me.port); + server.on('listening', function () { // 执行这块代码说明端口未被占用 + if (isPostBeUsed) { + me.logUsedPort(oldPort, me.port); + } + me.logUsingPort(); + if (me.openBrowser) { + open(`${me.protocal}://127.0.0.1:${me.port}`); + } + }); + + server.on('error', function (err) { + if (err.code === 'EADDRINUSE') { // 端口已经被使用 + isPostBeUsed = true; + me.port = parseInt(me.port) + 1; + server.listen(me.port); + } else { + console.log(err); + } + }) + } + + start() { + const me = this; + if (this.protocal === 'https') { + pem.createCertificate({ days: 1, selfSigned: true }, function (err, keys) { + if (err) { + throw err + } + me.logHttpsTrusted(); + me.startServer(keys); + }) + } else { + me.startServer(); + } + } +} + +module.exports = StaticServer; \ No newline at end of file diff --git a/Tools/FileServer/src/templates/404.js b/Tools/FileServer/src/templates/404.js new file mode 100644 index 00000000..62d60971 --- /dev/null +++ b/Tools/FileServer/src/templates/404.js @@ -0,0 +1,44 @@ +module.exports = ` + + + + + + + node静态服务器 + + + +
+ not found +
+

抱歉,你访问的路径不存在

+

您要找的页面没有找到,请返回首页继续浏览

+
+
+ + +` \ No newline at end of file diff --git a/Tools/FileServer/src/templates/default.js b/Tools/FileServer/src/templates/default.js new file mode 100644 index 00000000..4f389f6b --- /dev/null +++ b/Tools/FileServer/src/templates/default.js @@ -0,0 +1,93 @@ +module.exports = ` + + + + + + + node静态服务器 + + + +
+

当前目录:{{requestPath}}

+ {{#if showFileList}} +
    + {{#each fileList}} +
  • +

    + {{#if isDirectory }} + 「目录」 + {{else}} + 「文件」 + {{/if}} + {{name}} +

    +
  • + {{/each}} +
+ {{else}} + {{htmlStr}} + {{/if}} +
+ + + +`; \ No newline at end of file diff --git a/Tools/FileServer/src/templates/images/404.png b/Tools/FileServer/src/templates/images/404.png new file mode 100644 index 00000000..93cd1bb8 Binary files /dev/null and b/Tools/FileServer/src/templates/images/404.png differ diff --git a/Tools/FileServer/src/templates/index.js b/Tools/FileServer/src/templates/index.js new file mode 100644 index 00000000..4b51b700 --- /dev/null +++ b/Tools/FileServer/src/templates/index.js @@ -0,0 +1,7 @@ +const page_dafault = require('./default'); +const page_404 = require('./404'); + +module.exports = { + page_dafault, + page_404 +}; \ No newline at end of file diff --git a/Tools/FileServer/start.bat b/Tools/FileServer/start.bat new file mode 100644 index 00000000..7f83ac58 --- /dev/null +++ b/Tools/FileServer/start.bat @@ -0,0 +1 @@ +server -p 8081 -cors \ No newline at end of file diff --git a/Tools/FileServer/start.sh b/Tools/FileServer/start.sh new file mode 100644 index 00000000..9e536f9f --- /dev/null +++ b/Tools/FileServer/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +server -p 8081 -cors \ No newline at end of file diff --git a/Tools/Luban/CommandLine.dll b/Tools/Luban/CommandLine.dll new file mode 100644 index 00000000..3eab2be2 Binary files /dev/null and b/Tools/Luban/CommandLine.dll differ diff --git a/Tools/Luban/ExcelDataReader.dll b/Tools/Luban/ExcelDataReader.dll new file mode 100644 index 00000000..c730b00d Binary files /dev/null and b/Tools/Luban/ExcelDataReader.dll differ diff --git a/Tools/Luban/Google.Protobuf.dll b/Tools/Luban/Google.Protobuf.dll new file mode 100644 index 00000000..3cd09501 Binary files /dev/null and b/Tools/Luban/Google.Protobuf.dll differ diff --git a/Tools/Luban/Luban.Bson.deps.json b/Tools/Luban/Luban.Bson.deps.json new file mode 100644 index 00000000..e2df5d08 --- /dev/null +++ b/Tools/Luban/Luban.Bson.deps.json @@ -0,0 +1,107 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Bson/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Newtonsoft.Json.Bson": "1.0.3" + }, + "runtime": { + "Luban.Bson.dll": {} + } + }, + "Newtonsoft.Json/13.0.1": { + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.1.25517" + } + } + }, + "Newtonsoft.Json.Bson/1.0.3": { + "dependencies": { + "Newtonsoft.Json": "13.0.1" + }, + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.Bson.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.3.29904" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Bson/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Newtonsoft.Json/13.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==", + "path": "newtonsoft.json/13.0.1", + "hashPath": "newtonsoft.json.13.0.1.nupkg.sha512" + }, + "Newtonsoft.Json.Bson/1.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bCcwagnHfYnhwQfY1criEcn6Hy9PtBuVnZu0pA8hmRhuR3jI/8WxVgoVAdNw9BJ3JHkxmWJzpj/AQy+PMMLqxg==", + "path": "newtonsoft.json.bson/1.0.3", + "hashPath": "newtonsoft.json.bson.1.0.3.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Bson.dll b/Tools/Luban/Luban.Bson.dll new file mode 100644 index 00000000..edf88766 Binary files /dev/null and b/Tools/Luban/Luban.Bson.dll differ diff --git a/Tools/Luban/Luban.Bson.pdb b/Tools/Luban/Luban.Bson.pdb new file mode 100644 index 00000000..69c4b2fb Binary files /dev/null and b/Tools/Luban/Luban.Bson.pdb differ diff --git a/Tools/Luban/Luban.CSharp.deps.json b/Tools/Luban/Luban.CSharp.deps.json new file mode 100644 index 00000000..fdab8291 --- /dev/null +++ b/Tools/Luban/Luban.CSharp.deps.json @@ -0,0 +1,73 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.CSharp/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataValidator.Builtin": "1.0.0" + }, + "runtime": { + "Luban.CSharp.dll": {} + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "Luban.DataValidator.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.DataValidator.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.CSharp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "Luban.DataValidator.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.CSharp.dll b/Tools/Luban/Luban.CSharp.dll new file mode 100644 index 00000000..4d275460 Binary files /dev/null and b/Tools/Luban/Luban.CSharp.dll differ diff --git a/Tools/Luban/Luban.CSharp.pdb b/Tools/Luban/Luban.CSharp.pdb new file mode 100644 index 00000000..86a5ba19 Binary files /dev/null and b/Tools/Luban/Luban.CSharp.pdb differ diff --git a/Tools/Luban/Luban.Core.deps.json b/Tools/Luban/Luban.Core.deps.json new file mode 100644 index 00000000..03f04879 --- /dev/null +++ b/Tools/Luban/Luban.Core.deps.json @@ -0,0 +1,57 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": {} + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Core.dll b/Tools/Luban/Luban.Core.dll new file mode 100644 index 00000000..e3133dea Binary files /dev/null and b/Tools/Luban/Luban.Core.dll differ diff --git a/Tools/Luban/Luban.Core.pdb b/Tools/Luban/Luban.Core.pdb new file mode 100644 index 00000000..b0e5383c Binary files /dev/null and b/Tools/Luban/Luban.Core.pdb differ diff --git a/Tools/Luban/Luban.Cpp.deps.json b/Tools/Luban/Luban.Cpp.deps.json new file mode 100644 index 00000000..f01523e4 --- /dev/null +++ b/Tools/Luban/Luban.Cpp.deps.json @@ -0,0 +1,73 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Cpp/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Cpp.dll": {} + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Cpp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Cpp.dll b/Tools/Luban/Luban.Cpp.dll new file mode 100644 index 00000000..2b679cef Binary files /dev/null and b/Tools/Luban/Luban.Cpp.dll differ diff --git a/Tools/Luban/Luban.Cpp.pdb b/Tools/Luban/Luban.Cpp.pdb new file mode 100644 index 00000000..1f85692c Binary files /dev/null and b/Tools/Luban/Luban.Cpp.pdb differ diff --git a/Tools/Luban/Luban.DataLoader.Builtin.deps.json b/Tools/Luban/Luban.DataLoader.Builtin.deps.json new file mode 100644 index 00000000..62beda5e --- /dev/null +++ b/Tools/Luban/Luban.DataLoader.Builtin.deps.json @@ -0,0 +1,547 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.DataLoader.Builtin.dll b/Tools/Luban/Luban.DataLoader.Builtin.dll new file mode 100644 index 00000000..35e17c6d Binary files /dev/null and b/Tools/Luban/Luban.DataLoader.Builtin.dll differ diff --git a/Tools/Luban/Luban.DataLoader.Builtin.pdb b/Tools/Luban/Luban.DataLoader.Builtin.pdb new file mode 100644 index 00000000..fc542016 Binary files /dev/null and b/Tools/Luban/Luban.DataLoader.Builtin.pdb differ diff --git a/Tools/Luban/Luban.DataTarget.Builtin.deps.json b/Tools/Luban/Luban.DataTarget.Builtin.deps.json new file mode 100644 index 00000000..45659dd2 --- /dev/null +++ b/Tools/Luban/Luban.DataTarget.Builtin.deps.json @@ -0,0 +1,564 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.DataTarget.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.DataTarget.Builtin.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.DataTarget.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.DataTarget.Builtin.dll b/Tools/Luban/Luban.DataTarget.Builtin.dll new file mode 100644 index 00000000..67e6960c Binary files /dev/null and b/Tools/Luban/Luban.DataTarget.Builtin.dll differ diff --git a/Tools/Luban/Luban.DataTarget.Builtin.pdb b/Tools/Luban/Luban.DataTarget.Builtin.pdb new file mode 100644 index 00000000..39d7c10d Binary files /dev/null and b/Tools/Luban/Luban.DataTarget.Builtin.pdb differ diff --git a/Tools/Luban/Luban.DataValidator.Builtin.deps.json b/Tools/Luban/Luban.DataValidator.Builtin.deps.json new file mode 100644 index 00000000..0616312b --- /dev/null +++ b/Tools/Luban/Luban.DataValidator.Builtin.deps.json @@ -0,0 +1,73 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.DataValidator.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.DataValidator.Builtin.dll": {} + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.DataValidator.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.DataValidator.Builtin.dll b/Tools/Luban/Luban.DataValidator.Builtin.dll new file mode 100644 index 00000000..e2d9b89c Binary files /dev/null and b/Tools/Luban/Luban.DataValidator.Builtin.dll differ diff --git a/Tools/Luban/Luban.DataValidator.Builtin.pdb b/Tools/Luban/Luban.DataValidator.Builtin.pdb new file mode 100644 index 00000000..57086a3d Binary files /dev/null and b/Tools/Luban/Luban.DataValidator.Builtin.pdb differ diff --git a/Tools/Luban/Luban.FlatBuffers.deps.json b/Tools/Luban/Luban.FlatBuffers.deps.json new file mode 100644 index 00000000..d7e57c1c --- /dev/null +++ b/Tools/Luban/Luban.FlatBuffers.deps.json @@ -0,0 +1,581 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.FlatBuffers/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.FlatBuffers.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataTarget.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.DataTarget.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.FlatBuffers/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataTarget.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.FlatBuffers.dll b/Tools/Luban/Luban.FlatBuffers.dll new file mode 100644 index 00000000..e346a07c Binary files /dev/null and b/Tools/Luban/Luban.FlatBuffers.dll differ diff --git a/Tools/Luban/Luban.FlatBuffers.pdb b/Tools/Luban/Luban.FlatBuffers.pdb new file mode 100644 index 00000000..c131e2d9 Binary files /dev/null and b/Tools/Luban/Luban.FlatBuffers.pdb differ diff --git a/Tools/Luban/Luban.Gdscript.deps.json b/Tools/Luban/Luban.Gdscript.deps.json new file mode 100644 index 00000000..eec881e9 --- /dev/null +++ b/Tools/Luban/Luban.Gdscript.deps.json @@ -0,0 +1,581 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Gdscript/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Gdscript.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataTarget.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.DataTarget.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Gdscript/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataTarget.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Gdscript.dll b/Tools/Luban/Luban.Gdscript.dll new file mode 100644 index 00000000..9f932fa3 Binary files /dev/null and b/Tools/Luban/Luban.Gdscript.dll differ diff --git a/Tools/Luban/Luban.Gdscript.pdb b/Tools/Luban/Luban.Gdscript.pdb new file mode 100644 index 00000000..dccd347f Binary files /dev/null and b/Tools/Luban/Luban.Gdscript.pdb differ diff --git a/Tools/Luban/Luban.Golang.deps.json b/Tools/Luban/Luban.Golang.deps.json new file mode 100644 index 00000000..eb357886 --- /dev/null +++ b/Tools/Luban/Luban.Golang.deps.json @@ -0,0 +1,73 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Golang/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Golang.dll": {} + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Golang/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Golang.dll b/Tools/Luban/Luban.Golang.dll new file mode 100644 index 00000000..d6ee71c2 Binary files /dev/null and b/Tools/Luban/Luban.Golang.dll differ diff --git a/Tools/Luban/Luban.Golang.pdb b/Tools/Luban/Luban.Golang.pdb new file mode 100644 index 00000000..acb0b875 Binary files /dev/null and b/Tools/Luban/Luban.Golang.pdb differ diff --git a/Tools/Luban/Luban.Java.deps.json b/Tools/Luban/Luban.Java.deps.json new file mode 100644 index 00000000..83a9ec06 --- /dev/null +++ b/Tools/Luban/Luban.Java.deps.json @@ -0,0 +1,73 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Java/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Java.dll": {} + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Java/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Java.dll b/Tools/Luban/Luban.Java.dll new file mode 100644 index 00000000..ecf91baf Binary files /dev/null and b/Tools/Luban/Luban.Java.dll differ diff --git a/Tools/Luban/Luban.Java.pdb b/Tools/Luban/Luban.Java.pdb new file mode 100644 index 00000000..0fe67fe9 Binary files /dev/null and b/Tools/Luban/Luban.Java.pdb differ diff --git a/Tools/Luban/Luban.L10N.deps.json b/Tools/Luban/Luban.L10N.deps.json new file mode 100644 index 00000000..605a6037 --- /dev/null +++ b/Tools/Luban/Luban.L10N.deps.json @@ -0,0 +1,564 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.L10N/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.L10N.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.L10N/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.L10N.dll b/Tools/Luban/Luban.L10N.dll new file mode 100644 index 00000000..4647b09a Binary files /dev/null and b/Tools/Luban/Luban.L10N.dll differ diff --git a/Tools/Luban/Luban.L10N.pdb b/Tools/Luban/Luban.L10N.pdb new file mode 100644 index 00000000..f43d5def Binary files /dev/null and b/Tools/Luban/Luban.L10N.pdb differ diff --git a/Tools/Luban/Luban.Lua.deps.json b/Tools/Luban/Luban.Lua.deps.json new file mode 100644 index 00000000..dd9127d7 --- /dev/null +++ b/Tools/Luban/Luban.Lua.deps.json @@ -0,0 +1,73 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Lua/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Lua.dll": {} + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Lua/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Lua.dll b/Tools/Luban/Luban.Lua.dll new file mode 100644 index 00000000..c8512845 Binary files /dev/null and b/Tools/Luban/Luban.Lua.dll differ diff --git a/Tools/Luban/Luban.Lua.pdb b/Tools/Luban/Luban.Lua.pdb new file mode 100644 index 00000000..b349b4fc Binary files /dev/null and b/Tools/Luban/Luban.Lua.pdb differ diff --git a/Tools/Luban/Luban.MsgPack.deps.json b/Tools/Luban/Luban.MsgPack.deps.json new file mode 100644 index 00000000..8d9d9fd6 --- /dev/null +++ b/Tools/Luban/Luban.MsgPack.deps.json @@ -0,0 +1,123 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.MsgPack/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "MessagePack": "2.5.192" + }, + "runtime": { + "Luban.MsgPack.dll": {} + } + }, + "MessagePack/2.5.192": { + "dependencies": { + "MessagePack.Annotations": "2.5.192", + "Microsoft.NET.StringTools": "17.6.3" + }, + "runtime": { + "lib/net6.0/MessagePack.dll": { + "assemblyVersion": "2.5.0.0", + "fileVersion": "2.5.192.54228" + } + } + }, + "MessagePack.Annotations/2.5.192": { + "runtime": { + "lib/netstandard2.0/MessagePack.Annotations.dll": { + "assemblyVersion": "2.5.0.0", + "fileVersion": "2.5.192.54228" + } + } + }, + "Microsoft.NET.StringTools/17.6.3": { + "runtime": { + "lib/net7.0/Microsoft.NET.StringTools.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "17.6.3.22601" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.MsgPack/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "MessagePack/2.5.192": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Jtle5MaFeIFkdXtxQeL9Tu2Y3HsAQGoSntOzrn6Br/jrl6c8QmG22GEioT5HBtZJR0zw0s46OnKU8ei2M3QifA==", + "path": "messagepack/2.5.192", + "hashPath": "messagepack.2.5.192.nupkg.sha512" + }, + "MessagePack.Annotations/2.5.192": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jaJuwcgovWIZ8Zysdyf3b7b34/BrADw4v82GaEZymUhDd3ScMPrYd/cttekeDteJJPXseJxp04yTIcxiVUjTWg==", + "path": "messagepack.annotations/2.5.192", + "hashPath": "messagepack.annotations.2.5.192.nupkg.sha512" + }, + "Microsoft.NET.StringTools/17.6.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N0ZIanl1QCgvUumEL1laasU0a7sOE5ZwLZVTn0pAePnfhq8P7SvTjF8Axq+CnavuQkmdQpGNXQ1efZtu5kDFbA==", + "path": "microsoft.net.stringtools/17.6.3", + "hashPath": "microsoft.net.stringtools.17.6.3.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.MsgPack.dll b/Tools/Luban/Luban.MsgPack.dll new file mode 100644 index 00000000..f28076fb Binary files /dev/null and b/Tools/Luban/Luban.MsgPack.dll differ diff --git a/Tools/Luban/Luban.MsgPack.pdb b/Tools/Luban/Luban.MsgPack.pdb new file mode 100644 index 00000000..db2b47a2 Binary files /dev/null and b/Tools/Luban/Luban.MsgPack.pdb differ diff --git a/Tools/Luban/Luban.PHP.deps.json b/Tools/Luban/Luban.PHP.deps.json new file mode 100644 index 00000000..6447dd88 --- /dev/null +++ b/Tools/Luban/Luban.PHP.deps.json @@ -0,0 +1,581 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.PHP/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.PHP.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataTarget.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.DataTarget.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.PHP/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataTarget.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.PHP.dll b/Tools/Luban/Luban.PHP.dll new file mode 100644 index 00000000..9a37cc26 Binary files /dev/null and b/Tools/Luban/Luban.PHP.dll differ diff --git a/Tools/Luban/Luban.PHP.pdb b/Tools/Luban/Luban.PHP.pdb new file mode 100644 index 00000000..02edceda Binary files /dev/null and b/Tools/Luban/Luban.PHP.pdb differ diff --git a/Tools/Luban/Luban.Protobuf.deps.json b/Tools/Luban/Luban.Protobuf.deps.json new file mode 100644 index 00000000..a791bf76 --- /dev/null +++ b/Tools/Luban/Luban.Protobuf.deps.json @@ -0,0 +1,597 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Protobuf/1.0.0": { + "dependencies": { + "Google.Protobuf": "3.29.0", + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Protobuf.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Google.Protobuf/3.29.0": { + "runtime": { + "lib/net5.0/Google.Protobuf.dll": { + "assemblyVersion": "3.29.0.0", + "fileVersion": "3.29.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataTarget.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.DataTarget.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Protobuf/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Google.Protobuf/3.29.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-l1012jd1Y2XsLQ+h9cXE7Bo3WruXql3Xc3KP/z+yZDJMSkfb2guslHCxwFsqd2ScHB0h2J7Yuy255RrBD/DGBw==", + "path": "google.protobuf/3.29.0", + "hashPath": "google.protobuf.3.29.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataTarget.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Protobuf.dll b/Tools/Luban/Luban.Protobuf.dll new file mode 100644 index 00000000..98c29f97 Binary files /dev/null and b/Tools/Luban/Luban.Protobuf.dll differ diff --git a/Tools/Luban/Luban.Protobuf.pdb b/Tools/Luban/Luban.Protobuf.pdb new file mode 100644 index 00000000..f53ae4c1 Binary files /dev/null and b/Tools/Luban/Luban.Protobuf.pdb differ diff --git a/Tools/Luban/Luban.Python.deps.json b/Tools/Luban/Luban.Python.deps.json new file mode 100644 index 00000000..9afffa95 --- /dev/null +++ b/Tools/Luban/Luban.Python.deps.json @@ -0,0 +1,581 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Python/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Python.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataTarget.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.DataTarget.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Python/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataTarget.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Python.dll b/Tools/Luban/Luban.Python.dll new file mode 100644 index 00000000..623ae567 Binary files /dev/null and b/Tools/Luban/Luban.Python.dll differ diff --git a/Tools/Luban/Luban.Python.pdb b/Tools/Luban/Luban.Python.pdb new file mode 100644 index 00000000..41f45669 Binary files /dev/null and b/Tools/Luban/Luban.Python.pdb differ diff --git a/Tools/Luban/Luban.Rust.deps.json b/Tools/Luban/Luban.Rust.deps.json new file mode 100644 index 00000000..63c7d1a1 --- /dev/null +++ b/Tools/Luban/Luban.Rust.deps.json @@ -0,0 +1,73 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Rust/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Rust.dll": {} + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Rust/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Rust.dll b/Tools/Luban/Luban.Rust.dll new file mode 100644 index 00000000..a01231ea Binary files /dev/null and b/Tools/Luban/Luban.Rust.dll differ diff --git a/Tools/Luban/Luban.Rust.pdb b/Tools/Luban/Luban.Rust.pdb new file mode 100644 index 00000000..314410d0 Binary files /dev/null and b/Tools/Luban/Luban.Rust.pdb differ diff --git a/Tools/Luban/Luban.Schema.Builtin.deps.json b/Tools/Luban/Luban.Schema.Builtin.deps.json new file mode 100644 index 00000000..0f78b600 --- /dev/null +++ b/Tools/Luban/Luban.Schema.Builtin.deps.json @@ -0,0 +1,564 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Schema.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Schema.Builtin.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Schema.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Schema.Builtin.dll b/Tools/Luban/Luban.Schema.Builtin.dll new file mode 100644 index 00000000..6ae0976b Binary files /dev/null and b/Tools/Luban/Luban.Schema.Builtin.dll differ diff --git a/Tools/Luban/Luban.Schema.Builtin.pdb b/Tools/Luban/Luban.Schema.Builtin.pdb new file mode 100644 index 00000000..c61afad1 Binary files /dev/null and b/Tools/Luban/Luban.Schema.Builtin.pdb differ diff --git a/Tools/Luban/Luban.Schema.Builtin.runtimeconfig.json b/Tools/Luban/Luban.Schema.Builtin.runtimeconfig.json new file mode 100644 index 00000000..44665024 --- /dev/null +++ b/Tools/Luban/Luban.Schema.Builtin.runtimeconfig.json @@ -0,0 +1,14 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "rollForward": "LatestMinor", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Reflection.Metadata.MetadataUpdater.IsSupported": false, + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Typescript.deps.json b/Tools/Luban/Luban.Typescript.deps.json new file mode 100644 index 00000000..e5855b06 --- /dev/null +++ b/Tools/Luban/Luban.Typescript.deps.json @@ -0,0 +1,615 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban.Typescript/1.0.0": { + "dependencies": { + "Luban.CSharp": "1.0.0", + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Typescript.dll": {} + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.CSharp/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataValidator.Builtin": "1.0.0" + }, + "runtime": { + "Luban.CSharp.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataTarget.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.DataTarget.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataValidator.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.DataValidator.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban.Typescript/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.CSharp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataTarget.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataValidator.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.Typescript.dll b/Tools/Luban/Luban.Typescript.dll new file mode 100644 index 00000000..caef9708 Binary files /dev/null and b/Tools/Luban/Luban.Typescript.dll differ diff --git a/Tools/Luban/Luban.Typescript.pdb b/Tools/Luban/Luban.Typescript.pdb new file mode 100644 index 00000000..43b14d96 Binary files /dev/null and b/Tools/Luban/Luban.Typescript.pdb differ diff --git a/Tools/Luban/Luban.deps.json b/Tools/Luban/Luban.deps.json new file mode 100644 index 00000000..e1dbfc66 --- /dev/null +++ b/Tools/Luban/Luban.deps.json @@ -0,0 +1,998 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Luban/3.10.0": { + "dependencies": { + "CommandLineParser": "2.9.1", + "Luban.Bson": "1.0.0", + "Luban.CSharp": "1.0.0", + "Luban.Core": "1.0.0", + "Luban.Cpp": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0", + "Luban.DataValidator.Builtin": "1.0.0", + "Luban.FlatBuffers": "1.0.0", + "Luban.Gdscript": "1.0.0", + "Luban.Golang": "1.0.0", + "Luban.Java": "1.0.0", + "Luban.L10N": "1.0.0", + "Luban.Lua": "1.0.0", + "Luban.MsgPack": "1.0.0", + "Luban.PHP": "1.0.0", + "Luban.Protobuf": "1.0.0", + "Luban.Python": "1.0.0", + "Luban.Rust": "1.0.0", + "Luban.Schema.Builtin": "1.0.0", + "Luban.Typescript": "1.0.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.dll": {} + } + }, + "CommandLineParser/2.9.1": { + "runtime": { + "lib/netstandard2.0/CommandLine.dll": { + "assemblyVersion": "2.9.1.0", + "fileVersion": "2.9.1.0" + } + } + }, + "ExcelDataReader/3.7.0": { + "runtime": { + "lib/netstandard2.1/ExcelDataReader.dll": { + "assemblyVersion": "3.7.0.0", + "fileVersion": "3.7.0.0" + } + } + }, + "Google.Protobuf/3.29.0": { + "runtime": { + "lib/net5.0/Google.Protobuf.dll": { + "assemblyVersion": "3.29.0.0", + "fileVersion": "3.29.0.0" + } + } + }, + "MessagePack/2.5.192": { + "dependencies": { + "MessagePack.Annotations": "2.5.192", + "Microsoft.NET.StringTools": "17.6.3" + }, + "runtime": { + "lib/net6.0/MessagePack.dll": { + "assemblyVersion": "2.5.0.0", + "fileVersion": "2.5.192.54228" + } + } + }, + "MessagePack.Annotations/2.5.192": { + "runtime": { + "lib/netstandard2.0/MessagePack.Annotations.dll": { + "assemblyVersion": "2.5.0.0", + "fileVersion": "2.5.192.54228" + } + } + }, + "Microsoft.CSharp/4.5.0": {}, + "Microsoft.NET.StringTools/17.6.3": { + "runtime": { + "lib/net7.0/Microsoft.NET.StringTools.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "17.6.3.22601" + } + } + }, + "Microsoft.NETCore.Platforms/1.0.1": {}, + "Microsoft.NETCore.Targets/1.0.1": {}, + "NeoLua/1.3.14": { + "dependencies": { + "Microsoft.CSharp": "4.5.0" + }, + "runtime": { + "lib/net5.0/Neo.Lua.dll": { + "assemblyVersion": "5.3.0.0", + "fileVersion": "1.3.14.0" + } + }, + "resources": { + "lib/net5.0/de/Neo.Lua.resources.dll": { + "locale": "de" + } + } + }, + "Newtonsoft.Json/13.0.1": { + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.1.25517" + } + } + }, + "Newtonsoft.Json.Bson/1.0.3": { + "dependencies": { + "Newtonsoft.Json": "13.0.1" + }, + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.Bson.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.3.29904" + } + } + }, + "NLog/5.3.4": { + "runtime": { + "lib/netstandard2.0/NLog.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.3.4.2778" + } + } + }, + "Scriban/5.12.0": { + "runtime": { + "lib/net7.0/Scriban.dll": { + "assemblyVersion": "5.0.0.0", + "fileVersion": "5.12.0.0" + } + } + }, + "System.Collections/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Debug/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.Tools/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.IO/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Linq/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.ObjectModel/4.0.12": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit/4.0.1": { + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Primitives/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions/4.1.0": { + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager/4.0.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "System.Runtime.Extensions/4.1.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "dependencies": { + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions/4.1.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading/4.0.11": { + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks/4.0.11": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Ude.NetStandard/1.2.0": { + "runtime": { + "lib/netstandard2.0/Ude.NetStandard.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } + }, + "YamlDotNet.NetCore/1.0.0": { + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection.Extensions": "4.0.1", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0" + }, + "runtime": { + "lib/netstandard1.0/YamlDotNet.NetCore.dll": { + "assemblyVersion": "0.0.1.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Luban.Bson/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Newtonsoft.Json.Bson": "1.0.3" + }, + "runtime": { + "Luban.Bson.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Core/1.0.0": { + "dependencies": { + "NLog": "5.3.4", + "Scriban": "5.12.0" + }, + "runtime": { + "Luban.Core.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Cpp/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Cpp.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.CSharp/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataValidator.Builtin": "1.0.0" + }, + "runtime": { + "Luban.CSharp.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataLoader.Builtin/1.0.0": { + "dependencies": { + "ExcelDataReader": "3.7.0", + "Luban.Core": "1.0.0", + "NeoLua": "1.3.14", + "Ude.NetStandard": "1.2.0", + "YamlDotNet.NetCore": "1.0.0" + }, + "runtime": { + "Luban.DataLoader.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataTarget.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.DataTarget.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.DataValidator.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.DataValidator.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.FlatBuffers/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.FlatBuffers.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Gdscript/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Gdscript.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Golang/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Golang.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Java/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Java.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.L10N/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.L10N.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Lua/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Lua.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.MsgPack/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "MessagePack": "2.5.192" + }, + "runtime": { + "Luban.MsgPack.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.PHP/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.PHP.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Protobuf/1.0.0": { + "dependencies": { + "Google.Protobuf": "3.29.0", + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Protobuf.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Python/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Python.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Rust/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0" + }, + "runtime": { + "Luban.Rust.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Schema.Builtin/1.0.0": { + "dependencies": { + "Luban.Core": "1.0.0", + "Luban.DataLoader.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Schema.Builtin.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Luban.Typescript/1.0.0": { + "dependencies": { + "Luban.CSharp": "1.0.0", + "Luban.Core": "1.0.0", + "Luban.DataTarget.Builtin": "1.0.0" + }, + "runtime": { + "Luban.Typescript.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "Luban/3.10.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "CommandLineParser/2.9.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", + "path": "commandlineparser/2.9.1", + "hashPath": "commandlineparser.2.9.1.nupkg.sha512" + }, + "ExcelDataReader/3.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AMv3oDETRHSRyXC17rBtKH45qIfFyo433LMeaMB3u4RNr/c9Luuc0Z+JMP6+3Cx9n4wXqFqcrEIVxrf/GgYnZg==", + "path": "exceldatareader/3.7.0", + "hashPath": "exceldatareader.3.7.0.nupkg.sha512" + }, + "Google.Protobuf/3.29.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-l1012jd1Y2XsLQ+h9cXE7Bo3WruXql3Xc3KP/z+yZDJMSkfb2guslHCxwFsqd2ScHB0h2J7Yuy255RrBD/DGBw==", + "path": "google.protobuf/3.29.0", + "hashPath": "google.protobuf.3.29.0.nupkg.sha512" + }, + "MessagePack/2.5.192": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Jtle5MaFeIFkdXtxQeL9Tu2Y3HsAQGoSntOzrn6Br/jrl6c8QmG22GEioT5HBtZJR0zw0s46OnKU8ei2M3QifA==", + "path": "messagepack/2.5.192", + "hashPath": "messagepack.2.5.192.nupkg.sha512" + }, + "MessagePack.Annotations/2.5.192": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jaJuwcgovWIZ8Zysdyf3b7b34/BrADw4v82GaEZymUhDd3ScMPrYd/cttekeDteJJPXseJxp04yTIcxiVUjTWg==", + "path": "messagepack.annotations/2.5.192", + "hashPath": "messagepack.annotations.2.5.192.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.NET.StringTools/17.6.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N0ZIanl1QCgvUumEL1laasU0a7sOE5ZwLZVTn0pAePnfhq8P7SvTjF8Axq+CnavuQkmdQpGNXQ1efZtu5kDFbA==", + "path": "microsoft.net.stringtools/17.6.3", + "hashPath": "microsoft.net.stringtools.17.6.3.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==", + "path": "microsoft.netcore.platforms/1.0.1", + "hashPath": "microsoft.netcore.platforms.1.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==", + "path": "microsoft.netcore.targets/1.0.1", + "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512" + }, + "NeoLua/1.3.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BXIUN+ePY2wx3ZGiSmR8KZKD85s01pXI690orrB3u/biB8R0nalziGw+iGbPBq1Cuz8Upggpw2ERF84POXWTCQ==", + "path": "neolua/1.3.14", + "hashPath": "neolua.1.3.14.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==", + "path": "newtonsoft.json/13.0.1", + "hashPath": "newtonsoft.json.13.0.1.nupkg.sha512" + }, + "Newtonsoft.Json.Bson/1.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bCcwagnHfYnhwQfY1criEcn6Hy9PtBuVnZu0pA8hmRhuR3jI/8WxVgoVAdNw9BJ3JHkxmWJzpj/AQy+PMMLqxg==", + "path": "newtonsoft.json.bson/1.0.3", + "hashPath": "newtonsoft.json.bson.1.0.3.nupkg.sha512" + }, + "NLog/5.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gLy7+O1hEYJXIlcTr1/VWjGXrZTQFZzYNO18IWasD64pNwz0BreV+nHLxWKXWZzERRzoKnsk2XYtwLkTVk7J1A==", + "path": "nlog/5.3.4", + "hashPath": "nlog.5.3.4.nupkg.sha512" + }, + "Scriban/5.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/YTTCxjBIpfwX3MKMT4JMFVl1jX4IHW7zih+Bg3cTIkzGnbFt+B3l/k90ILDw6DRiFE7T+VxEyls7zk4p029ng==", + "path": "scriban/5.12.0", + "hashPath": "scriban.5.12.0.nupkg.sha512" + }, + "System.Collections/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "path": "system.collections/4.0.11", + "hashPath": "system.collections.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "path": "system.diagnostics.debug/4.0.11", + "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "path": "system.diagnostics.tools/4.0.1", + "hashPath": "system.diagnostics.tools.4.0.1.nupkg.sha512" + }, + "System.Globalization/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "path": "system.globalization/4.0.11", + "hashPath": "system.globalization.4.0.11.nupkg.sha512" + }, + "System.IO/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "path": "system.io/4.1.0", + "hashPath": "system.io.4.1.0.nupkg.sha512" + }, + "System.Linq/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "path": "system.linq/4.1.0", + "hashPath": "system.linq.4.1.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "path": "system.linq.expressions/4.1.0", + "hashPath": "system.linq.expressions.4.1.0.nupkg.sha512" + }, + "System.ObjectModel/4.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "path": "system.objectmodel/4.0.12", + "hashPath": "system.objectmodel.4.0.12.nupkg.sha512" + }, + "System.Reflection/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "path": "system.reflection/4.1.0", + "hashPath": "system.reflection.4.1.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "path": "system.reflection.emit/4.0.1", + "hashPath": "system.reflection.emit.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "path": "system.reflection.emit.ilgeneration/4.0.1", + "hashPath": "system.reflection.emit.ilgeneration.4.0.1.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "path": "system.reflection.emit.lightweight/4.0.1", + "hashPath": "system.reflection.emit.lightweight.4.0.1.nupkg.sha512" + }, + "System.Reflection.Extensions/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "path": "system.reflection.extensions/4.0.1", + "hashPath": "system.reflection.extensions.4.0.1.nupkg.sha512" + }, + "System.Reflection.Primitives/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "path": "system.reflection.primitives/4.0.1", + "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "path": "system.reflection.typeextensions/4.1.0", + "hashPath": "system.reflection.typeextensions.4.1.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "path": "system.resources.resourcemanager/4.0.1", + "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512" + }, + "System.Runtime/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "path": "system.runtime/4.1.0", + "hashPath": "system.runtime.4.1.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "path": "system.runtime.extensions/4.1.0", + "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HZ6Du5QrTG8MNJbf4e4qMO3JRAkIboGT5Fk804uZtg3Gq516S7hAqTm2UZKUHa7/6HUGdVy3AqMQKbns06G/cg==", + "path": "system.runtime.serialization.primitives/4.1.1", + "hashPath": "system.runtime.serialization.primitives.4.1.1.nupkg.sha512" + }, + "System.Text.Encoding/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "path": "system.text.encoding/4.0.11", + "hashPath": "system.text.encoding.4.0.11.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "path": "system.text.encoding.extensions/4.0.11", + "hashPath": "system.text.encoding.extensions.4.0.11.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "path": "system.text.regularexpressions/4.1.0", + "hashPath": "system.text.regularexpressions.4.1.0.nupkg.sha512" + }, + "System.Threading/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "path": "system.threading/4.0.11", + "hashPath": "system.threading.4.0.11.nupkg.sha512" + }, + "System.Threading.Tasks/4.0.11": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "path": "system.threading.tasks/4.0.11", + "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512" + }, + "Ude.NetStandard/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zRWpPAxBg3lNdm4UiKixTe+DFPoNid9CILggTCy/0WR2WKETe17kTWhiiIpLB2k5IEgnvA0QLfKlvd6Tvu0pzA==", + "path": "ude.netstandard/1.2.0", + "hashPath": "ude.netstandard.1.2.0.nupkg.sha512" + }, + "YamlDotNet.NetCore/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vPiKF4Yf02MS96Nzwcr8+WrvlhTx+camOgUzxhazU0hCzs2ESetWDCxaIT/MYdAw2oONYem1ow9PXWJjHkRUDw==", + "path": "yamldotnet.netcore/1.0.0", + "hashPath": "yamldotnet.netcore.1.0.0.nupkg.sha512" + }, + "Luban.Bson/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Core/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Cpp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.CSharp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataLoader.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataTarget.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.DataValidator.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.FlatBuffers/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Gdscript/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Golang/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Java/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.L10N/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Lua/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.MsgPack/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.PHP/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Protobuf/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Python/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Rust/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Schema.Builtin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Luban.Typescript/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tools/Luban/Luban.dll b/Tools/Luban/Luban.dll new file mode 100644 index 00000000..af6caed6 Binary files /dev/null and b/Tools/Luban/Luban.dll differ diff --git a/Tools/Luban/Luban.exe b/Tools/Luban/Luban.exe new file mode 100644 index 00000000..cadd3dd7 Binary files /dev/null and b/Tools/Luban/Luban.exe differ diff --git a/Tools/Luban/Luban.pdb b/Tools/Luban/Luban.pdb new file mode 100644 index 00000000..d37122ea Binary files /dev/null and b/Tools/Luban/Luban.pdb differ diff --git a/Tools/Luban/Luban.runtimeconfig.json b/Tools/Luban/Luban.runtimeconfig.json new file mode 100644 index 00000000..d7845156 --- /dev/null +++ b/Tools/Luban/Luban.runtimeconfig.json @@ -0,0 +1,13 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Reflection.Metadata.MetadataUpdater.IsSupported": false, + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/Tools/Luban/MessagePack.Annotations.dll b/Tools/Luban/MessagePack.Annotations.dll new file mode 100644 index 00000000..b3a3f489 Binary files /dev/null and b/Tools/Luban/MessagePack.Annotations.dll differ diff --git a/Tools/Luban/MessagePack.dll b/Tools/Luban/MessagePack.dll new file mode 100644 index 00000000..ed883d08 Binary files /dev/null and b/Tools/Luban/MessagePack.dll differ diff --git a/Tools/Luban/Microsoft.NET.StringTools.dll b/Tools/Luban/Microsoft.NET.StringTools.dll new file mode 100644 index 00000000..7d304399 Binary files /dev/null and b/Tools/Luban/Microsoft.NET.StringTools.dll differ diff --git a/Tools/Luban/NLog.dll b/Tools/Luban/NLog.dll new file mode 100644 index 00000000..49604e19 Binary files /dev/null and b/Tools/Luban/NLog.dll differ diff --git a/Tools/Luban/Neo.Lua.dll b/Tools/Luban/Neo.Lua.dll new file mode 100644 index 00000000..406f580c Binary files /dev/null and b/Tools/Luban/Neo.Lua.dll differ diff --git a/Tools/Luban/Newtonsoft.Json.Bson.dll b/Tools/Luban/Newtonsoft.Json.Bson.dll new file mode 100644 index 00000000..159d2edc Binary files /dev/null and b/Tools/Luban/Newtonsoft.Json.Bson.dll differ diff --git a/Tools/Luban/Newtonsoft.Json.dll b/Tools/Luban/Newtonsoft.Json.dll new file mode 100644 index 00000000..1ffeabe6 Binary files /dev/null and b/Tools/Luban/Newtonsoft.Json.dll differ diff --git a/Tools/Luban/Scriban.dll b/Tools/Luban/Scriban.dll new file mode 100644 index 00000000..c8131e2e Binary files /dev/null and b/Tools/Luban/Scriban.dll differ diff --git a/Tools/Luban/Templates/common/cpp/enum.sbn b/Tools/Luban/Templates/common/cpp/enum.sbn new file mode 100644 index 00000000..b9f3b0a5 --- /dev/null +++ b/Tools/Luban/Templates/common/cpp/enum.sbn @@ -0,0 +1,23 @@ +{{~ + comment = __enum.comment + items = __enum.items +~}} +{{namespace_with_grace_begin __namespace}} +{{~if comment != '' ~}} + /// + /// {{escape_comment comment}} + /// +{{~end~}} + enum class {{__name}} + { + {{~ for item in items ~}} +{{~if item.comment != '' ~}} + /// + /// {{escape_comment item.comment_or_alias}} + /// +{{~end~}} + {{format_enum_item_name __code_style item.name}} = {{item.value}}, + {{~end~}} + }; + +{{namespace_with_grace_end __namespace}} diff --git a/Tools/Luban/Templates/common/cs/enum.sbn b/Tools/Luban/Templates/common/cs/enum.sbn new file mode 100644 index 00000000..4dcd9b67 --- /dev/null +++ b/Tools/Luban/Templates/common/cs/enum.sbn @@ -0,0 +1,28 @@ +{{~ + comment = __enum.comment + items = __enum.items +~}} + + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if comment != '' ~}} + /// + /// {{escape_comment comment}} + /// +{{~end~}} + {{~if __enum.is_flags~}} + [System.Flags] + {{~end~}} + public enum {{__name}} + { + {{~ for item in items ~}} +{{~if item.comment != '' ~}} + /// + /// {{escape_comment item.comment_or_alias}} + /// +{{~end~}} + {{format_enum_item_name __code_style item.name}} = {{item.value}}, + {{~end~}} + } + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/common/go/enum.sbn b/Tools/Luban/Templates/common/go/enum.sbn new file mode 100644 index 00000000..7dd70a6b --- /dev/null +++ b/Tools/Luban/Templates/common/go/enum.sbn @@ -0,0 +1,19 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +const ( + {{~ for item in __this.items ~}} +{{~if item.comment_or_alias != '' ~}} + /** + * {{escape_comment item.comment_or_alias}} + */ +{{~end~}} + {{full_name __this}}_{{item.name}} = {{item.int_value}}; + {{~end~}} +) diff --git a/Tools/Luban/Templates/common/java/enum.sbn b/Tools/Luban/Templates/common/java/enum.sbn new file mode 100644 index 00000000..142d8a13 --- /dev/null +++ b/Tools/Luban/Templates/common/java/enum.sbn @@ -0,0 +1,19 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public final class {{__name}} { + {{~ for item in __this.items ~}} +{{~if item.comment_or_alias != '' ~}} + /** + * {{escape_comment item.comment_or_alias}} + */ +{{~end~}} + public static final int {{item.name}} = {{item.int_value}}; + {{~end~}} +} diff --git a/Tools/Luban/Templates/common/php/enum.sbn b/Tools/Luban/Templates/common/php/enum.sbn new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/Tools/Luban/Templates/common/php/enum.sbn @@ -0,0 +1,2 @@ + + diff --git a/Tools/Luban/Templates/common/rs/macros/Cargo.toml.sbn b/Tools/Luban/Templates/common/rs/macros/Cargo.toml.sbn new file mode 100644 index 00000000..ae3a110d --- /dev/null +++ b/Tools/Luban/Templates/common/rs/macros/Cargo.toml.sbn @@ -0,0 +1,14 @@ +[package] +name = "macros" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +quote = "1.0.36" +syn = "2.0.60" +proc-macro2 = "1.0.82" + +[lib] +proc-macro = true \ No newline at end of file diff --git a/Tools/Luban/Templates/common/rs/macros/src/lib.rs.sbn b/Tools/Luban/Templates/common/rs/macros/src/lib.rs.sbn new file mode 100644 index 00000000..7e93f74b --- /dev/null +++ b/Tools/Luban/Templates/common/rs/macros/src/lib.rs.sbn @@ -0,0 +1,65 @@ +#[macro_use] +extern crate quote; + +use proc_macro::TokenStream; +use proc_macro2; +use quote::{format_ident, quote, ToTokens}; +use syn::{parse_macro_input, Data, DeriveInput}; + +#[proc_macro_derive(TryIntoBase)] +pub fn base_try_from(item: TokenStream) -> TokenStream { + let derive_input = parse_macro_input!(item as DeriveInput); + let ty_name = &derive_input.ident; + + match derive_input.data { + Data::Struct(_) => {} + _ => panic!("base_try_from can only be used on structs or enums"), + } + + let expanded = quote! { + impl<'a> TryFrom<&'a AbstractBase> for &'a #ty_name { + type Error = String; + + fn try_from(value: &'a AbstractBase) -> Result { + let r = value.downcast_ref::<#ty_name>(); + if let Some(v) = r { + return Ok(v); + } + + Err(concat!("can not into to ", stringify!(#ty_name)).to_string()) + } + } + }; + + TokenStream::from(expanded) +} + +#[proc_macro_derive(EnumFromNum)] +pub fn enum_from_num(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as DeriveInput); + let ty_name = &input.ident; + + + let tokens = vec![ + format_ident!("i64"), + format_ident!("i16"), + format_ident!("i8"), + format_ident!("isize"), + format_ident!("u64"), + format_ident!("u32"), + format_ident!("u16"), + format_ident!("u8"), + format_ident!("usize"), + format_ident!("f64"), + format_ident!("f32"), + ]; + quote! { + #( + impl From<#tokens> for #ty_name { + fn from(value: #tokens) -> Self { + (value as i32).into() + } + } + )* + }.into() +} \ No newline at end of file diff --git a/Tools/Luban/Templates/common/ts/enum.sbn b/Tools/Luban/Templates/common/ts/enum.sbn new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/Tools/Luban/Templates/common/ts/enum.sbn @@ -0,0 +1,2 @@ + + diff --git a/Tools/Luban/Templates/cpp-rawptr-bin/bean.sbn b/Tools/Luban/Templates/cpp-rawptr-bin/bean.sbn new file mode 100644 index 00000000..2b856b0a --- /dev/null +++ b/Tools/Luban/Templates/cpp-rawptr-bin/bean.sbn @@ -0,0 +1,32 @@ +{{namespace_with_grace_begin __namespace}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +struct {{__name}} : public{{if __parent_def_type}} {{make_cpp_name __parent_def_type.full_name}} {{else}} luban::CfgBean {{end}} +{ + static bool deserialize{{__name}}(::luban::ByteBuf& _buf, {{__name}}*& _out); + + virtual ~{{__name}}() {} + + bool deserialize(::luban::ByteBuf& _buf); + + {{~ for field in __export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + {{~end~}} + +{{~if !__this.is_abstract_type~}} + static constexpr int __ID__ = {{__this.id}}; + + int getTypeId() const override { return __ID__; } +{{~end~}} +}; + +{{namespace_with_grace_end __namespace}} diff --git a/Tools/Luban/Templates/cpp-rawptr-bin/schema_cpp.sbn b/Tools/Luban/Templates/cpp-rawptr-bin/schema_cpp.sbn new file mode 100644 index 00000000..18c15312 --- /dev/null +++ b/Tools/Luban/Templates/cpp-rawptr-bin/schema_cpp.sbn @@ -0,0 +1,45 @@ +#include "{{__schema_header_file}}" + +{{namespace_with_grace_begin __top_module}} + +{{~for bean in __beans~}} + +bool {{make_cpp_name bean.full_name}}::deserialize(::luban::ByteBuf& _buf) +{ + {{~if bean.parent_def_type~}} + if (!{{make_cpp_name bean.parent_def_type.full_name}}::deserialize(_buf)) + { + return false; + } + {{~end~}} + + {{~ for field in bean.export_fields ~}} + {{deserialize '_buf' (format_field_name __code_style field.name) field.ctype}} + {{~end~}} + + return true; +} + +{{~if bean.is_abstract_type~}} +bool {{make_cpp_name bean.full_name}}::deserialize{{bean.name}}(::luban::ByteBuf& _buf, {{make_cpp_name bean.full_name}}*& _out) +{ + int32_t id; + if (!_buf.readInt(id)) return false; + switch (id) + { + {{~for child in bean.hierarchy_not_abstract_children~}} + case {{make_type_cpp_name child}}::__ID__: { _out = LUBAN_NEW({{make_type_cpp_name child}}); if (_out->deserialize(_buf)) { return true; } else { _out = nullptr; return false;} } + {{~end~}} + default: { _out = nullptr; return false;} + } +} +{{~else~}} +bool {{make_cpp_name bean.full_name}}::deserialize{{bean.name}}(::luban::ByteBuf& _buf, {{make_cpp_name bean.full_name}}*& _out) +{ + _out = LUBAN_NEW({{make_type_cpp_name bean}}); + return _out->deserialize(_buf); +} +{{~end~}} + +{{~end~}} +{{namespace_with_grace_end __top_module}} diff --git a/Tools/Luban/Templates/cpp-rawptr-bin/schema_h.sbn b/Tools/Luban/Templates/cpp-rawptr-bin/schema_h.sbn new file mode 100644 index 00000000..90ba84cb --- /dev/null +++ b/Tools/Luban/Templates/cpp-rawptr-bin/schema_h.sbn @@ -0,0 +1,21 @@ +#pragma once +#include +#include + +#include "CfgBean.h" + +{{namespace_with_grace_begin __top_module}} + +{{__enum_codes~}} + +{{~for b in __beans~}} +{{namespace_with_grace_begin b.namespace}} struct {{b.name}}; {{namespace_with_grace_end b.namespace}} +{{~end~}} + +{{~__bean_codes~}} + +{{~__table_codes~}} + +{{__tables_code}} + +{{namespace_with_grace_end __top_module}} diff --git a/Tools/Luban/Templates/cpp-rawptr-bin/table.sbn b/Tools/Luban/Templates/cpp-rawptr-bin/table.sbn new file mode 100644 index 00000000..511a5463 --- /dev/null +++ b/Tools/Luban/Templates/cpp-rawptr-bin/table.sbn @@ -0,0 +1,134 @@ +{{namespace_with_grace_begin __namespace}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} + +class {{__name}} +{ + {{~if __this.is_map_table ~}} + private: + ::luban::HashMap<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + ::luban::Vector<{{declaring_type_name __value_type}}> _dataList; + + public: + ~{{__name}}() + { + for (auto& _v : _dataList) + { + LUBAN_FREE(_v); + } + } + + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + for(; n > 0 ; --n) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.push_back(_v); + _dataMap[_v->{{format_field_name __code_style __this.index_field.name}}] = _v; + } + return true; + } + + const ::luban::HashMap<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>& getDataMap() const { return _dataMap; } + const ::luban::Vector<{{declaring_type_name __value_type}}>& getDataList() const { return _dataList; } + + {{declaring_type_name __value_type}} get({{declaring_type_name __key_type}} key) + { + auto it = _dataMap.find(key); + return it != _dataMap.end() ? it->second : nullptr; + } + + {{~else if __this.is_list_table~}} + private: + ::luban::Vector<{{declaring_type_name __value_type}}> _dataList; + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + ::luban::HashMap<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~else~}} + {{~end~}} + + public: + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + for(; n > 0 ; --n) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.push_back(_v); + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + _dataMap_{{idx.index_field.name}}[_v->{{idx.index_field.name}}] = _v; + {{~end~}} + {{~else~}} + {{~end~}} + } + return true; + } + + const ::luban::Vector<{{declaring_type_name __value_type}}>& getDataList() const { return _dataList; } + + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + ::luban::HashMap<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>& getDataMapBy{{idx.index_field.name}}() + { + return _dataMap_{{idx.index_field.name}}; + } + + {{declaring_type_name __value_type}} getBy{{idx.index_field.name}}({{declaring_type_name idx.type}} key) + { + auto it = _dataMap_{{idx.index_field.name}}.find(key); + return it != _dataMap_{{idx.index_field.name}}.end() ? it->second : nullptr; + } + {{~end~}} + {{~else~}} + + {{declaring_type_name __value_type}} get(size_t index) const + { + return _dataList[index]; + } + {{~end~}} + {{~else~}} + private: + {{declaring_type_name __value_type}} _data; + + public: + {{declaring_type_name __value_type}} data() const { return _data; } + + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + if (n != 1) return false; + {{deserialize '_buf' '_data' __value_type}} + return true; + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + {{declaring_type_name field.ctype}}& {{getter_name field.name}}() const { return _data->{{format_field_name __code_style field.name}}; } + {{~end~}} + {{~end~}} +}; + +{{namespace_with_grace_end __namespace}} diff --git a/Tools/Luban/Templates/cpp-rawptr-bin/tables.sbn b/Tools/Luban/Templates/cpp-rawptr-bin/tables.sbn new file mode 100644 index 00000000..76354d59 --- /dev/null +++ b/Tools/Luban/Templates/cpp-rawptr-bin/tables.sbn @@ -0,0 +1,23 @@ +class {{__name}} +{ + public: + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + {{make_cpp_name table.full_name}} {{table.name}}; + {{~end~}} + + bool load(::luban::Loader<::luban::ByteBuf> loader) + { + ::luban::ByteBuf buf; + {{~for table in __tables~}} + buf.clear(); + if (!loader(buf, "{{table.output_data_file}}")) return false; + if (!{{table.name}}.load(buf)) return false; + {{~end~}} + return true; + } +}; diff --git a/Tools/Luban/Templates/cpp-sharedptr-bin/bean.sbn b/Tools/Luban/Templates/cpp-sharedptr-bin/bean.sbn new file mode 100644 index 00000000..f55cd315 --- /dev/null +++ b/Tools/Luban/Templates/cpp-sharedptr-bin/bean.sbn @@ -0,0 +1,32 @@ +{{namespace_with_grace_begin __namespace}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +struct {{__name}} : public{{if __parent_def_type}} {{make_cpp_name __parent_def_type.full_name}} {{else}} luban::CfgBean {{end}} +{ + static bool deserialize{{__name}}(::luban::ByteBuf& _buf, ::luban::SharedPtr<{{__name}}>& _out); + + virtual ~{{__name}}() {} + + bool deserialize(::luban::ByteBuf& _buf); + + {{~ for field in __export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + {{~end~}} + +{{~if !__this.is_abstract_type~}} + static constexpr int __ID__ = {{__this.id}}; + + int getTypeId() const override { return __ID__; } +{{~end~}} +}; + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/Tools/Luban/Templates/cpp-sharedptr-bin/schema_cpp.sbn b/Tools/Luban/Templates/cpp-sharedptr-bin/schema_cpp.sbn new file mode 100644 index 00000000..1d1a92c1 --- /dev/null +++ b/Tools/Luban/Templates/cpp-sharedptr-bin/schema_cpp.sbn @@ -0,0 +1,50 @@ +#include "{{__schema_header_file}}" + +{{namespace_with_grace_begin __top_module}} + +{{~for bean in __beans~}} + +bool {{make_cpp_name bean.full_name}}::deserialize(::luban::ByteBuf& _buf) +{ + {{~if bean.parent_def_type~}} + if (!{{make_cpp_name bean.parent_def_type.full_name}}::deserialize(_buf)) + { + return false; + } + {{~end~}} + + {{~ for field in bean.export_fields ~}} + {{deserialize '_buf' (format_field_name __code_style field.name) field.ctype}} + {{~end~}} + + return true; +} + +bool {{make_cpp_name bean.full_name}}::deserialize{{bean.name}}(::luban::ByteBuf& _buf, ::luban::SharedPtr<{{make_cpp_name bean.full_name}}>& _out) +{ +{{~if bean.is_abstract_type~}} + int32_t id; + if (!_buf.readInt(id)) return false; + switch (id) + { + {{~for child in bean.hierarchy_not_abstract_children~}} + case {{make_type_cpp_name child}}::__ID__: { _out.reset(LUBAN_NEW({{make_type_cpp_name child}})); if (_out->deserialize(_buf)) { return true; } else { _out.reset(); return false;} } + {{~end~}} + default: { _out = nullptr; return false;} + } +{{~else~}} + _out.reset(LUBAN_NEW({{make_type_cpp_name bean}})); + if (_out->deserialize(_buf)) + { + return true; + } + else + { + _out.reset(); + return false; + } +{{~end~}} +} + +{{~end~}} +{{namespace_with_grace_end __top_module}} diff --git a/Tools/Luban/Templates/cpp-sharedptr-bin/schema_h.sbn b/Tools/Luban/Templates/cpp-sharedptr-bin/schema_h.sbn new file mode 100644 index 00000000..90ba84cb --- /dev/null +++ b/Tools/Luban/Templates/cpp-sharedptr-bin/schema_h.sbn @@ -0,0 +1,21 @@ +#pragma once +#include +#include + +#include "CfgBean.h" + +{{namespace_with_grace_begin __top_module}} + +{{__enum_codes~}} + +{{~for b in __beans~}} +{{namespace_with_grace_begin b.namespace}} struct {{b.name}}; {{namespace_with_grace_end b.namespace}} +{{~end~}} + +{{~__bean_codes~}} + +{{~__table_codes~}} + +{{__tables_code}} + +{{namespace_with_grace_end __top_module}} diff --git a/Tools/Luban/Templates/cpp-sharedptr-bin/table.sbn b/Tools/Luban/Templates/cpp-sharedptr-bin/table.sbn new file mode 100644 index 00000000..f8838472 --- /dev/null +++ b/Tools/Luban/Templates/cpp-sharedptr-bin/table.sbn @@ -0,0 +1,140 @@ +{{namespace_with_grace_begin __namespace}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} + +class {{__name}} +{ + {{~if __this.is_map_table ~}} + private: + ::luban::HashMap<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + ::luban::Vector<{{declaring_type_name __value_type}}> _dataList; + + public: + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + for(; n > 0 ; --n) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.push_back(_v); + _dataMap[_v->{{format_field_name __code_style __this.index_field.name}}] = _v; + } + return true; + } + + const ::luban::HashMap<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>& getDataMap() const { return _dataMap; } + const ::luban::Vector<{{declaring_type_name __value_type}}>& getDataList() const { return _dataList; } + + {{make_type_cpp_name __value_type.def_bean}}* getRaw({{declaring_type_name __key_type}} key) + { + auto it = _dataMap.find(key); + return it != _dataMap.end() ? it->second.get() : nullptr; + } + + {{declaring_type_name __value_type}} get({{declaring_type_name __key_type}} key) + { + auto it = _dataMap.find(key); + return it != _dataMap.end() ? it->second : nullptr; + } + + {{~else if __this.is_list_table~}} + private: + ::luban::Vector<{{declaring_type_name __value_type}}> _dataList; + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + ::luban::HashMap<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~else~}} + {{~end~}} + + public: + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + for(; n > 0 ; --n) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.push_back(_v); + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + _dataMap_{{idx.index_field.name}}[_v->{{idx.index_field.name}}] = _v; + {{~end~}} + {{~else~}} + {{~end~}} + } + return true; + } + + const ::luban::Vector<{{declaring_type_name __value_type}}>& getDataList() const { return _dataList; } + + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + ::luban::HashMap<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>& getDataMapBy{{idx.index_field.name}}() + { + return _dataMap_{{idx.index_field.name}}; + } + {{make_type_cpp_name __value_type.def_bean}}* getRawBy{{idx.index_field.name}}({{declaring_type_name idx.type}} key) + { + auto it = _dataMap_{{idx.index_field.name}}.find(key); + return it != _dataMap_{{idx.index_field.name}}.end() ? it->second.get() : nullptr; + } + {{declaring_type_name __value_type}} getBy{{idx.index_field.name}}({{declaring_type_name idx.type}} key) + { + auto it = _dataMap_{{idx.index_field.name}}.find(key); + return it != _dataMap_{{idx.index_field.name}}.end() ? it->second : nullptr; + } + {{~end~}} + {{~else~}} + {{make_type_cpp_name __value_type.def_bean}}* getRaw(size_t index) const + { + return _dataList[index].get(); + } + + {{declaring_type_name __value_type}} get(size_t index) const + { + return _dataList[index]; + } + {{~end~}} + {{~else~}} + private: + {{declaring_type_name __value_type}} _data; + + public: + {{declaring_type_name __value_type}} data() const { return _data; } + + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + if (n != 1) return false; + {{deserialize '_buf' '_data' __value_type}} + return true; + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + {{declaring_type_name field.ctype}}& {{getter_name field.name}}() const { return _data->{{format_field_name __code_style field.name}}; } + {{~end~}} + {{~end~}} +}; + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/Tools/Luban/Templates/cpp-sharedptr-bin/tables.sbn b/Tools/Luban/Templates/cpp-sharedptr-bin/tables.sbn new file mode 100644 index 00000000..76354d59 --- /dev/null +++ b/Tools/Luban/Templates/cpp-sharedptr-bin/tables.sbn @@ -0,0 +1,23 @@ +class {{__name}} +{ + public: + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + {{make_cpp_name table.full_name}} {{table.name}}; + {{~end~}} + + bool load(::luban::Loader<::luban::ByteBuf> loader) + { + ::luban::ByteBuf buf; + {{~for table in __tables~}} + buf.clear(); + if (!loader(buf, "{{table.output_data_file}}")) return false; + if (!{{table.name}}.load(buf)) return false; + {{~end~}} + return true; + } +}; diff --git a/Tools/Luban/Templates/cs-bin/bean.sbn b/Tools/Luban/Templates/cs-bin/bean.sbn new file mode 100644 index 00000000..53ce23da --- /dev/null +++ b/Tools/Luban/Templates/cs-bin/bean.sbn @@ -0,0 +1,151 @@ +using Luban; +{{ + parent_def_type = __bean.parent_def_type + export_fields = __bean.export_fields + hierarchy_export_fields = __bean.hierarchy_export_fields +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __bean.comment != '' ~}} +/// +/// {{escape_comment __bean.comment}} +/// +{{~end~}} +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_Ref' +end + +func get_index_var_name + ret (format_property_name __code_style $0.name) + '_Index' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = format_property_name __code_style refTable.name + if field.is_nullable + ret (get_ref_name field) + ' = ' + fieldName + '!= null ? tables.' + tableName + '.GetOrDefault(' + (get_value_of_nullable_type field.ctype fieldName) + ') : null;' + else + ret (get_ref_name field) + ' = tables.' + tableName + '.GetOrDefault(' + fieldName + ');' + end + else if can_generate_collection_ref field + collection_ref_table = get_collection_ref_table field + tableName = format_property_name __code_style collection_ref_table.name + if field.ctype.type_name == 'list' || field.ctype.type_name == 'set' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var _v in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(tables.' + tableName + '.GetOrDefault(_v)); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'array' + line1 = (get_ref_name field) + ' = new ' + (declaring_type_name collection_ref_table.value_ttype) + '[' + fieldName + '.Length];' + '\n' + line2 = 'for (int _i = 0; _i < ' + fieldName + '.Length; _i++) { ' + (get_ref_name field) + '[_i] = tables.' + tableName + '.GetOrDefault(' + fieldName + '[_i]); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'map' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var kvp in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(kvp.Key, tables.' + tableName + '.GetOrDefault(kvp.Value)); }' + '\n' + ret line1 + line2 + else + ret '' + end + else + if (is_field_bean_need_resolve_ref field) + ret fieldName + '?.ResolveRef(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + ') { _e?.ResolveRef(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + '.Values) { _e?.ResolveRef(tables); }' + else + ret '' + end + end +end +~}} +{{~if __bean.is_value_type~}} +public partial struct {{__name}} +{{~else~}} +public {{class_modifier __bean}} partial class {{__name}} : {{if parent_def_type}}{{__bean.parent}}{{else}}Luban.BeanBase{{end}} +{{~end~}} +{ + public {{__name}}(ByteBuf _buf) {{if parent_def_type}} : base(_buf) {{end}} + { + {{~ for field in export_fields + fieldName = format_property_name __code_style field.name + ~}} + {{deserialize '_buf' fieldName field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}} = null; + {{~end~}} + {{~if has_index field~}} + foreach(var _v in {{fieldName}}) + { + {{get_index_var_name field}}.Add(_v.{{format_property_name __code_style (get_index_field field).name}}, _v); + } + {{~end~}} + {{~end~}} + } + + public static {{__name}} Deserialize{{__name}}(ByteBuf _buf) + { + {{~if __bean.is_abstract_type~}} + switch (_buf.ReadInt()) + { + {{~for child in __bean.hierarchy_not_abstract_children~}} + case {{child.full_name}}.__ID__: return new {{child.full_name}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__bean.full_name}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public readonly {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}}; + {{~if can_generate_ref field~}} + public {{declaring_type_name (get_ref_type field)}} {{get_ref_name field}}; + {{~else if can_generate_collection_ref field~}} + public {{declaring_collection_ref_name field.ctype}} {{get_ref_name field}}; + {{~end~}} + {{~if has_index field + indexMapType = get_index_map_type field + ~}} + public readonly {{declaring_type_name indexMapType}} {{get_index_var_name field}} = new {{declaring_type_name indexMapType}}(); + {{~end~}} + {{~end~}} + +{{~if !__bean.is_abstract_type && !__bean.is_value_type~}} + public const int __ID__ = {{__bean.id}}; + public override int GetTypeId() => __ID__; +{{~end~}} + + public {{method_modifier __bean}} void ResolveRef({{__manager_name}} tables) + { + {{~if parent_def_type~}} + base.ResolveRef(tables); + {{~end~}} + {{~for field in export_fields~}} + {{~ line = generate_resolve_field_ref field ~}} + {{~ if line != ''~}} + {{line}} + {{~end~}} + {{~end~}} + } + + public override string ToString() + { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{to_pretty_string (format_property_name __code_style field.name) field.ctype}} + "," + {{~end~}} + + "}"; + } +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-bin/table.sbn b/Tools/Luban/Templates/cs-bin/table.sbn new file mode 100644 index 00000000..72710d6d --- /dev/null +++ b/Tools/Luban/Templates/cs-bin/table.sbn @@ -0,0 +1,163 @@ +using Luban; + +{{ + key_type = __table.key_ttype + value_type = __table.value_ttype + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'System.Collections.Generic.Dictionary<(' + (array.each __table.index_list @index_type_name | array.join ', ') + '), ' + (declaring_type_name value_type) + '>' + end + + func table_key_list + varName = $0 + indexList = __table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = __table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = __table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __table.comment != '' ~}} +/// +/// {{escape_comment __table.comment}} +/// +{{~end~}} +public partial class {{__name}} +{ + {{~if __table.is_map_table ~}} + private readonly System.Collections.Generic.Dictionary<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> _dataMap; + private readonly System.Collections.Generic.List<{{declaring_type_name value_type}}> _dataList; + + public {{__name}}(ByteBuf _buf) + { + _dataMap = new System.Collections.Generic.Dictionary<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}>(); + _dataList = new System.Collections.Generic.List<{{declaring_type_name value_type}}>(); + + for(int n = _buf.ReadSize() ; n > 0 ; --n) + { + {{declaring_type_name value_type}} _v; + {{deserialize '_buf' '_v' value_type}} + _dataList.Add(_v); + _dataMap.Add(_v.{{format_property_name __code_style __table.index_field.name}}, _v); + } + } + + public System.Collections.Generic.Dictionary<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> DataMap => _dataMap; + public System.Collections.Generic.List<{{declaring_type_name value_type}}> DataList => _dataList; + +{{~if value_type.is_dynamic~}} + public T GetOrDefaultAs({{declaring_type_name key_type}} key) where T : {{declaring_type_name value_type}} => _dataMap.TryGetValue(key, out var v) ? (T)v : null; + public T GetAs({{declaring_type_name key_type}} key) where T : {{declaring_type_name value_type}} => (T)_dataMap[key]; +{{~end~}} + public {{declaring_type_name value_type}} GetOrDefault({{declaring_type_name key_type}} key) => _dataMap.TryGetValue(key, out var v) ? v : null; + public {{declaring_type_name value_type}} Get({{declaring_type_name key_type}} key) => _dataMap[key]; + public {{declaring_type_name value_type}} this[{{declaring_type_name key_type}} key] => _dataMap[key]; + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + + {{~else if __table.is_list_table ~}} + private readonly System.Collections.Generic.List<{{declaring_type_name value_type}}> _dataList; + + {{~if __table.is_union_index~}} + private {{table_union_map_type_name}} _dataMapUnion; + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + private System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~end~}} + + public {{__name}}(ByteBuf _buf) + { + _dataList = new System.Collections.Generic.List<{{declaring_type_name value_type}}>(); + + for(int n = _buf.ReadSize() ; n > 0 ; --n) + { + {{declaring_type_name value_type}} _v; + {{deserialize '_buf' '_v' value_type}} + _dataList.Add(_v); + } + {{~if __table.is_union_index~}} + _dataMapUnion = new {{table_union_map_type_name}}(); + foreach(var _v in _dataList) + { + _dataMapUnion.Add(({{table_key_list "_v"}}), _v); + } + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}} = new System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name value_type}}>(); + {{~end~}} + foreach(var _v in _dataList) + { + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}}.Add(_v.{{format_property_name __code_style idx.index_field.name}}, _v); + {{~end~}} + } + {{~end~}} + } + + public System.Collections.Generic.List<{{declaring_type_name value_type}}> DataList => _dataList; + + {{~if __table.is_union_index~}} + public {{declaring_type_name value_type}} Get({{table_param_def_list}}) => _dataMapUnion.TryGetValue(({{table_param_name_list}}), out {{declaring_type_name value_type}} __v) ? __v : null; + {{~else if !__table.index_list.empty? ~}} + {{~for idx in __table.index_list~}} + public {{declaring_type_name value_type}} GetBy{{format_property_name __code_style idx.index_field.name}}({{declaring_type_name idx.type}} key) => _dataMap_{{idx.index_field.name}}.TryGetValue(key, out {{declaring_type_name value_type}} __v) ? __v : null; + {{~end~}} + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + {{~else~}} + + private readonly {{declaring_type_name value_type}} _data; + + public {{declaring_type_name value_type}} Data => _data; + + public {{__name}}(ByteBuf _buf) + { + int n = _buf.ReadSize(); + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_buf' '_data' value_type}} + } + + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}} => _data.{{format_property_name __code_style field.name}}; + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + _data.ResolveRef(tables); + } + {{~end~}} +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-bin/tables.sbn b/Tools/Luban/Templates/cs-bin/tables.sbn new file mode 100644 index 00000000..be907ad7 --- /dev/null +++ b/Tools/Luban/Templates/cs-bin/tables.sbn @@ -0,0 +1,31 @@ +using Luban; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + public {{table.full_name}} {{format_property_name __code_style table.name}} {get; } + {{~end~}} + + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = new {{table.full_name}}(loader("{{table.output_data_file}}")); + {{~end~}} + ResolveRef(); + } + + private void ResolveRef() + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}}.ResolveRef(this); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/Tools/Luban/Templates/cs-dotnet-json/bean.sbn b/Tools/Luban/Templates/cs-dotnet-json/bean.sbn new file mode 100644 index 00000000..d7f63071 --- /dev/null +++ b/Tools/Luban/Templates/cs-dotnet-json/bean.sbn @@ -0,0 +1,152 @@ +using Luban; +using System.Text.Json; +{{ + parent_def_type = __bean.parent_def_type + export_fields = __bean.export_fields + hierarchy_export_fields = __bean.hierarchy_export_fields +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __bean.comment != '' ~}} +/// +/// {{escape_comment __bean.comment}} +/// +{{~end~}} +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_Ref' +end + +func get_index_var_name + ret (format_property_name __code_style $0.name) + '_Index' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = format_property_name __code_style refTable.name + if field.is_nullable + ret (get_ref_name field) + ' = ' + fieldName + '!= null ? tables.' + tableName + '.GetOrDefault(' + (get_value_of_nullable_type field.ctype fieldName) + ') : null;' + else + ret (get_ref_name field) + ' = tables.' + tableName + '.GetOrDefault(' + fieldName + ');' + end + else if can_generate_collection_ref field + collection_ref_table = get_collection_ref_table field + tableName = format_property_name __code_style collection_ref_table.name + if field.ctype.type_name == 'list' || field.ctype.type_name == 'set' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var _v in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(tables.' + tableName + '.GetOrDefault(_v)); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'array' + line1 = (get_ref_name field) + ' = new ' + (declaring_type_name collection_ref_table.value_ttype) + '[' + fieldName + '.Length];' + '\n' + line2 = 'for (int _i = 0; _i < ' + fieldName + '.Length; _i++) { ' + (get_ref_name field) + '[_i] = tables.' + tableName + '.GetOrDefault(' + fieldName + '[_i]); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'map' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var kvp in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(kvp.Key, tables.' + tableName + '.GetOrDefault(kvp.Value)); }' + '\n' + ret line1 + line2 + else + ret '' + end + else + if (is_field_bean_need_resolve_ref field) + ret fieldName + '?.ResolveRef(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + ') { _e?.ResolveRef(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + '.Values) { _e?.ResolveRef(tables); }' + else + ret '' + end + end +end +~}} +{{~if __bean.is_value_type~}} +public partial struct {{__name}} +{{~else~}} +public {{class_modifier __bean}} partial class {{__name}} : {{if parent_def_type}}{{__bean.parent}}{{else}}Luban.BeanBase{{end}} +{{~end~}} +{ + public {{__name}}(JsonElement _buf) {{if parent_def_type}} : base(_buf) {{end}} + { + {{~ for field in export_fields + fieldName = format_property_name __code_style field.name + ~}} + {{deserialize_field fieldName '_buf' field.name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}} = null; + {{~end~}} + {{~if has_index field~}} + foreach(var _v in {{fieldName}}) + { + {{get_index_var_name field}}.Add(_v.{{format_property_name __code_style (get_index_field field).name}}, _v); + } + {{~end~}} + {{~end~}} + } + + public static {{__name}} Deserialize{{__name}}(JsonElement _buf) + { + {{~if __bean.is_abstract_type~}} + switch (_buf.GetProperty("$type").GetString()) + { + {{~for child in __bean.hierarchy_not_abstract_children~}} + case "{{impl_data_type child __bean}}": return new {{child.full_name}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__bean.full_name}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public readonly {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}}; + {{~if can_generate_ref field~}} + public {{declaring_type_name (get_ref_type field)}} {{get_ref_name field}}; + {{~else if can_generate_collection_ref field~}} + public {{declaring_collection_ref_name field.ctype}} {{get_ref_name field}}; + {{~end~}} + {{~if has_index field + indexMapType = get_index_map_type field + ~}} + public readonly {{declaring_type_name indexMapType}} {{get_index_var_name field}} = new {{declaring_type_name indexMapType}}(); + {{~end~}} + {{~end~}} + +{{~if !__bean.is_abstract_type && !__bean.is_value_type~}} + public const int __ID__ = {{__bean.id}}; + public override int GetTypeId() => __ID__; +{{~end~}} + + public {{method_modifier __bean}} void ResolveRef({{__manager_name}} tables) + { + {{~if parent_def_type~}} + base.ResolveRef(tables); + {{~end~}} + {{~for field in export_fields~}} + {{~ line = generate_resolve_field_ref field ~}} + {{~ if line != ''~}} + {{line}} + {{~end~}} + {{~end~}} + } + + public override string ToString() + { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{to_pretty_string (format_property_name __code_style field.name) field.ctype}} + "," + {{~end~}} + + "}"; + } +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-dotnet-json/table.sbn b/Tools/Luban/Templates/cs-dotnet-json/table.sbn new file mode 100644 index 00000000..b227e192 --- /dev/null +++ b/Tools/Luban/Templates/cs-dotnet-json/table.sbn @@ -0,0 +1,162 @@ +using Luban; +using System.Text.Json; + +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'System.Collections.Generic.Dictionary<(' + (array.each __table.index_list @index_type_name | array.join ', ') + '), ' + (declaring_type_name __value_type) + '>' + end + + func table_key_list + varName = $0 + indexList = __table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = __table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = __table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __table.comment != '' ~}} +/// +/// {{escape_comment __table.comment}} +/// +{{~end~}} +public partial class {{__name}} +{ + {{~if __table.is_map_table ~}} + private readonly System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + public {{__name}}(JsonElement _buf) + { + _dataMap = new System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>(); + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JsonElement _ele in _buf.EnumerateArray()) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + _dataMap.Add(_v.{{format_property_name __code_style __table.index_field.name}}, _v); + } + } + + public System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> DataMap => _dataMap; + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + +{{~if __value_type.is_dynamic~}} + public T GetOrDefaultAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => _dataMap.TryGetValue(key, out var v) ? (T)v : null; + public T GetAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => (T)_dataMap[key]; +{{~end~}} + public {{declaring_type_name __value_type}} GetOrDefault({{declaring_type_name __key_type}} key) => _dataMap.TryGetValue(key, out var v) ? v : null; + public {{declaring_type_name __value_type}} Get({{declaring_type_name __key_type}} key) => _dataMap[key]; + public {{declaring_type_name __value_type}} this[{{declaring_type_name __key_type}} key] => _dataMap[key]; + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + + {{~else if __table.is_list_table ~}} + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + {{~if __table.is_union_index~}} + private {{table_union_map_type_name}} _dataMapUnion; + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + private System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~end~}} + + public {{__name}}(JsonElement _buf) + { + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JsonElement _ele in _buf.EnumerateArray()) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + } + {{~if __table.is_union_index~}} + _dataMapUnion = new {{table_union_map_type_name}}(); + foreach(var _v in _dataList) + { + _dataMapUnion.Add(({{table_key_list "_v"}}), _v); + } + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}} = new System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>(); + {{~end~}} + foreach(var _v in _dataList) + { + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}}.Add(_v.{{format_property_name __code_style idx.index_field.name}}, _v); + {{~end~}} + } + {{~end~}} + } + + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + + {{~if __table.is_union_index~}} + public {{declaring_type_name __value_type}} Get({{table_param_def_list}}) => _dataMapUnion.TryGetValue(({{table_param_name_list}}), out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~else if !__table.index_list.empty? ~}} + {{~for idx in __table.index_list~}} + public {{declaring_type_name __value_type}} GetBy{{format_property_name __code_style idx.index_field.name}}({{declaring_type_name idx.type}} key) => _dataMap_{{idx.index_field.name}}.TryGetValue(key, out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~end~}} + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + {{~else~}} + + private readonly {{declaring_type_name __value_type}} _data; + + public {{declaring_type_name __value_type}} Data => _data; + + public {{__name}}(JsonElement _buf) + { + int n = _buf.GetArrayLength(); + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_data' '_buf[0]' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}} => _data.{{format_property_name __code_style field.name}}; + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + _data.ResolveRef(tables); + } + {{~end~}} +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-dotnet-json/tables.sbn b/Tools/Luban/Templates/cs-dotnet-json/tables.sbn new file mode 100644 index 00000000..fcb18326 --- /dev/null +++ b/Tools/Luban/Templates/cs-dotnet-json/tables.sbn @@ -0,0 +1,32 @@ +using Luban; +using System.Text.Json; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + public {{table.full_name}} {{format_property_name __code_style table.name}} {get; } + {{~end~}} + + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = new {{table.full_name}}(loader("{{table.output_data_file}}")); + {{~end~}} + ResolveRef(); + } + + private void ResolveRef() + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}}.ResolveRef(this); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/Tools/Luban/Templates/cs-editor-json/bean.sbn b/Tools/Luban/Templates/cs-editor-json/bean.sbn new file mode 100644 index 00000000..8fd74be6 --- /dev/null +++ b/Tools/Luban/Templates/cs-editor-json/bean.sbn @@ -0,0 +1,102 @@ +using System.Collections.Generic; +using SimpleJSON; +using Luban; + +{{namespace_with_grace_begin __namespace_with_top_module}} + +{{~if __this.comment != '' ~}} +/// +/// {{escape_comment __this.comment}} +/// +{{~end~}} +public {{class_modifier __bean}} class {{__name}} : {{if __parent_def_type}} {{__this.parent}} {{else}} Luban.EditorBeanBase {{end}} +{ + public {{__name}}() + { + {{~ for field in __fields ~}} + {{~if (need_init field.ctype) && !field.ctype.is_nullable ~}} + {{format_field_name __code_style field.name}} = {{init_value field.ctype}}; + {{~end~}} + {{~end~}} + } + + {{~if !__this.is_abstract_type~}} + public override void LoadJson(SimpleJSON.JSONObject _json) + { + {{~ for field in __hierarchy_fields ~}} + { + var _fieldJson = _json["{{field.name}}"]; + if (_fieldJson != null) + { + {{deserialize '_fieldJson' (format_field_name __code_style field.name) field.ctype}} + } + } + + {{~end~}} + } + + public override void SaveJson(SimpleJSON.JSONObject _json) + { + {{~if parent~}} + _json["$type"] = "{{__this.full_name}}"; + {{~end~}} + {{~ for field in __hierarchy_fields ~}} + {{~if field.ctype.is_nullable}} + if ({{format_field_name __code_style field.name}} != null) + { + {{serialize '_json' field.name (format_field_name __code_style field.name) field.ctype}} + } + {{~else~}} + { + {{~if (is_raw_nullable field.ctype)}} + if ({{format_field_name __code_style field.name}} == null) { throw new System.ArgumentNullException(); } + {{~end~}} + {{serialize '_json' field.name (format_field_name __code_style field.name) field.ctype}} + } + {{~end~}} + {{~end~}} + } + {{~end~}} + + public static {{__name}} LoadJson{{__name}}(SimpleJSON.JSONNode _json) + { + {{~if __this.is_abstract_type~}} + string type = _json["$type"]; + {{__name}} obj; + switch (type) + { + {{~for child in __this.hierarchy_not_abstract_children~}} + {{~if child.namespace == __this.namespace && __this.namespace != '' ~}} + case "{{child.full_name}}": + {{~end~}} + case "{{impl_data_type child __this}}":obj = new {{child.full_name}}(); break; + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + {{__name}} obj = new {{__this.full_name}}(); + {{~end~}} + obj.LoadJson((SimpleJSON.JSONObject)_json); + return obj; + } + + public static void SaveJson{{__name}}({{__name}} _obj, SimpleJSON.JSONNode _json) + { + {{~if __this.is_abstract_type~}} + _json["$type"] = _obj.GetType().Name; + {{~end~}} + _obj.SaveJson((SimpleJSON.JSONObject)_json); + } + + {{~ for field in __fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + + {{~end~}} +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-editor-json/enum.sbn b/Tools/Luban/Templates/cs-editor-json/enum.sbn new file mode 100644 index 00000000..fb36236f --- /dev/null +++ b/Tools/Luban/Templates/cs-editor-json/enum.sbn @@ -0,0 +1,59 @@ +{{~ + comment = __enum.comment + items = __enum.items + itemType = 'Luban.EditorEnumItemInfo' +~}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if comment != '' ~}} + /// + /// {{escape_comment comment}} + /// +{{~end~}} + {{~if __enum.is_flags~}} + [System.Flags] + {{~end~}} + public enum {{__name}} + { + {{~ for item in items ~}} +{{~if item.comment != '' ~}} + /// + /// {{escape_comment item.comment_or_alias}} + /// +{{~end~}} + {{format_enum_item_name __code_style item.name}} = {{item.value}}, + {{~end~}} + } + + public static class {{__name}}_Metadata + { + {{~ for item in items ~}} + public static readonly {{itemType}} {{item.name}} = new {{itemType}}("{{item.name}}", "{{item.alias}}", {{item.int_value}}, "{{item.comment}}"); + {{~end~}} + + private static readonly System.Collections.Generic.List<{{itemType}}> __items = new System.Collections.Generic.List<{{itemType}}> + { + {{~ for item in items ~}} + {{item.name}}, + {{~end~}} + }; + + public static System.Collections.Generic.List<{{itemType}}> GetItems() => __items; + + public static {{itemType}} GetByName(string name) + { + return __items.Find(c => c.Name == name); + } + + public static {{itemType}} GetByNameOrAlias(string name) + { + return __items.Find(c => c.Name == name || c.Alias == name); + } + + public static {{itemType}} GetByValue(int value) + { + return __items.Find(c => c.Value == value); + } + } + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-newtonsoft-json/bean.sbn b/Tools/Luban/Templates/cs-newtonsoft-json/bean.sbn new file mode 100644 index 00000000..f8ae9bd2 --- /dev/null +++ b/Tools/Luban/Templates/cs-newtonsoft-json/bean.sbn @@ -0,0 +1,158 @@ +using Luban; +using Newtonsoft.Json.Linq; + +{{ + parent_def_type = __bean.parent_def_type + export_fields = __bean.export_fields + hierarchy_export_fields = __bean.hierarchy_export_fields +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __bean.comment != '' ~}} +/// +/// {{escape_comment __bean.comment}} +/// +{{~end~}} +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_Ref' +end + +func get_index_var_name + ret (format_property_name __code_style $0.name) + '_Index' +end + + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = format_property_name __code_style refTable.name + if field.is_nullable + ret (get_ref_name field) + ' = ' + fieldName + '!= null ? tables.' + tableName + '.GetOrDefault(' + (get_value_of_nullable_type field.ctype fieldName) + ') : null;' + else + ret (get_ref_name field) + ' = tables.' + tableName + '.GetOrDefault(' + fieldName + ');' + end + else if can_generate_collection_ref field + collection_ref_table = get_collection_ref_table field + tableName = format_property_name __code_style collection_ref_table.name + if field.ctype.type_name == 'list' || field.ctype.type_name == 'set' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var _v in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(tables.' + tableName + '.GetOrDefault(_v)); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'array' + line1 = (get_ref_name field) + ' = new ' + (declaring_type_name collection_ref_table.value_ttype) + '[' + fieldName + '.Length];' + '\n' + line2 = 'for (int _i = 0; _i < ' + fieldName + '.Length; _i++) { ' + (get_ref_name field) + '[_i] = tables.' + tableName + '.GetOrDefault(' + fieldName + '[_i]); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'map' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var kvp in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(kvp.Key, tables.' + tableName + '.GetOrDefault(kvp.Value)); }' + '\n' + ret line1 + line2 + else + ret '' + end + else + if (is_field_bean_need_resolve_ref field) + ret fieldName + '?.ResolveRef(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + ') { _e?.ResolveRef(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + '.Values) { _e?.ResolveRef(tables); }' + else + ret '' + end + end +end + +~}} + +{{~if __bean.is_value_type~}} +public partial struct {{__name}} +{{~else~}} +public {{class_modifier __bean}} partial class {{__name}} : {{if parent_def_type}}{{__bean.parent}}{{else}}Luban.BeanBase{{end}} +{{~end~}} +{ + public {{__name}}(JToken _buf) {{if parent_def_type}} : base(_buf) {{end}} + { + JObject _obj = _buf as JObject; + {{~ for field in export_fields + fieldName = format_property_name __code_style field.name + ~}} + {{deserialize_field fieldName '_obj' field.name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}} = null; + {{~end~}} + {{~if has_index field~}} + foreach(var _v in {{fieldName}}) + { + {{get_index_var_name field}}.Add(_v.{{format_property_name __code_style (get_index_field field).name}}, _v); + } + {{~end~}} + {{~end~}} + } + + public static {{__name}} Deserialize{{__name}}(JToken _buf) + { + {{~if __bean.is_abstract_type~}} + var _obj=_buf as JObject; + switch (_obj.GetValue("$type").ToString()) + { + {{~for child in __bean.hierarchy_not_abstract_children~}} + case "{{impl_data_type child __bean}}": return new {{child.full_name}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__bean.full_name}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public readonly {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}}; + {{~if can_generate_ref field~}} + public {{declaring_type_name (get_ref_type field)}} {{get_ref_name field}}; + {{~else if can_generate_collection_ref field~}} + public {{declaring_collection_ref_name field.ctype}} {{get_ref_name field}}; + {{~end~}} + {{~if has_index field + indexMapType = get_index_map_type field + ~}} + public readonly {{declaring_type_name indexMapType}} {{get_index_var_name field}} = new {{declaring_type_name indexMapType}}(); + {{~end~}} + {{~end~}} + + + {{~if !__bean.is_abstract_type && !__bean.is_value_type~}} + public const int __ID__ = {{__bean.id}}; + public override int GetTypeId() => __ID__; + {{~end~}} + + public {{method_modifier __bean}} void ResolveRef({{__manager_name}} tables) + { + {{~if parent_def_type~}} + base.ResolveRef(tables); + {{~end~}} + {{~for field in export_fields~}} + {{~ line = generate_resolve_field_ref field ~}} + {{~ if line != ''~}} + {{line}} + {{~end~}} + {{~end~}} + } + + public override string ToString() + { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{to_pretty_string (format_property_name __code_style field.name) field.ctype}} + "," + {{~end~}} + + "}"; + } +} +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-newtonsoft-json/table.sbn b/Tools/Luban/Templates/cs-newtonsoft-json/table.sbn new file mode 100644 index 00000000..edc3a54b --- /dev/null +++ b/Tools/Luban/Templates/cs-newtonsoft-json/table.sbn @@ -0,0 +1,169 @@ +using Newtonsoft.Json.Linq; +using Luban; + +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'System.Collections.Generic.Dictionary<(' + (array.each __table.index_list @index_type_name | array.join ', ') + '), ' + (declaring_type_name __value_type) + '>' + end + + func table_key_list + varName = $0 + indexList = __table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = __table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = __table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} + +{{~if __table.comment != '' ~}} +/// +/// {{escape_comment __table.comment}} +/// +{{~end~}} +public partial class {{__name}} +{ + {{~if __table.is_map_table ~}} + private readonly System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + public {{__name}}(JArray _buf) + { + _dataMap = new System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>(); + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JObject _ele in _buf) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + _dataMap.Add(_v.{{format_property_name __code_style __table.index_field.name}}, _v); + } + } + + + public System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> DataMap => _dataMap; + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + +{{~if __value_type.is_dynamic~}} + public T GetOrDefaultAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => _dataMap.TryGetValue(key, out var v) ? (T)v : null; + public T GetAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => (T)_dataMap[key]; +{{~end~}} + public {{declaring_type_name __value_type}} GetOrDefault({{declaring_type_name __key_type}} key) => _dataMap.TryGetValue(key, out var v) ? v : null; + public {{declaring_type_name __value_type}} Get({{declaring_type_name __key_type}} key) => _dataMap[key]; + public {{declaring_type_name __value_type}} this[{{declaring_type_name __key_type}} key] => _dataMap[key]; + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + + {{~else if __table.is_list_table ~}} + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + {{~if __table.is_union_index~}} + private {{table_union_map_type_name}} _dataMapUnion; + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + private System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~end~}} + + + public {{__name}}(JArray _buf) + { + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JObject _ele in _buf) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + } + {{~if __table.is_union_index~}} + _dataMapUnion = new {{table_union_map_type_name}}(); + foreach(var _v in _dataList) + { + _dataMapUnion.Add(({{table_key_list "_v"}}), _v); + } + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}} = new System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>(); + {{~end~}} + foreach(var _v in _dataList) + { + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}}.Add(_v.{{format_property_name __code_style idx.index_field.name}}, _v); + {{~end~}} + } + {{~end~}} + } + + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + + + {{~if __table.is_union_index~}} + public {{declaring_type_name __value_type}} Get({{table_param_def_list}}) => _dataMapUnion.TryGetValue(({{table_param_name_list}}), out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~else if !__table.index_list.empty? ~}} + {{~for idx in __table.index_list~}} + public {{declaring_type_name __value_type}} GetBy{{format_property_name __code_style idx.index_field.name}}({{declaring_type_name idx.type}} key) => _dataMap_{{idx.index_field.name}}.TryGetValue(key, out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~end~}} + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + {{~else~}} + + private readonly {{declaring_type_name __value_type}} _data; + + public {{declaring_type_name __value_type}} Data => _data; + + public {{__name}}(JArray _buf) + { + int n = _buf.Count; + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_data' '_buf[0]' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}} => _data.{{format_property_name __code_style field.name}}; + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + _data.ResolveRef(tables); + } + + + + {{~end~}} +} +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-newtonsoft-json/tables.sbn b/Tools/Luban/Templates/cs-newtonsoft-json/tables.sbn new file mode 100644 index 00000000..5f10e0a6 --- /dev/null +++ b/Tools/Luban/Templates/cs-newtonsoft-json/tables.sbn @@ -0,0 +1,32 @@ +using Newtonsoft.Json.Linq; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + public {{table.full_name}} {{format_property_name __code_style table.name}} {get; } + {{~end~}} + + + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = new {{table.full_name}}(loader("{{table.output_data_file}}")); + {{~end~}} + ResolveRef(); + } + + private void ResolveRef() + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}}.ResolveRef(this); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} diff --git a/Tools/Luban/Templates/cs-simple-json/bean.sbn b/Tools/Luban/Templates/cs-simple-json/bean.sbn new file mode 100644 index 00000000..67ea7db2 --- /dev/null +++ b/Tools/Luban/Templates/cs-simple-json/bean.sbn @@ -0,0 +1,152 @@ +using Luban; +using SimpleJSON; +{{ + parent_def_type = __bean.parent_def_type + export_fields = __bean.export_fields + hierarchy_export_fields = __bean.hierarchy_export_fields +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __bean.comment != '' ~}} +/// +/// {{escape_comment __bean.comment}} +/// +{{~end~}} +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_Ref' +end + +func get_index_var_name + ret (format_property_name __code_style $0.name) + '_Index' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = format_property_name __code_style refTable.name + if field.is_nullable + ret (get_ref_name field) + ' = ' + fieldName + '!= null ? tables.' + tableName + '.GetOrDefault(' + (get_value_of_nullable_type field.ctype fieldName) + ') : null;' + else + ret (get_ref_name field) + ' = tables.' + tableName + '.GetOrDefault(' + fieldName + ');' + end + else if can_generate_collection_ref field + collection_ref_table = get_collection_ref_table field + tableName = format_property_name __code_style collection_ref_table.name + if field.ctype.type_name == 'list' || field.ctype.type_name == 'set' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var _v in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(tables.' + tableName + '.GetOrDefault(_v)); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'array' + line1 = (get_ref_name field) + ' = new ' + (declaring_type_name collection_ref_table.value_ttype) + '[' + fieldName + '.Length];' + '\n' + line2 = 'for (int _i = 0; _i < ' + fieldName + '.Length; _i++) { ' + (get_ref_name field) + '[_i] = tables.' + tableName + '.GetOrDefault(' + fieldName + '[_i]); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'map' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var kvp in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(kvp.Key, tables.' + tableName + '.GetOrDefault(kvp.Value)); }' + '\n' + ret line1 + line2 + else + ret '' + end + else + if (is_field_bean_need_resolve_ref field) + ret fieldName + '?.ResolveRef(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + ') { _e?.ResolveRef(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + '.Values) { _e?.ResolveRef(tables); }' + else + ret '' + end + end +end +~}} +{{~if __bean.is_value_type~}} +public partial struct {{__name}} +{{~else~}} +public {{class_modifier __bean}} partial class {{__name}} : {{if parent_def_type}}{{__bean.parent}}{{else}}Luban.BeanBase{{end}} +{{~end~}} +{ + public {{__name}}(JSONNode _buf) {{if parent_def_type}} : base(_buf) {{end}} + { + {{~ for field in export_fields + fieldName = format_property_name __code_style field.name + ~}} + {{deserialize_field fieldName '_buf' field.name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}} = null; + {{~end~}} + {{~if has_index field~}} + foreach(var _v in {{fieldName}}) + { + {{get_index_var_name field}}.Add(_v.{{format_property_name __code_style (get_index_field field).name}}, _v); + } + {{~end~}} + {{~end~}} + } + + public static {{__name}} Deserialize{{__name}}(JSONNode _buf) + { + {{~if __bean.is_abstract_type~}} + switch ((string)_buf["$type"]) + { + {{~for child in __bean.hierarchy_not_abstract_children~}} + case "{{impl_data_type child __bean}}": return new {{child.full_name}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__bean.full_name}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public readonly {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}}; + {{~if can_generate_ref field~}} + public {{declaring_type_name (get_ref_type field)}} {{get_ref_name field}}; + {{~else if can_generate_collection_ref field~}} + public {{declaring_collection_ref_name field.ctype}} {{get_ref_name field}}; + {{~end~}} + {{~if has_index field + indexMapType = get_index_map_type field + ~}} + public readonly {{declaring_type_name indexMapType}} {{get_index_var_name field}} = new {{declaring_type_name indexMapType}}(); + {{~end~}} + {{~end~}} + +{{~if !__bean.is_abstract_type && !__bean.is_value_type~}} + public const int __ID__ = {{__bean.id}}; + public override int GetTypeId() => __ID__; +{{~end~}} + + public {{method_modifier __bean}} void ResolveRef({{__manager_name}} tables) + { + {{~if parent_def_type~}} + base.ResolveRef(tables); + {{~end~}} + {{~for field in export_fields~}} + {{~ line = generate_resolve_field_ref field ~}} + {{~ if line != ''~}} + {{line}} + {{~end~}} + {{~end~}} + } + + public override string ToString() + { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{to_pretty_string (format_property_name __code_style field.name) field.ctype}} + "," + {{~end~}} + + "}"; + } +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-simple-json/table.sbn b/Tools/Luban/Templates/cs-simple-json/table.sbn new file mode 100644 index 00000000..44785b75 --- /dev/null +++ b/Tools/Luban/Templates/cs-simple-json/table.sbn @@ -0,0 +1,162 @@ +using Luban; +using SimpleJSON; + +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'System.Collections.Generic.Dictionary<(' + (array.each __table.index_list @index_type_name | array.join ', ') + '), ' + (declaring_type_name __value_type) + '>' + end + + func table_key_list + varName = $0 + indexList = __table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = __table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = __table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __table.comment != '' ~}} +/// +/// {{escape_comment __table.comment}} +/// +{{~end~}} +public partial class {{__name}} +{ + {{~if __table.is_map_table ~}} + private readonly System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + public {{__name}}(JSONNode _buf) + { + _dataMap = new System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>(); + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JSONNode _ele in _buf.Children) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + _dataMap.Add(_v.{{format_property_name __code_style __table.index_field.name}}, _v); + } + } + + public System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> DataMap => _dataMap; + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + +{{~if __value_type.is_dynamic~}} + public T GetOrDefaultAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => _dataMap.TryGetValue(key, out var v) ? (T)v : null; + public T GetAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => (T)_dataMap[key]; +{{~end~}} + public {{declaring_type_name __value_type}} GetOrDefault({{declaring_type_name __key_type}} key) => _dataMap.TryGetValue(key, out var v) ? v : null; + public {{declaring_type_name __value_type}} Get({{declaring_type_name __key_type}} key) => _dataMap[key]; + public {{declaring_type_name __value_type}} this[{{declaring_type_name __key_type}} key] => _dataMap[key]; + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + + {{~else if __table.is_list_table ~}} + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + {{~if __table.is_union_index~}} + private {{table_union_map_type_name}} _dataMapUnion; + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + private System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~end~}} + + public {{__name}}(JSONNode _buf) + { + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JSONNode _ele in _buf.Children) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + } + {{~if __table.is_union_index~}} + _dataMapUnion = new {{table_union_map_type_name}}(); + foreach(var _v in _dataList) + { + _dataMapUnion.Add(({{table_key_list "_v"}}), _v); + } + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}} = new System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>(); + {{~end~}} + foreach(var _v in _dataList) + { + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}}.Add(_v.{{format_property_name __code_style idx.index_field.name}}, _v); + {{~end~}} + } + {{~end~}} + } + + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + + {{~if __table.is_union_index~}} + public {{declaring_type_name __value_type}} Get({{table_param_def_list}}) => _dataMapUnion.TryGetValue(({{table_param_name_list}}), out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~else if !__table.index_list.empty? ~}} + {{~for idx in __table.index_list~}} + public {{declaring_type_name __value_type}} GetBy{{format_property_name __code_style idx.index_field.name}}({{declaring_type_name idx.type}} key) => _dataMap_{{idx.index_field.name}}.TryGetValue(key, out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~end~}} + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + {{~else~}} + + private readonly {{declaring_type_name __value_type}} _data; + + public {{declaring_type_name __value_type}} Data => _data; + + public {{__name}}(JSONNode _buf) + { + int n = _buf.Count; + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_data' '_buf[0]' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}} => _data.{{format_property_name __code_style field.name}}; + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + _data.ResolveRef(tables); + } + {{~end~}} +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/Tools/Luban/Templates/cs-simple-json/tables.sbn b/Tools/Luban/Templates/cs-simple-json/tables.sbn new file mode 100644 index 00000000..66770e93 --- /dev/null +++ b/Tools/Luban/Templates/cs-simple-json/tables.sbn @@ -0,0 +1,32 @@ +using Luban; +using SimpleJSON; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + public {{table.full_name}} {{format_property_name __code_style table.name}} {get; } + {{~end~}} + + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = new {{table.full_name}}(loader("{{table.output_data_file}}")); + {{~end~}} + ResolveRef(); + } + + private void ResolveRef() + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}}.ResolveRef(this); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/Tools/Luban/Templates/cs_pb/tables.sbn b/Tools/Luban/Templates/cs_pb/tables.sbn new file mode 100644 index 00000000..837061f5 --- /dev/null +++ b/Tools/Luban/Templates/cs_pb/tables.sbn @@ -0,0 +1,32 @@ +using Google.Protobuf; +using Google.Protobuf.Collections; +using System.Reflection; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + public {{proto_full_name table.full_name}} {{format_property_name __code_style table.name}} { get; } + + {{~end~}} + + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = {{proto_full_name table.full_name}}.Parser.ParseFrom(loader("{{table.output_data_file}}")); + {{~end~}} + } + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = {{proto_full_name table.full_name}}.Parser.ParseJson(loader("{{table.output_data_file}}")); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} diff --git a/Tools/Luban/Templates/flatbuffers/schema.sbn b/Tools/Luban/Templates/flatbuffers/schema.sbn new file mode 100644 index 00000000..ca8099c1 --- /dev/null +++ b/Tools/Luban/Templates/flatbuffers/schema.sbn @@ -0,0 +1,51 @@ +namespace {{__namespace}}; + +{{~for enum in __enums + typeName = full_name enum + ~}} +enum {{typeName}}:int { + {{~if !enum.has_zero_value_item~}} + __GENERATE_DEFAULT_VALUE = 0, + {{~end~}} + {{~for item in enum.items ~}} + {{typeName}}_{{item.name}} = {{item.int_value}}, + {{~end~}} +} +{{~end~}} + +{{~for bean in __beans~}} +{{~if bean.is_abstract_type ~}} +union {{full_name bean}} { + {{~for c in bean.hierarchy_not_abstract_children~}} + {{full_name c}}, + {{~end~}} +} +{{~end~}} +{{~end~}} + +{{~for bean in __beans~}} +{{~if !bean.is_abstract_type ~}} +table {{full_name bean}} { + {{~for f in bean.hierarchy_export_fields ~}} + {{f.name}}:{{declaring_type_name f.ctype}}{{type_metadata f.ctype}}; + {{~end~}} +} +{{~end~}} +{{~end~}} + +{{~for map in __maps~}} +table KeyValue_{{declaring_type_name map.key_type}}_{{declaring_type_name map.value_type}} { + key: {{declaring_type_name map.key_type}}{{type_metadata map.key_type}}; + value: {{declaring_type_name map.value_type}}{{type_metadata map.value_type}}; +} +{{~end~}} + +{{~for table in __tables~}} +table {{full_name table}} { + // WARN! The name 'data_list' is used by FlatBuffersJsonExporter. don't modify it! + data_list:[{{declaring_type_name table.value_ttype}}](required); +} + +root_type {{full_name table}}; +{{~end~}} + diff --git a/Tools/Luban/Templates/gdscript-json/schema.sbn b/Tools/Luban/Templates/gdscript-json/schema.sbn new file mode 100644 index 00000000..dca95335 --- /dev/null +++ b/Tools/Luban/Templates/gdscript-json/schema.sbn @@ -0,0 +1,167 @@ +@tool +class_name Schema +extends RefCounted + + +{{~for enum in __enums~}} +{{~if enum.comment != '' ~}} +## {{enum.comment | html.escape}} +{{~end~}} +enum {{full_name enum}} +{ + {{~ for item in enum.items ~}} + {{~if item.comment_or_alias != '' ~}} + ## {{item.comment_or_alias | html.escape}} + {{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} +} + + +{{~end~}} +{{~for bean in __beans + name = (full_name bean) +~}} +{{~if bean.comment != '' ~}} +## {{bean.comment | html.escape}} +{{~end~}} +class {{name}}{{if bean.parent_def_type}} extends {{full_name bean.parent_def_type}}{{end}}: +{{~ for field in bean.export_fields ~}} + {{~if field.comment != '' ~}} + ## {{field.comment | html.escape}} + {{~end~}} + var {{format_field_name __code_style field.name}}: {{declaring_type_name field.ctype}} +{{~end~}} + +{{~if bean.is_abstract_type~}} + static func fromJson(_json_): + var type = _json_['$type'] + match type: + {{~ for child in bean.hierarchy_not_abstract_children~}} + "{{impl_data_type child bean}}": return {{full_name child}}.new(_json_) + {{~end~}} + _: assert(false) + +{{~end~}} + func _init(_json_) -> void: +{{~if bean.parent_def_type~}} + super(_json_) +{{~end~}} + {{~ for field in bean.export_fields ~}} + {{deserialize_field ('self.' + (format_field_name __code_style field.name)) '_json_' field.name field.ctype}} + {{~end~}} + {{~if bean.export_fields.empty?~}} + pass + {{~end~}} + + +{{~end~}} +{{~for table in __tables + value_type = table.value_ttype + value_type_name = (declaring_type_name value_type) +~}} +{{~if table.comment != '' ~}} +## {{table.comment | html.escape}} +{{~end~}} +class {{full_name table}}: + {{~if table.is_map_table ~}} + var _data_list: Array[{{value_type_name}}] + var _data_map: Dictionary + + func _init(_json_) -> void: + for _json2_ in _json_: + var _v: {{value_type_name}} + {{deserialize '_v' '_json2_' value_type}} + self._data_list.append(_v) + self._data_map[_v.{{format_field_name __code_style table.index_field.name}}] = _v + + func get_data_list() -> Array[{{value_type_name}}]: + return self._data_list + + func get_data_map() -> Dictionary: + return self._data_map + + func get_item(key) -> {{value_type_name}}: + return self._data_map.get(key) + + {{~else if table.multi_key ~}} + var _data_list: Array[{{value_type_name}}] + {{~ for INDEX in table.index_list ~}} + var _{{INDEX.index_field.name}}_data_map: Dictionary + {{~ end ~}} + + func _init(_json_) -> void: + {{~ for INDEX in table.index_list ~}} + self._{{INDEX.index_field.name}}_data_map = {} + {{~ end ~}} + + for _json2_ in _json_: + var _v: {{value_type_name}} + {{deserialize '_v' '_json2_' value_type}} + self._data_list.append(_v) + {{~ for INDEX in table.index_list ~}} + self._{{INDEX.index_field.name}}_data_map[_v.{{INDEX.index_field.name}}] = _v + {{~ end ~}} + + func get_data_list() -> Array[{{value_type_name}}]: + return self._data_list + + {{~ for INDEX in table.index_list ~}} + func get_{{INDEX.index_field.name}}_data_map() -> Dictionary: + return self._{{INDEX.index_field.name}}_data_map + {{~ end ~}} + +{{~ for INDEX in table.index_list ~}} + func get_item_by_{{INDEX.index_field.name}}({{INDEX.index_field.name}}) -> {{value_type_name}}: + return self._{{INDEX.index_field.name}}_data_map.get({{INDEX.index_field.name}}) + +{{~ end ~}} + {{~else if table.is_list_table ~}} + var _data_list: Array[{{value_type_name}}] + + func _init(_json_) -> void: + for _json2_ in _json_: + var _v: {{value_type_name}} + {{deserialize '_v' '_json2_' value_type}} + self._data_list.append(_v) + + func get_data_list() -> Array[{{value_type_name}}]: + return self._data_list + + func get_item(index) -> {{value_type_name}}: + return self._data_list[index] + {{~else~}} + var _data:{{value_type_name}} + + func _init(_json_) -> void: + assert(len(_json_) == 1, "table mode = one, but size != 1") + {{deserialize 'self._data' '_json_[0]' value_type}} + + func get_data() -> {{value_type_name}}: + return self._data + + {{~ for field in value_type.def_bean.hierarchy_export_fields + name = format_field_name __code_style field.name + ~}} +{{~if field.comment != '' ~}} + ## {{escape_comment field.comment}} +{{~end~}} + var {{name}}: {{declaring_type_name field.ctype}}: + get: return self._data.{{name}} + + {{~end~}} + {{~end~}} + +{{~end~}} +class {{str_full_name __full_name}}: + {{~for table in __tables ~}} + {{~if table.comment != ''~}} + ## {{table.comment | html.escape}} + {{~end~}} + var {{format_method_name __code_style table.name}}: {{full_name table}} + {{~end~}} + + func _init(loader: Callable) -> void: + {{~for table in __tables ~}} + self.{{format_method_name __code_style table.name}} = {{full_name table}}.new(loader.call('{{table.output_data_file}}')) + {{~end~}} \ No newline at end of file diff --git a/Tools/Luban/Templates/go-bin/bean.sbn b/Tools/Luban/Templates/go-bin/bean.sbn new file mode 100644 index 00000000..0ff01a03 --- /dev/null +++ b/Tools/Luban/Templates/go-bin/bean.sbn @@ -0,0 +1,54 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~ + go_full_name = full_name __this + parent_def_type = __this.parent_def_type + is_abstract_type = __this.is_abstract_type + hierarchy_fields = __this.hierarchy_export_fields + hierarchy_not_abstract_children = __this.hierarchy_not_abstract_children +~}} + +import ( + "{{__luban_module_name}}" +) + +{{collect_import __this}} + +type {{go_full_name}} struct { + {{~for field in hierarchy_fields ~}} + {{format_field_name __code_style field.name}} {{declaring_type_name field.ctype}} + {{~end~}} +} + +const TypeId_{{go_full_name}} = {{__this.id}} + +func (*{{go_full_name}}) GetTypeId() int32 { + return {{__this.id}} +} + +{{~if is_abstract_type~}} +func New{{go_full_name}}(_buf *luban.ByteBuf) (interface{}, error) { + var id int32 + var err error + if id, err = _buf.ReadInt() ; err != nil { + return nil, err + } + switch id { + {{~for child in hierarchy_not_abstract_children~}} + case {{child.id}}: _v, err := New{{full_name child}}(_buf); if err != nil { return nil, errors.New("{{child.full_name|string.downcase}}") } else { return _v, nil } + {{~end~}} + default: return nil, errors.New("unknown type id") + } +} + +{{~else~}} +func New{{go_full_name}}(_buf *luban.ByteBuf) (_v *{{go_full_name}}, err error) { + _v = &{{go_full_name}}{} + {{~for field in hierarchy_fields ~}} + {{deserialize_field field.ctype ("_v." + (format_field_name __code_style field.name)) '_buf' 'err'}} + {{~end~}} + return +} +{{~end~}} diff --git a/Tools/Luban/Templates/go-bin/table.sbn b/Tools/Luban/Templates/go-bin/table.sbn new file mode 100644 index 00000000..e511405b --- /dev/null +++ b/Tools/Luban/Templates/go-bin/table.sbn @@ -0,0 +1,116 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~ + go_full_name = full_name __this + key_type = __this.key_ttype + value_type = __this.value_ttype + index_field = __this.index_field +~}} + +import "{{__luban_module_name}}" + +{{~if __this.is_map_table~}} +type {{go_full_name}} struct { + _dataMap map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}} + _dataList []{{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf *luban.ByteBuf) (*{{go_full_name}}, error) { + if size, err := _buf.ReadSize() ; err != nil { + return nil, err + } else { + _dataList := make([]{{declaring_type_name value_type}}, 0, size) + dataMap := make(map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}}) + + for i := 0 ; i < size ; i++ { + if _v, err2 := New{{full_name value_type.def_bean}}(_buf); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) +{{~if value_type.is_dynamic ~}} + {{~for child in value_type.def_bean.hierarchy_not_abstract_children~}} + if __v, __is := _v.(*{{full_name child}}) ; __is { + dataMap[__v.{{format_field_name __code_style index_field.name}}] = _v + continue + } + {{~end~}} +{{~else~}} + dataMap[_v.{{format_field_name __code_style index_field.name}}] = _v +{{~end~}} + } + } + return &{{go_full_name}}{_dataList:_dataList, _dataMap:dataMap}, nil + } +} + +func (table *{{go_full_name}}) GetDataMap() map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}} { + return table._dataMap +} + +func (table *{{go_full_name}}) GetDataList() []{{declaring_type_name value_type}} { + return table._dataList +} + +func (table *{{go_full_name}}) Get(key {{declaring_type_name key_type}}) {{declaring_type_name value_type}} { + return table._dataMap[key] +} + +{{~else if __this.is_list_table~}} +type {{go_full_name}} struct { + _dataList []{{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf *luban.ByteBuf) (*{{go_full_name}}, error) { + if size, err := _buf.ReadSize() ; err != nil { + return nil, err + } else { + _dataList := make([]{{declaring_type_name value_type}}, 0, size) + + for i := 0 ; i < size ; i++ { + if _v, err2 := New{{full_name value_type.def_bean}}(_buf); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + } + } + return &{{go_full_name}}{_dataList:_dataList}, nil + } +} + +func (table *{{go_full_name}}) GetDataList() []{{declaring_type_name value_type}} { + return table._dataList +} + +func (table *{{go_full_name}}) Get(index int) {{declaring_type_name value_type}} { + return table._dataList[index] +} + +{{~else~}} + +import "errors" + +type {{go_full_name}} struct { + _data {{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf *luban.ByteBuf) (*{{go_full_name}}, error) { + if size, err := _buf.ReadSize() ; err != nil { + return nil, err + } else if size != 1 { + return nil, errors.New(" size != 1 ") + } else { + if _v, err2 := New{{full_name value_type.def_bean}}(_buf); err2 != nil { + return nil, err2 + } else { + return &{{go_full_name}}{_data:_v}, nil + } + } +} + +func (table *{{go_full_name}}) Get() {{declaring_type_name value_type}} { + return table._data +} + +{{~end~}} diff --git a/Tools/Luban/Templates/go-bin/tables.sbn b/Tools/Luban/Templates/go-bin/tables.sbn new file mode 100644 index 00000000..4b0e7d12 --- /dev/null +++ b/Tools/Luban/Templates/go-bin/tables.sbn @@ -0,0 +1,33 @@ +{{~if __namespace != ''~}} +package {{__namespace}}; +{{~end~}} + +import ( + "{{__luban_module_name}}" + "errors" +) + +type ByteBufLoader func(string) (*luban.ByteBuf, error) + +type {{__name}} struct { + {{~for table in __tables ~}} + {{table.name}} *{{full_name table}} + {{~end~}} +} + +func NewTables(loader ByteBufLoader) (*{{__name}}, error) { + var err error + var buf *luban.ByteBuf + + tables := &{{__name}}{} + {{~for table in __tables ~}} + if buf, err = loader("{{table.output_data_file}}") ; err != nil { + return nil, err + } + if tables.{{table.name}}, err = New{{full_name table}}(buf) ; err != nil { + return nil, errors.Join(errors.New("failed to load {{table.name}}"), err) + } + {{~end~}} + return tables, nil +} + diff --git a/Tools/Luban/Templates/go-json/bean.sbn b/Tools/Luban/Templates/go-json/bean.sbn new file mode 100644 index 00000000..1da3b0e4 --- /dev/null +++ b/Tools/Luban/Templates/go-json/bean.sbn @@ -0,0 +1,50 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~ + go_full_name = full_name __this + parent_def_type = __this.parent_def_type + is_abstract_type = __this.is_abstract_type + hierarchy_fields = __this.hierarchy_export_fields + hierarchy_not_abstract_children = __this.hierarchy_not_abstract_children +~}} + +{{collect_import __this}} + +type {{go_full_name}} struct { + {{~for field in hierarchy_fields ~}} + {{format_field_name __code_style field.name}} {{declaring_type_name field.ctype}} + {{~end~}} +} + +const TypeId_{{go_full_name}} = {{__this.id}} + +func (*{{go_full_name}}) GetTypeId() int32 { + return {{__this.id}} +} + +{{~if is_abstract_type~}} +func New{{go_full_name}}(_buf map[string]interface{}) (interface{}, error) { + var id string + var _ok_ bool + if id, _ok_ = _buf["$type"].(string) ; !_ok_ { + return nil, errors.New("type id missing") + } + switch id { + {{~for child in hierarchy_not_abstract_children~}} + case "{{impl_data_type child __this}}": _v, err := New{{full_name child}}(_buf); if err != nil { return nil, errors.New("{{full_name child|string.downcase}}") } else { return _v, nil } + {{~end~}} + default: return nil, errors.New("unknown type id") + } +} + +{{~else~}} +func New{{go_full_name}}(_buf map[string]interface{}) (_v *{{go_full_name}}, err error) { + _v = &{{go_full_name}}{} + {{~for field in hierarchy_fields ~}} + {{deserialize_field field.ctype ("_v." + (format_field_name __code_style field.name)) field.name '_buf'}} + {{~end~}} + return +} +{{~end~}} diff --git a/Tools/Luban/Templates/go-json/table.sbn b/Tools/Luban/Templates/go-json/table.sbn new file mode 100644 index 00000000..3fd5f9e4 --- /dev/null +++ b/Tools/Luban/Templates/go-json/table.sbn @@ -0,0 +1,103 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~ + go_full_name = full_name __this + key_type = __this.key_ttype + value_type = __this.value_ttype + index_field = __this.index_field +~}} + +{{~if __this.is_map_table~}} +type {{go_full_name}} struct { + _dataMap map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}} + _dataList []{{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf []map[string]interface{}) (*{{go_full_name}}, error) { + _dataList := make([]{{declaring_type_name value_type}}, 0, len(_buf)) + dataMap := make(map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}}) + + for _, _ele_ := range _buf { + if _v, err2 := New{{full_name value_type.def_bean}}(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) +{{~if value_type.is_dynamic ~}} + {{~for child in value_type.def_bean.hierarchy_not_abstract_children~}} + if __v, __is := _v.(*{{full_name child}}) ; __is { + dataMap[__v.{{format_field_name __code_style index_field.name}}] = _v + continue + } + {{~end~}} +{{~else~}} + dataMap[_v.{{format_field_name __code_style index_field.name}}] = _v +{{~end~}} + } + } + return &{{go_full_name}}{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *{{go_full_name}}) GetDataMap() map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}} { + return table._dataMap +} + +func (table *{{go_full_name}}) GetDataList() []{{declaring_type_name value_type}} { + return table._dataList +} + +func (table *{{go_full_name}}) Get(key {{declaring_type_name key_type}}) {{declaring_type_name value_type}} { + return table._dataMap[key] +} + +{{~else if __this.is_list_table~}} +type {{go_full_name}} struct { + _dataList []{{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf []map[string]interface{}) (*{{go_full_name}}, error) { + _dataList := make([]{{declaring_type_name value_type}}, 0, len(_buf)) + for _, _ele_ := range _buf { + if _v, err2 := New{{full_name value_type.def_bean}}(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + } + } + return &{{go_full_name}}{_dataList:_dataList}, nil +} + +func (table *{{go_full_name}}) GetDataList() []{{declaring_type_name value_type}} { + return table._dataList +} + +func (table *{{go_full_name}}) Get(index int) {{declaring_type_name value_type}} { + return table._dataList[index] +} + +{{~else~}} + +import "errors" + +type {{go_full_name}} struct { + _data {{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf []map[string]interface{}) (*{{go_full_name}}, error) { + if len(_buf) != 1 { + return nil, errors.New(" size != 1 ") + } else { + if _v, err2 := New{{full_name value_type.def_bean}}(_buf[0]); err2 != nil { + return nil, err2 + } else { + return &{{go_full_name}}{_data:_v}, nil + } + } +} + +func (table *{{go_full_name}}) Get() {{declaring_type_name value_type}} { + return table._data +} + +{{~end~}} diff --git a/Tools/Luban/Templates/go-json/tables.sbn b/Tools/Luban/Templates/go-json/tables.sbn new file mode 100644 index 00000000..6f174821 --- /dev/null +++ b/Tools/Luban/Templates/go-json/tables.sbn @@ -0,0 +1,28 @@ +{{~if __namespace != ''~}} +package {{__namespace}}; +{{~end~}} + +type JsonLoader func(string) ([]map[string]interface{}, error) + +type {{__name}} struct { + {{~for table in __tables ~}} + {{table.name}} *{{full_name table}} + {{~end~}} +} + +func NewTables(loader JsonLoader) (*{{__name}}, error) { + var err error + var buf []map[string]interface{} + + tables := &{{__name}}{} + {{~for table in __tables ~}} + if buf, err = loader("{{table.output_data_file}}") ; err != nil { + return nil, err + } + if tables.{{table.name}}, err = New{{full_name table}}(buf) ; err != nil { + return nil, err + } + {{~end~}} + return tables, nil +} + diff --git a/Tools/Luban/Templates/java-bin/bean.sbn b/Tools/Luban/Templates/java-bin/bean.sbn new file mode 100644 index 00000000..39f90f0a --- /dev/null +++ b/Tools/Luban/Templates/java-bin/bean.sbn @@ -0,0 +1,65 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +import luban.*; + +{{~ + parent_def_type = __this.parent_def_type + export_fields = __this.export_fields + hierarchy_export_fields = __this.hierarchy_export_fields +~}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public {{class_modifier __this}} class {{__name}} extends {{if parent_def_type}}{{__this.parent_def_type.full_name_with_top_module}}{{else}}AbstractBean{{end}} { + public {{__name}}(ByteBuf _buf) { + {{~if parent_def_type~}} + super(_buf); + {{~end~}} + {{~ for field in export_fields ~}} + {{deserialize '_buf' (format_field_name __code_style field.name) field.ctype}} + {{~end~}} + } + + public static {{__name}} deserialize(ByteBuf _buf) { + {{~if __this.is_abstract_type~}} + switch (_buf.readInt()) { + {{~for child in __this.hierarchy_not_abstract_children~}} + case {{child.full_name_with_top_module}}.__ID__: return new {{child.full_name_with_top_module}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__this.full_name_with_top_module}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public final {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + {{~end~}} + +{{~if !__this.is_abstract_type~}} + public static final int __ID__ = {{__this.id}}; + + @Override + public int getTypeId() { return __ID__; } +{{~end~}} + + @Override + public String toString() { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{format_field_name __code_style field.name}} + "," + {{~end~}} + + "}"; + } +} diff --git a/Tools/Luban/Templates/java-bin/table.sbn b/Tools/Luban/Templates/java-bin/table.sbn new file mode 100644 index 00000000..8f3c2225 --- /dev/null +++ b/Tools/Luban/Templates/java-bin/table.sbn @@ -0,0 +1,81 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +import luban.*; + + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public final class {{__name}} { + {{~if __this.is_map_table + key_type = __this.key_ttype + ~}} + private final java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}> _dataMap; + private final java.util.ArrayList<{{declaring_box_type_name __value_type}}> _dataList; + + public {{__name}}(ByteBuf _buf) { + _dataMap = new java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}>(); + _dataList = new java.util.ArrayList<{{declaring_box_type_name __value_type}}>(); + + for(int n = _buf.readSize() ; n > 0 ; --n) { + {{declaring_box_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.add(_v); + _dataMap.put(_v.{{format_field_name __code_style __this.index_field.name}}, _v); + } + } + + public java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}> getDataMap() { return _dataMap; } + public java.util.ArrayList<{{declaring_box_type_name __value_type}}> getDataList() { return _dataList; } + +{{~if __value_type.is_dynamic~}} + @SuppressWarnings("unchecked") + public T getAs({{declaring_type_name key_type}} key) { return (T)_dataMap.get(key); } +{{~end~}} + public {{declaring_box_type_name __value_type}} get({{declaring_type_name key_type}} key) { return _dataMap.get(key); } + + {{~else if __this.is_list_table ~}} + private final java.util.ArrayList<{{declaring_box_type_name __value_type}}> _dataList; + + public {{__name}}(ByteBuf _buf) { + _dataList = new java.util.ArrayList<{{declaring_box_type_name __value_type}}>(); + + for(int n = _buf.readSize() ; n > 0 ; --n) { + {{declaring_box_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.add(_v); + } + } + + public java.util.ArrayList<{{declaring_box_type_name __value_type}}> getDataList() { return _dataList; } + + public {{declaring_box_type_name __value_type}} get(int index) { return _dataList.get(index); } + + + {{~else~}} + private final {{declaring_type_name __value_type}} _data; + + public final {{declaring_type_name __value_type}} data() { return _data; } + + public {{__name}}(ByteBuf _buf) { + int n = _buf.readSize(); + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_buf' '_data' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public {{declaring_type_name field.ctype}} {{getter_name field.name}}() { return _data.{{format_field_name __code_style field.name}}; } + {{~end~}} + + {{~end~}} +} \ No newline at end of file diff --git a/Tools/Luban/Templates/java-bin/tables.sbn b/Tools/Luban/Templates/java-bin/tables.sbn new file mode 100644 index 00000000..7ab77d85 --- /dev/null +++ b/Tools/Luban/Templates/java-bin/tables.sbn @@ -0,0 +1,37 @@ +{{~if __namespace != ''~}} +package {{__namespace}}; +{{~end~}} + +import luban.*; +{{~ +func get_table_inner_name + ret '_' + ($0 | string.downcase) +end +~}} + +public final class {{__name}} +{ + public static interface IByteBufLoader { + ByteBuf load(String file) throws java.io.IOException; + } + + {{~for table in __tables + inner_name = get_table_inner_name table.name + ~}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + private final {{table.full_name_with_top_module}} {{inner_name}}; + public {{table.full_name_with_top_module}} get{{table.name}}() { return {{inner_name}}; } + {{~end~}} + + public {{__name}}(IByteBufLoader loader) throws java.io.IOException { + {{~for table in __tables + inner_name = get_table_inner_name table.name + ~}} + {{inner_name}} = new {{table.full_name_with_top_module}}(loader.load("{{table.output_data_file}}")); + {{~end~}} + } +} diff --git a/Tools/Luban/Templates/java-json/bean.sbn b/Tools/Luban/Templates/java-json/bean.sbn new file mode 100644 index 00000000..34fe4158 --- /dev/null +++ b/Tools/Luban/Templates/java-json/bean.sbn @@ -0,0 +1,67 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +import luban.*; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +{{~ + parent_def_type = __this.parent_def_type + export_fields = __this.export_fields + hierarchy_export_fields = __this.hierarchy_export_fields +~}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public {{class_modifier __this}} class {{__name}} extends {{if parent_def_type}}{{__this.parent_def_type.full_name_with_top_module}}{{else}}AbstractBean{{end}} { + public {{__name}}(JsonObject _buf) { + {{~if parent_def_type~}} + super(_buf); + {{~end~}} + {{~ for field in export_fields ~}} + {{deserialize_field (format_field_name __code_style field.name) '_buf' field.name field.ctype}} + {{~end~}} + } + + public static {{__name}} deserialize(JsonObject _buf) { + {{~if __this.is_abstract_type~}} + switch (_buf.get("$type").getAsString()) { + {{~for child in __this.hierarchy_not_abstract_children~}} + case "{{impl_data_type child __this}}": return new {{child.full_name_with_top_module}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__this.full_name_with_top_module}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public final {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + {{~end~}} + +{{~if !__this.is_abstract_type~}} + public static final int __ID__ = {{__this.id}}; + + @Override + public int getTypeId() { return __ID__; } +{{~end~}} + + @Override + public String toString() { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{format_field_name __code_style field.name}} + "," + {{~end~}} + + "}"; + } +} diff --git a/Tools/Luban/Templates/java-json/table.sbn b/Tools/Luban/Templates/java-json/table.sbn new file mode 100644 index 00000000..d4a5ebd6 --- /dev/null +++ b/Tools/Luban/Templates/java-json/table.sbn @@ -0,0 +1,82 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +import luban.*; +import com.google.gson.JsonElement; + + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public final class {{__name}} { + {{~if __this.is_map_table + key_type = __this.key_ttype + ~}} + private final java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}> _dataMap; + private final java.util.ArrayList<{{declaring_box_type_name __value_type}}> _dataList; + + public {{__name}}(JsonElement _buf) { + _dataMap = new java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}>(); + _dataList = new java.util.ArrayList<{{declaring_box_type_name __value_type}}>(); + + for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { + {{declaring_box_type_name __value_type}} _v; + {{deserialize '_v' '_e_' __value_type}} + _dataList.add(_v); + _dataMap.put(_v.{{format_field_name __code_style __this.index_field.name}}, _v); + } + } + + public java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}> getDataMap() { return _dataMap; } + public java.util.ArrayList<{{declaring_box_type_name __value_type}}> getDataList() { return _dataList; } + +{{~if __value_type.is_dynamic~}} + @SuppressWarnings("unchecked") + public T getAs({{declaring_type_name key_type}} key) { return (T)_dataMap.get(key); } +{{~end~}} + public {{declaring_box_type_name __value_type}} get({{declaring_type_name key_type}} key) { return _dataMap.get(key); } + + {{~else if __this.is_list_table ~}} + private final java.util.ArrayList<{{declaring_box_type_name __value_type}}> _dataList; + + public {{__name}}(JsonElement _buf) { + _dataList = new java.util.ArrayList<{{declaring_box_type_name __value_type}}>(); + + for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { + {{declaring_box_type_name __value_type}} _v; + {{deserialize '_v' '_e_' __value_type}} + _dataList.add(_v); + } + } + + public java.util.ArrayList<{{declaring_box_type_name __value_type}}> getDataList() { return _dataList; } + + public {{declaring_box_type_name __value_type}} get(int index) { return _dataList.get(index); } + + + {{~else~}} + private final {{declaring_type_name __value_type}} _data; + + public final {{declaring_type_name __value_type}} data() { return _data; } + + public {{__name}}(JsonElement _buf) { + int n = _buf.getAsJsonArray().size(); + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_data' '_buf.getAsJsonArray().get(0).getAsJsonObject()' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public {{declaring_type_name field.ctype}} {{getter_name field.name}}() { return _data.{{format_field_name __code_style field.name}}; } + {{~end~}} + + {{~end~}} +} \ No newline at end of file diff --git a/Tools/Luban/Templates/java-json/tables.sbn b/Tools/Luban/Templates/java-json/tables.sbn new file mode 100644 index 00000000..dbb624b0 --- /dev/null +++ b/Tools/Luban/Templates/java-json/tables.sbn @@ -0,0 +1,39 @@ +{{~if __namespace != ''~}} +package {{__namespace}}; +{{~end~}} + +import luban.*; +import com.google.gson.JsonElement; +{{~ +func get_table_inner_name + ret '_' + ($0 | string.downcase) +end +~}} + +public final class {{__name}} +{ + + public interface IJsonLoader { + JsonElement load(String file) throws java.io.IOException; + } + + {{~for table in __tables + inner_name = get_table_inner_name table.name + ~}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + private final {{table.full_name_with_top_module}} {{inner_name}}; + public {{table.full_name_with_top_module}} get{{table.name}}() { return {{inner_name}}; } + {{~end~}} + + public {{__name}}(IJsonLoader loader) throws java.io.IOException { + {{~for table in __tables + inner_name = get_table_inner_name table.name + ~}} + {{inner_name}} = new {{table.full_name_with_top_module}}(loader.load("{{table.output_data_file}}")); + {{~end~}} + } +} diff --git a/Tools/Luban/Templates/lua-bin/schema.sbn b/Tools/Luban/Templates/lua-bin/schema.sbn new file mode 100644 index 00000000..5a492a7f --- /dev/null +++ b/Tools/Luban/Templates/lua-bin/schema.sbn @@ -0,0 +1,158 @@ +local setmetatable = setmetatable +local pairs = pairs +local ipairs = ipairs +local tinsert = table.insert + +local function SimpleClass() + local class = {} + class.__index = class + class.New = function(...) + local ctor = class.ctor + local o = ctor and ctor(...) or {} + setmetatable(o, class) + return o + end + return class +end + + +local function get_map_size(m) + local n = 0 + for _ in pairs(m) do + n = n + 1 + end + return n +end + +local enums = +{ + {{~ for c in __enums ~}} + ---@class {{c.full_name}} {{-if c.comment != ''}} @{{escape_comment c.comment}}{{end}} + {{~ for item in c.items ~}} + ---@field public {{item.name}} integer {{-if item.comment != ''}} @{{escape_comment item.comment}}{{end}} + {{~end~}} + ['{{c.full_name}}'] = { {{ for item in c.items }} {{item.name}}={{item.int_value}}, {{end}} }; + {{~end~}} +} + +local tables = +{ +{{~for table in __tables ~}} + {{~if table.is_map_table ~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='map', index='{{table.index}}', value_type='{{table.value_ttype.def_bean.full_name}}' }, + {{~else if table.is_list_table ~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='list', index='{{table.index}}', value_type='{{table.value_ttype.def_bean.full_name}}' }, + {{~else~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='one', value_type='{{table.value_ttype.def_bean.full_name}}'}, + {{~end~}} +{{~end~}} +} + +local function InitTypes(methods) + local readBool = methods.readBool + local readByte = methods.readByte + local readShort = methods.readShort + local readFshort = methods.readFshort + local readInt = methods.readInt + local readFint = methods.readFint + local readLong = methods.readLong + local readFlong = methods.readFlong + local readFloat = methods.readFloat + local readDouble = methods.readDouble + local readSize = methods.readSize + + local readString = methods.readString + + local function readList(bs, keyFun) + local list = {} + local v + for i = 1, readSize(bs) do + tinsert(list, keyFun(bs)) + end + return list + end + + local readArray = readList + + local function readSet(bs, keyFun) + local set = {} + local v + for i = 1, readSize(bs) do + tinsert(set, keyFun(bs)) + end + return set + end + + local function readMap(bs, keyFun, valueFun) + local map = {} + for i = 1, readSize(bs) do + local k = keyFun(bs) + local v = valueFun(bs) + map[k] = v + end + return map + end + + local function readNullableBool(bs) + if readBool(bs) then + return readBool(bs) + end + end + + local beans = {} + {{~ for bean in __beans ~}} + do + ---@class {{bean.full_name}} {{if bean.parent_def_type}}:{{bean.parent}} {{end}} {{-if bean.comment != ''}} @{{escape_comment bean.comment}}{{end}} + {{~ for field in bean.export_fields~}} + ---@field public {{field.name}} {{comment_type field.ctype}} {{-if field.comment != ''}} @{{escape_comment field.comment}}{{end}} + {{~end~}} + local class = { + {{~ for field in bean.export_fields~}} + { name='{{field.name}}', type='{{comment_type field.ctype}}'}, + {{~end~}} + } + beans['{{bean.full_name}}'] = class + end + {{~end~}} + + local beans = {} +{{~ for bean in __beans ~}} + do + ---@class {{bean.full_name}} {{if bean.parent_def_type}}:{{bean.parent}} {{end}} + {{~ for field in bean.export_fields~}} + ---@field public {{field.name}} {{comment_type field.ctype}} + {{~end~}} + local class = SimpleClass() + class._id = {{bean.id}} + class._type_ = '{{bean.full_name}}' + local id2name = { {{for c in bean.hierarchy_not_abstract_children}} [{{c.id}}] = '{{c.full_name}}', {{end}} } +{{~if bean.is_abstract_type~}} + class._deserialize = function(bs) + local id = readInt(bs) + return beans[id2name[id]]._deserialize(bs) + end +{{~else~}} + class._deserialize = function(bs) + local o = { + {{~ for field in bean.hierarchy_export_fields ~}} + {{~if !(need_marshal_bool_prefix field.ctype)~}} + {{field.name}} = {{deserialize 'bs' field.ctype}}, + {{~else~}} + {{field.name}} = {{if !field.ctype.is_bool}}readBool(bs) and {{deserialize 'bs' field.ctype}} or nil {{-else-}} readNullableBool(bs) {{-end-}}, + {{~end~}} + {{~end~}} + } + setmetatable(o, class) + return o + end +{{~end~}} + beans[class._type_] = class + end +{{~end~}} + + + return { enums = enums, beans = beans, tables = tables } + end + +return { InitTypes = InitTypes } + diff --git a/Tools/Luban/Templates/lua-lua/schema.sbn b/Tools/Luban/Templates/lua-lua/schema.sbn new file mode 100644 index 00000000..3a75e1a3 --- /dev/null +++ b/Tools/Luban/Templates/lua-lua/schema.sbn @@ -0,0 +1,42 @@ + +local enums = +{ + {{~ for c in __enums ~}} + ---@class {{c.full_name}} {{-if c.comment != ''}} @{{escape_comment c.comment}}{{end}} + {{~ for item in c.items ~}} + ---@field public {{item.name}} integer {{-if item.comment != ''}} @{{escape_comment item.comment}}{{end}} + {{~end~}} + ['{{c.full_name}}'] = { {{ for item in c.items }} {{item.name}}={{item.int_value}}, {{end}} }; + {{~end~}} +} + +local beans = {} +{{~ for bean in __beans ~}} + do + ---@class {{bean.full_name}} {{if bean.parent_def_type}}:{{bean.parent}} {{end}} {{-if bean.comment != ''}} @{{escape_comment bean.comment}}{{end}} + {{~ for field in bean.export_fields~}} + ---@field public {{field.name}} {{comment_type field.ctype}} {{-if field.comment != ''}} @{{escape_comment field.comment}}{{end}} + {{~end~}} + local class = { + {{~ for field in bean.export_fields~}} + { name='{{field.name}}', type='{{comment_type field.ctype}}'}, + {{~end~}} + } + beans['{{bean.full_name}}'] = class + end +{{~end~}} + +local tables = +{ +{{~for table in __tables ~}} + {{~if table.is_map_table ~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='map', index='{{table.index}}', value_type='{{table.value_ttype.def_bean.full_name}}' }, + {{~else if table.is_list_table ~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='list', index='{{table.index}}', value_type='{{table.value_ttype.def_bean.full_name}}' }, + {{~else~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='one', value_type='{{table.value_ttype.def_bean.full_name}}'}, + {{~end~}} +{{~end~}} +} + +return { enums = enums, beans = beans, tables = tables } diff --git a/Tools/Luban/Templates/pb/schema.sbn b/Tools/Luban/Templates/pb/schema.sbn new file mode 100644 index 00000000..fce80354 --- /dev/null +++ b/Tools/Luban/Templates/pb/schema.sbn @@ -0,0 +1,41 @@ +syntax = "{{__syntax}}"; + +package {{__namespace}}; + +{{~for enum in __enums + typeName = full_name enum + ~}} +enum {{typeName}} { + {{~if !enum.has_zero_value_item ~}} + {{typeName}}_EMPTY_PLACEHOLDER = 0; + {{~end~}} + {{~for item in enum.items ~}} + {{typeName}}_{{item.name}} = {{item.int_value}}; + {{~end~}} +} +{{~end~}} + +{{~for bean in __beans + typeName = full_name bean +~}} +message {{typeName}} { +{{~if bean.is_abstract_type ~}} + oneof value { + {{~for c in bean.hierarchy_not_abstract_children~}} + {{full_name c}} {{c.name}} = {{c.auto_id}}; + {{~end~}} + } +{{~else~}} + {{~for f in bean.hierarchy_export_fields ~}} + {{pre_decorator f.ctype}} {{declaring_type_name f.ctype}} {{f.name}} = {{f.auto_id}} {{suffix_options f.ctype}}; + {{~end~}} +{{~end~}} +} +{{~end~}} + +{{~for table in __tables~}} +message {{full_name table}} { + repeated {{declaring_type_name table.value_ttype}} data_list = 1 [packed = false]; +} +{{~end~}} + diff --git a/Tools/Luban/Templates/php-json/schema.sbn b/Tools/Luban/Templates/php-json/schema.sbn new file mode 100644 index 00000000..478c850f --- /dev/null +++ b/Tools/Luban/Templates/php-json/schema.sbn @@ -0,0 +1,155 @@ +{{~namespace_with_grace_begin __namespace~}} + +{{~for enum in __enums~}} +{{~if enum.comment != '' ~}} +/** + * {{enum.comment | html.escape}} + */ +{{~end~}} +class {{full_name enum}} { + {{~for item in enum.items ~}} +{{~if item.comment != '' ~}} + /** + * {{escape_comment item.comment}} + */ +{{~end~}} + public const {{item.name}} = {{item.value}}; + {{~end~}} +} + +{{~end~}} + + +{{~for bean in __beans~}} +{{name = (full_name bean)}} +{{~if bean.comment != '' ~}} +/** + * {{escape_comment bean.comment}} + */ +{{~end~}} +{{class_modifier bean}} class {{name}}{{if bean.parent_def_type}} extends {{full_name bean.parent_def_type}}{{end}} { +{{~if bean.is_abstract_type~}} + public static function constructFrom($_json_) { + $type = $_json_['$type']; + switch ($type) { + {{~ for child in bean.hierarchy_not_abstract_children~}} + case '{{impl_data_type child bean}}': return new {{full_name child}}($_json_); + {{~end~}} + default: throw new \Exception("unknown type:$type"); + } + } +{{~end~}} + + public function __construct($_json_) { + {{~if bean.parent_def_type~}} + parent::__construct($_json_); + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{~if !field.ctype.is_nullable~}} + if (!array_key_exists('{{field.name}}', $_json_)) { throw new \Exception("field:'{{field.name}}' missing"); } + {{~end~}} + {{deserialize ('$this->' + format_field_name __code_style field.name) ( '$_json_[\'' + field.name + '\']') field.ctype}}; + {{~end~}} + } + + {{~ for field in bean.export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public ${{format_field_name __code_style field.name}}; + {{~end~}} +} + + +{{~end~}} + +{{~for table in __tables + key_type = table.key_ttype + value_type = table.value_ttype + name = (full_name table) +~}} + +{{~if table.comment != '' ~}} +/** + * {{escape_comment table.comment}} + */ +{{~end~}} +class {{name}} { + {{~if table.is_map_table ~}} + private $_dataMap; + private $_dataList; + public function __construct($_json_) { + $this->_dataMap = []; + $this->_dataList = []; + foreach ($_json_ as $_json2_) { + {{deserialize '$_v' '$_json2_' value_type}}; + array_push($this->_dataList, $_v); + $this->_dataMap[$_v->{{format_field_name __code_style table.index_field.name}}] = $_v; + } + } + + public function getDataMap() { return $this->_dataMap; } + public function getDataList() { return $this->_dataList; } + + public function get($key) { return $this->_dataMap[$key]; } + + {{~else if table.is_list_table ~}} + private $_dataList; + + public function __construct($_json_) { + $this->_dataList = []; + foreach ($_json_ as $_json2_) { + {{deserialize '$_v' '$_json2_' value_type}}; + array_push($this->_dataList, $_v); + } + } + + public function getDataList() { return $this->_dataList; } + + public function get($index) { return $this->_dataList[$index]; } + + {{~else~}} + + private $_data; + public function __construct($_json_) { + if (count($_json_) != 1) throw new \Exception('table:{{table.name}} mode=one, but size != 1'); + {{deserialize '$this->_data' '$_json_[0]' value_type}}; + } + + public function getData() { return $this->_data; } + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public function get{{format_field_name __code_style field.name}}() { return $this->_data->{{format_field_name __code_style field.name}}; } + {{~end~}} + + {{end}} +} + +{{~end~}} + +class {{__name}} { + {{~ for table in __tables ~}} + private $_{{table.name}}; +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + public function get{{table.name}}() { return $this->_{{table.name}}; } + {{~end~}} + + public function __construct($loader) { + {{~for table in __tables ~}} + $this->_{{table.name}} = new {{full_name table}}($loader('{{table.output_data_file}}')); + {{~end~}} + } +} + +{{~namespace_with_grace_end __namespace~}} diff --git a/Tools/Luban/Templates/python-json/schema.sbn b/Tools/Luban/Templates/python-json/schema.sbn new file mode 100644 index 00000000..dfa6e4bb --- /dev/null +++ b/Tools/Luban/Templates/python-json/schema.sbn @@ -0,0 +1,156 @@ +from enum import Enum +{{ + + func table_key_list + table = $0 + varName = $1 + indexList = table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_name_list + table = $0 + paramList = table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} + +{{~for enum in __enums~}} +{{~if enum.comment != '' ~}} +''' +{{enum.comment | html.escape}} +''' +{{~end~}} +class {{full_name enum}}(Enum): + {{~ for item in enum.items ~}} +{{~if item.comment_or_alias != '' ~}} + ''' + {{item.comment_or_alias | html.escape}} + ''' +{{~end~}} + {{item.name}} = {{item.value}} + {{~end~}} + {{~if enum.items.empty?~}} + pass + {{~end~}} + +{{~end~}} + +{{~for bean in __beans + name = (full_name bean) +~}} +class {{name}} {{if bean.parent_def_type}}({{full_name bean.parent_def_type}}){{end}}: +{{~if bean.is_abstract_type~}} + _childrenTypes = None + @staticmethod + def fromJson(_json_): + childrenTypes = {{name}}._childrenTypes + if not childrenTypes: + childrenTypes = {{name}}._childrenTypes = { + {{~ for child in bean.hierarchy_not_abstract_children~}} + '{{impl_data_type child bean}}': {{name}}, + {{~end~}} + } + type = _json_['$type'] + child = {{name}}._childrenTypes.get(type) + if child != None: + return child(_json_) + else: + raise Exception() +{{~end~}} + def __init__(self, _json_): + {{~if bean.parent_def_type~}} + {{full_name bean.parent_def_type}}.__init__(self, _json_) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{deserialize_field ('self.' + (format_field_name __code_style field.name)) '_json_' field.name field.ctype}} + {{~end~}} + {{~if bean.export_fields.empty?}} + pass + {{~end~}} + +{{~end~}} + +{{~for table in __tables + value_type = table.value_ttype +~}} +class {{full_name table}}: + {{~if table.is_map_table ~}} + + def __init__(self, _json_ ): + self._dataMap = {} + self._dataList = [] + + for _json2_ in _json_: + {{deserialize '_v' '_json2_' value_type}} + self._dataList.append(_v) + self._dataMap[_v.{{format_field_name __code_style table.index_field.name}}] = _v + + def getDataMap(self) : return self._dataMap + def getDataList(self) : return self._dataList + + def get(self, key) : return self._dataMap.get(key) + {{~else if table.is_union_index~}} + + def __init__(self, _json_ ): + self._dataMap = {} + self._dataList = [] + + for _json2_ in _json_: + {{deserialize '_v' '_json2_' value_type}} + self._dataList.append(_v) + self._dataMap[({{table_key_list table '_v'}})] = _v + + def getDataMap(self) : return self._dataMap + def getDataList(self) : return self._dataList + + def get(self, {{table_param_name_list table}}) : return self._dataMap.get(({{table_param_name_list table}})) + + {{~else if table.is_list_table ~}} + + def __init__(self, _json_ ): + self._dataList = [] + {{~for idx in table.index_list~}} + self._dataMap_{{idx.index_field.name}} = {} + {{~end~}} + for _json2_ in _json_: + {{deserialize '_v' '_json2_' value_type}} + self._dataList.append(_v) + {{~for idx in table.index_list~}} + self._dataMap_{{idx.index_field.name}}[_v.{{format_property_name __code_style idx.index_field.name}}] = _v + {{~end~}} + + def getDataList(self) : return self._dataList + + def get(self, index) : return self._dataList[index] + {{~for idx in table.index_list~}} + def get_by_{{format_property_name __code_style idx.index_field.name}}(self, key): return self._dataMap_{{idx.index_field.name}}.get(key) + {{~end~}} + {{~else~}} + + def __init__(self, _json_): + if (len(_json_) != 1): raise Exception('table mode=one, but size != 1') + {{deserialize 'self._data' '_json_[0]' value_type}} + + def getData(self) : return self._data + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' + name = format_field_name __code_style field.name +~}} + ''' + {{escape_comment field.comment}} + ''' +{{~end~}} + def {{name}}(self) : return self._data.{{name}} + {{~end~}} + {{~end~}} + +{{~end~}} + + +class {{str_full_name __full_name}}: + def __init__(self, loader): + {{~for table in __tables ~}} + self.{{format_method_name __code_style table.name}} = {{full_name table}}(loader('{{table.output_data_file}}')); + {{~end~}} diff --git a/Tools/Luban/Templates/rust-bin/lib.sbn b/Tools/Luban/Templates/rust-bin/lib.sbn new file mode 100644 index 00000000..254110e7 --- /dev/null +++ b/Tools/Luban/Templates/rust-bin/lib.sbn @@ -0,0 +1,51 @@ +pub mod prelude{ + pub use crate::*; +{{~ for ns in __ns ~}} + pub use {{ns}}::*; +{{~end~}} +} +{{~ if __polymorphic_beans.count != 0 ~}} + +type AbstractBase = dyn std::any::Any + Sync + Send; + +pub trait GetBase<'a, T> { + fn get_base(&'a self) -> Result; +} +{{~end~}} + +#[derive(Debug)] +pub enum LubanError { + Loader(String), + Table(String), + Bean(String), + Polymorphic(String), + Unknown(String), +} + +impl std::fmt::Display for LubanError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(match self { + LubanError::Loader(msg) | + LubanError::Table(msg) | + LubanError::Bean(msg) | + LubanError::Polymorphic(msg) | + LubanError::Unknown(msg) => msg, + }) + } +} + +pub struct Tables{ +{{~ for table in __tables ~}} + pub {{table.name}}: std::sync::Arc<{{full_name table}}>, +{{~end~}} +} + +impl Tables { + pub fn new Result>(loader: T) -> Result { + Ok(Tables { +{{~ for table in __tables ~}} + {{table.name}}: {{full_name table}}::new(loader("{{table.output_data_file}}")?)?, +{{~end~}} + }) + } +} \ No newline at end of file diff --git a/Tools/Luban/Templates/rust-bin/mod.sbn b/Tools/Luban/Templates/rust-bin/mod.sbn new file mode 100644 index 00000000..a844024b --- /dev/null +++ b/Tools/Luban/Templates/rust-bin/mod.sbn @@ -0,0 +1,280 @@ +{{~ for mod in __mod.sub_mods ~}} +pub mod {{mod.name}}; +{{~end~}} + +{{~ if __mod.name != '' ~}} +use super::*; +{{~end~}} +use luban_lib::*; + +{{~ for enum in __mod.enums ~}} +{{~ if enum.comment != '' ~}} +///{{enum.comment | html.escape}} +{{~end~}} +{{~ if enum.is_flags ~}} +bitflags::bitflags!{ + #[derive(Debug, Hash, Eq, PartialEq)] + pub struct {{enum.name}} : u32 { + {{~ for item in enum.items ~}} + {{~if item.comment_or_alias != '' ~}} + ///{{item.comment_or_alias | html.escape}} + {{~end~}} + const {{item.name}} = {{item.int_value}}; + {{~end~}} + } +} +{{~else~}} +#[derive(Debug, Hash, Eq, PartialEq, macros::EnumFromNum)] +pub enum {{enum.name}} { + {{~ for item in enum.items ~}} +{{~if item.comment_or_alias != '' ~}} + ///{{item.comment_or_alias | html.escape}} +{{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} + {{~if enum.items.empty?~}} + None + {{~end~}} +} + +impl From for {{enum.name}} { + fn from(value: i32) -> Self { + match value { + {{~ for item in enum.items ~}} + {{item.value}} => {{enum.name}}::{{item.name}}, + {{~end~}} + _ => panic!("Invalid value for {{enum.name}}:{}", value), + } + } +} + +{{~end~}} +{{~end~}} +{{~ for bean in __mod.beans + hierarchy_fields = bean.hierarchy_export_fields +~}} +#[derive(Debug)] +{{~if bean.parent != ''~}} +#[derive(macros::TryIntoBase)] +{{~end~}} +pub struct {{bean.name}} { + {{~ for field in hierarchy_fields ~}} +{{~if field.comment != '' ~}} + /// {{escape_comment field.comment}} +{{~end~}} + pub {{field.name}}: {{declaring_type_name field.ctype}}, + {{~end~}} +} +{{~if bean.is_abstract_type~}} + +impl {{bean.name}} { + pub fn new(mut buf: &mut ByteBuf) -> Result, LubanError> { + let type_id = buf.read_int(); + match type_id { + {{~for child in bean.hierarchy_not_abstract_children~}} + {{full_name child}}::__ID__ => Ok(std::sync::Arc::new({{full_name child}}::new(buf)?)), + {{~end~}} + _ => Err(LubanError::Bean(format!("Invalid type for {{bean.name}}:{}", type_id))) + } + } +} + +pub trait T{{bean.name}} { + {{~ for field in hierarchy_fields ~}} + fn {{getter_name field.name}}(&self) -> &{{declaring_type_name field.ctype}}; + {{~end~}} +} +{{~for child in bean.hierarchy_not_abstract_children~}} + +impl {{base_trait_name bean}} for {{full_name child}} { + {{~ for field in hierarchy_fields ~}} + fn {{getter_name field.name}}(&self) -> &{{declaring_type_name field.ctype}} { + &self.{{field.name}} + } + {{~end~}} +} +{{~end~}} + +impl<'a> GetBase<'a, &'a dyn {{base_trait_name bean}}> for AbstractBase { + fn get_base(&'a self) -> Result<&'a dyn {{base_trait_name bean}}, LubanError> { + {{~for child in bean.hierarchy_not_abstract_children~}} + let base: Result<&{{full_name child}}, _> = self.try_into(); + if let Ok(r) = base { + return Ok(r); + } + {{~end~}} + + Err(LubanError::Polymorphic(format!("Invalid type for {{bean.name}}"))) + } +} +{{~else~}} + +impl {{bean.name}}{ + pub fn new(mut buf: &mut ByteBuf) -> Result<{{bean.name}}, LubanError> { + {{~ for field in hierarchy_fields ~}} + {{deserialize field.name 'buf' field.ctype}} + {{~end~}} + + Ok({{bean.name}} { {{ for field in hierarchy_fields }}{{field.name}}, {{end}}}) + } + + pub const __ID__: i32 = {{bean.id}}; +} +{{~end~}} + +{{~end~}} +{{~ for table in __mod.tables + key_type = declaring_type_name table.key_ttype + if table.value_ttype.def_bean.is_abstract_type + value_type = declaring_type_name table.value_ttype + else + value_type = "std::sync::Arc<"+declaring_type_name table.value_ttype+">" + end + name = table.name + map_type = "std::collections::HashMap<"+key_type+", "+value_type+">" +~}} +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'std::collections::HashMap<(' + (array.each table.index_list @index_type_name | array.join ', ') + '), ' + value_type + '>' + end + + func table_key_list + varName = $0 + indexList = table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{~ if table.comment != '' ~}} +///{{table.comment | html.escape}} +{{~end~}} +#[derive(Debug)] +pub struct {{table.name}} { + {{~if table.is_map_table ~}} + pub data_list: Vec<{{value_type}}>, + pub data_map: {{map_type}}, + {{~else if table.is_list_table ~}} + pub data_list: Vec<{{value_type}}>, + {{~if table.is_union_index~}} + pub data_map_union: {{table_union_map_type_name}}, + {{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + pub data_map_{{idx.index_field.name}}: std::collections::HashMap<{{declaring_type_name idx.type}}, {{value_type}}>, + {{~end~}} + {{~end~}} + {{~else~}} + pub data: {{declaring_type_name table.value_ttype}}, + {{~end~}} +} +{{~if table.is_map_table ~}} + +impl {{name}} { + pub fn new(mut buf: ByteBuf) -> Result, LubanError> { + let mut data_map: {{map_type}} = Default::default(); + let mut data_list: Vec<{{value_type}}> = vec![]; + + for x in (0..buf.read_size()).rev() { + {{deserialize_row "row" "buf" table.value_ttype}} + data_list.push(row.clone()); + {{~ if table.value_ttype.def_bean.is_abstract_type ~}} + let key = >::get_base(std::ops::Deref::deref(&row))?; + data_map.insert(key.{{getter_name table.index_field.name}}().clone(), row.clone()); + {{~else~}} + data_map.insert(row.{{table.index_field.name}}.clone(), row.clone()); + {{~end~}} + } + + Ok(std::sync::Arc::new({{name}} { data_map, data_list })) + } + + pub fn get(&self, key: &{{key_type}}) -> Option<{{value_type}}> { + self.data_map.get(key).map(|x| x.clone()) + } +} + +impl std::ops::Index<{{key_type}}> for {{name}} { + type Output = {{value_type}}; + + fn index(&self, index: {{key_type}}) -> &Self::Output { + &self.data_map.get(&index).unwrap() + } +} +{{~else if table.is_list_table ~}} + +impl {{name}} { + pub fn new(mut buf: ByteBuf) -> Result, LubanError> { + let mut data_list: Vec<{{value_type}}> = vec![]; + + for x in (0..buf.read_size()).rev() { + {{deserialize_row "row" "buf" table.value_ttype}} + data_list.push(row.clone()); + } + {{~if table.is_union_index~}} + let mut data_map_union: {{table_union_map_type_name}} = Default::default(); + for x in &data_list { + data_map_union.insert(({{table_key_list "x"}}.clone()), x.clone()); + } + {{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + let mut data_map_{{idx.index_field.name}}: std::collections::HashMap<{{declaring_type_name idx.index_field.ctype}}, {{value_type}}> = Default::default(); + {{~end~}} + for x in &data_list { + {{~for idx in table.index_list~}} + data_map_{{idx.index_field.name}}.insert(x.{{format_property_name __code_style idx.index_field.name}}.clone(), x.clone()); + {{~end~}} + } + {{~end~}} + + Ok(std::sync::Arc::new({{table.name}} { + data_list, +{{~if table.is_union_index~}} + data_map_union, +{{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + data_map_{{idx.index_field.name}}, + {{~end~}} +{{~end~}} + })) + } + + {{~if table.is_union_index~}} + pub fn get(&self, key: &({{array.each table.index_list @index_type_name | array.join ', '}})) -> Option<{{value_type}}> { + self.data_map_union.get(key).map(|x| x.clone()) + } + {{~else if !table.index_list.empty? ~}} + {{~for idx in table.index_list + index = format_property_name __code_style idx.index_field.name + ~}} + pub fn get_by_{{index}}(&self, key: &{{declaring_type_name idx.type}}) -> Option<{{value_type}}> { + self.data_map_{{index}}.get(key).map(|x| x.clone()) + } + {{~end~}} + {{~end~}} +} +{{~else~}} + +impl {{name}} { + pub fn new(mut buf: ByteBuf) -> Result, LubanError> { + let n = buf.read_size(); + if n != 1 { return Err(LubanError::Table(format!("table mode=one, but size != 1"))); } + {{deserialize 'data' 'buf' table.value_ttype}} + Ok(std::sync::Arc::new({{name}} { data })) + } +} +{{~end~}} + +{{~end~}} diff --git a/Tools/Luban/Templates/rust-bin/toml.sbn b/Tools/Luban/Templates/rust-bin/toml.sbn new file mode 100644 index 00000000..6345181f --- /dev/null +++ b/Tools/Luban/Templates/rust-bin/toml.sbn @@ -0,0 +1,11 @@ +[package] +name = "{{__name}}" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +bitflags = { version = "2.5.x" , features = ["serde"] } +macros = { path = "../macros" } +luban_lib = { path = "../../luban_lib" } \ No newline at end of file diff --git a/Tools/Luban/Templates/rust-json/lib.sbn b/Tools/Luban/Templates/rust-json/lib.sbn new file mode 100644 index 00000000..8f906cc1 --- /dev/null +++ b/Tools/Luban/Templates/rust-json/lib.sbn @@ -0,0 +1,51 @@ +pub mod prelude{ + pub use crate::*; +{{~ for ns in __ns ~}} + pub use {{ns}}::*; +{{~end~}} +} +{{~ if __polymorphic_beans.count != 0 ~}} + +type AbstractBase = dyn std::any::Any + Sync + Send; + +pub trait GetBase<'a, T> { + fn get_base(&'a self) -> Result; +} +{{~end~}} + +#[derive(Debug)] +pub enum LubanError { + Loader(String), + Table(String), + Bean(String), + Polymorphic(String), + Unknown(String), +} + +impl std::fmt::Display for LubanError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(match self { + LubanError::Loader(msg) | + LubanError::Table(msg) | + LubanError::Bean(msg) | + LubanError::Polymorphic(msg) | + LubanError::Unknown(msg) => msg, + }) + } +} + +pub struct Tables{ +{{~ for table in __tables ~}} + pub {{table.name}}: std::sync::Arc<{{full_name table}}>, +{{~end~}} +} + +impl Tables { + pub fn new Result>(loader: T) -> Result { + Ok(Tables { +{{~ for table in __tables ~}} + {{table.name}}: {{full_name table}}::new(&loader("{{table.output_data_file}}")?)?, +{{~end~}} + }) + } +} \ No newline at end of file diff --git a/Tools/Luban/Templates/rust-json/mod.sbn b/Tools/Luban/Templates/rust-json/mod.sbn new file mode 100644 index 00000000..fc2f0be4 --- /dev/null +++ b/Tools/Luban/Templates/rust-json/mod.sbn @@ -0,0 +1,287 @@ +{{~ for mod in __mod.sub_mods ~}} +pub mod {{mod.name}}; +{{~end~}} + +{{~ if __mod.name != '' ~}} +use super::*; +{{~end~}} +use serde::Deserialize; + +{{~ for enum in __mod.enums ~}} +{{~ if enum.comment != '' ~}} +///{{enum.comment | html.escape}} +{{~end~}} +{{~ if enum.is_flags ~}} +bitflags::bitflags!{ + #[derive(Debug, Hash, Eq, PartialEq)] + pub struct {{enum.name}} : u32 { + {{~ for item in enum.items ~}} + {{~if item.comment_or_alias != '' ~}} + ///{{item.comment_or_alias | html.escape}} + {{~end~}} + const {{item.name}} = {{item.int_value}}; + {{~end~}} + } +} +{{~else~}} +#[derive(Deserialize, Debug, Hash, Eq, PartialEq, macros::EnumFromNum)] +pub enum {{enum.name}} { + {{~ for item in enum.items ~}} +{{~if item.comment_or_alias != '' ~}} + ///{{item.comment_or_alias | html.escape}} +{{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} + {{~if enum.items.empty?~}} + None + {{~end~}} +} + +impl From for {{enum.name}} { + fn from(value: i32) -> Self { + match value { + {{~ for item in enum.items ~}} + {{item.value}} => {{enum.name}}::{{item.name}}, + {{~end~}} + _ => panic!("Invalid value for {{enum.name}}:{}", value), + } + } +} + +{{~end~}} +{{~end~}} +{{~ for bean in __mod.beans + hierarchy_fields = bean.hierarchy_export_fields +~}} +#[derive(Debug)] +{{~if bean.parent != ''~}} +#[derive(macros::TryIntoBase)] +{{~end~}} +pub struct {{bean.name}} { + {{~ for field in hierarchy_fields ~}} +{{~if field.comment != '' ~}} + /// {{escape_comment field.comment}} +{{~end~}} + pub {{field.name}}: {{declaring_type_name field.ctype}}, + {{~end~}} +} +{{~if bean.is_abstract_type~}} + +impl {{bean.name}} { + pub fn new(json: &serde_json::Value) -> Result, LubanError> { + let type_id = json["$type"].as_str().unwrap(); + match type_id { + {{~for child in bean.hierarchy_not_abstract_children~}} + "{{impl_data_type child bean}}" => Ok(std::sync::Arc::new({{full_name child}}::new(json)?)), + {{~end~}} + _ => Err(LubanError::Bean(format!("Invalid type for {{bean.name}}:{}", type_id))) + } + } +} + +pub trait T{{bean.name}} { + {{~ for field in hierarchy_fields ~}} + fn {{getter_name field.name}}(&self) -> &{{declaring_type_name field.ctype}}; + {{~end~}} +} +{{~for child in bean.hierarchy_not_abstract_children~}} + +impl {{base_trait_name bean}} for {{full_name child}} { + {{~ for field in hierarchy_fields ~}} + fn {{getter_name field.name}}(&self) -> &{{declaring_type_name field.ctype}} { + &self.{{field.name}} + } + {{~end~}} +} +{{~end~}} + +impl<'a> GetBase<'a, &'a dyn {{base_trait_name bean}}> for AbstractBase { + fn get_base(&'a self) -> Result<&'a dyn {{base_trait_name bean}}, LubanError> { + {{~for child in bean.hierarchy_not_abstract_children~}} + let base: Result<&{{full_name child}}, _> = self.try_into(); + if let Ok(r) = base { + return Ok(r); + } + {{~end~}} + + Err(LubanError::Polymorphic(format!("Invalid type for {{bean.name}}"))) + } +} +{{~else~}} + +impl {{bean.name}}{ + pub fn new(json: &serde_json::Value) -> Result<{{bean.name}}, LubanError> { + {{~ for field in hierarchy_fields ~}} + {{deserialize_field field.name 'json' field.ctype}} + {{~end~}} + + Ok({{bean.name}} { {{ for field in hierarchy_fields }}{{field.name}}, {{end}}}) + } +} +{{~end~}} + +{{~end~}} +{{~ for table in __mod.tables + key_type = declaring_type_name table.key_ttype + if table.value_ttype.def_bean.is_abstract_type + value_type = declaring_type_name table.value_ttype + else + value_type = "std::sync::Arc<"+declaring_type_name table.value_ttype+">" + end + name = table.name + map_type = "std::collections::HashMap<"+key_type+", "+value_type+">" +~}} +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'std::collections::HashMap<(' + (array.each table.index_list @index_type_name | array.join ', ') + '), ' + value_type + '>' + end + + func table_key_list + varName = $0 + indexList = table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{~ if table.comment != '' ~}} +///{{table.comment | html.escape}} +{{~end~}} +#[derive(Debug)] +pub struct {{table.name}} { + {{~if table.is_map_table ~}} + pub data_list: Vec<{{value_type}}>, + pub data_map: {{map_type}}, + {{~else if table.is_list_table ~}} + pub data_list: Vec<{{value_type}}>, + {{~if table.is_union_index~}} + pub data_map_union: {{table_union_map_type_name}}, + {{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + pub data_map_{{idx.index_field.name}}: std::collections::HashMap<{{declaring_type_name idx.type}}, {{value_type}}>, + {{~end~}} + {{~end~}} + {{~else~}} + pub data: {{declaring_type_name table.value_ttype}}, + {{~end~}} +} +{{~if table.is_map_table ~}} + +impl {{name}} { + pub fn new(json: &serde_json::Value) -> Result, LubanError> { + let mut data_map: {{map_type}} = Default::default(); + let mut data_list: Vec<{{value_type}}> = vec![]; + + for x in json.as_array().unwrap() { + {{~ if table.value_ttype.is_bean ~}} + {{deserialize_row "row" "x" table.value_ttype}} + {{~else~}} + let row: {{value_type}} = std::sync::Arc::new(serde_json::from_value(x.clone()).unwrap()); + {{~end~}} + data_list.push(row.clone()); + {{~ if table.value_ttype.def_bean.is_abstract_type ~}} + let key = >::get_base(std::ops::Deref::deref(&row))?; + data_map.insert(key.{{getter_name table.index_field.name}}().clone(), row.clone()); + {{~else~}} + data_map.insert(row.{{table.index_field.name}}.clone(), row.clone()); + {{~end~}} + } + + Ok(std::sync::Arc::new({{name}} { data_map, data_list })) + } + + pub fn get(&self, key: &{{key_type}}) -> Option<{{value_type}}> { + self.data_map.get(key).map(|x| x.clone()) + } +} + +impl std::ops::Index<{{key_type}}> for {{name}} { + type Output = {{value_type}}; + + fn index(&self, index: {{key_type}}) -> &Self::Output { + &self.data_map.get(&index).unwrap() + } +} +{{~else if table.is_list_table ~}} + +impl {{name}} { + pub fn new(json: &serde_json::Value) -> Result, LubanError> { + let mut data_list: Vec<{{value_type}}> = vec![]; + + for x in json.as_array().unwrap() { + {{~ if table.value_ttype.is_bean ~}} + {{deserialize_row "row" "x" table.value_ttype}} + {{~else~}} + let row: {{value_type}} = std::sync::Arc::new(serde_json::from_value(x.clone()).unwrap()); + {{~end~}} + data_list.push(row.clone()); + } + {{~if table.is_union_index~}} + let mut data_map_union: {{table_union_map_type_name}} = Default::default(); + for x in &data_list { + data_map_union.insert(({{table_key_list "x"}}.clone()), x.clone()); + } + {{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + let mut data_map_{{idx.index_field.name}}: std::collections::HashMap<{{declaring_type_name idx.index_field.ctype}}, {{value_type}}> = Default::default(); + {{~end~}} + for x in &data_list { + {{~for idx in table.index_list~}} + data_map_{{idx.index_field.name}}.insert(x.{{format_property_name __code_style idx.index_field.name}}.clone(), x.clone()); + {{~end~}} + } + {{~end~}} + + Ok(std::sync::Arc::new({{table.name}} { + data_list, +{{~if table.is_union_index~}} + data_map_union, +{{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + data_map_{{idx.index_field.name}}, + {{~end~}} +{{~end~}} + })) + } + + {{~if table.is_union_index~}} + pub fn get(&self, key: &({{array.each table.index_list @index_type_name | array.join ', '}})) -> Option<{{value_type}}> { + self.data_map_union.get(key).map(|x| x.clone()) + } + {{~else if !table.index_list.empty? ~}} + {{~for idx in table.index_list + index = format_property_name __code_style idx.index_field.name + ~}} + pub fn get_by_{{index}}(&self, key: &{{declaring_type_name idx.type}}) -> Option<{{value_type}}> { + self.data_map_{{index}}.get(key).map(|x| x.clone()) + } + {{~end~}} + {{~end~}} +} +{{~else~}} + +impl {{name}} { + pub fn new(json: &serde_json::Value) -> Result, LubanError> { + let json = json.as_array().unwrap(); + let n = json.len(); + if n != 1 { return Err(LubanError::Table(format!("table mode=one, but size != 1"))); } + let data = {{full_name table.value_ttype.def_bean}}::new(&json[0])?; + Ok(std::sync::Arc::new({{name}} { data })) + } +} +{{~end~}} + +{{~end~}} diff --git a/Tools/Luban/Templates/rust-json/toml.sbn b/Tools/Luban/Templates/rust-json/toml.sbn new file mode 100644 index 00000000..40870c70 --- /dev/null +++ b/Tools/Luban/Templates/rust-json/toml.sbn @@ -0,0 +1,12 @@ +[package] +name = "{{__name}}" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde = { version = "1.0.x", features = ["derive"] } +serde_json = "1.0.x" +bitflags = { version = "2.5.x" , features = ["serde"]} +macros = {path = "../macros"} \ No newline at end of file diff --git a/Tools/Luban/Templates/typescript-bin/schema.sbn b/Tools/Luban/Templates/typescript-bin/schema.sbn new file mode 100644 index 00000000..f8f9f967 --- /dev/null +++ b/Tools/Luban/Templates/typescript-bin/schema.sbn @@ -0,0 +1,234 @@ + +import ByteBuf from '../bright/serialization/ByteBuf' + +{{~for enum in __enums~}} +{{namespace_with_grace_begin enum.namespace}} +{{~if enum.comment != '' ~}} +/** + * {{enum.comment | html.escape}} + */ +{{~end~}} +export enum {{enum.name}} { + {{~for item in enum.items ~}} +{{~if item.comment != '' ~}} + /** + * {{escape_comment item.comment}} + */ +{{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} +} + +{{namespace_with_grace_end enum.namespace}} +{{~end~}} + + +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_ref' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = refTable.name + if field.is_nullable + ret 'this.'+(get_ref_name field) + ' = this.' + fieldName + '!= null ? tables.' + tableName + '.get(this.' + fieldName + ') : null' + else + ret 'this.'+(get_ref_name field) + ' = tables.' + tableName + '.get(this.' + fieldName + ')' + end + else + if (is_field_bean_need_resolve_ref field) + ret 'this.'+fieldName + '?.resolve(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'for (let _e of ' + 'this.' + fieldName + ') { _e?.resolve(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'for (let [_, _e] of ' + 'this.' + fieldName + ') { _e?.resolve(tables); }' + else + ret '' + end + end +end +~}} + +{{~for bean in __beans~}} + +{{namespace_with_grace_begin bean.namespace}} +{{~if bean.comment != '' ~}} +/** + * {{escape_comment bean.comment}} + */ +{{~end~}} +export {{if bean.is_abstract_type}}abstract {{end}}class {{bean.name}}{{if bean.parent_def_type}} extends {{bean.parent_def_type.full_name}}{{end}} { +{{~if bean.is_abstract_type~}} + static constructorFrom(_buf_: ByteBuf): {{bean.name}}{ + switch (_buf_.ReadInt()) { + {{~ for child in bean.hierarchy_not_abstract_children~}} + case {{child.id}}: return new {{child.full_name}}(_buf_) + {{~end~}} + default: throw new Error() + } + } +{{~end~}} + + constructor(_buf_: ByteBuf) { + {{~if bean.parent_def_type~}} + super(_buf_) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{deserialize ('this.' + format_field_name __code_style field.name) '_buf_' field.ctype}} + {{~end~}} + } + + {{~ for field in bean.export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + readonly {{format_field_name __code_style field.name}}: {{declaring_type_name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}}: {{declaring_type_name (get_ref_type field)}} | undefined + {{~end~}} + {{~end~}} + + resolve(tables:{{__name}}) { + {{~if bean.parent_def_type~}} + super.resolve(tables) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{generate_resolve_field_ref field}} + {{~end~}} + } +} + +{{namespace_with_grace_end bean.namespace}} + +{{~end~}} + +{{~for table in __tables + key_type = table.key_ttype + value_type = table.value_ttype +~}} + +{{namespace_with_grace_begin table.namespace}} +{{~if table.comment != '' ~}} +/** + * {{escape_comment table.comment}} + */ +{{~end~}} +export class {{table.name}} { + {{~if table.is_map_table ~}} + private _dataMap: Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> + private _dataList: {{declaring_type_name value_type}}[] + constructor(_buf_: ByteBuf) { + this._dataMap = new Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}>() + this._dataList = [] + for(let n = _buf_.ReadInt(); n > 0; n--) { + let _v: {{declaring_type_name value_type}} + {{deserialize '_v' '_buf_' value_type}} + this._dataList.push(_v) + this._dataMap.set(_v.{{format_field_name __code_style table.index_field.name}}, _v) + } + } + + getDataMap(): Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> { return this._dataMap; } + getDataList(): {{declaring_type_name value_type}}[] { return this._dataList; } + + get(key: {{declaring_type_name key_type}}): {{declaring_type_name value_type}} | undefined { + return this._dataMap.get(key); + } + + resolve(tables:{{__name}}) { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + {{~else if table.is_list_table ~}} + private _dataList: {{declaring_type_name value_type}}[] + + constructor(_buf_: ByteBuf) { + this._dataList = [] + for(let n = _buf_.ReadInt(); n > 0; n--) { + let _v: {{declaring_type_name value_type}} + {{deserialize '_v' '_buf_' value_type}} + this._dataList.push(_v) + } + } + + getDataList(): {{declaring_type_name value_type}}[] { return this._dataList } + + get(index: number): {{declaring_type_name value_type}} | undefined { return this._dataList[index] } + + resolve(tables:{{__name}}) { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + {{~else~}} + + private _data: {{declaring_type_name value_type}} + constructor(_buf_: ByteBuf) { + if (_buf_.ReadInt() != 1) throw new Error('table mode=one, but size != 1') + {{deserialize 'this._data' '_buf_' value_type}} + } + + getData(): {{declaring_type_name value_type}} { return this._data; } + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + get {{format_field_name __code_style field.name}}(): {{declaring_type_name field.ctype}} { return this._data.{{format_field_name __code_style field.name}}; } + {{~if can_generate_ref field~}} + get {{format_field_name __code_style field.name}}_ref(): {{declaring_type_name (get_ref_type field)}} | undefined { return this._data.{{format_field_name __code_style field.name}}_ref; } + {{~end~}} + {{~end~}} + + resolve(tables:{{__name}}) { + this._data.resolve(tables) + } + {{end}} +} +{{namespace_with_grace_end table.namespace}} + +{{~end~}} + + +type ByteBufLoader = (file: string) => ByteBuf + +export class {{__name}} { + {{~ for table in __tables ~}} + private _{{table.name}}: {{table.full_name}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + get {{table.name}}(): {{table.full_name}} { return this._{{table.name}};} + {{~end~}} + + static getTableNames(): string[] { + let names: string[] = []; + {{~for table in __tables ~}} + names.push('{{table.output_data_file}}'); + {{~end~}} + return names; + } + + constructor(loader: ByteBufLoader) { + {{~for table in __tables ~}} + this._{{table.name}} = new {{table.full_name}}(loader('{{table.output_data_file}}')) + {{~end~}} + + {{~for table in __tables ~}} + this._{{table.name}}.resolve(this) + {{~end~}} + } +} diff --git a/Tools/Luban/Templates/typescript-json/schema.sbn b/Tools/Luban/Templates/typescript-json/schema.sbn new file mode 100644 index 00000000..ed794223 --- /dev/null +++ b/Tools/Luban/Templates/typescript-json/schema.sbn @@ -0,0 +1,226 @@ + +{{~for enum in __enums~}} +{{namespace_with_grace_begin enum.namespace}} +{{~if enum.comment != '' ~}} +/** + * {{enum.comment | html.escape}} + */ +{{~end~}} +export enum {{enum.name}} { + {{~for item in enum.items ~}} +{{~if item.comment != '' ~}} + /** + * {{escape_comment item.comment}} + */ +{{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} +} + +{{namespace_with_grace_end enum.namespace}} +{{~end~}} + + +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_ref' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = refTable.name + if field.is_nullable + ret 'this.'+(get_ref_name field) + ' = this.' + fieldName + '!= null ? tables.' + tableName + '.get(this.' + fieldName + ') : null' + else + ret 'this.'+(get_ref_name field) + ' = tables.' + tableName + '.get(this.' + fieldName + ')' + end + else + if (is_field_bean_need_resolve_ref field) + ret 'this.'+fieldName + '?.resolve(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'for (let _e of ' + 'this.' + fieldName + ') { _e?.resolve(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'for (let [_, _e] of ' + 'this.' + fieldName + ') { _e?.resolve(tables); }' + else + ret '' + end + end +end +~}} + +{{~for bean in __beans~}} + +{{namespace_with_grace_begin bean.namespace}} +{{~if bean.comment != '' ~}} +/** + * {{escape_comment bean.comment}} + */ +{{~end~}} +export {{if bean.is_abstract_type}}abstract {{end}}class {{bean.name}}{{if bean.parent_def_type}} extends {{bean.parent_def_type.full_name}}{{end}} { +{{~if bean.is_abstract_type~}} + static constructorFrom(_json_: any): {{bean.name}}{ + switch (_json_["$type"]) { + {{~ for child in bean.hierarchy_not_abstract_children~}} + case '{{impl_data_type child bean}}': return new {{child.full_name}}(_json_) + {{~end~}} + default: throw new Error() + } + } +{{~end~}} + + constructor(_json_: any) { + {{~if bean.parent_def_type~}} + super(_json_) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{~if !field.ctype.is_nullable~}} + if (_json_.{{field.name}} === undefined) { throw new Error() } + {{~end~}} + {{deserialize ('this.' + format_field_name __code_style field.name) ( '_json_.' + field.name) field.ctype}} + {{~end~}} + } + + {{~ for field in bean.export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + readonly {{format_field_name __code_style field.name}}: {{declaring_type_name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}}: {{declaring_type_name (get_ref_type field)}} | undefined + {{~end~}} + {{~end~}} + + resolve(tables:{{__name}}) { + {{~if bean.parent_def_type~}} + super.resolve(tables) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{generate_resolve_field_ref field}} + {{~end~}} + } +} + +{{namespace_with_grace_end bean.namespace}} + +{{~end~}} + +{{~for table in __tables + key_type = table.key_ttype + value_type = table.value_ttype +~}} + +{{namespace_with_grace_begin table.namespace}} +{{~if table.comment != '' ~}} +/** + * {{escape_comment table.comment}} + */ +{{~end~}} +export class {{table.name}} { + {{~if table.is_map_table ~}} + private _dataMap: Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> + private _dataList: {{declaring_type_name value_type}}[] + constructor(_json_: any) { + this._dataMap = new Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}>() + this._dataList = [] + for(var _json2_ of _json_) { + let _v: {{declaring_type_name value_type}} + {{deserialize '_v' '_json2_' value_type}} + this._dataList.push(_v) + this._dataMap.set(_v.{{format_field_name __code_style table.index_field.name}}, _v) + } + } + + getDataMap(): Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> { return this._dataMap; } + getDataList(): {{declaring_type_name value_type}}[] { return this._dataList; } + + get(key: {{declaring_type_name key_type}}): {{declaring_type_name value_type}} | undefined { return this._dataMap.get(key); } + + resolve(tables:{{__name}}) { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + {{~else if table.is_list_table ~}} + private _dataList: {{declaring_type_name value_type}}[] + + constructor(_json_: any) { + this._dataList = [] + for(var _json2_ of _json_) { + let _v: {{declaring_type_name value_type}} + {{deserialize '_v' '_json2_' value_type}} + this._dataList.push(_v) + } + } + + getDataList(): {{declaring_type_name value_type}}[] { return this._dataList } + + get(index: number): {{declaring_type_name value_type}} | undefined { return this._dataList[index] } + + resolve(tables:{{__name}}) { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + {{~else~}} + + private _data: {{declaring_type_name value_type}} + constructor(_json_: any) { + if (_json_.length != 1) throw new Error('table mode=one, but size != 1') + {{deserialize 'this._data' '_json_[0]' value_type}} + } + + getData(): {{declaring_type_name value_type}} { return this._data; } + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + get {{format_field_name __code_style field.name}}(): {{declaring_type_name field.ctype}} { return this._data.{{format_field_name __code_style field.name}}; } + {{~if can_generate_ref field~}} + get {{format_field_name __code_style field.name}}_ref(): {{declaring_type_name (get_ref_type field)}} | undefined { return this._data.{{format_field_name __code_style field.name}}_ref; } + {{~end~}} + {{~end~}} + + resolve(tables:{{__name}}) + { + this._data.resolve(tables) + } + {{end}} +} +{{namespace_with_grace_end table.namespace}} + +{{~end~}} + + +type JsonLoader = (file: string) => any + +export class {{__name}} { + {{~ for table in __tables ~}} + private _{{table.name}}: {{table.full_name}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + get {{table.name}}(): {{table.full_name}} { return this._{{table.name}};} + {{~end~}} + + constructor(loader: JsonLoader) { + {{~for table in __tables ~}} + this._{{table.name}} = new {{table.full_name}}(loader('{{table.output_data_file}}')) + {{~end~}} + + {{~for table in __tables ~}} + this._{{table.name}}.resolve(this) + {{~end~}} + } +} diff --git a/Tools/Luban/Templates/typescript-protobuf/schema.sbn b/Tools/Luban/Templates/typescript-protobuf/schema.sbn new file mode 100644 index 00000000..0538d7b5 --- /dev/null +++ b/Tools/Luban/Templates/typescript-protobuf/schema.sbn @@ -0,0 +1,31 @@ +import pb from 'pb'; + +type BufLoader = (file: string) => Uint8Array; + +export class {{__name}} { + {{~ for table in __tables ~}} + private _{{table.name}}: pb.cfg.{{table.name}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + get {{table.name}}(): pb.cfg.{{table.name}} { return this._{{table.name}};} + {{~end~}} + + static getTableNames(): string[] { + let names: string[] = []; + {{~for table in __tables ~}} + names.push('{{table.output_data_file}}'); + {{~end~}} + return names; + } + + constructor(loader: BufLoader) { + let buffer: Uint8Array; + {{~for table in __tables ~}} + buffer = loader('{{table.output_data_file}}'); + this._{{table.name}} = pb.cfg.{{table.name}}.decode(buffer, buffer.length); + {{~end~}} + } +} diff --git a/Tools/Luban/Ude.NetStandard.dll b/Tools/Luban/Ude.NetStandard.dll new file mode 100644 index 00000000..2cb9b2f5 Binary files /dev/null and b/Tools/Luban/Ude.NetStandard.dll differ diff --git a/Tools/Luban/YamlDotNet.NetCore.dll b/Tools/Luban/YamlDotNet.NetCore.dll new file mode 100644 index 00000000..1c598d78 Binary files /dev/null and b/Tools/Luban/YamlDotNet.NetCore.dll differ diff --git a/Tools/Luban/de/Neo.Lua.resources.dll b/Tools/Luban/de/Neo.Lua.resources.dll new file mode 100644 index 00000000..69bb3852 Binary files /dev/null and b/Tools/Luban/de/Neo.Lua.resources.dll differ diff --git a/Tools/Luban/nlog.xml b/Tools/Luban/nlog.xml new file mode 100644 index 00000000..8c390bc0 --- /dev/null +++ b/Tools/Luban/nlog.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + diff --git a/Tools/build-luban.bat b/Tools/build-luban.bat new file mode 100644 index 00000000..dbbe761e --- /dev/null +++ b/Tools/build-luban.bat @@ -0,0 +1,5 @@ +rd /s /q Luban + +dotnet build ../luban/src/Luban/Luban.csproj -c Release -o Luban + +pause \ No newline at end of file diff --git a/Tools/build-luban.sh b/Tools/build-luban.sh new file mode 100644 index 00000000..c09a7286 --- /dev/null +++ b/Tools/build-luban.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +[ -d Luban ] && rm -rf Luban + +dotnet build ../../luban/src/Luban/Luban.csproj -c Release -o Luban \ No newline at end of file diff --git a/luban/.editorconfig b/luban/.editorconfig new file mode 100644 index 00000000..165843fe --- /dev/null +++ b/luban/.editorconfig @@ -0,0 +1,53 @@ +root = true + +[*] +indent_style = space +insert_final_newline = true + +# CSharp formatting rules: +[*.cs] +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents_when_block = false + +csharp_space_after_cast = false +csharp_space_after_keywords_in_control_flow_statements = true +# csharp_space_between_parentheses = control_flow_statements, type_casts +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_after_comma = true +csharp_space_before_comma = false +csharp_space_after_dot = false +csharp_space_before_dot = false +csharp_space_after_semicolon_in_for_statement = true +csharp_space_before_semicolon_in_for_statement = false +csharp_space_around_declaration_statements = false +csharp_space_before_open_square_brackets = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_square_brackets = false + +csharp_preserve_single_line_statements = false +csharp_preserve_single_line_blocks = true + +csharp_prefer_braces = true +dotnet_diagnostic.IDE0011.severity = error + +max_line_length = 180 diff --git a/luban/.gitattributes b/luban/.gitattributes new file mode 100644 index 00000000..1ff0c423 --- /dev/null +++ b/luban/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/luban/.github/FUNDING.yml b/luban/.github/FUNDING.yml new file mode 100644 index 00000000..68d1b522 --- /dev/null +++ b/luban/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # [pirunxi] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: walon +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: ['https://raw.githubusercontent.com/focus-creative-games/luban/main/docs/sponsor/weixin.JPG','https://raw.githubusercontent.com/focus-creative-games/luban/main/docs/sponsor/zhifubao.JPG'] diff --git a/luban/.github/workflows/sync_gitee.yml b/luban/.github/workflows/sync_gitee.yml new file mode 100644 index 00000000..e08eacd9 --- /dev/null +++ b/luban/.github/workflows/sync_gitee.yml @@ -0,0 +1,38 @@ +# This is a basic workflow to help you get started with Actions + +name: sync-gitee-mirror + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + sync: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: sync-gitee-mirror + uses: wangchucheng/git-repo-sync@v0.1.0 + with: + # Target Repo URL + target-url: https://gitee.com/focus-creative-games/luban.git + # Target Repo Username + target-username: ${{ secrets.GITEE_USERNAME }} + # Target Token + target-token: ${{ secrets.GITEE_PASSWORD }} + + + + diff --git a/luban/.gitignore b/luban/.gitignore new file mode 100644 index 00000000..c05d2490 --- /dev/null +++ b/luban/.gitignore @@ -0,0 +1,275 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +ReaderLib/**/Config + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +# *.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# gen cache meta file +.cache.meta + +/config/output_code +/config/output_data +/config/output_lua +/config/output_lua_without_test +/src/Excel2TextDiff/Properties/launchSettings.json +/src/packages +/src/.vscode +/src/Luban/Properties/*.json diff --git a/luban/.travis.yml b/luban/.travis.yml new file mode 100644 index 00000000..083128a5 --- /dev/null +++ b/luban/.travis.yml @@ -0,0 +1,9 @@ +language: csharp +solution: src/Luban.sln + +mono: none +dotnet: 6.0 +script: + - cd src + - dotnet restore Luban.sln + - dotnet build Luban.sln \ No newline at end of file diff --git a/luban/LICENSE b/luban/LICENSE new file mode 100644 index 00000000..dcad5cf6 --- /dev/null +++ b/luban/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Code Philosophy Technology Ltd. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/luban/README.md b/luban/README.md new file mode 100644 index 00000000..a0d6ef57 --- /dev/null +++ b/luban/README.md @@ -0,0 +1,51 @@ + +- [README 中文](./README.md) +- [README English](./README_EN.md) + +# Luban + +![icon](docs/images/logo.png) + +[![license](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT) ![star](https://img.shields.io/github/stars/focus-creative-games/luban?style=flat-square) + + +luban是一个强大、易用、优雅、稳定的游戏配置解决方案。它设计目标为满足从小型到超大型游戏项目的简单到复杂的游戏配置工作流需求。 + +luban可以处理丰富的文件类型,支持主流的语言,可以生成多种导出格式,支持丰富的数据检验功能,具有良好的跨平台能力,并且生成极快。 +luban有清晰优雅的生成管线设计,支持良好的模块化和插件化,方便开发者进行二次开发。开发者很容易就能将luban适配到自己的配置格式,定制出满足项目要求的强大的配置工具。 + +luban标准化了游戏配置开发工作流,可以极大提升策划和程序的工作效率。 + +## 核心特性 + +- 丰富的源数据格式。支持excel族(csv,xls,xlsx,xlsm)、json、xml、yaml、lua等 +- 丰富的导出格式。 支持生成binary、json、bson、xml、lua、yaml等格式数据 +- 增强的excel格式。可以简洁地配置出像简单列表、子结构、结构列表,以及任意复杂的深层次的嵌套结构 +- 完备的类型系统。不仅能表达常见的规范行列表,由于**支持OOP类型继承**,能灵活优雅表达行为树、技能、剧情、副本之类复杂GamePlay数据 +- 支持多种的语言。内置支持生成c#、java、go、cpp、lua、python、typescript、rust、php、erlang 等语言代码,同时还能通过protobuf之类消息方案支持其他语言 +- 支持主流的消息方案。 protobuf(schema + binary + json)、flatbuffers(schema + json)、msgpack(binary) +- 强大的数据校验能力。ref引用检查、path资源路径、range范围检查等等 +- 完善的本地化支持 +- 支持所有主流的游戏引擎和平台。支持Unity、Unreal、Cocos2x、Godot、微信小游戏等 +- 良好的跨平台能力。能在Win,Linux,Mac平台良好运行。 +- 支持所有主流的热更新方案。hybridclr、ilruntime、{x,t,s}lua、puerts等 +- 清晰优雅的生成管线,很容易在luban基础上进行二次开发,定制出适合自己项目风格的配置工具。 + +## 文档 + +- [官方文档](https://luban.doc.code-philosophy.com/) +- [快速上手](https://luban.doc.code-philosophy.com/docs/beginner/quickstart) +- **示例项目** ([github](https://github.com/focus-creative-games/luban_examples)) ([gitee](https://gitee.com/focus-creative-games/luban_examples)) + + +## 支持与联系 + +- QQ群: 692890842 (Luban开发交流群) +- discord: https://discord.gg/dGY4zzGMJ4 +- 邮箱: luban@code-philosophy.com + + + +## license + +Luban is licensed under the [MIT](https://github.com/focus-creative-games/luban/blob/main/LICENSE) license diff --git a/luban/README_EN.md b/luban/README_EN.md new file mode 100644 index 00000000..18d7213d --- /dev/null +++ b/luban/README_EN.md @@ -0,0 +1,49 @@ + +- [README 中文](./README.md) +- [README English](./README_EN.md) + +# Luban + +![icon](docs/images/logo.png) + +[![license](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT) ![star](https://img.shields.io/github/stars/focus-creative-games/luban?style=flat-square) + + +luban is a powerful, easy-to-use, elegant, and stable game configuration solution. It is designed to meet the needs of simple to complex game configuration workflows from small to very large game projects. + +luban can handle a variety of file types, supports popular languages, can generate multiple export formats, supports rich data inspection functions, has good cross-platform capabilities, and generates extremely fast. +Luban has a clear and elegant generation pipeline design, supports good modularization and plug-in, and is convenient for developers to carry out secondary development. Developers can easily adapt luban to their own configuration format, and customize powerful configuration tools that meet project requirements. + +Luban standardizes the game configuration development workflow, which can greatly improve the efficiency of planning and programming. + +## Core features + +- Rich source data format. Support excel family (csv, xls, xlsx, xlsm), json, xml, yaml, lua, etc. +- Rich export formats. Support generating binary, json, bson, xml, lua, yaml and other format data +- Enhanced excel format. Simple configurations such as simple lists, substructures, structured lists, and arbitrarily complex deep nested structures can be concisely configured +- Complete type system. Not only can it express common specification line lists, but it can flexibly and elegantly express complex GamePlay data such as behavior trees, skills, plots, and dungeons because **supports OOP type inheritance** +- Support multiple languages. Supports generating language codes such as c#, java, go, cpp, lua, python, typescript, php, rust, etc. +- Support popular message schemes. protobuf(schema + binary + json), flatbuffers(schema + json), msgpack(binary) +- Powerful data verification capability. ref reference check, path resource path, range range check, etc. +- Perfect localization support +- Supports all major game engines and platforms. Support Unity, Unreal, Cocos2x, Godot, WeChat games, etc. +- Good cross-platform capability. It can run well on Win, Linux, and Mac platforms. +- Support all mainstream hot update solutions. hybridclr, ilruntime, {x,t,s}lua, puerts, etc. +- Clear and elegant generation pipeline, it is easy to carry out secondary development on the basis of luban, and customize a configuration tool suitable for your own project style. + +## Documentation + +- [Official Documentation](https://luban.doc.code-philosophy.com/) +- [Quick Start](https://luban.doc.code-philosophy.com/docs/beginner/quickstart) +- **Example Project** ([github](https://github.com/focus-creative-games/luban_examples)) ([gitee](https://gitee.com/focus-creative-games/luban_examples) ) + +## Support and contact + +- QQ group: 692890842 (Luban development exchange group) +- discord: https://discord.gg/dGY4zzGMJ4 +- Email: luban@code-philosophy.com + + +## license + +Luban is licensed under the [MIT](https://github.com/focus-creative-games/luban/blob/main/LICENSE) license diff --git a/luban/docs/_config.yml b/luban/docs/_config.yml new file mode 100644 index 00000000..c7418817 --- /dev/null +++ b/luban/docs/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-slate \ No newline at end of file diff --git a/luban/docs/images/Client_Server.png b/luban/docs/images/Client_Server.png new file mode 100644 index 00000000..aa9a9136 Binary files /dev/null and b/luban/docs/images/Client_Server.png differ diff --git a/luban/docs/images/adv/def_01.png b/luban/docs/images/adv/def_01.png new file mode 100644 index 00000000..649a4aae Binary files /dev/null and b/luban/docs/images/adv/def_01.png differ diff --git a/luban/docs/images/adv/def_02.png b/luban/docs/images/adv/def_02.png new file mode 100644 index 00000000..49539cdb Binary files /dev/null and b/luban/docs/images/adv/def_02.png differ diff --git a/luban/docs/images/adv/def_03.png b/luban/docs/images/adv/def_03.png new file mode 100644 index 00000000..820a40e0 Binary files /dev/null and b/luban/docs/images/adv/def_03.png differ diff --git a/luban/docs/images/adv/def_04.png b/luban/docs/images/adv/def_04.png new file mode 100644 index 00000000..c996439b Binary files /dev/null and b/luban/docs/images/adv/def_04.png differ diff --git a/luban/docs/images/adv/def_05.png b/luban/docs/images/adv/def_05.png new file mode 100644 index 00000000..2a606fc3 Binary files /dev/null and b/luban/docs/images/adv/def_05.png differ diff --git a/luban/docs/images/adv/def_06.png b/luban/docs/images/adv/def_06.png new file mode 100644 index 00000000..880516ee Binary files /dev/null and b/luban/docs/images/adv/def_06.png differ diff --git a/luban/docs/images/adv/def_07.png b/luban/docs/images/adv/def_07.png new file mode 100644 index 00000000..644ed570 Binary files /dev/null and b/luban/docs/images/adv/def_07.png differ diff --git a/luban/docs/images/adv/def_08.png b/luban/docs/images/adv/def_08.png new file mode 100644 index 00000000..c1e92768 Binary files /dev/null and b/luban/docs/images/adv/def_08.png differ diff --git a/luban/docs/images/adv/def_09.png b/luban/docs/images/adv/def_09.png new file mode 100644 index 00000000..2a7e0abe Binary files /dev/null and b/luban/docs/images/adv/def_09.png differ diff --git a/luban/docs/images/adv/def_10.png b/luban/docs/images/adv/def_10.png new file mode 100644 index 00000000..28726ae7 Binary files /dev/null and b/luban/docs/images/adv/def_10.png differ diff --git a/luban/docs/images/adv/def_11.png b/luban/docs/images/adv/def_11.png new file mode 100644 index 00000000..c7ae7f2a Binary files /dev/null and b/luban/docs/images/adv/def_11.png differ diff --git a/luban/docs/images/adv/def_12.png b/luban/docs/images/adv/def_12.png new file mode 100644 index 00000000..79dc31a8 Binary files /dev/null and b/luban/docs/images/adv/def_12.png differ diff --git a/luban/docs/images/adv/def_13.png b/luban/docs/images/adv/def_13.png new file mode 100644 index 00000000..d4a9e53d Binary files /dev/null and b/luban/docs/images/adv/def_13.png differ diff --git a/luban/docs/images/adv/def_14.png b/luban/docs/images/adv/def_14.png new file mode 100644 index 00000000..cd627546 Binary files /dev/null and b/luban/docs/images/adv/def_14.png differ diff --git a/luban/docs/images/adv/def_15.png b/luban/docs/images/adv/def_15.png new file mode 100644 index 00000000..f87af644 Binary files /dev/null and b/luban/docs/images/adv/def_15.png differ diff --git a/luban/docs/images/adv/def_16.png b/luban/docs/images/adv/def_16.png new file mode 100644 index 00000000..27eb67a0 Binary files /dev/null and b/luban/docs/images/adv/def_16.png differ diff --git a/luban/docs/images/adv/def_17.png b/luban/docs/images/adv/def_17.png new file mode 100644 index 00000000..225be3bd Binary files /dev/null and b/luban/docs/images/adv/def_17.png differ diff --git a/luban/docs/images/adv/def_18.png b/luban/docs/images/adv/def_18.png new file mode 100644 index 00000000..ef1624c9 Binary files /dev/null and b/luban/docs/images/adv/def_18.png differ diff --git a/luban/docs/images/adv/def_19.png b/luban/docs/images/adv/def_19.png new file mode 100644 index 00000000..6736085b Binary files /dev/null and b/luban/docs/images/adv/def_19.png differ diff --git a/luban/docs/images/adv/def_20.png b/luban/docs/images/adv/def_20.png new file mode 100644 index 00000000..02098f5d Binary files /dev/null and b/luban/docs/images/adv/def_20.png differ diff --git a/luban/docs/images/adv/def_21.png b/luban/docs/images/adv/def_21.png new file mode 100644 index 00000000..09fa7ae2 Binary files /dev/null and b/luban/docs/images/adv/def_21.png differ diff --git a/luban/docs/images/adv/def_22.png b/luban/docs/images/adv/def_22.png new file mode 100644 index 00000000..51c867b5 Binary files /dev/null and b/luban/docs/images/adv/def_22.png differ diff --git a/luban/docs/images/adv/def_23.png b/luban/docs/images/adv/def_23.png new file mode 100644 index 00000000..2a11bc71 Binary files /dev/null and b/luban/docs/images/adv/def_23.png differ diff --git a/luban/docs/images/adv/def_24.png b/luban/docs/images/adv/def_24.png new file mode 100644 index 00000000..6884c6ab Binary files /dev/null and b/luban/docs/images/adv/def_24.png differ diff --git a/luban/docs/images/adv/def_25.png b/luban/docs/images/adv/def_25.png new file mode 100644 index 00000000..334876f5 Binary files /dev/null and b/luban/docs/images/adv/def_25.png differ diff --git a/luban/docs/images/adv/def_26.png b/luban/docs/images/adv/def_26.png new file mode 100644 index 00000000..e5e57d6d Binary files /dev/null and b/luban/docs/images/adv/def_26.png differ diff --git a/luban/docs/images/adv/def_27.png b/luban/docs/images/adv/def_27.png new file mode 100644 index 00000000..12dff4a9 Binary files /dev/null and b/luban/docs/images/adv/def_27.png differ diff --git a/luban/docs/images/adv/def_28.png b/luban/docs/images/adv/def_28.png new file mode 100644 index 00000000..5f9f40a0 Binary files /dev/null and b/luban/docs/images/adv/def_28.png differ diff --git a/luban/docs/images/adv/def_29.png b/luban/docs/images/adv/def_29.png new file mode 100644 index 00000000..c9ce39d6 Binary files /dev/null and b/luban/docs/images/adv/def_29.png differ diff --git a/luban/docs/images/adv/def_30.png b/luban/docs/images/adv/def_30.png new file mode 100644 index 00000000..8b72ef50 Binary files /dev/null and b/luban/docs/images/adv/def_30.png differ diff --git a/luban/docs/images/adv/def_31.png b/luban/docs/images/adv/def_31.png new file mode 100644 index 00000000..9abb36a5 Binary files /dev/null and b/luban/docs/images/adv/def_31.png differ diff --git a/luban/docs/images/adv/def_32.png b/luban/docs/images/adv/def_32.png new file mode 100644 index 00000000..33893c42 Binary files /dev/null and b/luban/docs/images/adv/def_32.png differ diff --git a/luban/docs/images/adv/def_33.png b/luban/docs/images/adv/def_33.png new file mode 100644 index 00000000..9a8c6d3c Binary files /dev/null and b/luban/docs/images/adv/def_33.png differ diff --git a/luban/docs/images/adv/def_34.png b/luban/docs/images/adv/def_34.png new file mode 100644 index 00000000..d7869193 Binary files /dev/null and b/luban/docs/images/adv/def_34.png differ diff --git a/luban/docs/images/adv/def_35.png b/luban/docs/images/adv/def_35.png new file mode 100644 index 00000000..22257304 Binary files /dev/null and b/luban/docs/images/adv/def_35.png differ diff --git a/luban/docs/images/adv/def_36.png b/luban/docs/images/adv/def_36.png new file mode 100644 index 00000000..74b8193c Binary files /dev/null and b/luban/docs/images/adv/def_36.png differ diff --git a/luban/docs/images/adv/def_37.png b/luban/docs/images/adv/def_37.png new file mode 100644 index 00000000..8f1237df Binary files /dev/null and b/luban/docs/images/adv/def_37.png differ diff --git a/luban/docs/images/adv/def_38.png b/luban/docs/images/adv/def_38.png new file mode 100644 index 00000000..eb9eda92 Binary files /dev/null and b/luban/docs/images/adv/def_38.png differ diff --git a/luban/docs/images/adv/def_39.png b/luban/docs/images/adv/def_39.png new file mode 100644 index 00000000..2d8b9af9 Binary files /dev/null and b/luban/docs/images/adv/def_39.png differ diff --git a/luban/docs/images/adv/def_40.png b/luban/docs/images/adv/def_40.png new file mode 100644 index 00000000..66277d75 Binary files /dev/null and b/luban/docs/images/adv/def_40.png differ diff --git a/luban/docs/images/adv/def_41.png b/luban/docs/images/adv/def_41.png new file mode 100644 index 00000000..6250797e Binary files /dev/null and b/luban/docs/images/adv/def_41.png differ diff --git a/luban/docs/images/adv/def_42.png b/luban/docs/images/adv/def_42.png new file mode 100644 index 00000000..9479528c Binary files /dev/null and b/luban/docs/images/adv/def_42.png differ diff --git a/luban/docs/images/adv/def_43.png b/luban/docs/images/adv/def_43.png new file mode 100644 index 00000000..39b1df61 Binary files /dev/null and b/luban/docs/images/adv/def_43.png differ diff --git a/luban/docs/images/adv/def_44.png b/luban/docs/images/adv/def_44.png new file mode 100644 index 00000000..9e4372cb Binary files /dev/null and b/luban/docs/images/adv/def_44.png differ diff --git a/luban/docs/images/adv/def_45.png b/luban/docs/images/adv/def_45.png new file mode 100644 index 00000000..060d814a Binary files /dev/null and b/luban/docs/images/adv/def_45.png differ diff --git a/luban/docs/images/adv/def_46.png b/luban/docs/images/adv/def_46.png new file mode 100644 index 00000000..81d0d5a3 Binary files /dev/null and b/luban/docs/images/adv/def_46.png differ diff --git a/luban/docs/images/adv/def_47.png b/luban/docs/images/adv/def_47.png new file mode 100644 index 00000000..b9cb2a34 Binary files /dev/null and b/luban/docs/images/adv/def_47.png differ diff --git a/luban/docs/images/adv/def_48.png b/luban/docs/images/adv/def_48.png new file mode 100644 index 00000000..a2f3fc89 Binary files /dev/null and b/luban/docs/images/adv/def_48.png differ diff --git a/luban/docs/images/adv/def_49.png b/luban/docs/images/adv/def_49.png new file mode 100644 index 00000000..fa1e3535 Binary files /dev/null and b/luban/docs/images/adv/def_49.png differ diff --git a/luban/docs/images/adv/def_50.png b/luban/docs/images/adv/def_50.png new file mode 100644 index 00000000..e39fc3f6 Binary files /dev/null and b/luban/docs/images/adv/def_50.png differ diff --git a/luban/docs/images/cases/bean.jpg b/luban/docs/images/cases/bean.jpg new file mode 100644 index 00000000..47ea9b6c Binary files /dev/null and b/luban/docs/images/cases/bean.jpg differ diff --git a/luban/docs/images/cases/bean2.jpg b/luban/docs/images/cases/bean2.jpg new file mode 100644 index 00000000..0ee7875a Binary files /dev/null and b/luban/docs/images/cases/bean2.jpg differ diff --git a/luban/docs/images/cases/collection.jpg b/luban/docs/images/cases/collection.jpg new file mode 100644 index 00000000..6283fb50 Binary files /dev/null and b/luban/docs/images/cases/collection.jpg differ diff --git a/luban/docs/images/cases/enum.jpg b/luban/docs/images/cases/enum.jpg new file mode 100644 index 00000000..d0dd7d0c Binary files /dev/null and b/luban/docs/images/cases/enum.jpg differ diff --git a/luban/docs/images/cases/ignorefield.jpg b/luban/docs/images/cases/ignorefield.jpg new file mode 100644 index 00000000..6c52c2b0 Binary files /dev/null and b/luban/docs/images/cases/ignorefield.jpg differ diff --git a/luban/docs/images/cases/l10n_text.jpg b/luban/docs/images/cases/l10n_text.jpg new file mode 100644 index 00000000..568f546b Binary files /dev/null and b/luban/docs/images/cases/l10n_text.jpg differ diff --git a/luban/docs/images/cases/multileveltitle.jpg b/luban/docs/images/cases/multileveltitle.jpg new file mode 100644 index 00000000..25abc58f Binary files /dev/null and b/luban/docs/images/cases/multileveltitle.jpg differ diff --git a/luban/docs/images/cases/multiline.jpg b/luban/docs/images/cases/multiline.jpg new file mode 100644 index 00000000..a4bdb70c Binary files /dev/null and b/luban/docs/images/cases/multiline.jpg differ diff --git a/luban/docs/images/cases/nullable.jpg b/luban/docs/images/cases/nullable.jpg new file mode 100644 index 00000000..3ffeac72 Binary files /dev/null and b/luban/docs/images/cases/nullable.jpg differ diff --git a/luban/docs/images/cases/primitive_type.jpg b/luban/docs/images/cases/primitive_type.jpg new file mode 100644 index 00000000..9c395fd0 Binary files /dev/null and b/luban/docs/images/cases/primitive_type.jpg differ diff --git a/luban/docs/images/cases/quickstart_reward.jpg b/luban/docs/images/cases/quickstart_reward.jpg new file mode 100644 index 00000000..bdd31dab Binary files /dev/null and b/luban/docs/images/cases/quickstart_reward.jpg differ diff --git a/luban/docs/images/cases/quickstart_table.jpg b/luban/docs/images/cases/quickstart_table.jpg new file mode 100644 index 00000000..6114af6d Binary files /dev/null and b/luban/docs/images/cases/quickstart_table.jpg differ diff --git a/luban/docs/images/cases/sep_bean.jpg b/luban/docs/images/cases/sep_bean.jpg new file mode 100644 index 00000000..af5872a1 Binary files /dev/null and b/luban/docs/images/cases/sep_bean.jpg differ diff --git a/luban/docs/images/cases/sep_container1.jpg b/luban/docs/images/cases/sep_container1.jpg new file mode 100644 index 00000000..7004468c Binary files /dev/null and b/luban/docs/images/cases/sep_container1.jpg differ diff --git a/luban/docs/images/cases/sep_container2.jpg b/luban/docs/images/cases/sep_container2.jpg new file mode 100644 index 00000000..953a472e Binary files /dev/null and b/luban/docs/images/cases/sep_container2.jpg differ diff --git a/luban/docs/images/cases/simple1.jpg b/luban/docs/images/cases/simple1.jpg new file mode 100644 index 00000000..eda7bb75 Binary files /dev/null and b/luban/docs/images/cases/simple1.jpg differ diff --git a/luban/docs/images/cases/singleton.jpg b/luban/docs/images/cases/singleton.jpg new file mode 100644 index 00000000..90a6843e Binary files /dev/null and b/luban/docs/images/cases/singleton.jpg differ diff --git a/luban/docs/images/cases/singleton2.jpg b/luban/docs/images/cases/singleton2.jpg new file mode 100644 index 00000000..74a09740 Binary files /dev/null and b/luban/docs/images/cases/singleton2.jpg differ diff --git a/luban/docs/images/cases/stream.jpg b/luban/docs/images/cases/stream.jpg new file mode 100644 index 00000000..aec6c89e Binary files /dev/null and b/luban/docs/images/cases/stream.jpg differ diff --git a/luban/docs/images/cases/table_list_indep_key.jpg b/luban/docs/images/cases/table_list_indep_key.jpg new file mode 100644 index 00000000..81725068 Binary files /dev/null and b/luban/docs/images/cases/table_list_indep_key.jpg differ diff --git a/luban/docs/images/cases/table_list_not_key.jpg b/luban/docs/images/cases/table_list_not_key.jpg new file mode 100644 index 00000000..f5445d56 Binary files /dev/null and b/luban/docs/images/cases/table_list_not_key.jpg differ diff --git a/luban/docs/images/cases/table_list_union_key.jpg b/luban/docs/images/cases/table_list_union_key.jpg new file mode 100644 index 00000000..c893e727 Binary files /dev/null and b/luban/docs/images/cases/table_list_union_key.jpg differ diff --git a/luban/docs/images/cases/tag.jpg b/luban/docs/images/cases/tag.jpg new file mode 100644 index 00000000..1b49dcb2 Binary files /dev/null and b/luban/docs/images/cases/tag.jpg differ diff --git a/luban/docs/images/cases/tag2.jpg b/luban/docs/images/cases/tag2.jpg new file mode 100644 index 00000000..99ce7b34 Binary files /dev/null and b/luban/docs/images/cases/tag2.jpg differ diff --git a/luban/docs/images/cases/title_dynamic_bean.jpg b/luban/docs/images/cases/title_dynamic_bean.jpg new file mode 100644 index 00000000..8488bc25 Binary files /dev/null and b/luban/docs/images/cases/title_dynamic_bean.jpg differ diff --git a/luban/docs/images/cases/title_enum.jpg b/luban/docs/images/cases/title_enum.jpg new file mode 100644 index 00000000..7087d987 Binary files /dev/null and b/luban/docs/images/cases/title_enum.jpg differ diff --git a/luban/docs/images/cases/title_map.jpg b/luban/docs/images/cases/title_map.jpg new file mode 100644 index 00000000..edab2d26 Binary files /dev/null and b/luban/docs/images/cases/title_map.jpg differ diff --git a/luban/docs/images/cases/titlelimit.jpg b/luban/docs/images/cases/titlelimit.jpg new file mode 100644 index 00000000..ab63dd5d Binary files /dev/null and b/luban/docs/images/cases/titlelimit.jpg differ diff --git a/luban/docs/images/docusaurus-social-card.jpg b/luban/docs/images/docusaurus-social-card.jpg new file mode 100644 index 00000000..ffcb4482 Binary files /dev/null and b/luban/docs/images/docusaurus-social-card.jpg differ diff --git a/luban/docs/images/docusaurus.png b/luban/docs/images/docusaurus.png new file mode 100644 index 00000000..f458149e Binary files /dev/null and b/luban/docs/images/docusaurus.png differ diff --git a/luban/docs/images/dots_release.png b/luban/docs/images/dots_release.png new file mode 100644 index 00000000..a25e5715 Binary files /dev/null and b/luban/docs/images/dots_release.png differ diff --git a/luban/docs/images/easy.svg b/luban/docs/images/easy.svg new file mode 100644 index 00000000..811bdd3b --- /dev/null +++ b/luban/docs/images/easy.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + diff --git a/luban/docs/images/efficient.svg b/luban/docs/images/efficient.svg new file mode 100644 index 00000000..82c59561 --- /dev/null +++ b/luban/docs/images/efficient.svg @@ -0,0 +1,32 @@ + + + + + + + + + \ No newline at end of file diff --git a/luban/docs/images/excel_bean.jpg b/luban/docs/images/excel_bean.jpg new file mode 100644 index 00000000..ea90e030 Binary files /dev/null and b/luban/docs/images/excel_bean.jpg differ diff --git a/luban/docs/images/excel_enum.jpg b/luban/docs/images/excel_enum.jpg new file mode 100644 index 00000000..c7be7ade Binary files /dev/null and b/luban/docs/images/excel_enum.jpg differ diff --git a/luban/docs/images/excel_table.jpg b/luban/docs/images/excel_table.jpg new file mode 100644 index 00000000..8c942a85 Binary files /dev/null and b/luban/docs/images/excel_table.jpg differ diff --git a/luban/docs/images/favicon.ico b/luban/docs/images/favicon.ico new file mode 100644 index 00000000..3fc4d606 Binary files /dev/null and b/luban/docs/images/favicon.ico differ diff --git a/luban/docs/images/favicon.png b/luban/docs/images/favicon.png new file mode 100644 index 00000000..e8828b06 Binary files /dev/null and b/luban/docs/images/favicon.png differ diff --git a/luban/docs/images/flying-seagull.jpg b/luban/docs/images/flying-seagull.jpg new file mode 100644 index 00000000..f6fa36fc Binary files /dev/null and b/luban/docs/images/flying-seagull.jpg differ diff --git a/luban/docs/images/icon.png b/luban/docs/images/icon.png new file mode 100644 index 00000000..547b44c5 Binary files /dev/null and b/luban/docs/images/icon.png differ diff --git a/luban/docs/images/install/install_01.png b/luban/docs/images/install/install_01.png new file mode 100644 index 00000000..816f7b17 Binary files /dev/null and b/luban/docs/images/install/install_01.png differ diff --git a/luban/docs/images/install/install_02.png b/luban/docs/images/install/install_02.png new file mode 100644 index 00000000..e785e8ea Binary files /dev/null and b/luban/docs/images/install/install_02.png differ diff --git a/luban/docs/images/install/install_03.png b/luban/docs/images/install/install_03.png new file mode 100644 index 00000000..db31bb52 Binary files /dev/null and b/luban/docs/images/install/install_03.png differ diff --git a/luban/docs/images/install/install_04.png b/luban/docs/images/install/install_04.png new file mode 100644 index 00000000..360079e9 Binary files /dev/null and b/luban/docs/images/install/install_04.png differ diff --git a/luban/docs/images/install/install_05.png b/luban/docs/images/install/install_05.png new file mode 100644 index 00000000..24f6e798 Binary files /dev/null and b/luban/docs/images/install/install_05.png differ diff --git a/luban/docs/images/install/install_06.png b/luban/docs/images/install/install_06.png new file mode 100644 index 00000000..e1e48f4e Binary files /dev/null and b/luban/docs/images/install/install_06.png differ diff --git a/luban/docs/images/install/install_07.png b/luban/docs/images/install/install_07.png new file mode 100644 index 00000000..127bb041 Binary files /dev/null and b/luban/docs/images/install/install_07.png differ diff --git a/luban/docs/images/install/install_08.png b/luban/docs/images/install/install_08.png new file mode 100644 index 00000000..309b0e49 Binary files /dev/null and b/luban/docs/images/install/install_08.png differ diff --git a/luban/docs/images/install/install_09.png b/luban/docs/images/install/install_09.png new file mode 100644 index 00000000..9ee50c3c Binary files /dev/null and b/luban/docs/images/install/install_09.png differ diff --git a/luban/docs/images/install/install_10.png b/luban/docs/images/install/install_10.png new file mode 100644 index 00000000..02bbd353 Binary files /dev/null and b/luban/docs/images/install/install_10.png differ diff --git a/luban/docs/images/logo.png b/luban/docs/images/logo.png new file mode 100644 index 00000000..547b44c5 Binary files /dev/null and b/luban/docs/images/logo.png differ diff --git a/luban/docs/images/logo.svg b/luban/docs/images/logo.svg new file mode 100644 index 00000000..9db6d0d0 --- /dev/null +++ b/luban/docs/images/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/luban/docs/images/luban_edit_tool.png b/luban/docs/images/luban_edit_tool.png new file mode 100644 index 00000000..27cf4631 Binary files /dev/null and b/luban/docs/images/luban_edit_tool.png differ diff --git a/luban/docs/images/more.png b/luban/docs/images/more.png new file mode 100644 index 00000000..830613ba Binary files /dev/null and b/luban/docs/images/more.png differ diff --git a/luban/docs/images/other.png b/luban/docs/images/other.png new file mode 100644 index 00000000..87f80989 Binary files /dev/null and b/luban/docs/images/other.png differ diff --git a/luban/docs/images/panda-waving.png b/luban/docs/images/panda-waving.png new file mode 100644 index 00000000..20246c60 Binary files /dev/null and b/luban/docs/images/panda-waving.png differ diff --git a/luban/docs/images/pipeline.jpg b/luban/docs/images/pipeline.jpg new file mode 100644 index 00000000..de4f8770 Binary files /dev/null and b/luban/docs/images/pipeline.jpg differ diff --git a/luban/docs/images/process.jpg b/luban/docs/images/process.jpg new file mode 100644 index 00000000..539d6e58 Binary files /dev/null and b/luban/docs/images/process.jpg differ diff --git a/luban/docs/images/python.png b/luban/docs/images/python.png new file mode 100644 index 00000000..c3ddebeb Binary files /dev/null and b/luban/docs/images/python.png differ diff --git a/luban/docs/images/reliable-dark.svg b/luban/docs/images/reliable-dark.svg new file mode 100644 index 00000000..c811d01b --- /dev/null +++ b/luban/docs/images/reliable-dark.svg @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/luban/docs/images/reliable.svg b/luban/docs/images/reliable.svg new file mode 100644 index 00000000..720f443e --- /dev/null +++ b/luban/docs/images/reliable.svg @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/luban/docs/images/ui.png b/luban/docs/images/ui.png new file mode 100644 index 00000000..617c56d7 Binary files /dev/null and b/luban/docs/images/ui.png differ diff --git a/luban/docs/images/undraw_docusaurus_mountain.svg b/luban/docs/images/undraw_docusaurus_mountain.svg new file mode 100644 index 00000000..af961c49 --- /dev/null +++ b/luban/docs/images/undraw_docusaurus_mountain.svg @@ -0,0 +1,171 @@ + + Easy to Use + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/luban/docs/images/undraw_docusaurus_react.svg b/luban/docs/images/undraw_docusaurus_react.svg new file mode 100644 index 00000000..94b5cf08 --- /dev/null +++ b/luban/docs/images/undraw_docusaurus_react.svg @@ -0,0 +1,170 @@ + + Powered by React + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/luban/docs/images/undraw_docusaurus_tree.svg b/luban/docs/images/undraw_docusaurus_tree.svg new file mode 100644 index 00000000..d9161d33 --- /dev/null +++ b/luban/docs/images/undraw_docusaurus_tree.svg @@ -0,0 +1,40 @@ + + Focus on What Matters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/luban/docs/images/web.png b/luban/docs/images/web.png new file mode 100644 index 00000000..0a6e27c4 Binary files /dev/null and b/luban/docs/images/web.png differ diff --git a/luban/docs/images/weixin.jpg b/luban/docs/images/weixin.jpg new file mode 100644 index 00000000..5f07a644 Binary files /dev/null and b/luban/docs/images/weixin.jpg differ diff --git a/luban/docs/images/zhifubao.jpg b/luban/docs/images/zhifubao.jpg new file mode 100644 index 00000000..5a9b4d7f Binary files /dev/null and b/luban/docs/images/zhifubao.jpg differ diff --git a/luban/docs/sponsor/weixin.JPG b/luban/docs/sponsor/weixin.JPG new file mode 100644 index 00000000..f57b48e0 Binary files /dev/null and b/luban/docs/sponsor/weixin.JPG differ diff --git a/luban/docs/sponsor/zhifubao.JPG b/luban/docs/sponsor/zhifubao.JPG new file mode 100644 index 00000000..20f45f1a Binary files /dev/null and b/luban/docs/sponsor/zhifubao.JPG differ diff --git a/luban/scripts/format.bat b/luban/scripts/format.bat new file mode 100644 index 00000000..40b07fd8 --- /dev/null +++ b/luban/scripts/format.bat @@ -0,0 +1,2 @@ +cd ../src +dotnet format --severity error -v n diff --git a/luban/scripts/format.sh b/luban/scripts/format.sh new file mode 100644 index 00000000..40b07fd8 --- /dev/null +++ b/luban/scripts/format.sh @@ -0,0 +1,2 @@ +cd ../src +dotnet format --severity error -v n diff --git a/luban/src/.dockerignore b/luban/src/.dockerignore new file mode 100644 index 00000000..58649f00 --- /dev/null +++ b/luban/src/.dockerignore @@ -0,0 +1,6 @@ +**/bin/ +**/obj/ +/lubanAssistant/ +/packages/ +/TestResults/ +LubanTools.sln diff --git a/luban/src/.editorconfig b/luban/src/.editorconfig new file mode 100644 index 00000000..165843fe --- /dev/null +++ b/luban/src/.editorconfig @@ -0,0 +1,53 @@ +root = true + +[*] +indent_style = space +insert_final_newline = true + +# CSharp formatting rules: +[*.cs] +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents_when_block = false + +csharp_space_after_cast = false +csharp_space_after_keywords_in_control_flow_statements = true +# csharp_space_between_parentheses = control_flow_statements, type_casts +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_after_comma = true +csharp_space_before_comma = false +csharp_space_after_dot = false +csharp_space_before_dot = false +csharp_space_after_semicolon_in_for_statement = true +csharp_space_before_semicolon_in_for_statement = false +csharp_space_around_declaration_statements = false +csharp_space_before_open_square_brackets = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_square_brackets = false + +csharp_preserve_single_line_statements = false +csharp_preserve_single_line_blocks = true + +csharp_prefer_braces = true +dotnet_diagnostic.IDE0011.severity = error + +max_line_length = 180 diff --git a/luban/src/Luban.Bson/AssemblyInfo.cs b/luban/src/Luban.Bson/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Bson/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Bson/BsonDataTarget.cs b/luban/src/Luban.Bson/BsonDataTarget.cs new file mode 100644 index 00000000..b3846d95 --- /dev/null +++ b/luban/src/Luban.Bson/BsonDataTarget.cs @@ -0,0 +1,32 @@ +using Luban.DataTarget; +using Luban.Defs; +using Luban.Utils; +using Newtonsoft.Json.Bson; + +namespace Luban.Bson; + +[DataTarget("bson")] +public class BsonDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "bson"; + + + private void WriteAsArray(List datas, BsonDataWriter x) + { + x.WriteStartArray(); + foreach (var d in datas) + { + d.Data.Apply(BsonDataVisitor.Ins, x); + } + x.WriteEndArray(); + } + + public override OutputFile ExportTable(DefTable table, List records) + { + var ss = new MemoryStream(); + var bsonWriter = new BsonDataWriter(ss); + WriteAsArray(records, bsonWriter); + bsonWriter.Flush(); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", DataUtil.StreamToBytes(ss)); + } +} diff --git a/luban/src/Luban.Bson/BsonDataVisitor.cs b/luban/src/Luban.Bson/BsonDataVisitor.cs new file mode 100644 index 00000000..bf79a018 --- /dev/null +++ b/luban/src/Luban.Bson/BsonDataVisitor.cs @@ -0,0 +1,132 @@ +using Luban.DataLoader; +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Utils; +using Newtonsoft.Json.Bson; + +namespace Luban.Bson; + +public class BsonDataVisitor : IDataActionVisitor +{ + public static BsonDataVisitor Ins { get; } = new(); + + public void Accept(DBool type, BsonDataWriter x) + { + x.WriteValue(type.Value); + } + + public void Accept(DByte type, BsonDataWriter x) + { + x.WriteValue(type.Value); + } + + public void Accept(DShort type, BsonDataWriter x) + { + x.WriteValue(type.Value); + } + + public void Accept(DInt type, BsonDataWriter x) + { + x.WriteValue(type.Value); + } + + public void Accept(DLong type, BsonDataWriter x) + { + x.WriteValue(type.Value); + } + + public void Accept(DFloat type, BsonDataWriter x) + { + x.WriteValue(type.Value); + } + + public void Accept(DDouble type, BsonDataWriter x) + { + x.WriteValue(type.Value); + } + + public virtual void Accept(DEnum type, BsonDataWriter x) + { + x.WriteValue(type.Value); + } + + public void Accept(DString type, BsonDataWriter x) + { + x.WriteValue(type.Value); + } + + public virtual void Accept(DDateTime type, BsonDataWriter x) + { + x.WriteValue(type.UnixTimeOfCurrentContext()); + } + + public virtual void Accept(DBean type, BsonDataWriter x) + { + x.WriteStartObject(); + + if (type.Type.IsAbstractType) + { + x.WritePropertyName(FieldNames.JsonTypeNameKey); + x.WriteValue(DataUtil.GetImplTypeName(type)); + } + + var defFields = type.ImplType.HierarchyFields; + int index = 0; + foreach (var d in type.Fields) + { + var defField = defFields[index++]; + + // 特殊处理 bean 多态类型 + // 另外,不生成 xxx:null 这样 + if (d == null || !defField.NeedExport()) + { + //x.WriteNullValue(); + } + else + { + x.WritePropertyName(defField.Name); + d.Apply(this, x); + } + } + x.WriteEndObject(); + } + + public void WriteList(List datas, BsonDataWriter x) + { + x.WriteStartArray(); + foreach (var d in datas) + { + d.Apply(this, x); + } + x.WriteEndArray(); + } + + public void Accept(DArray type, BsonDataWriter x) + { + WriteList(type.Datas, x); + } + + public void Accept(DList type, BsonDataWriter x) + { + WriteList(type.Datas, x); + } + + public void Accept(DSet type, BsonDataWriter x) + { + WriteList(type.Datas, x); + } + + public virtual void Accept(DMap type, BsonDataWriter x) + { + x.WriteStartArray(); + foreach (var d in type.Datas) + { + x.WriteStartArray(); + d.Key.Apply(this, x); + d.Value.Apply(this, x); + x.WriteEndArray(); + } + x.WriteEndArray(); + } +} diff --git a/luban/src/Luban.Bson/Luban.Bson.csproj b/luban/src/Luban.Bson/Luban.Bson.csproj new file mode 100644 index 00000000..e3583f45 --- /dev/null +++ b/luban/src/Luban.Bson/Luban.Bson.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + enable + disable + + + + + + + + + + + diff --git a/luban/src/Luban.CSharp/AssemblyInfo.cs b/luban/src/Luban.CSharp/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.CSharp/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.CSharp/CodeTarget/CsharpBinCodeTarget.cs b/luban/src/Luban.CSharp/CodeTarget/CsharpBinCodeTarget.cs new file mode 100644 index 00000000..72a86a37 --- /dev/null +++ b/luban/src/Luban.CSharp/CodeTarget/CsharpBinCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.CSharp.TemplateExtensions; +using Scriban; + +namespace Luban.CSharp.CodeTarget; + +[CodeTarget("cs-bin")] +public class CsharpBinCodeTarget : CsharpCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new CsharpBinTemplateExtension()); + } +} diff --git a/luban/src/Luban.CSharp/CodeTarget/CsharpCodeTargetBase.cs b/luban/src/Luban.CSharp/CodeTarget/CsharpCodeTargetBase.cs new file mode 100644 index 00000000..0191f140 --- /dev/null +++ b/luban/src/Luban.CSharp/CodeTarget/CsharpCodeTargetBase.cs @@ -0,0 +1,36 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.CSharp.TemplateExtensions; +using Scriban; + +namespace Luban.CSharp.CodeTarget; + +public abstract class CsharpCodeTargetBase : TemplateCodeTargetBase +{ + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_C_LIKE; + + protected override string FileSuffixName => "cs"; + + protected override ICodeStyle DefaultCodeStyle => CodeFormatManager.Ins.CsharpDefaultCodeStyle; + + private static readonly HashSet s_preservedKeyWords = new() + { + "abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", "class", "const", "continue", "decimal", "default", "delegate", + "do", "double", "else", "enum", "event", "explicit", "extern", "false", "finally", "fixed", "float", "for", "foreach", "goto", "if", "implicit", "in", + "int", "interface", "internal", "is", "lock", "long", "namespace", "new", "null", "object", "operator", "out", "override", "params", "private", "protected", + "public", "readonly", "ref", "return", "sbyte", "sealed", "short", "sizeof", "stackalloc", "static", "string", "struct", "switch", "this", "throw", "true", + "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort", "using", "virtual", "void", "volatile", "while" + }; + + protected override IReadOnlySet PreservedKeyWords => s_preservedKeyWords; + + protected override string GetFileNameWithoutExtByTypeName(string name) + { + return name.Replace('.', '/'); + } + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new CsharpTemplateExtension()); + } +} diff --git a/luban/src/Luban.CSharp/CodeTarget/CsharpDotnetJsonCodeTarget.cs b/luban/src/Luban.CSharp/CodeTarget/CsharpDotnetJsonCodeTarget.cs new file mode 100644 index 00000000..b2034981 --- /dev/null +++ b/luban/src/Luban.CSharp/CodeTarget/CsharpDotnetJsonCodeTarget.cs @@ -0,0 +1,16 @@ +using Luban.CodeTarget; +using Luban.CSharp.TemplateExtensions; +using Scriban; + +namespace Luban.CSharp.CodeTarget; + +[CodeTarget("cs-dotnet-json")] +public class CsharpDotnetJsonCodeTarget : CsharpCodeTargetBase +{ + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new CsharpDotNetJsonTemplateExtension()); + } +} diff --git a/luban/src/Luban.CSharp/CodeTarget/CsharpEditorJsonCodeTarget.cs b/luban/src/Luban.CSharp/CodeTarget/CsharpEditorJsonCodeTarget.cs new file mode 100644 index 00000000..40eabd56 --- /dev/null +++ b/luban/src/Luban.CSharp/CodeTarget/CsharpEditorJsonCodeTarget.cs @@ -0,0 +1,94 @@ +using Luban.CodeTarget; +using Luban.CSharp.TemplateExtensions; +using Luban.Defs; +using Luban.Utils; +using Scriban; +using Scriban.Runtime; + +namespace Luban.CSharp.CodeTarget; + +[CodeTarget("cs-editor-json")] +public class CsharpEditorJsonCodeTarget : CsharpCodeTargetBase +{ + public override void Handle(GenerationContext ctx, OutputFileManifest manifest) + { + var tasks = new List>(); + + foreach (var bean in ctx.Assembly.TypeList.OfType()) + { + tasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateBean(ctx, bean, writer); + return CreateOutputFile($"{GetFileNameWithoutExtByTypeName(bean.FullName)}.{FileSuffixName}", writer.ToResult(FileHeader)); + })); + } + + foreach (var @enum in ctx.Assembly.TypeList.OfType()) + { + tasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateEnum(ctx, @enum, writer); + return CreateOutputFile($"{GetFileNameWithoutExtByTypeName(@enum.FullName)}.{FileSuffixName}", writer.ToResult(FileHeader)); + })); + } + + Task.WaitAll(tasks.ToArray()); + foreach (var task in tasks) + { + manifest.AddFile(task.Result); + } + } + + public override void GenerateBean(GenerationContext ctx, DefBean bean, CodeWriter writer) + { + var template = GetTemplate("bean"); + var tplCtx = CreateTemplateContext(template); + string topModule = ctx.Target.TopModule; + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__top_module", topModule }, + { "__name", bean.Name }, + { "__namespace", bean.Namespace }, + { "__namespace_with_top_module", TypeUtil.MakeFullName(topModule, bean.Namespace) }, + { "__full_name_with_top_module", TypeUtil.MakeFullName(topModule, bean.FullName) }, + { "__bean", bean }, + { "__this", bean }, + {"__fields", bean.Fields}, + {"__hierarchy_fields", bean.HierarchyFields}, + {"__parent_def_type", bean.ParentDefType}, + { "__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + } + + public override void GenerateEnum(GenerationContext ctx, DefEnum @enum, CodeWriter writer) + { + var template = GetTemplate("enum"); + var tplCtx = CreateTemplateContext(template); + string topModule = ctx.Target.TopModule; + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__name", @enum.Name }, + { "__namespace", @enum.Namespace }, + { "__top_module", topModule }, + { "__namespace_with_top_module", TypeUtil.MakeFullName(topModule, @enum.Namespace) }, + { "__full_name_with_top_module", TypeUtil.MakeFullName(topModule, @enum.FullName) }, + { "__enum", @enum }, + { "__this", @enum }, + { "__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + } + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new CsharpEditorTemplateExtension()); + } +} diff --git a/luban/src/Luban.CSharp/CodeTarget/CsharpNewtonSoftJsonCodeTarget.cs b/luban/src/Luban.CSharp/CodeTarget/CsharpNewtonSoftJsonCodeTarget.cs new file mode 100644 index 00000000..88b9c755 --- /dev/null +++ b/luban/src/Luban.CSharp/CodeTarget/CsharpNewtonSoftJsonCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.CSharp.TemplateExtensions; +using Scriban; + +namespace Luban.CSharp.CodeTarget; + +[CodeTarget("cs-newtonsoft-json")] +public class CsharpNewtonSoftJsonCodeTarget : CsharpCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new CsharpNewtonSoftJsonTemplateExtension()); + } +} diff --git a/luban/src/Luban.CSharp/CodeTarget/CsharpSimpleJsonCodeTarget.cs b/luban/src/Luban.CSharp/CodeTarget/CsharpSimpleJsonCodeTarget.cs new file mode 100644 index 00000000..797a7d60 --- /dev/null +++ b/luban/src/Luban.CSharp/CodeTarget/CsharpSimpleJsonCodeTarget.cs @@ -0,0 +1,16 @@ +using Luban.CodeTarget; +using Luban.CSharp.TemplateExtensions; +using Scriban; + +namespace Luban.CSharp.CodeTarget; + +[CodeTarget("cs-simple-json")] +public class CsharpSimpleJsonCodeTarget : CsharpCodeTargetBase +{ + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new CsharpSimpleJsonTemplateExtension()); + } +} diff --git a/luban/src/Luban.CSharp/ConstStrings.cs b/luban/src/Luban.CSharp/ConstStrings.cs new file mode 100644 index 00000000..edef8ebf --- /dev/null +++ b/luban/src/Luban.CSharp/ConstStrings.cs @@ -0,0 +1,8 @@ +namespace Luban.CSharp; + +public static class ConstStrings +{ + public const string ListTypeName = "System.Collections.Generic.List"; + public const string HashSetTypeName = "System.Collections.Generic.HashSet"; + public const string HashMapTypeName = "System.Collections.Generic.Dictionary"; +} diff --git a/luban/src/Luban.CSharp/Luban.CSharp.csproj b/luban/src/Luban.CSharp/Luban.CSharp.csproj new file mode 100644 index 00000000..4c4fc4fe --- /dev/null +++ b/luban/src/Luban.CSharp/Luban.CSharp.csproj @@ -0,0 +1,102 @@ + + + + + + net8.0 + enable + + + + + false + runtime + + + + + + + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + diff --git a/luban/src/Luban.CSharp/TemplateExtensions/CsharpBinTemplateExtension.cs b/luban/src/Luban.CSharp/TemplateExtensions/CsharpBinTemplateExtension.cs new file mode 100644 index 00000000..88972fda --- /dev/null +++ b/luban/src/Luban.CSharp/TemplateExtensions/CsharpBinTemplateExtension.cs @@ -0,0 +1,13 @@ +using Luban.CSharp.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.CSharp.TemplateExtensions; + +public class CsharpBinTemplateExtension : ScriptObject +{ + public static string Deserialize(string bufName, string fieldName, TType type) + { + return type.Apply(BinaryDeserializeVisitor.Ins, bufName, fieldName); + } +} diff --git a/luban/src/Luban.CSharp/TemplateExtensions/CsharpDotNetJsonTemplateExtension.cs b/luban/src/Luban.CSharp/TemplateExtensions/CsharpDotNetJsonTemplateExtension.cs new file mode 100644 index 00000000..b198f140 --- /dev/null +++ b/luban/src/Luban.CSharp/TemplateExtensions/CsharpDotNetJsonTemplateExtension.cs @@ -0,0 +1,32 @@ +using Luban.CSharp.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.CSharp.TemplateExtensions; + +public class CsharpDotNetJsonTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string jsonVar, TType type) + { + if (type.IsNullable) + { + return $"{{var _j = {jsonVar}; if (_j.ValueKind != JsonValueKind.Null) {{ {type.Apply(DotNetJsonDeserializeVisitor.Ins, "_j", fieldName, 0)} }} else {{ {fieldName} = null; }} }}"; + } + else + { + return type.Apply(DotNetJsonDeserializeVisitor.Ins, jsonVar, fieldName, 0); + } + } + + public static string DeserializeField(string fieldName, string jsonVar, string jsonFieldName, TType type) + { + if (type.IsNullable) + { + return $"{{if ({jsonVar}.TryGetProperty(\"{jsonFieldName}\", out var _j) && _j.ValueKind != JsonValueKind.Null) {{ {type.Apply(DotNetJsonDeserializeVisitor.Ins, "_j", fieldName, 0)} }} else {{ {fieldName} = null; }} }}"; + } + else + { + return type.Apply(DotNetJsonDeserializeVisitor.Ins, $"{jsonVar}.GetProperty(\"{jsonFieldName}\")", fieldName, 0); + } + } +} diff --git a/luban/src/Luban.CSharp/TemplateExtensions/CsharpEditorJsonTemplateExtension.cs b/luban/src/Luban.CSharp/TemplateExtensions/CsharpEditorJsonTemplateExtension.cs new file mode 100644 index 00000000..c05f0887 --- /dev/null +++ b/luban/src/Luban.CSharp/TemplateExtensions/CsharpEditorJsonTemplateExtension.cs @@ -0,0 +1,39 @@ +using Luban.CSharp.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.CSharp.TemplateExtensions; + +public class CsharpEditorTemplateExtension : ScriptObject +{ + + public static string DeclaringTypeName(TType type) + { + return type.Apply(EditorDeclaringTypeNameVisitor.Ins); + } + + public static string Deserialize(string jsonName, string fieldName, TType type) + { + return $"{type.Apply(EditorJsonLoad.Ins, jsonName, fieldName, 0)}"; + } + + public static string Serialize(string jsonName, string jsonFieldName, string fieldName, TType type) + { + return $"{type.Apply(EditorJsonSave.Ins, jsonName, jsonFieldName, fieldName, 0)}"; + } + + public static bool IsRawNullable(TType type) + { + return type.Apply(IsRawNullableTypeVisitor.Ins); + } + + public static bool NeedInit(TType type) + { + return type.Apply(EditorNeedInitVisitor.Ins); + } + + public static string InitValue(TType type) + { + return type.Apply(EditorInitValueVisitor.Ins); + } +} diff --git a/luban/src/Luban.CSharp/TemplateExtensions/CsharpNewtonSoftJsonTemplateExtension.cs b/luban/src/Luban.CSharp/TemplateExtensions/CsharpNewtonSoftJsonTemplateExtension.cs new file mode 100644 index 00000000..b40d5c46 --- /dev/null +++ b/luban/src/Luban.CSharp/TemplateExtensions/CsharpNewtonSoftJsonTemplateExtension.cs @@ -0,0 +1,24 @@ +using Luban.CSharp.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; +namespace Luban.CSharp.TemplateExtensions; + +internal class CsharpNewtonSoftJsonTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string jsonVar, TType type) + { + return type.Apply(NewtonSoftJsonDeserializeVisitor.Ins, jsonVar, fieldName, 0); + } + + public static string DeserializeField(string fieldName, string jsonVar, string jsonFieldName, TType type) + { + if (type.IsNullable) + { + return $"{{if ({jsonVar}.TryGetValue(\"{jsonFieldName}\", out var _j)) {{ {type.Apply(NewtonSoftJsonDeserializeVisitor.Ins, "_j", fieldName, 0)} }} else {{ {fieldName} = null; }} }}"; + } + else + { + return type.Apply(NewtonSoftJsonDeserializeVisitor.Ins, $"{jsonVar}.GetValue(\"{jsonFieldName}\")", fieldName, 0); + } + } +} diff --git a/luban/src/Luban.CSharp/TemplateExtensions/CsharpSimpleJsonTemplateExtension.cs b/luban/src/Luban.CSharp/TemplateExtensions/CsharpSimpleJsonTemplateExtension.cs new file mode 100644 index 00000000..193daf28 --- /dev/null +++ b/luban/src/Luban.CSharp/TemplateExtensions/CsharpSimpleJsonTemplateExtension.cs @@ -0,0 +1,32 @@ +using Luban.CSharp.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.CSharp.TemplateExtensions; + +public class CsharpSimpleJsonTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string jsonVar, TType type) + { + if (type.IsNullable) + { + return $"{{var _j = {jsonVar}; if (_j.Tag != JSONNodeType.None && _j.Tag != JSONNodeType.NullValue) {{ {type.Apply(SimpleJsonDeserializeVisitor.Ins, "_j", fieldName, 0)} }} else {{ {fieldName} = null; }} }}"; + } + else + { + return type.Apply(SimpleJsonDeserializeVisitor.Ins, jsonVar, fieldName, 0); + } + } + + public static string DeserializeField(string fieldName, string jsonVar, string jsonFieldName, TType type) + { + if (type.IsNullable) + { + return $"{{ var _j = {jsonVar}[\"{jsonFieldName}\"]; if (_j.Tag != JSONNodeType.None && _j.Tag != JSONNodeType.NullValue) {{ {type.Apply(SimpleJsonDeserializeVisitor.Ins, "_j", fieldName, 0)} }} else {{ {fieldName} = null; }} }}"; + } + else + { + return type.Apply(SimpleJsonDeserializeVisitor.Ins, $"{jsonVar}[\"{jsonFieldName}\"]", fieldName, 0); + } + } +} diff --git a/luban/src/Luban.CSharp/TemplateExtensions/CsharpTemplateExtension.cs b/luban/src/Luban.CSharp/TemplateExtensions/CsharpTemplateExtension.cs new file mode 100644 index 00000000..b5355563 --- /dev/null +++ b/luban/src/Luban.CSharp/TemplateExtensions/CsharpTemplateExtension.cs @@ -0,0 +1,73 @@ +using Luban.CodeFormat; +using Luban.CSharp.TypeVisitors; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.CSharp.TemplateExtensions; + +public class CsharpTemplateExtension : ScriptObject +{ + public static string DeclaringTypeName(TType type) + { + return type.Apply(DeclaringTypeNameVisitor.Ins); + } + + public static string DeclaringCollectionRefName(TType type) + { + return type.Apply(DeclaringCollectionRefNameVisitor.Ins); + } + + public static string ClassOrStruct(DefBean bean) + { + return bean.IsValueType ? "struct" : "class"; + } + + public static string ClassModifier(DefBean bean) + { + return bean.IsAbstractType ? "abstract" : "sealed"; + } + + public static string MethodModifier(DefBean bean) + { + return bean.ParentDefType != null ? "override" : (bean.IsAbstractType ? "virtual" : ""); + } + + public static string NamespaceWithGraceBegin(string ns) + { + if (string.IsNullOrEmpty(ns)) + { + return string.Empty; + } + return $"namespace {ns}\n{{"; + } + + public static string NamespaceWithGraceEnd(string ns) + { + if (string.IsNullOrEmpty(ns)) + { + return string.Empty; + } + return "}"; + } + + public static string ToPrettyString(string name, TType type) + { + return type.Apply(DataToStringVisitor.Ins, name); + } + + public static string GetValueOfNullableType(TType type, string varName) + { + return type.Apply(IsRawNullableTypeVisitor.Ins) ? varName : $"{varName}.Value"; + } + + // public static string RefTypeName(DefField field) + // { + // if (field.CType.GetTag("ref") is { } value && GenerationContext.Current.Assembly.GetCfgTable(value) is { } cfgTable) + // { + // return cfgTable.ValueTType.Apply(DeclaringTypeNameVisitor.Ins); + // } + // return string.Empty; + // } +} diff --git a/luban/src/Luban.CSharp/Templates/common/cs/enum.sbn b/luban/src/Luban.CSharp/Templates/common/cs/enum.sbn new file mode 100644 index 00000000..4dcd9b67 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/common/cs/enum.sbn @@ -0,0 +1,28 @@ +{{~ + comment = __enum.comment + items = __enum.items +~}} + + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if comment != '' ~}} + /// + /// {{escape_comment comment}} + /// +{{~end~}} + {{~if __enum.is_flags~}} + [System.Flags] + {{~end~}} + public enum {{__name}} + { + {{~ for item in items ~}} +{{~if item.comment != '' ~}} + /// + /// {{escape_comment item.comment_or_alias}} + /// +{{~end~}} + {{format_enum_item_name __code_style item.name}} = {{item.value}}, + {{~end~}} + } + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-bin/bean.sbn b/luban/src/Luban.CSharp/Templates/cs-bin/bean.sbn new file mode 100644 index 00000000..53ce23da --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-bin/bean.sbn @@ -0,0 +1,151 @@ +using Luban; +{{ + parent_def_type = __bean.parent_def_type + export_fields = __bean.export_fields + hierarchy_export_fields = __bean.hierarchy_export_fields +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __bean.comment != '' ~}} +/// +/// {{escape_comment __bean.comment}} +/// +{{~end~}} +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_Ref' +end + +func get_index_var_name + ret (format_property_name __code_style $0.name) + '_Index' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = format_property_name __code_style refTable.name + if field.is_nullable + ret (get_ref_name field) + ' = ' + fieldName + '!= null ? tables.' + tableName + '.GetOrDefault(' + (get_value_of_nullable_type field.ctype fieldName) + ') : null;' + else + ret (get_ref_name field) + ' = tables.' + tableName + '.GetOrDefault(' + fieldName + ');' + end + else if can_generate_collection_ref field + collection_ref_table = get_collection_ref_table field + tableName = format_property_name __code_style collection_ref_table.name + if field.ctype.type_name == 'list' || field.ctype.type_name == 'set' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var _v in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(tables.' + tableName + '.GetOrDefault(_v)); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'array' + line1 = (get_ref_name field) + ' = new ' + (declaring_type_name collection_ref_table.value_ttype) + '[' + fieldName + '.Length];' + '\n' + line2 = 'for (int _i = 0; _i < ' + fieldName + '.Length; _i++) { ' + (get_ref_name field) + '[_i] = tables.' + tableName + '.GetOrDefault(' + fieldName + '[_i]); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'map' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var kvp in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(kvp.Key, tables.' + tableName + '.GetOrDefault(kvp.Value)); }' + '\n' + ret line1 + line2 + else + ret '' + end + else + if (is_field_bean_need_resolve_ref field) + ret fieldName + '?.ResolveRef(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + ') { _e?.ResolveRef(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + '.Values) { _e?.ResolveRef(tables); }' + else + ret '' + end + end +end +~}} +{{~if __bean.is_value_type~}} +public partial struct {{__name}} +{{~else~}} +public {{class_modifier __bean}} partial class {{__name}} : {{if parent_def_type}}{{__bean.parent}}{{else}}Luban.BeanBase{{end}} +{{~end~}} +{ + public {{__name}}(ByteBuf _buf) {{if parent_def_type}} : base(_buf) {{end}} + { + {{~ for field in export_fields + fieldName = format_property_name __code_style field.name + ~}} + {{deserialize '_buf' fieldName field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}} = null; + {{~end~}} + {{~if has_index field~}} + foreach(var _v in {{fieldName}}) + { + {{get_index_var_name field}}.Add(_v.{{format_property_name __code_style (get_index_field field).name}}, _v); + } + {{~end~}} + {{~end~}} + } + + public static {{__name}} Deserialize{{__name}}(ByteBuf _buf) + { + {{~if __bean.is_abstract_type~}} + switch (_buf.ReadInt()) + { + {{~for child in __bean.hierarchy_not_abstract_children~}} + case {{child.full_name}}.__ID__: return new {{child.full_name}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__bean.full_name}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public readonly {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}}; + {{~if can_generate_ref field~}} + public {{declaring_type_name (get_ref_type field)}} {{get_ref_name field}}; + {{~else if can_generate_collection_ref field~}} + public {{declaring_collection_ref_name field.ctype}} {{get_ref_name field}}; + {{~end~}} + {{~if has_index field + indexMapType = get_index_map_type field + ~}} + public readonly {{declaring_type_name indexMapType}} {{get_index_var_name field}} = new {{declaring_type_name indexMapType}}(); + {{~end~}} + {{~end~}} + +{{~if !__bean.is_abstract_type && !__bean.is_value_type~}} + public const int __ID__ = {{__bean.id}}; + public override int GetTypeId() => __ID__; +{{~end~}} + + public {{method_modifier __bean}} void ResolveRef({{__manager_name}} tables) + { + {{~if parent_def_type~}} + base.ResolveRef(tables); + {{~end~}} + {{~for field in export_fields~}} + {{~ line = generate_resolve_field_ref field ~}} + {{~ if line != ''~}} + {{line}} + {{~end~}} + {{~end~}} + } + + public override string ToString() + { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{to_pretty_string (format_property_name __code_style field.name) field.ctype}} + "," + {{~end~}} + + "}"; + } +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-bin/table.sbn b/luban/src/Luban.CSharp/Templates/cs-bin/table.sbn new file mode 100644 index 00000000..72710d6d --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-bin/table.sbn @@ -0,0 +1,163 @@ +using Luban; + +{{ + key_type = __table.key_ttype + value_type = __table.value_ttype + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'System.Collections.Generic.Dictionary<(' + (array.each __table.index_list @index_type_name | array.join ', ') + '), ' + (declaring_type_name value_type) + '>' + end + + func table_key_list + varName = $0 + indexList = __table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = __table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = __table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __table.comment != '' ~}} +/// +/// {{escape_comment __table.comment}} +/// +{{~end~}} +public partial class {{__name}} +{ + {{~if __table.is_map_table ~}} + private readonly System.Collections.Generic.Dictionary<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> _dataMap; + private readonly System.Collections.Generic.List<{{declaring_type_name value_type}}> _dataList; + + public {{__name}}(ByteBuf _buf) + { + _dataMap = new System.Collections.Generic.Dictionary<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}>(); + _dataList = new System.Collections.Generic.List<{{declaring_type_name value_type}}>(); + + for(int n = _buf.ReadSize() ; n > 0 ; --n) + { + {{declaring_type_name value_type}} _v; + {{deserialize '_buf' '_v' value_type}} + _dataList.Add(_v); + _dataMap.Add(_v.{{format_property_name __code_style __table.index_field.name}}, _v); + } + } + + public System.Collections.Generic.Dictionary<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> DataMap => _dataMap; + public System.Collections.Generic.List<{{declaring_type_name value_type}}> DataList => _dataList; + +{{~if value_type.is_dynamic~}} + public T GetOrDefaultAs({{declaring_type_name key_type}} key) where T : {{declaring_type_name value_type}} => _dataMap.TryGetValue(key, out var v) ? (T)v : null; + public T GetAs({{declaring_type_name key_type}} key) where T : {{declaring_type_name value_type}} => (T)_dataMap[key]; +{{~end~}} + public {{declaring_type_name value_type}} GetOrDefault({{declaring_type_name key_type}} key) => _dataMap.TryGetValue(key, out var v) ? v : null; + public {{declaring_type_name value_type}} Get({{declaring_type_name key_type}} key) => _dataMap[key]; + public {{declaring_type_name value_type}} this[{{declaring_type_name key_type}} key] => _dataMap[key]; + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + + {{~else if __table.is_list_table ~}} + private readonly System.Collections.Generic.List<{{declaring_type_name value_type}}> _dataList; + + {{~if __table.is_union_index~}} + private {{table_union_map_type_name}} _dataMapUnion; + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + private System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~end~}} + + public {{__name}}(ByteBuf _buf) + { + _dataList = new System.Collections.Generic.List<{{declaring_type_name value_type}}>(); + + for(int n = _buf.ReadSize() ; n > 0 ; --n) + { + {{declaring_type_name value_type}} _v; + {{deserialize '_buf' '_v' value_type}} + _dataList.Add(_v); + } + {{~if __table.is_union_index~}} + _dataMapUnion = new {{table_union_map_type_name}}(); + foreach(var _v in _dataList) + { + _dataMapUnion.Add(({{table_key_list "_v"}}), _v); + } + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}} = new System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name value_type}}>(); + {{~end~}} + foreach(var _v in _dataList) + { + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}}.Add(_v.{{format_property_name __code_style idx.index_field.name}}, _v); + {{~end~}} + } + {{~end~}} + } + + public System.Collections.Generic.List<{{declaring_type_name value_type}}> DataList => _dataList; + + {{~if __table.is_union_index~}} + public {{declaring_type_name value_type}} Get({{table_param_def_list}}) => _dataMapUnion.TryGetValue(({{table_param_name_list}}), out {{declaring_type_name value_type}} __v) ? __v : null; + {{~else if !__table.index_list.empty? ~}} + {{~for idx in __table.index_list~}} + public {{declaring_type_name value_type}} GetBy{{format_property_name __code_style idx.index_field.name}}({{declaring_type_name idx.type}} key) => _dataMap_{{idx.index_field.name}}.TryGetValue(key, out {{declaring_type_name value_type}} __v) ? __v : null; + {{~end~}} + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + {{~else~}} + + private readonly {{declaring_type_name value_type}} _data; + + public {{declaring_type_name value_type}} Data => _data; + + public {{__name}}(ByteBuf _buf) + { + int n = _buf.ReadSize(); + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_buf' '_data' value_type}} + } + + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}} => _data.{{format_property_name __code_style field.name}}; + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + _data.ResolveRef(tables); + } + {{~end~}} +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-bin/tables.sbn b/luban/src/Luban.CSharp/Templates/cs-bin/tables.sbn new file mode 100644 index 00000000..be907ad7 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-bin/tables.sbn @@ -0,0 +1,31 @@ +using Luban; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + public {{table.full_name}} {{format_property_name __code_style table.name}} {get; } + {{~end~}} + + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = new {{table.full_name}}(loader("{{table.output_data_file}}")); + {{~end~}} + ResolveRef(); + } + + private void ResolveRef() + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}}.ResolveRef(this); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/luban/src/Luban.CSharp/Templates/cs-dotnet-json/bean.sbn b/luban/src/Luban.CSharp/Templates/cs-dotnet-json/bean.sbn new file mode 100644 index 00000000..d7f63071 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-dotnet-json/bean.sbn @@ -0,0 +1,152 @@ +using Luban; +using System.Text.Json; +{{ + parent_def_type = __bean.parent_def_type + export_fields = __bean.export_fields + hierarchy_export_fields = __bean.hierarchy_export_fields +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __bean.comment != '' ~}} +/// +/// {{escape_comment __bean.comment}} +/// +{{~end~}} +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_Ref' +end + +func get_index_var_name + ret (format_property_name __code_style $0.name) + '_Index' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = format_property_name __code_style refTable.name + if field.is_nullable + ret (get_ref_name field) + ' = ' + fieldName + '!= null ? tables.' + tableName + '.GetOrDefault(' + (get_value_of_nullable_type field.ctype fieldName) + ') : null;' + else + ret (get_ref_name field) + ' = tables.' + tableName + '.GetOrDefault(' + fieldName + ');' + end + else if can_generate_collection_ref field + collection_ref_table = get_collection_ref_table field + tableName = format_property_name __code_style collection_ref_table.name + if field.ctype.type_name == 'list' || field.ctype.type_name == 'set' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var _v in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(tables.' + tableName + '.GetOrDefault(_v)); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'array' + line1 = (get_ref_name field) + ' = new ' + (declaring_type_name collection_ref_table.value_ttype) + '[' + fieldName + '.Length];' + '\n' + line2 = 'for (int _i = 0; _i < ' + fieldName + '.Length; _i++) { ' + (get_ref_name field) + '[_i] = tables.' + tableName + '.GetOrDefault(' + fieldName + '[_i]); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'map' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var kvp in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(kvp.Key, tables.' + tableName + '.GetOrDefault(kvp.Value)); }' + '\n' + ret line1 + line2 + else + ret '' + end + else + if (is_field_bean_need_resolve_ref field) + ret fieldName + '?.ResolveRef(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + ') { _e?.ResolveRef(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + '.Values) { _e?.ResolveRef(tables); }' + else + ret '' + end + end +end +~}} +{{~if __bean.is_value_type~}} +public partial struct {{__name}} +{{~else~}} +public {{class_modifier __bean}} partial class {{__name}} : {{if parent_def_type}}{{__bean.parent}}{{else}}Luban.BeanBase{{end}} +{{~end~}} +{ + public {{__name}}(JsonElement _buf) {{if parent_def_type}} : base(_buf) {{end}} + { + {{~ for field in export_fields + fieldName = format_property_name __code_style field.name + ~}} + {{deserialize_field fieldName '_buf' field.name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}} = null; + {{~end~}} + {{~if has_index field~}} + foreach(var _v in {{fieldName}}) + { + {{get_index_var_name field}}.Add(_v.{{format_property_name __code_style (get_index_field field).name}}, _v); + } + {{~end~}} + {{~end~}} + } + + public static {{__name}} Deserialize{{__name}}(JsonElement _buf) + { + {{~if __bean.is_abstract_type~}} + switch (_buf.GetProperty("$type").GetString()) + { + {{~for child in __bean.hierarchy_not_abstract_children~}} + case "{{impl_data_type child __bean}}": return new {{child.full_name}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__bean.full_name}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public readonly {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}}; + {{~if can_generate_ref field~}} + public {{declaring_type_name (get_ref_type field)}} {{get_ref_name field}}; + {{~else if can_generate_collection_ref field~}} + public {{declaring_collection_ref_name field.ctype}} {{get_ref_name field}}; + {{~end~}} + {{~if has_index field + indexMapType = get_index_map_type field + ~}} + public readonly {{declaring_type_name indexMapType}} {{get_index_var_name field}} = new {{declaring_type_name indexMapType}}(); + {{~end~}} + {{~end~}} + +{{~if !__bean.is_abstract_type && !__bean.is_value_type~}} + public const int __ID__ = {{__bean.id}}; + public override int GetTypeId() => __ID__; +{{~end~}} + + public {{method_modifier __bean}} void ResolveRef({{__manager_name}} tables) + { + {{~if parent_def_type~}} + base.ResolveRef(tables); + {{~end~}} + {{~for field in export_fields~}} + {{~ line = generate_resolve_field_ref field ~}} + {{~ if line != ''~}} + {{line}} + {{~end~}} + {{~end~}} + } + + public override string ToString() + { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{to_pretty_string (format_property_name __code_style field.name) field.ctype}} + "," + {{~end~}} + + "}"; + } +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-dotnet-json/table.sbn b/luban/src/Luban.CSharp/Templates/cs-dotnet-json/table.sbn new file mode 100644 index 00000000..b227e192 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-dotnet-json/table.sbn @@ -0,0 +1,162 @@ +using Luban; +using System.Text.Json; + +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'System.Collections.Generic.Dictionary<(' + (array.each __table.index_list @index_type_name | array.join ', ') + '), ' + (declaring_type_name __value_type) + '>' + end + + func table_key_list + varName = $0 + indexList = __table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = __table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = __table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __table.comment != '' ~}} +/// +/// {{escape_comment __table.comment}} +/// +{{~end~}} +public partial class {{__name}} +{ + {{~if __table.is_map_table ~}} + private readonly System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + public {{__name}}(JsonElement _buf) + { + _dataMap = new System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>(); + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JsonElement _ele in _buf.EnumerateArray()) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + _dataMap.Add(_v.{{format_property_name __code_style __table.index_field.name}}, _v); + } + } + + public System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> DataMap => _dataMap; + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + +{{~if __value_type.is_dynamic~}} + public T GetOrDefaultAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => _dataMap.TryGetValue(key, out var v) ? (T)v : null; + public T GetAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => (T)_dataMap[key]; +{{~end~}} + public {{declaring_type_name __value_type}} GetOrDefault({{declaring_type_name __key_type}} key) => _dataMap.TryGetValue(key, out var v) ? v : null; + public {{declaring_type_name __value_type}} Get({{declaring_type_name __key_type}} key) => _dataMap[key]; + public {{declaring_type_name __value_type}} this[{{declaring_type_name __key_type}} key] => _dataMap[key]; + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + + {{~else if __table.is_list_table ~}} + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + {{~if __table.is_union_index~}} + private {{table_union_map_type_name}} _dataMapUnion; + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + private System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~end~}} + + public {{__name}}(JsonElement _buf) + { + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JsonElement _ele in _buf.EnumerateArray()) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + } + {{~if __table.is_union_index~}} + _dataMapUnion = new {{table_union_map_type_name}}(); + foreach(var _v in _dataList) + { + _dataMapUnion.Add(({{table_key_list "_v"}}), _v); + } + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}} = new System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>(); + {{~end~}} + foreach(var _v in _dataList) + { + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}}.Add(_v.{{format_property_name __code_style idx.index_field.name}}, _v); + {{~end~}} + } + {{~end~}} + } + + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + + {{~if __table.is_union_index~}} + public {{declaring_type_name __value_type}} Get({{table_param_def_list}}) => _dataMapUnion.TryGetValue(({{table_param_name_list}}), out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~else if !__table.index_list.empty? ~}} + {{~for idx in __table.index_list~}} + public {{declaring_type_name __value_type}} GetBy{{format_property_name __code_style idx.index_field.name}}({{declaring_type_name idx.type}} key) => _dataMap_{{idx.index_field.name}}.TryGetValue(key, out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~end~}} + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + {{~else~}} + + private readonly {{declaring_type_name __value_type}} _data; + + public {{declaring_type_name __value_type}} Data => _data; + + public {{__name}}(JsonElement _buf) + { + int n = _buf.GetArrayLength(); + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_data' '_buf[0]' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}} => _data.{{format_property_name __code_style field.name}}; + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + _data.ResolveRef(tables); + } + {{~end~}} +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-dotnet-json/tables.sbn b/luban/src/Luban.CSharp/Templates/cs-dotnet-json/tables.sbn new file mode 100644 index 00000000..fcb18326 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-dotnet-json/tables.sbn @@ -0,0 +1,32 @@ +using Luban; +using System.Text.Json; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + public {{table.full_name}} {{format_property_name __code_style table.name}} {get; } + {{~end~}} + + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = new {{table.full_name}}(loader("{{table.output_data_file}}")); + {{~end~}} + ResolveRef(); + } + + private void ResolveRef() + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}}.ResolveRef(this); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/luban/src/Luban.CSharp/Templates/cs-editor-json/bean.sbn b/luban/src/Luban.CSharp/Templates/cs-editor-json/bean.sbn new file mode 100644 index 00000000..8fd74be6 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-editor-json/bean.sbn @@ -0,0 +1,102 @@ +using System.Collections.Generic; +using SimpleJSON; +using Luban; + +{{namespace_with_grace_begin __namespace_with_top_module}} + +{{~if __this.comment != '' ~}} +/// +/// {{escape_comment __this.comment}} +/// +{{~end~}} +public {{class_modifier __bean}} class {{__name}} : {{if __parent_def_type}} {{__this.parent}} {{else}} Luban.EditorBeanBase {{end}} +{ + public {{__name}}() + { + {{~ for field in __fields ~}} + {{~if (need_init field.ctype) && !field.ctype.is_nullable ~}} + {{format_field_name __code_style field.name}} = {{init_value field.ctype}}; + {{~end~}} + {{~end~}} + } + + {{~if !__this.is_abstract_type~}} + public override void LoadJson(SimpleJSON.JSONObject _json) + { + {{~ for field in __hierarchy_fields ~}} + { + var _fieldJson = _json["{{field.name}}"]; + if (_fieldJson != null) + { + {{deserialize '_fieldJson' (format_field_name __code_style field.name) field.ctype}} + } + } + + {{~end~}} + } + + public override void SaveJson(SimpleJSON.JSONObject _json) + { + {{~if parent~}} + _json["$type"] = "{{__this.full_name}}"; + {{~end~}} + {{~ for field in __hierarchy_fields ~}} + {{~if field.ctype.is_nullable}} + if ({{format_field_name __code_style field.name}} != null) + { + {{serialize '_json' field.name (format_field_name __code_style field.name) field.ctype}} + } + {{~else~}} + { + {{~if (is_raw_nullable field.ctype)}} + if ({{format_field_name __code_style field.name}} == null) { throw new System.ArgumentNullException(); } + {{~end~}} + {{serialize '_json' field.name (format_field_name __code_style field.name) field.ctype}} + } + {{~end~}} + {{~end~}} + } + {{~end~}} + + public static {{__name}} LoadJson{{__name}}(SimpleJSON.JSONNode _json) + { + {{~if __this.is_abstract_type~}} + string type = _json["$type"]; + {{__name}} obj; + switch (type) + { + {{~for child in __this.hierarchy_not_abstract_children~}} + {{~if child.namespace == __this.namespace && __this.namespace != '' ~}} + case "{{child.full_name}}": + {{~end~}} + case "{{impl_data_type child __this}}":obj = new {{child.full_name}}(); break; + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + {{__name}} obj = new {{__this.full_name}}(); + {{~end~}} + obj.LoadJson((SimpleJSON.JSONObject)_json); + return obj; + } + + public static void SaveJson{{__name}}({{__name}} _obj, SimpleJSON.JSONNode _json) + { + {{~if __this.is_abstract_type~}} + _json["$type"] = _obj.GetType().Name; + {{~end~}} + _obj.SaveJson((SimpleJSON.JSONObject)_json); + } + + {{~ for field in __fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + + {{~end~}} +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-editor-json/enum.sbn b/luban/src/Luban.CSharp/Templates/cs-editor-json/enum.sbn new file mode 100644 index 00000000..fb36236f --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-editor-json/enum.sbn @@ -0,0 +1,59 @@ +{{~ + comment = __enum.comment + items = __enum.items + itemType = 'Luban.EditorEnumItemInfo' +~}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if comment != '' ~}} + /// + /// {{escape_comment comment}} + /// +{{~end~}} + {{~if __enum.is_flags~}} + [System.Flags] + {{~end~}} + public enum {{__name}} + { + {{~ for item in items ~}} +{{~if item.comment != '' ~}} + /// + /// {{escape_comment item.comment_or_alias}} + /// +{{~end~}} + {{format_enum_item_name __code_style item.name}} = {{item.value}}, + {{~end~}} + } + + public static class {{__name}}_Metadata + { + {{~ for item in items ~}} + public static readonly {{itemType}} {{item.name}} = new {{itemType}}("{{item.name}}", "{{item.alias}}", {{item.int_value}}, "{{item.comment}}"); + {{~end~}} + + private static readonly System.Collections.Generic.List<{{itemType}}> __items = new System.Collections.Generic.List<{{itemType}}> + { + {{~ for item in items ~}} + {{item.name}}, + {{~end~}} + }; + + public static System.Collections.Generic.List<{{itemType}}> GetItems() => __items; + + public static {{itemType}} GetByName(string name) + { + return __items.Find(c => c.Name == name); + } + + public static {{itemType}} GetByNameOrAlias(string name) + { + return __items.Find(c => c.Name == name || c.Alias == name); + } + + public static {{itemType}} GetByValue(int value) + { + return __items.Find(c => c.Value == value); + } + } + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-newtonsoft-json/bean.sbn b/luban/src/Luban.CSharp/Templates/cs-newtonsoft-json/bean.sbn new file mode 100644 index 00000000..f8ae9bd2 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-newtonsoft-json/bean.sbn @@ -0,0 +1,158 @@ +using Luban; +using Newtonsoft.Json.Linq; + +{{ + parent_def_type = __bean.parent_def_type + export_fields = __bean.export_fields + hierarchy_export_fields = __bean.hierarchy_export_fields +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __bean.comment != '' ~}} +/// +/// {{escape_comment __bean.comment}} +/// +{{~end~}} +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_Ref' +end + +func get_index_var_name + ret (format_property_name __code_style $0.name) + '_Index' +end + + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = format_property_name __code_style refTable.name + if field.is_nullable + ret (get_ref_name field) + ' = ' + fieldName + '!= null ? tables.' + tableName + '.GetOrDefault(' + (get_value_of_nullable_type field.ctype fieldName) + ') : null;' + else + ret (get_ref_name field) + ' = tables.' + tableName + '.GetOrDefault(' + fieldName + ');' + end + else if can_generate_collection_ref field + collection_ref_table = get_collection_ref_table field + tableName = format_property_name __code_style collection_ref_table.name + if field.ctype.type_name == 'list' || field.ctype.type_name == 'set' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var _v in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(tables.' + tableName + '.GetOrDefault(_v)); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'array' + line1 = (get_ref_name field) + ' = new ' + (declaring_type_name collection_ref_table.value_ttype) + '[' + fieldName + '.Length];' + '\n' + line2 = 'for (int _i = 0; _i < ' + fieldName + '.Length; _i++) { ' + (get_ref_name field) + '[_i] = tables.' + tableName + '.GetOrDefault(' + fieldName + '[_i]); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'map' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var kvp in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(kvp.Key, tables.' + tableName + '.GetOrDefault(kvp.Value)); }' + '\n' + ret line1 + line2 + else + ret '' + end + else + if (is_field_bean_need_resolve_ref field) + ret fieldName + '?.ResolveRef(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + ') { _e?.ResolveRef(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + '.Values) { _e?.ResolveRef(tables); }' + else + ret '' + end + end +end + +~}} + +{{~if __bean.is_value_type~}} +public partial struct {{__name}} +{{~else~}} +public {{class_modifier __bean}} partial class {{__name}} : {{if parent_def_type}}{{__bean.parent}}{{else}}Luban.BeanBase{{end}} +{{~end~}} +{ + public {{__name}}(JToken _buf) {{if parent_def_type}} : base(_buf) {{end}} + { + JObject _obj = _buf as JObject; + {{~ for field in export_fields + fieldName = format_property_name __code_style field.name + ~}} + {{deserialize_field fieldName '_obj' field.name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}} = null; + {{~end~}} + {{~if has_index field~}} + foreach(var _v in {{fieldName}}) + { + {{get_index_var_name field}}.Add(_v.{{format_property_name __code_style (get_index_field field).name}}, _v); + } + {{~end~}} + {{~end~}} + } + + public static {{__name}} Deserialize{{__name}}(JToken _buf) + { + {{~if __bean.is_abstract_type~}} + var _obj=_buf as JObject; + switch (_obj.GetValue("$type").ToString()) + { + {{~for child in __bean.hierarchy_not_abstract_children~}} + case "{{impl_data_type child __bean}}": return new {{child.full_name}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__bean.full_name}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public readonly {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}}; + {{~if can_generate_ref field~}} + public {{declaring_type_name (get_ref_type field)}} {{get_ref_name field}}; + {{~else if can_generate_collection_ref field~}} + public {{declaring_collection_ref_name field.ctype}} {{get_ref_name field}}; + {{~end~}} + {{~if has_index field + indexMapType = get_index_map_type field + ~}} + public readonly {{declaring_type_name indexMapType}} {{get_index_var_name field}} = new {{declaring_type_name indexMapType}}(); + {{~end~}} + {{~end~}} + + + {{~if !__bean.is_abstract_type && !__bean.is_value_type~}} + public const int __ID__ = {{__bean.id}}; + public override int GetTypeId() => __ID__; + {{~end~}} + + public {{method_modifier __bean}} void ResolveRef({{__manager_name}} tables) + { + {{~if parent_def_type~}} + base.ResolveRef(tables); + {{~end~}} + {{~for field in export_fields~}} + {{~ line = generate_resolve_field_ref field ~}} + {{~ if line != ''~}} + {{line}} + {{~end~}} + {{~end~}} + } + + public override string ToString() + { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{to_pretty_string (format_property_name __code_style field.name) field.ctype}} + "," + {{~end~}} + + "}"; + } +} +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-newtonsoft-json/table.sbn b/luban/src/Luban.CSharp/Templates/cs-newtonsoft-json/table.sbn new file mode 100644 index 00000000..edc3a54b --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-newtonsoft-json/table.sbn @@ -0,0 +1,169 @@ +using Newtonsoft.Json.Linq; +using Luban; + +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'System.Collections.Generic.Dictionary<(' + (array.each __table.index_list @index_type_name | array.join ', ') + '), ' + (declaring_type_name __value_type) + '>' + end + + func table_key_list + varName = $0 + indexList = __table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = __table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = __table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} + +{{~if __table.comment != '' ~}} +/// +/// {{escape_comment __table.comment}} +/// +{{~end~}} +public partial class {{__name}} +{ + {{~if __table.is_map_table ~}} + private readonly System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + public {{__name}}(JArray _buf) + { + _dataMap = new System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>(); + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JObject _ele in _buf) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + _dataMap.Add(_v.{{format_property_name __code_style __table.index_field.name}}, _v); + } + } + + + public System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> DataMap => _dataMap; + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + +{{~if __value_type.is_dynamic~}} + public T GetOrDefaultAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => _dataMap.TryGetValue(key, out var v) ? (T)v : null; + public T GetAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => (T)_dataMap[key]; +{{~end~}} + public {{declaring_type_name __value_type}} GetOrDefault({{declaring_type_name __key_type}} key) => _dataMap.TryGetValue(key, out var v) ? v : null; + public {{declaring_type_name __value_type}} Get({{declaring_type_name __key_type}} key) => _dataMap[key]; + public {{declaring_type_name __value_type}} this[{{declaring_type_name __key_type}} key] => _dataMap[key]; + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + + {{~else if __table.is_list_table ~}} + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + {{~if __table.is_union_index~}} + private {{table_union_map_type_name}} _dataMapUnion; + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + private System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~end~}} + + + public {{__name}}(JArray _buf) + { + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JObject _ele in _buf) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + } + {{~if __table.is_union_index~}} + _dataMapUnion = new {{table_union_map_type_name}}(); + foreach(var _v in _dataList) + { + _dataMapUnion.Add(({{table_key_list "_v"}}), _v); + } + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}} = new System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>(); + {{~end~}} + foreach(var _v in _dataList) + { + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}}.Add(_v.{{format_property_name __code_style idx.index_field.name}}, _v); + {{~end~}} + } + {{~end~}} + } + + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + + + {{~if __table.is_union_index~}} + public {{declaring_type_name __value_type}} Get({{table_param_def_list}}) => _dataMapUnion.TryGetValue(({{table_param_name_list}}), out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~else if !__table.index_list.empty? ~}} + {{~for idx in __table.index_list~}} + public {{declaring_type_name __value_type}} GetBy{{format_property_name __code_style idx.index_field.name}}({{declaring_type_name idx.type}} key) => _dataMap_{{idx.index_field.name}}.TryGetValue(key, out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~end~}} + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + {{~else~}} + + private readonly {{declaring_type_name __value_type}} _data; + + public {{declaring_type_name __value_type}} Data => _data; + + public {{__name}}(JArray _buf) + { + int n = _buf.Count; + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_data' '_buf[0]' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}} => _data.{{format_property_name __code_style field.name}}; + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + _data.ResolveRef(tables); + } + + + + {{~end~}} +} +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-newtonsoft-json/tables.sbn b/luban/src/Luban.CSharp/Templates/cs-newtonsoft-json/tables.sbn new file mode 100644 index 00000000..5f10e0a6 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-newtonsoft-json/tables.sbn @@ -0,0 +1,32 @@ +using Newtonsoft.Json.Linq; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + public {{table.full_name}} {{format_property_name __code_style table.name}} {get; } + {{~end~}} + + + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = new {{table.full_name}}(loader("{{table.output_data_file}}")); + {{~end~}} + ResolveRef(); + } + + private void ResolveRef() + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}}.ResolveRef(this); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} diff --git a/luban/src/Luban.CSharp/Templates/cs-simple-json/bean.sbn b/luban/src/Luban.CSharp/Templates/cs-simple-json/bean.sbn new file mode 100644 index 00000000..67ea7db2 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-simple-json/bean.sbn @@ -0,0 +1,152 @@ +using Luban; +using SimpleJSON; +{{ + parent_def_type = __bean.parent_def_type + export_fields = __bean.export_fields + hierarchy_export_fields = __bean.hierarchy_export_fields +}} + +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __bean.comment != '' ~}} +/// +/// {{escape_comment __bean.comment}} +/// +{{~end~}} +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_Ref' +end + +func get_index_var_name + ret (format_property_name __code_style $0.name) + '_Index' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = format_property_name __code_style refTable.name + if field.is_nullable + ret (get_ref_name field) + ' = ' + fieldName + '!= null ? tables.' + tableName + '.GetOrDefault(' + (get_value_of_nullable_type field.ctype fieldName) + ') : null;' + else + ret (get_ref_name field) + ' = tables.' + tableName + '.GetOrDefault(' + fieldName + ');' + end + else if can_generate_collection_ref field + collection_ref_table = get_collection_ref_table field + tableName = format_property_name __code_style collection_ref_table.name + if field.ctype.type_name == 'list' || field.ctype.type_name == 'set' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var _v in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(tables.' + tableName + '.GetOrDefault(_v)); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'array' + line1 = (get_ref_name field) + ' = new ' + (declaring_type_name collection_ref_table.value_ttype) + '[' + fieldName + '.Length];' + '\n' + line2 = 'for (int _i = 0; _i < ' + fieldName + '.Length; _i++) { ' + (get_ref_name field) + '[_i] = tables.' + tableName + '.GetOrDefault(' + fieldName + '[_i]); }' + '\n' + ret line1 + line2 + else if field.ctype.type_name == 'map' + line1 = (get_ref_name field) + ' = new ' + (declaring_collection_ref_name field.ctype) + '();' + '\n' + line2 = 'foreach (var kvp in ' + fieldName + ') { ' + (get_ref_name field) + '.Add(kvp.Key, tables.' + tableName + '.GetOrDefault(kvp.Value)); }' + '\n' + ret line1 + line2 + else + ret '' + end + else + if (is_field_bean_need_resolve_ref field) + ret fieldName + '?.ResolveRef(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + ') { _e?.ResolveRef(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'foreach (var _e in ' + fieldName + '.Values) { _e?.ResolveRef(tables); }' + else + ret '' + end + end +end +~}} +{{~if __bean.is_value_type~}} +public partial struct {{__name}} +{{~else~}} +public {{class_modifier __bean}} partial class {{__name}} : {{if parent_def_type}}{{__bean.parent}}{{else}}Luban.BeanBase{{end}} +{{~end~}} +{ + public {{__name}}(JSONNode _buf) {{if parent_def_type}} : base(_buf) {{end}} + { + {{~ for field in export_fields + fieldName = format_property_name __code_style field.name + ~}} + {{deserialize_field fieldName '_buf' field.name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}} = null; + {{~end~}} + {{~if has_index field~}} + foreach(var _v in {{fieldName}}) + { + {{get_index_var_name field}}.Add(_v.{{format_property_name __code_style (get_index_field field).name}}, _v); + } + {{~end~}} + {{~end~}} + } + + public static {{__name}} Deserialize{{__name}}(JSONNode _buf) + { + {{~if __bean.is_abstract_type~}} + switch ((string)_buf["$type"]) + { + {{~for child in __bean.hierarchy_not_abstract_children~}} + case "{{impl_data_type child __bean}}": return new {{child.full_name}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__bean.full_name}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public readonly {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}}; + {{~if can_generate_ref field~}} + public {{declaring_type_name (get_ref_type field)}} {{get_ref_name field}}; + {{~else if can_generate_collection_ref field~}} + public {{declaring_collection_ref_name field.ctype}} {{get_ref_name field}}; + {{~end~}} + {{~if has_index field + indexMapType = get_index_map_type field + ~}} + public readonly {{declaring_type_name indexMapType}} {{get_index_var_name field}} = new {{declaring_type_name indexMapType}}(); + {{~end~}} + {{~end~}} + +{{~if !__bean.is_abstract_type && !__bean.is_value_type~}} + public const int __ID__ = {{__bean.id}}; + public override int GetTypeId() => __ID__; +{{~end~}} + + public {{method_modifier __bean}} void ResolveRef({{__manager_name}} tables) + { + {{~if parent_def_type~}} + base.ResolveRef(tables); + {{~end~}} + {{~for field in export_fields~}} + {{~ line = generate_resolve_field_ref field ~}} + {{~ if line != ''~}} + {{line}} + {{~end~}} + {{~end~}} + } + + public override string ToString() + { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{to_pretty_string (format_property_name __code_style field.name) field.ctype}} + "," + {{~end~}} + + "}"; + } +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-simple-json/table.sbn b/luban/src/Luban.CSharp/Templates/cs-simple-json/table.sbn new file mode 100644 index 00000000..44785b75 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-simple-json/table.sbn @@ -0,0 +1,162 @@ +using Luban; +using SimpleJSON; + +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'System.Collections.Generic.Dictionary<(' + (array.each __table.index_list @index_type_name | array.join ', ') + '), ' + (declaring_type_name __value_type) + '>' + end + + func table_key_list + varName = $0 + indexList = __table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = __table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = __table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{namespace_with_grace_begin __namespace_with_top_module}} +{{~if __table.comment != '' ~}} +/// +/// {{escape_comment __table.comment}} +/// +{{~end~}} +public partial class {{__name}} +{ + {{~if __table.is_map_table ~}} + private readonly System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + public {{__name}}(JSONNode _buf) + { + _dataMap = new System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>(); + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JSONNode _ele in _buf.Children) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + _dataMap.Add(_v.{{format_property_name __code_style __table.index_field.name}}, _v); + } + } + + public System.Collections.Generic.Dictionary<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> DataMap => _dataMap; + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + +{{~if __value_type.is_dynamic~}} + public T GetOrDefaultAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => _dataMap.TryGetValue(key, out var v) ? (T)v : null; + public T GetAs({{declaring_type_name __key_type}} key) where T : {{declaring_type_name __value_type}} => (T)_dataMap[key]; +{{~end~}} + public {{declaring_type_name __value_type}} GetOrDefault({{declaring_type_name __key_type}} key) => _dataMap.TryGetValue(key, out var v) ? v : null; + public {{declaring_type_name __value_type}} Get({{declaring_type_name __key_type}} key) => _dataMap[key]; + public {{declaring_type_name __value_type}} this[{{declaring_type_name __key_type}} key] => _dataMap[key]; + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + + {{~else if __table.is_list_table ~}} + private readonly System.Collections.Generic.List<{{declaring_type_name __value_type}}> _dataList; + + {{~if __table.is_union_index~}} + private {{table_union_map_type_name}} _dataMapUnion; + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + private System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~end~}} + + public {{__name}}(JSONNode _buf) + { + _dataList = new System.Collections.Generic.List<{{declaring_type_name __value_type}}>(); + + foreach(JSONNode _ele in _buf.Children) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_v' '_ele' __value_type}} + _dataList.Add(_v); + } + {{~if __table.is_union_index~}} + _dataMapUnion = new {{table_union_map_type_name}}(); + foreach(var _v in _dataList) + { + _dataMapUnion.Add(({{table_key_list "_v"}}), _v); + } + {{~else if !__table.index_list.empty?~}} + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}} = new System.Collections.Generic.Dictionary<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>(); + {{~end~}} + foreach(var _v in _dataList) + { + {{~for idx in __table.index_list~}} + _dataMap_{{idx.index_field.name}}.Add(_v.{{format_property_name __code_style idx.index_field.name}}, _v); + {{~end~}} + } + {{~end~}} + } + + public System.Collections.Generic.List<{{declaring_type_name __value_type}}> DataList => _dataList; + + {{~if __table.is_union_index~}} + public {{declaring_type_name __value_type}} Get({{table_param_def_list}}) => _dataMapUnion.TryGetValue(({{table_param_name_list}}), out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~else if !__table.index_list.empty? ~}} + {{~for idx in __table.index_list~}} + public {{declaring_type_name __value_type}} GetBy{{format_property_name __code_style idx.index_field.name}}({{declaring_type_name idx.type}} key) => _dataMap_{{idx.index_field.name}}.TryGetValue(key, out {{declaring_type_name __value_type}} __v) ? __v : null; + {{~end~}} + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + foreach(var _v in _dataList) + { + _v.ResolveRef(tables); + } + } + {{~else~}} + + private readonly {{declaring_type_name __value_type}} _data; + + public {{declaring_type_name __value_type}} Data => _data; + + public {{__name}}(JSONNode _buf) + { + int n = _buf.Count; + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_data' '_buf[0]' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /// + /// {{escape_comment field.comment}} + /// +{{~end~}} + public {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}} => _data.{{format_property_name __code_style field.name}}; + {{~end~}} + + public void ResolveRef({{__manager_name}} tables) + { + _data.ResolveRef(tables); + } + {{~end~}} +} + +{{namespace_with_grace_end __namespace_with_top_module}} diff --git a/luban/src/Luban.CSharp/Templates/cs-simple-json/tables.sbn b/luban/src/Luban.CSharp/Templates/cs-simple-json/tables.sbn new file mode 100644 index 00000000..66770e93 --- /dev/null +++ b/luban/src/Luban.CSharp/Templates/cs-simple-json/tables.sbn @@ -0,0 +1,32 @@ +using Luban; +using SimpleJSON; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// + /// {{escape_comment table.comment}} + /// +{{~end~}} + public {{table.full_name}} {{format_property_name __code_style table.name}} {get; } + {{~end~}} + + public {{__name}}(System.Func loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = new {{table.full_name}}(loader("{{table.output_data_file}}")); + {{~end~}} + ResolveRef(); + } + + private void ResolveRef() + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}}.ResolveRef(this); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/luban/src/Luban.CSharp/TypeVisitors/BinaryDeserializeVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/BinaryDeserializeVisitor.cs new file mode 100644 index 00000000..fa4a82ee --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/BinaryDeserializeVisitor.cs @@ -0,0 +1,21 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class BinaryDeserializeVisitor : DecoratorFuncVisitor +{ + public static BinaryDeserializeVisitor Ins { get; } = new(); + + public override string DoAccept(TType type, string bufName, string fieldName) + { + if (type.IsNullable) + { + return $"if({bufName}.ReadBool()){{ {type.Apply(BinaryUnderlyingDeserializeVisitor.Ins, bufName, fieldName, 0)} }} else {{ {fieldName} = null; }}"; + } + else + { + return type.Apply(BinaryUnderlyingDeserializeVisitor.Ins, bufName, fieldName, 0); + } + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/BinaryUnderlyingDeserializeVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/BinaryUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..5b1af27e --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/BinaryUnderlyingDeserializeVisitor.cs @@ -0,0 +1,115 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.CSharp.TypeVisitors; + +public class BinaryUnderlyingDeserializeVisitor : ITypeFuncVisitor +{ + public static BinaryUnderlyingDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadBool();"; + } + + public string Accept(TByte type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadByte();"; + } + + public string Accept(TShort type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadShort();"; + } + public string Accept(TInt type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadInt();"; + } + + public string Accept(TLong type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadLong();"; + } + + public string Accept(TFloat type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadFloat();"; + } + + public string Accept(TDouble type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadDouble();"; + } + + public string Accept(TEnum type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = ({type.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}){bufName}.ReadInt();"; + } + + public string Accept(TString type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadString();"; + } + + public string Accept(TDateTime type, string bufName, string fieldName, int depth) + { + string src = $"{bufName}.ReadLong()"; + return $"{fieldName} = {src};"; + } + + public string Accept(TBean type, string bufName, string fieldName, int depth) + { + string src = $"{type.DefBean.FullName}.Deserialize{type.DefBean.Name}({bufName})"; + string constructor = type.DefBean.TypeConstructorWithTypeMapper(); + return $"{fieldName} = {(string.IsNullOrEmpty(constructor) ? src : $"{constructor}({src})")};"; + } + + public static string CreateNewArrayWithSize(TArray type, string n) + { + string typeStr = $"{type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}[{n}]"; + if (type.Dimension > 1) + { + typeStr = $"{type.FinalElementType.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}[{n}]"; + for (int i = 0; i < type.Dimension - 1; i++) + { + typeStr += "[]"; + } + } + return typeStr; + } + + public string Accept(TArray type, string bufName, string fieldName, int depth) + { + string n = $"__n{depth}"; + string e = $"__e{depth}"; + string index = $"__index{depth}"; + string typeStr = CreateNewArrayWithSize(type, n); + return $"{{int {n} = System.Math.Min({bufName}.ReadSize(), {bufName}.Size);{fieldName} = new {typeStr};for(var {index} = 0 ; {index} < {n} ; {index}++) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {e};{type.ElementType.Apply(this, bufName, $"{e}", depth + 1)} {fieldName}[{index}] = {e};}}}}"; + } + + public string Accept(TList type, string bufName, string fieldName, int depth) + { + string n = $"n{depth}"; + string e = $"_e{depth}"; + string i = $"i{depth}"; + return $"{{int {n} = System.Math.Min({bufName}.ReadSize(), {bufName}.Size);{fieldName} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}({n});for(var {i} = 0 ; {i} < {n} ; {i}++) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {e}; {type.ElementType.Apply(this, bufName, $"{e}", depth + 1)} {fieldName}.Add({e});}}}}"; + } + + public string Accept(TSet type, string bufName, string fieldName, int depth) + { + string n = $"n{depth}"; + string e = $"_e{depth}"; + string i = $"i{depth}"; + return $"{{int {n} = System.Math.Min({bufName}.ReadSize(), {bufName}.Size);{fieldName} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}(/*{n} * 3 / 2*/);for(var {i} = 0 ; {i} < {n} ; {i}++) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {e}; {type.ElementType.Apply(this, bufName, $"{e}", +1)} {fieldName}.Add({e});}}}}"; + } + + public string Accept(TMap type, string bufName, string fieldName, int depth) + { + string n = $"n{depth}"; + string k = $"_k{depth}"; + string v = $"_v{depth}"; + string i = $"i{depth}"; + return $"{{int {n} = System.Math.Min({bufName}.ReadSize(), {bufName}.Size);{fieldName} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}({n} * 3 / 2);for(var {i} = 0 ; {i} < {n} ; {i}++) {{ {type.KeyType.Apply(DeclaringTypeNameVisitor.Ins)} {k}; {type.KeyType.Apply(this, bufName, k, depth + 1)} {type.ValueType.Apply(DeclaringTypeNameVisitor.Ins)} {v}; {type.ValueType.Apply(this, bufName, v, depth + 1)} {fieldName}.Add({k}, {v});}}}}"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/ConstValueVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/ConstValueVisitor.cs new file mode 100644 index 00000000..e6678205 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/ConstValueVisitor.cs @@ -0,0 +1,84 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class ConstValueVisitor : ITypeFuncVisitor +{ + public static ConstValueVisitor Ins { get; } = new(); + + public string Accept(TBool type, string x) + { + return x.ToLower(); + } + + public string Accept(TByte type, string x) + { + return x; + } + + public string Accept(TShort type, string x) + { + return x; + } + + public string Accept(TInt type, string x) + { + return x; + } + + public virtual string Accept(TLong type, string x) + { + return x + "L"; + } + + public virtual string Accept(TFloat type, string x) + { + return x + "f"; + } + + public string Accept(TDouble type, string x) + { + return x; + } + + public string Accept(TEnum type, string x) + { + return x; + } + + public string Accept(TString type, string x) + { + return "\"" + x + "\""; + } + + public string Accept(TDateTime type, string x) + { + throw new NotImplementedException(); + } + + public string Accept(TBean type, string x) + { + throw new NotImplementedException(); + } + + public string Accept(TArray type, string x) + { + throw new NotImplementedException(); + } + + public string Accept(TList type, string x) + { + throw new NotImplementedException(); + } + + public string Accept(TSet type, string x) + { + throw new NotImplementedException(); + } + + public string Accept(TMap type, string x) + { + throw new NotImplementedException(); + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/CtorDefaultValueVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/CtorDefaultValueVisitor.cs new file mode 100644 index 00000000..69ef16dc --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/CtorDefaultValueVisitor.cs @@ -0,0 +1,44 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class CtorDefaultValueVisitor : DecoratorFuncVisitor +{ + public static CtorDefaultValueVisitor Ins { get; } = new(); + + public override string DoAccept(TType type) + { + return "default"; + } + + public override string Accept(TString type) + { + return "\"\""; + } + + public override string Accept(TBean type) + { + return type.DefBean.IsAbstractType ? "default" : $"new {type.Apply(DeclaringTypeNameVisitor.Ins)}()"; + } + + public override string Accept(TArray type) + { + return $"System.Array.Empty<{type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}>()"; + } + + public override string Accept(TList type) + { + return $"new {ConstStrings.ListTypeName}<{type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}>()"; + } + + public override string Accept(TSet type) + { + return $"new {ConstStrings.HashSetTypeName}<{type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}>()"; + } + + public override string Accept(TMap type) + { + return $"new {ConstStrings.HashMapTypeName}<{type.KeyType.Apply(DeclaringTypeNameVisitor.Ins)},{type.ValueType.Apply(DeclaringTypeNameVisitor.Ins)}>()"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/DataToStringVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/DataToStringVisitor.cs new file mode 100644 index 00000000..d3430e0e --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/DataToStringVisitor.cs @@ -0,0 +1,34 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class DataToStringVisitor : DecoratorFuncVisitor +{ + public static DataToStringVisitor Ins { get; } = new(); + + public override string DoAccept(TType type, string fieldName) + { + return fieldName; + } + + public override string Accept(TArray type, string fieldName) + { + return $"Luban.StringUtil.CollectionToString({fieldName})"; + } + + public override string Accept(TList type, string fieldName) + { + return $"Luban.StringUtil.CollectionToString({fieldName})"; + } + + public override string Accept(TSet type, string fieldName) + { + return $"Luban.StringUtil.CollectionToString({fieldName})"; + } + + public override string Accept(TMap type, string fieldName) + { + return $"Luban.StringUtil.CollectionToString({fieldName})"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/DeclaringCollectionRefNameVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/DeclaringCollectionRefNameVisitor.cs new file mode 100644 index 00000000..bce2a408 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/DeclaringCollectionRefNameVisitor.cs @@ -0,0 +1,122 @@ +using Luban.Defs; +using Luban.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class DeclaringCollectionRefNameVisitor : ITypeFuncVisitor +{ + public static DeclaringCollectionRefNameVisitor Ins { get; } = new(); + public string Accept(TBool type) + { + throw new NotImplementedException(); + } + + public string Accept(TByte type) + { + throw new NotImplementedException(); + } + + public string Accept(TShort type) + { + throw new NotImplementedException(); + } + + public string Accept(TInt type) + { + throw new NotImplementedException(); + } + + public string Accept(TLong type) + { + throw new NotImplementedException(); + } + + public string Accept(TFloat type) + { + throw new NotImplementedException(); + } + + public string Accept(TDouble type) + { + throw new NotImplementedException(); + } + + public string Accept(TEnum type) + { + throw new NotImplementedException(); + } + + public string Accept(TString type) + { + throw new NotImplementedException(); + } + + public string Accept(TDateTime type) + { + throw new NotImplementedException(); + } + + public string Accept(TBean type) + { + throw new NotImplementedException(); + } + + public string Accept(TArray type) + { + var refTable = GetCollectionRefTable(type); + if (refTable != null) + { + return refTable.ValueTType.Apply(DeclaringTypeNameVisitor.Ins) + "[]"; + } + throw new Exception($"解析'{type.ElementType}[]' 的ref失败"); + } + + public string Accept(TList type) + { + var refTable = GetCollectionRefTable(type); + if (refTable != null) + { + return $"{ConstStrings.ListTypeName}<{refTable.ValueTType.Apply(DeclaringTypeNameVisitor.Ins)}>"; + } + throw new Exception($"解析'{ConstStrings.ListTypeName}<{type.ElementType}>' 的ref失败"); + } + + public string Accept(TSet type) + { + var refTable = GetCollectionRefTable(type); + if (refTable != null) + { + return $"{ConstStrings.HashSetTypeName}<{refTable.ValueTType.Apply(DeclaringTypeNameVisitor.Ins)}>"; + } + throw new Exception($"解析'{ConstStrings.HashSetTypeName}<{type.ElementType}>' 的ref失败"); + } + + public string Accept(TMap type) + { + var refTable = GetCollectionRefTable(type); + if (refTable != null) + { + return $"{ConstStrings.HashMapTypeName}<{type.KeyType.Apply(DeclaringTypeNameVisitor.Ins)}, {refTable.ValueTType.Apply(DeclaringTypeNameVisitor.Ins)}>"; + } + throw new Exception($"解析'{ConstStrings.HashMapTypeName}<{type.KeyType}, {type.ValueType}>' 的ref失败"); + } + private static DefTable GetCollectionRefTable(TType type) + { + var refTag = type.GetTag("ref"); + if (refTag == null) + { + refTag = type.ElementType.GetTag("ref"); + } + if (refTag == null) + { + return null; + } + if (GenerationContext.Current.Assembly.GetCfgTable(refTag.Replace("?", "")) is { } cfgTable) + { + return cfgTable; + } + return null; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/DeclaringTypeNameVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/DeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..9c4e5fab --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/DeclaringTypeNameVisitor.cs @@ -0,0 +1,36 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class DeclaringTypeNameVisitor : DecoratorFuncVisitor +{ + public static DeclaringTypeNameVisitor Ins { get; } = new(); + + protected virtual ITypeFuncVisitor UnderlyingVisitor => UnderlyingDeclaringTypeNameVisitor.Ins; + + public override string DoAccept(TType type) + { + return type.IsNullable && !type.Apply(IsRawNullableTypeVisitor.Ins) ? (type.Apply(UnderlyingVisitor) + "?") : type.Apply(UnderlyingVisitor); + } + + public override string Accept(TArray type) + { + return $"{type.ElementType.Apply(this)}[]"; + } + + public override string Accept(TList type) + { + return $"{ConstStrings.ListTypeName}<{type.ElementType.Apply(this)}>"; + } + + public override string Accept(TSet type) + { + return $"{ConstStrings.HashSetTypeName}<{type.ElementType.Apply(this)}>"; + } + + public override string Accept(TMap type) + { + return $"{ConstStrings.HashMapTypeName}<{type.KeyType.Apply(this)}, {type.ValueType.Apply(this)}>"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/DotNetJsonDeserializeVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/DotNetJsonDeserializeVisitor.cs new file mode 100644 index 00000000..1f2a9930 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/DotNetJsonDeserializeVisitor.cs @@ -0,0 +1,114 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.CSharp.TypeVisitors; + +public class DotNetJsonDeserializeVisitor : ITypeFuncVisitor +{ + public static DotNetJsonDeserializeVisitor Ins { get; } = new(); + public string Accept(TBool type, string json, string x, int depth) + { + return $"{x} = {json}.GetBoolean();"; + } + + public string Accept(TByte type, string json, string x, int depth) + { + return $"{x} = {json}.GetByte();"; + } + + public string Accept(TShort type, string json, string x, int depth) + { + return $"{x} = {json}.GetInt16();"; + } + + public string Accept(TInt type, string json, string x, int depth) + { + return $"{x} = {json}.GetInt32();"; + } + + public string Accept(TLong type, string json, string x, int depth) + { + return $"{x} = {json}.GetInt64();"; + } + + public string Accept(TFloat type, string json, string x, int depth) + { + return $"{x} = {json}.GetSingle();"; + } + + public string Accept(TDouble type, string json, string x, int depth) + { + return $"{x} = {json}.GetDouble();"; + } + + public string Accept(TEnum type, string json, string x, int depth) + { + return $"{x} = ({type.Apply(DeclaringTypeNameVisitor.Ins)}){json}.GetInt32();"; + } + + public string Accept(TString type, string json, string x, int depth) + { + return $"{x} = {json}.GetString();"; + } + + public string Accept(TDateTime type, string json, string x, int depth) + { + return $"{x} = {json}.GetInt64();"; + } + + public string Accept(TBean type, string json, string x, int depth) + { + string src = $"{type.DefBean.FullName}.Deserialize{type.DefBean.Name}({json})"; + string constructor = type.DefBean.TypeConstructorWithTypeMapper(); + return $"{x} = {(string.IsNullOrEmpty(constructor) ? src : $"{constructor}({src})")};"; + } + + public string Accept(TArray type, string json, string x, int depth) + { + string _n = $"_n{depth}"; + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __json = $"__json{depth}"; + string __index = $"__index{depth}"; + string typeStr = $"{type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}[{_n}]"; + if (type.Dimension > 1) + { + if (type.FinalElementType == null) + { + throw new System.Exception("��ά����û��Ԫ������"); + } + typeStr = $"{type.FinalElementType.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}[{_n}]"; + for (int i = 0; i < type.Dimension - 1; i++) + { + typeStr += "[]"; + } + } + return $"{{ var {__json} = {json}; int {_n} = {__json}.GetArrayLength(); {x} = new {typeStr}; int {__index}=0; foreach(JsonElement {__e} in {__json}.EnumerateArray()) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, $"{__e}", $"{__v}", depth + 1)} {x}[{__index}++] = {__v}; }} }}"; + } + + public string Accept(TList type, string json, string x, int depth) + { + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __json = $"__json{depth}"; + return $"{{ var {__json} = {json}; {x} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}({__json}.GetArrayLength()); foreach(JsonElement {__e} in {__json}.EnumerateArray()) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, $"{__e}", $"{__v}", depth + 1)} {x}.Add({__v}); }} }}"; + } + + public string Accept(TSet type, string json, string x, int depth) + { + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __json = $"__json{depth}"; + return $"{{ var {__json} = {json}; {x} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}({__json}.GetArrayLength()); foreach(JsonElement {__e} in {__json}.EnumerateArray()) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, $"{__e}", $"{__v}", depth + 1)} {x}.Add({__v}); }} }}"; + } + + public string Accept(TMap type, string json, string x, int depth) + { + string __e = $"__e{depth}"; + string __k = $"_k{depth}"; + string __v = $"_v{depth}"; + string __json = $"__json{depth}"; + return @$"{{ var {__json} = {json}; {x} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}({__json}.GetArrayLength()); foreach(JsonElement {__e} in {__json}.EnumerateArray()) {{ {type.KeyType.Apply(DeclaringTypeNameVisitor.Ins)} {__k}; {type.KeyType.Apply(this, $"{__e}[0]", __k, depth + 1)} {type.ValueType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ValueType.Apply(this, $"{__e}[1]", __v, depth + 1)} {x}.Add({__k}, {__v}); }} }}"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/EditorDeclaringTypeNameVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/EditorDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..63295ee4 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/EditorDeclaringTypeNameVisitor.cs @@ -0,0 +1,16 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class EditorDeclaringTypeNameVisitor : DeclaringTypeNameVisitor +{ + public new static EditorDeclaringTypeNameVisitor Ins { get; } = new(); + + protected override ITypeFuncVisitor UnderlyingVisitor => EditorUnderlyingTypeNameVisitor.Ins; + + public override string Accept(TDateTime type) + { + return "string"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/EditorInitValueVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/EditorInitValueVisitor.cs new file mode 100644 index 00000000..a1e546e9 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/EditorInitValueVisitor.cs @@ -0,0 +1,43 @@ +using Luban.Types; + +namespace Luban.CSharp.TypeVisitors; + +public class EditorInitValueVisitor : CtorDefaultValueVisitor +{ + public new static EditorInitValueVisitor Ins { get; } = new(); + + public override string Accept(TEnum type) + { + return $"{(type.DefEnum.Items.Count > 0 ? $"{type.Apply(EditorDeclaringTypeNameVisitor.Ins)}." + type.DefEnum.Items[0].Name : "default")}"; + } + + public override string Accept(TDateTime type) + { + return "\"1970-01-01 00:00:00\""; + } + + public override string Accept(TBean type) + { + return type.IsNullable || type.DefBean.IsAbstractType ? "default" : $"new {type.Apply(EditorUnderlyingTypeNameVisitor.Ins)}()"; + } + + public override string Accept(TArray type) + { + return $"System.Array.Empty<{type.ElementType.Apply(EditorDeclaringTypeNameVisitor.Ins)}>()"; + } + + public override string Accept(TList type) + { + return $"new {ConstStrings.ListTypeName}<{type.ElementType.Apply(EditorDeclaringTypeNameVisitor.Ins)}>()"; + } + + public override string Accept(TSet type) + { + return $"new {ConstStrings.HashSetTypeName}<{type.ElementType.Apply(EditorDeclaringTypeNameVisitor.Ins)}>()"; + } + + public override string Accept(TMap type) + { + return $"new {ConstStrings.HashMapTypeName}<{type.KeyType.Apply(EditorDeclaringTypeNameVisitor.Ins)},{type.ValueType.Apply(EditorDeclaringTypeNameVisitor.Ins)}>()"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/EditorIsRawNullableTypeVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/EditorIsRawNullableTypeVisitor.cs new file mode 100644 index 00000000..1648b046 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/EditorIsRawNullableTypeVisitor.cs @@ -0,0 +1,19 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class EditorIsRawNullableTypeVisitor : IsRawNullableTypeVisitor +{ + public new static EditorIsRawNullableTypeVisitor Ins { get; } = new(); + + public override bool Accept(TBean type) + { + return true; + } + + public override bool Accept(TDateTime type) + { + return true; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/EditorJsonLoad.cs b/luban/src/Luban.CSharp/TypeVisitors/EditorJsonLoad.cs new file mode 100644 index 00000000..915b94c4 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/EditorJsonLoad.cs @@ -0,0 +1,84 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +class EditorJsonLoad : ITypeFuncVisitor +{ + public static EditorJsonLoad Ins { get; } = new(); + + public string Accept(TBool type, string json, string x, int depth) + { + return $"if(!{json}.IsBoolean) {{ throw new SerializationException(); }} {x} = {json};"; + } + + public string Accept(TByte type, string json, string x, int depth) + { + return $"if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json};"; + } + + public string Accept(TShort type, string json, string x, int depth) + { + return $"if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json};"; + } + + public string Accept(TInt type, string json, string x, int depth) + { + return $"if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json};"; + } + + public string Accept(TLong type, string json, string x, int depth) + { + return $"if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json};"; + } + + public string Accept(TFloat type, string json, string x, int depth) + { + return $"if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json};"; + } + + public string Accept(TDouble type, string json, string x, int depth) + { + return $"if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json};"; + } + + public string Accept(TEnum type, string json, string x, int depth) + { + return $"if({json}.IsString) {{ {x} = ({type.Apply(EditorDeclaringTypeNameVisitor.Ins)})System.Enum.Parse(typeof({type.Apply(EditorDeclaringTypeNameVisitor.Ins)}), {json}); }} else if({json}.IsNumber) {{ {x} = ({type.Apply(EditorDeclaringTypeNameVisitor.Ins)})(int){json}; }} else {{ throw new SerializationException(); }} "; + } + + public string Accept(TString type, string json, string x, int depth) + { + return $"if(!{json}.IsString) {{ throw new SerializationException(); }} {x} = {json};"; + } + + public string Accept(TBean type, string json, string x, int depth) + { + return $"if(!{json}.IsObject) {{ throw new SerializationException(); }} {x} = {type.Apply(EditorUnderlyingTypeNameVisitor.Ins)}.LoadJson{type.DefBean.Name}({json});"; + } + + public string Accept(TArray type, string json, string x, int depth) + { + return $"if(!{json}.IsArray) {{ throw new SerializationException(); }} int _n{depth} = {json}.Count; {x} = new {BinaryUnderlyingDeserializeVisitor.CreateNewArrayWithSize(type, $"_n{depth}")}; int _index{depth}=0; foreach(SimpleJSON.JSONNode __e{depth} in {json}.Children) {{ {type.ElementType.Apply(EditorDeclaringTypeNameVisitor.Ins)} __v{depth}; {type.ElementType.Apply(this, $"__e{depth}", $"__v{depth}", depth + 1)} {x}[_index{depth}++] = __v{depth}; }} "; + } + + public string Accept(TList type, string json, string x, int depth) + { + return $"if(!{json}.IsArray) {{ throw new SerializationException(); }} {x} = new {type.Apply(EditorDeclaringTypeNameVisitor.Ins)}(); foreach(JSONNode __e{depth} in {json}.Children) {{ {type.ElementType.Apply(EditorDeclaringTypeNameVisitor.Ins)} __v{depth}; {type.ElementType.Apply(this, $"__e{depth}", $"__v{depth}", depth + 1)} {x}.Add(__v{depth}); }} "; + } + + public string Accept(TSet type, string json, string x, int depth) + { + return $"if(!{json}.IsArray) {{ throw new SerializationException(); }} {x} = new {type.Apply(EditorDeclaringTypeNameVisitor.Ins)}(); foreach(JSONNode __e{depth} in {json}.Children) {{ {type.ElementType.Apply(EditorDeclaringTypeNameVisitor.Ins)} __v{depth}; {type.ElementType.Apply(this, $"__e{depth}", $"__v{depth}", depth + 1)} {x}.Add(__v{depth}); }} "; + } + + public string Accept(TMap type, string json, string x, int depth) + { + return @$"if(!{json}.IsArray) {{ throw new SerializationException(); }} {x} = new {type.Apply(EditorDeclaringTypeNameVisitor.Ins)}(); foreach(JSONNode __e{depth} in {json}.Children) {{ {type.KeyType.Apply(EditorDeclaringTypeNameVisitor.Ins)} __k{depth}; {type.KeyType.Apply(this, $"__e{depth}[0]", $"__k{depth}", depth + 1)} {type.ValueType.Apply(EditorDeclaringTypeNameVisitor.Ins)} __v{depth}; {type.ValueType.Apply(this, $"__e{depth}[1]", $"__v{depth}", depth + 1)} {x}.Add(__k{depth}, __v{depth}); }} "; + } + + public string Accept(TDateTime type, string json, string x, int depth) + { + return $"if(!{json}.IsString) {{ throw new SerializationException(); }} {x} = {json};"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/EditorJsonSave.cs b/luban/src/Luban.CSharp/TypeVisitors/EditorJsonSave.cs new file mode 100644 index 00000000..a707d5f2 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/EditorJsonSave.cs @@ -0,0 +1,14 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +class EditorJsonSave : DecoratorFuncVisitor +{ + public static EditorJsonSave Ins { get; } = new(); + + public override string DoAccept(TType type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{type.Apply(EditorJsonSaveUnderlying.Ins, jsonName, jsonFieldName, (!type.IsNullable || type.Apply(EditorIsRawNullableTypeVisitor.Ins) ? value : $"{value}.Value"), depth)}"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/EditorJsonSaveUnderlying.cs b/luban/src/Luban.CSharp/TypeVisitors/EditorJsonSaveUnderlying.cs new file mode 100644 index 00000000..0a7d113d --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/EditorJsonSaveUnderlying.cs @@ -0,0 +1,89 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +class EditorJsonSaveUnderlying : ITypeFuncVisitor +{ + public static EditorJsonSaveUnderlying Ins { get; } = new(); + + public string Accept(TBool type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONBool({value});"; + } + + public string Accept(TByte type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONNumber({value});"; + } + + public string Accept(TShort type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONNumber({value});"; + } + + public string Accept(TInt type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONNumber({value});"; + } + + public string Accept(TLong type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONNumber({value});"; + } + + public string Accept(TFloat type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONNumber({value});"; + } + + public string Accept(TDouble type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONNumber({value});"; + } + + public string Accept(TEnum type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONNumber((int){value});"; + } + + public string Accept(TString type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONString({value});"; + } + + public string Accept(TDateTime type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{jsonName}[\"{jsonFieldName}\"] = new JSONString({value});"; + } + + public string Accept(TBean type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{{ var __bjson{depth} = new JSONObject(); {jsonName}[\"{jsonFieldName}\"] = __bjson{depth}; {type.Apply(EditorUnderlyingTypeNameVisitor.Ins)}.SaveJson{type.DefBean.Name}({value}, __bjson{depth}); }}"; + } + + private string AcceptArrayLink(TType elementType, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{{ var __cjson{depth} = new JSONArray(); {jsonName}[\"{jsonFieldName}\"] = __cjson{depth}; foreach(var _e{depth} in {value}) {{ JSONNode __v{depth}; {elementType.Apply(EditorJsonSaveUnderlying2.Ins, $"__v{depth}", $"_e{depth}", depth + 1)} __cjson{depth}.Add(__v{depth}); }} }}"; + } + + public string Accept(TArray type, string jsonName, string jsonFieldName, string value, int depth) + { + return AcceptArrayLink(type.ElementType, jsonName, jsonFieldName, value, depth); + } + + public string Accept(TList type, string jsonName, string jsonFieldName, string value, int depth) + { + return AcceptArrayLink(type.ElementType, jsonName, jsonFieldName, value, depth); + } + + public string Accept(TSet type, string jsonName, string jsonFieldName, string value, int depth) + { + return AcceptArrayLink(type.ElementType, jsonName, jsonFieldName, value, depth); + } + + public string Accept(TMap type, string jsonName, string jsonFieldName, string value, int depth) + { + return $"{{ var __cjson{depth} = new JSONArray(); {jsonName}[\"{jsonFieldName}\"] = __cjson{depth}; foreach(var _e{depth} in {value}) {{ var __entry{depth} = new JSONArray(); __cjson{depth}.Add(__entry{depth}); JSONNode __k{depth}; {type.KeyType.Apply(EditorJsonSaveUnderlying2.Ins, $"__k{depth}", $"_e{depth}.Key", depth + 1)} __entry{depth}.Add(__k{depth}); JSONNode __v{depth}; {type.ValueType.Apply(EditorJsonSaveUnderlying2.Ins, $"__v{depth}", $"_e{depth}.Value", depth + 1)} __entry{depth}.Add(__v{depth}); }} }}"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/EditorJsonSaveUnderlying2.cs b/luban/src/Luban.CSharp/TypeVisitors/EditorJsonSaveUnderlying2.cs new file mode 100644 index 00000000..942f6092 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/EditorJsonSaveUnderlying2.cs @@ -0,0 +1,89 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +class EditorJsonSaveUnderlying2 : ITypeFuncVisitor +{ + public static EditorJsonSaveUnderlying2 Ins { get; } = new(); + + public string Accept(TBool type, string varName, string value, int depth) + { + return $"{varName} = new JSONBool({value});"; + } + + public string Accept(TByte type, string varName, string value, int depth) + { + return $"{varName} = new JSONNumber({value});"; + } + + public string Accept(TShort type, string varName, string value, int depth) + { + return $"{varName} = new JSONNumber({value});"; + } + + public string Accept(TInt type, string varName, string value, int depth) + { + return $"{varName} = new JSONNumber({value});"; + } + + public string Accept(TLong type, string varName, string value, int depth) + { + return $"{varName} = new JSONNumber({value});"; + } + + public string Accept(TFloat type, string varName, string value, int depth) + { + return $"{varName} = new JSONNumber({value});"; + } + + public string Accept(TDouble type, string varName, string value, int depth) + { + return $"{varName} = new JSONNumber({value});"; + } + + public string Accept(TEnum type, string varName, string value, int depth) + { + return $"{varName} = new JSONNumber((int){value});"; + } + + public string Accept(TString type, string varName, string value, int depth) + { + return $"{varName} = new JSONString({value});"; + } + + public string Accept(TDateTime type, string varName, string value, int depth) + { + return $"{varName} = new JSONString({value});"; + } + + public string Accept(TBean type, string varName, string value, int depth) + { + return $"{{ var __bjson{depth} = new JSONObject(); {varName} = __bjson{depth}; {type.Apply(EditorUnderlyingTypeNameVisitor.Ins)}.SaveJson{type.DefBean.Name}({value}, __bjson{depth}); }}"; + } + + private string AcceptArrayLike(TType elementType, string varName, string value, int depth) + { + return $"{{ var __cjson{depth} = new JSONArray(); {varName} = __cjson{depth}; foreach(var _e{depth} in {value}) {{ JSONNode __v{depth}; {elementType.Apply(this, $"__v{depth}", $"_e{depth}", depth + 1)} __cjson{depth}.Add(__v{depth}); }} }}"; + } + + public string Accept(TArray type, string varName, string value, int depth) + { + return AcceptArrayLike(type.ElementType, varName, value, depth); + } + + public string Accept(TList type, string varName, string value, int depth) + { + return AcceptArrayLike(type.ElementType, varName, value, depth); + } + + public string Accept(TSet type, string varName, string value, int depth) + { + return AcceptArrayLike(type.ElementType, varName, value, depth); + } + + public string Accept(TMap type, string varName, string value, int depth) + { + return $"{{ var __cjson{depth} = new JSONArray(); {varName} = __cjson{depth}; foreach(var _e{depth} in {value}) {{ var __entry{depth} = new JSONArray(); __cjson{depth}.Add(__entry{depth}); JSONNode __k{depth}; {type.KeyType.Apply(this, $"__k{depth}", $"_e{depth}.Key", depth + 1)} __entry{depth}.Add(__k{depth}); JSONNode __v{depth}; {type.ValueType.Apply(this, $"__v{depth}", $"_e{depth}.Value", depth + 1)} __entry{depth}.Add(__v{depth}); }} }}"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/EditorNeedInitVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/EditorNeedInitVisitor.cs new file mode 100644 index 00000000..407a1d57 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/EditorNeedInitVisitor.cs @@ -0,0 +1,18 @@ +using Luban.Types; + +namespace Luban.CSharp.TypeVisitors; + +public class EditorNeedInitVisitor : NeedInitFieldVisitor +{ + public new static EditorNeedInitVisitor Ins { get; } = new(); + + public override bool Accept(TEnum type) + { + return true; + } + + public override bool Accept(TDateTime type) + { + return true; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/EditorUnderlyingTypeNameVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/EditorUnderlyingTypeNameVisitor.cs new file mode 100644 index 00000000..9f3823c1 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/EditorUnderlyingTypeNameVisitor.cs @@ -0,0 +1,13 @@ +using Luban.Types; + +namespace Luban.CSharp.TypeVisitors; + +public class EditorUnderlyingTypeNameVisitor : UnderlyingDeclaringTypeNameVisitor +{ + public new static EditorUnderlyingTypeNameVisitor Ins { get; } = new(); + + public override string Accept(TDateTime type) + { + return "string"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/IsRawNullableTypeVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/IsRawNullableTypeVisitor.cs new file mode 100644 index 00000000..b909247d --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/IsRawNullableTypeVisitor.cs @@ -0,0 +1,39 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class IsRawNullableTypeVisitor : AllFalseVisitor +{ + public static IsRawNullableTypeVisitor Ins { get; } = new(); + + public override bool Accept(TString type) + { + return true; + } + + public override bool Accept(TArray type) + { + return true; + } + + public override bool Accept(TList type) + { + return true; + } + + public override bool Accept(TSet type) + { + return true; + } + + public override bool Accept(TMap type) + { + return true; + } + + public override bool Accept(TBean type) + { + return !type.DefBean.IsValueType; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/NeedInitFieldVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/NeedInitFieldVisitor.cs new file mode 100644 index 00000000..4fcff422 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/NeedInitFieldVisitor.cs @@ -0,0 +1,39 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class NeedInitFieldVisitor : AllFalseVisitor +{ + public static NeedInitFieldVisitor Ins { get; } = new(); + + public override bool Accept(TString type) + { + return true; + } + + public override bool Accept(TArray type) + { + return true; + } + + public override bool Accept(TList type) + { + return true; + } + + public override bool Accept(TSet type) + { + return true; + } + + public override bool Accept(TMap type) + { + return true; + } + + public override bool Accept(TBean type) + { + return !type.IsDynamic; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/NewtonSoftJsonDeserializeVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/NewtonSoftJsonDeserializeVisitor.cs new file mode 100644 index 00000000..c2f199de --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/NewtonSoftJsonDeserializeVisitor.cs @@ -0,0 +1,117 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.CSharp.TypeVisitors +{ + internal class NewtonSoftJsonDeserializeVisitor: ITypeFuncVisitor + { + + public static NewtonSoftJsonDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string x, string y, int z) + { + return $"{y} = (bool){x};"; + } + + public string Accept(TByte type, string x, string y, int z) + { + return $"{y} = (byte){x};"; + } + + public string Accept(TShort type, string x, string y, int z) + { + return $"{y} = (short){x};"; + } + + public string Accept(TInt type, string x, string y, int z) + { + return $"{y} = (int){x};"; + } + + public string Accept(TLong type, string x, string y, int z) + { + return $"{y} = (long){x};"; + } + + public string Accept(TFloat type, string x, string y, int z) + { + return $"{y} = (float){x};"; + } + + public string Accept(TDouble type, string x, string y, int z) + { + return $"{y} = (double){x};"; + } + + public string Accept(TEnum type, string x, string y, int z) + { + return $"{y} = ({type.Apply(DeclaringTypeNameVisitor.Ins)})(int){x};"; + } + + public string Accept(TString type, string x, string y, int z) + { + return $"{y} = (string){x};"; + } + + public string Accept(TDateTime type, string x, string y, int z) + { + return $"{y} = (long){x};"; + } + + public string Accept(TBean type, string x, string y, int z) + { + string src = $"{type.DefBean.FullName}.Deserialize{type.DefBean.Name}({x})"; + string constructor = type.DefBean.TypeConstructorWithTypeMapper(); + return $"{y} = {(string.IsNullOrEmpty(constructor) ? src : $"{constructor}({src})")};"; + } + + public string Accept(TArray type, string json, string x, int depth) + { + string _n = $"_n{depth}"; + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __json = $"__json{depth}"; + string __index = $"__index{depth}"; + string typeStr = $"{type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}[{_n}]"; + if (type.Dimension > 1) + { + if (type.FinalElementType == null) + { + throw new System.Exception("should not be here!"); + } + typeStr = $"{type.FinalElementType.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}[{_n}]"; + for (int i = 0; i < type.Dimension - 1; i++) + { + typeStr += "[]"; + } + } + return $"{{ var {__json} = {json}; int {_n} = ({__json} as JArray).Count; {x} = new {typeStr}; int {__index}=0; foreach(JToken {__e} in {__json}) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, $"{__e}", $"{__v}", depth + 1)} {x}[{__index}++] = {__v}; }} }}"; + } + + public string Accept(TList type, string json, string x, int depth) + { + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __json = $"__json{depth}"; + return $"{{ var {__json} = {json}; {x} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}(({__json} as JArray).Count); foreach(JToken {__e} in {__json}) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, $"{__e}", $"{__v}", depth + 1)} {x}.Add({__v}); }} }}"; + } + + public string Accept(TSet type, string json, string x, int depth) + { + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __json = $"__json{depth}"; + return $"{{ var {__json} = {json}; {x} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}(({__json} as JArray).Count); foreach(JToken {__e} in {__json}) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, $"{__e}", $"{__v}", depth + 1)} {x}.Add({__v}); }} }}"; + } + + public string Accept(TMap type, string json, string x, int depth) + { + string __e = $"__e{depth}"; + string __k = $"_k{depth}"; + string __v = $"_v{depth}"; + string __json = $"__json{depth}"; + return @$"{{ var {__json} = {json}; {x} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}(({__json} as JArray).Count); foreach(JToken {__e} in {__json}) {{ {type.KeyType.Apply(DeclaringTypeNameVisitor.Ins)} {__k}; {type.KeyType.Apply(this, $"{__e}[0]", __k, depth + 1)} {type.ValueType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ValueType.Apply(this, $"{__e}[1]", __v, depth + 1)} {x}.Add({__k}, {__v}); }} }}"; + } + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/RecursiveResolveVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/RecursiveResolveVisitor.cs new file mode 100644 index 00000000..5e8e0345 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/RecursiveResolveVisitor.cs @@ -0,0 +1,84 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class RecursiveResolveVisitor : ITypeFuncVisitor +{ + public static RecursiveResolveVisitor Ins { get; } = new(); + + public string Accept(TBool type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TByte type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TShort type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TInt type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TLong type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TFloat type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TDouble type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TEnum type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TString type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TDateTime type, string fieldName, string tablesName) + { + throw new NotImplementedException(); + } + + public string Accept(TBean type, string fieldName, string tablesName) + { + return $"{fieldName}?.Resolve({tablesName});"; + } + + public string Accept(TArray type, string fieldName, string tablesName) + { + return $@"foreach(var _e in {fieldName}) {{ _e?.Resolve({tablesName}); }}"; + } + + public string Accept(TList type, string fieldName, string tablesName) + { + return $@"foreach(var _e in {fieldName}) {{ _e?.Resolve({tablesName}); }}"; + } + + public string Accept(TSet type, string fieldName, string tablesName) + { + return $@"foreach(var _e in {fieldName}) {{ _e?.Resolve({tablesName}); }}"; + } + + public string Accept(TMap type, string fieldName, string tablesName) + { + return $@"foreach(var _e in {fieldName}.Values) {{ _e?.Resolve({tablesName}); }}"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/SimpleJsonDeserializeVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/SimpleJsonDeserializeVisitor.cs new file mode 100644 index 00000000..1736fade --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/SimpleJsonDeserializeVisitor.cs @@ -0,0 +1,119 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.CSharp.TypeVisitors; + +public class SimpleJsonDeserializeVisitor : ITypeFuncVisitor +{ + public static SimpleJsonDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsBoolean) {{ throw new SerializationException(); }} {x} = {json}; }}"; + } + + public string Accept(TByte type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json}; }}"; + } + + public string Accept(TShort type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json}; }}"; + } + + public string Accept(TInt type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json}; }}"; + } + + public string Accept(TLong type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json}; }}"; + } + + public string Accept(TFloat type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json}; }}"; + } + + public string Accept(TDouble type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json}; }}"; + } + + public string Accept(TEnum type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = ({type.Apply(DeclaringTypeNameVisitor.Ins)}){json}.AsInt; }}"; + } + + public string Accept(TString type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsString) {{ throw new SerializationException(); }} {x} = {json}; }}"; + } + + public string Accept(TDateTime type, string json, string x, int depth) + { + return $"{{ if(!{json}.IsNumber) {{ throw new SerializationException(); }} {x} = {json}; }}"; + } + + public string Accept(TBean type, string json, string x, int depth) + { + string src = $"{type.DefBean.FullName}.Deserialize{type.DefBean.Name}({json})"; + string constructor = type.DefBean.TypeConstructorWithTypeMapper(); + return $"{{ if(!{json}.IsObject) {{ throw new SerializationException(); }} {x} = {(string.IsNullOrEmpty(constructor) ? src : $"{constructor}({src})")}; }}"; + } + + public string Accept(TArray type, string json, string x, int depth) + { + string _n = $"_n{depth}"; + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __json = $"__json{depth}"; + string __index = $"__index{depth}"; + string tempJsonName = __json; + string typeStr = $"{type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}[{_n}]"; + if (type.Dimension > 1) + { + if (type.FinalElementType == null) + { + throw new System.Exception("��ά����û��Ԫ������"); + } + typeStr = $"{type.FinalElementType.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}[{_n}]"; + for (int i = 0; i < type.Dimension - 1; i++) + { + typeStr += "[]"; + } + } + return $"{{ var {tempJsonName} = {json}; if(!{tempJsonName}.IsArray) {{ throw new SerializationException(); }} int {_n} = {tempJsonName}.Count; {x} = new {typeStr}; int {__index}=0; foreach(JSONNode {__e} in {tempJsonName}.Children) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, __e, __v, depth + 1)} {x}[{__index}++] = {__v}; }} }}"; + } + + public string Accept(TList type, string json, string x, int depth) + { + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __json = $"__json{depth}"; + string tempJsonName = __json; + return $"{{ var {tempJsonName} = {json}; if(!{tempJsonName}.IsArray) {{ throw new SerializationException(); }} {x} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}({tempJsonName}.Count); foreach(JSONNode {__e} in {tempJsonName}.Children) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, __e, __v, depth + 1)} {x}.Add({__v}); }} }}"; + } + + public string Accept(TSet type, string json, string x, int depth) + { + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __json = $"__json{depth}"; + string tempJsonName = __json; + return $"{{ var {tempJsonName} = {json}; if(!{tempJsonName}.IsArray) {{ throw new SerializationException(); }} {x} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}(/*{tempJsonName}.Count*/); foreach(JSONNode {__e} in {tempJsonName}.Children) {{ {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, __e, __v, depth + 1)} {x}.Add({__v}); }} }}"; + } + + public string Accept(TMap type, string json, string x, int depth) + { + string __e = $"__e{depth}"; + string __k = $"_k{depth}"; + string __v = $"_v{depth}"; + string __json = $"__json{depth}"; + string tempJsonName = __json; + return @$"{{ var {tempJsonName} = {json}; if(!{tempJsonName}.IsArray) {{ throw new SerializationException(); }} {x} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}({tempJsonName}.Count); foreach(JSONNode {__e} in {tempJsonName}.Children) {{ {type.KeyType.Apply(DeclaringTypeNameVisitor.Ins)} {__k}; {type.KeyType.Apply(this, $"{__e}[0]", __k, depth + 1)} {type.ValueType.Apply(DeclaringTypeNameVisitor.Ins)} {__v}; {type.ValueType.Apply(this, $"{__e}[1]", __v, depth + 1)} {x}.Add({__k}, {__v}); }} }}"; + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/StringDeserializeVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/StringDeserializeVisitor.cs new file mode 100644 index 00000000..a145a758 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/StringDeserializeVisitor.cs @@ -0,0 +1,84 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.CSharp.TypeVisitors; + +public class StringDeserializeVisitor : ITypeFuncVisitor +{ + public static StringDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string strName, string varName) + { + return $"{varName} = bool.Parse({strName});"; + } + + public string Accept(TByte type, string strName, string varName) + { + return $"{varName} = byte.Parse({strName});"; + } + + public string Accept(TShort type, string strName, string varName) + { + return $"{varName} = short.Parse({strName});"; + } + + public string Accept(TInt type, string strName, string varName) + { + return $"{varName} = int.Parse({strName});"; + } + + public string Accept(TLong type, string strName, string varName) + { + return $"{varName} = long.Parse({strName});"; + } + + public string Accept(TFloat type, string strName, string varName) + { + return $"{varName} = float.Parse({strName});"; + } + + public string Accept(TDouble type, string strName, string varName) + { + return $"{varName} = double.Parse({strName});"; + } + + public string Accept(TEnum type, string strName, string varName) + { + return $"{varName} = ({type.Apply(DeclaringTypeNameVisitor.Ins)})int.Parse({strName});"; + } + + public string Accept(TString type, string strName, string varName) + { + return $"{varName} = {strName};"; + } + + public string Accept(TDateTime type, string strName, string varName) + { + throw new NotSupportedException(); + } + + public string Accept(TBean type, string strName, string varName) + { + throw new NotSupportedException(); + } + + public string Accept(TArray type, string strName, string varName) + { + throw new NotSupportedException(); + } + + public string Accept(TList type, string strName, string varName) + { + throw new NotSupportedException(); + } + + public string Accept(TSet type, string strName, string varName) + { + throw new NotSupportedException(); + } + + public string Accept(TMap type, string strName, string varName) + { + throw new NotSupportedException(); + } +} diff --git a/luban/src/Luban.CSharp/TypeVisitors/UnderlyingDeclaringTypeNameVisitor.cs b/luban/src/Luban.CSharp/TypeVisitors/UnderlyingDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..b11733c0 --- /dev/null +++ b/luban/src/Luban.CSharp/TypeVisitors/UnderlyingDeclaringTypeNameVisitor.cs @@ -0,0 +1,85 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.CSharp.TypeVisitors; + +public class UnderlyingDeclaringTypeNameVisitor : ITypeFuncVisitor +{ + public static UnderlyingDeclaringTypeNameVisitor Ins { get; } = new(); + + public string Accept(TBool type) + { + return "bool"; + } + + public string Accept(TByte type) + { + return "byte"; + } + + public string Accept(TShort type) + { + return "short"; + } + + public string Accept(TInt type) + { + return "int"; + } + + public string Accept(TLong type) + { + return "long"; + } + + public string Accept(TFloat type) + { + return "float"; + } + + public string Accept(TDouble type) + { + return "double"; + } + + public virtual string Accept(TEnum type) + { + return type.DefEnum.TypeNameWithTypeMapper() ?? type.DefEnum.FullName; + } + + public string Accept(TString type) + { + return "string"; + } + + public string Accept(TBean type) + { + return type.DefBean.TypeNameWithTypeMapper() ?? type.DefBean.FullName; + } + + public string Accept(TArray type) + { + return $"{type.ElementType.Apply(this)}[]"; + } + + public string Accept(TList type) + { + return $"{ConstStrings.ListTypeName}<{type.ElementType.Apply(this)}>"; + } + + public string Accept(TSet type) + { + return $"{ConstStrings.HashSetTypeName}<{type.ElementType.Apply(this)}>"; + } + + public string Accept(TMap type) + { + return $"{ConstStrings.HashMapTypeName}<{type.KeyType.Apply(this)}, {type.ValueType.Apply(this)}>"; + } + + public virtual string Accept(TDateTime type) + { + return "long"; + } +} diff --git a/luban/src/Luban.Core/AssemblyInfo.cs b/luban/src/Luban.Core/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Core/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Core/BuiltinOptionNames.cs b/luban/src/Luban.Core/BuiltinOptionNames.cs new file mode 100644 index 00000000..6cf0d070 --- /dev/null +++ b/luban/src/Luban.Core/BuiltinOptionNames.cs @@ -0,0 +1,58 @@ +namespace Luban; + +public static class BuiltinOptionNames +{ + public const string InputDataDir = "inputDataDir"; + + public const string OutputCodeDir = "outputCodeDir"; + + public const string OutputDataDir = "outputDataDir"; + + public const string OutputCodeExtension = "outputCodeExtension"; + + public const string OutputDataExtension = "fileExt"; + + public const string CodeStyle = "codeStyle"; + + public const string DataExporter = "dataExporter"; + + public const string CodePostprocess = "codePostprocess"; + + public const string DataPostprocess = "dataPostprocess"; + + public const string OutputSaver = "outputSaver"; + + public const string CleanUpOutputDir = "cleanUpOutputDir"; + + public const string SchemaCollectorFamily = "schemaCollector"; + + public const string L10NFamily = "l10n"; + + public const string L10NProviderName = "provider"; + + public const string L10NTextFilePath = "textFile.path"; + + public const string L10NTextFileKeyFieldName = "textFile.keyFieldName"; + + public const string L10NTextFileLanguageFieldName = "textFile.languageFieldName"; + + public const string L10NConvertTextKeyToValue = "convertTextKeyToValue"; + + //public const string L10NUnknownTextKeyListOutputFile = "unknownTextKeyListOutputFile"; + + public const string L10NTextListFile = "textListFile"; + + public const string TypeMapperType = "type"; + + public const string TypeMapperConstructor = "constructor"; + + public const string PathValidatorFamily = "pathValidator"; + + public const string PathValidatorRootDir = "rootDir"; + + public const string NamingConvention = "namingConvention"; + + public const string LineEnding = "lineEnding"; + + public const string FileEncoding = "fileEncoding"; +} diff --git a/luban/src/Luban.Core/CodeFormat/CodeFormatManager.cs b/luban/src/Luban.Core/CodeFormat/CodeFormatManager.cs new file mode 100644 index 00000000..297292c8 --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/CodeFormatManager.cs @@ -0,0 +1,86 @@ +using System.Reflection; +using Luban.CodeFormat.CodeStyles; +using Luban.CustomBehaviour; +using NLog; + +namespace Luban.CodeFormat; + +public class CodeFormatManager +{ + private static readonly ILogger s_logger = LogManager.GetCurrentClassLogger(); + + public static CodeFormatManager Ins { get; } = new(); + + + public ICodeStyle NoneCodeStyle { get; private set; } + + public ICodeStyle CsharpDefaultCodeStyle { get; private set; } + + public ICodeStyle JavaDefaultCodeStyle { get; private set; } + + public ICodeStyle GoDefaultCodeStyle { get; private set; } + + public ICodeStyle LuaDefaultCodeStyle { get; private set; } + + public ICodeStyle TypescriptDefaultCodeStyle { get; private set; } + + public ICodeStyle CppDefaultCodeStyle { get; private set; } + + public ICodeStyle PythonDefaultCodeStyle { get; private set; } + + public void Init() + { + } + + public void PostInit() + { + NoneCodeStyle = RegisterCodeStyle("none", "none", "none", "none", "none", "none", "none"); + CsharpDefaultCodeStyle = RegisterCodeStyle("csharp-default", "pascal", "pascal", "pascal", "pascal", "camel", "none"); + JavaDefaultCodeStyle = RegisterCodeStyle("java-default", "pascal", "pascal", "camel", "camel", "camel", "none"); + GoDefaultCodeStyle = RegisterCodeStyle("go-default", "snake", "pascal", "camel", "camel", "pascal", "none"); + LuaDefaultCodeStyle = RegisterCodeStyle("lua-default", "snake", "pascal", "camel", "camel", "snake", "none"); + TypescriptDefaultCodeStyle = RegisterCodeStyle("typescript-default", "pascal", "pascal", "camel", "camel", "camel", "none"); + CppDefaultCodeStyle = RegisterCodeStyle("cpp-default", "snake", "pascal", "pascal", "pascal", "camel", "none"); + PythonDefaultCodeStyle = RegisterCodeStyle("python-default", "snake", "pascal", "snake", "snake", "snake", "none"); + } + + public INamingConventionFormatter CreateFormatter(string formatterName) + { + return CustomBehaviourManager.Ins.CreateBehaviour(formatterName); + } + + public ICodeStyle GetCodeStyle(string codeStyleName) + { + return CustomBehaviourManager.Ins.CreateBehaviour(codeStyleName); + } + + public void RegisterCodeStyle(string name, ICodeStyle codeStyle) + { + CustomBehaviourManager.Ins.RegisterBehaviour(typeof(CodeStyleAttribute), name, 0, () => codeStyle); + } + + public ICodeStyle RegisterCodeStyle(string name, string namespaceNamingConvention, string typeNamingConvention, + string methodNamingConvention, string propertyNamingConvention, string fieldNamingConvention, string enumNamingConvention) + { + var codeStyle = new ConfigurableCodeStyle(namespaceNamingConvention, typeNamingConvention, + methodNamingConvention, propertyNamingConvention, fieldNamingConvention, enumNamingConvention); + RegisterCodeStyle(name, codeStyle); + return codeStyle; + } + + public void ScanRegisterCodeStyle(Assembly assembly) + { + foreach (var type in assembly.GetTypes()) + { + if (type.GetCustomAttribute() is { } attr) + { + if (!typeof(ICodeStyle).IsAssignableFrom(type)) + { + throw new Exception($"type:{type.FullName} not implement interface:{typeof(ICodeStyle).FullName}"); + } + var codeStyle = (ICodeStyle)Activator.CreateInstance(type); + RegisterCodeStyle(attr.Name, codeStyle); + } + } + } +} diff --git a/luban/src/Luban.Core/CodeFormat/CodeStyleAttribute.cs b/luban/src/Luban.Core/CodeFormat/CodeStyleAttribute.cs new file mode 100644 index 00000000..c06ac81d --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/CodeStyleAttribute.cs @@ -0,0 +1,11 @@ +using Luban.CustomBehaviour; + +namespace Luban.CodeFormat; + +[AttributeUsage(AttributeTargets.Class)] +public class CodeStyleAttribute : BehaviourBaseAttribute +{ + public CodeStyleAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/CodeFormat/CodeStyles/CodeStyleBase.cs b/luban/src/Luban.Core/CodeFormat/CodeStyles/CodeStyleBase.cs new file mode 100644 index 00000000..81668121 --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/CodeStyles/CodeStyleBase.cs @@ -0,0 +1,17 @@ +namespace Luban.CodeFormat.CodeStyles; + +public abstract class CodeStyleBase : ICodeStyle +{ + public abstract string FormatNamespace(string ns); + public abstract string FormatType(string typeName); + public abstract string FormatMethod(string methodName); + + public virtual string FormatProperty(string propertyName) + { + return FormatMethod(propertyName); + } + + public abstract string FormatField(string fieldName); + + public abstract string FormatEnumItemName(string enumItemName); +} diff --git a/luban/src/Luban.Core/CodeFormat/CodeStyles/ConfigurableCodeStyle.cs b/luban/src/Luban.Core/CodeFormat/CodeStyles/ConfigurableCodeStyle.cs new file mode 100644 index 00000000..e8544c3a --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/CodeStyles/ConfigurableCodeStyle.cs @@ -0,0 +1,52 @@ +namespace Luban.CodeFormat.CodeStyles; + +public class ConfigurableCodeStyle : CodeStyleBase +{ + private readonly INamingConventionFormatter _namespaceFormatter; + private readonly INamingConventionFormatter _typeFormatter; + private readonly INamingConventionFormatter _methodFormatter; + private readonly INamingConventionFormatter _propertyFormatter; + private readonly INamingConventionFormatter _fieldFormatter; + private readonly INamingConventionFormatter _enumItemFormatter; + + public ConfigurableCodeStyle(string namespaceFormatterName, string typeFormatterName, string methodFormatterName, + string propertyFormatterName, string fieldFormatterName, string enumItemFormatterName) + { + _namespaceFormatter = CodeFormatManager.Ins.CreateFormatter(namespaceFormatterName); + _typeFormatter = CodeFormatManager.Ins.CreateFormatter(typeFormatterName); + _methodFormatter = CodeFormatManager.Ins.CreateFormatter(methodFormatterName); + _propertyFormatter = CodeFormatManager.Ins.CreateFormatter(propertyFormatterName); + _fieldFormatter = CodeFormatManager.Ins.CreateFormatter(fieldFormatterName); + _enumItemFormatter = CodeFormatManager.Ins.CreateFormatter(enumItemFormatterName); + } + + public override string FormatNamespace(string ns) + { + return _namespaceFormatter.FormatName(ns); + } + + public override string FormatType(string typeName) + { + return _typeFormatter.FormatName(typeName); + } + + public override string FormatMethod(string methodName) + { + return _methodFormatter.FormatName(methodName); + } + + public override string FormatProperty(string propertyName) + { + return _propertyFormatter.FormatName(propertyName); + } + + public override string FormatField(string fieldName) + { + return _fieldFormatter.FormatName(fieldName); + } + + public override string FormatEnumItemName(string enumItemName) + { + return _enumItemFormatter.FormatName(enumItemName); + } +} diff --git a/luban/src/Luban.Core/CodeFormat/CodeStyles/OverlayCodeStyle.cs b/luban/src/Luban.Core/CodeFormat/CodeStyles/OverlayCodeStyle.cs new file mode 100644 index 00000000..447d6309 --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/CodeStyles/OverlayCodeStyle.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.CodeFormat.CodeStyles; + +public class OverlayCodeStyle : CodeStyleBase +{ + private ICodeStyle _defaultStyle; + private readonly INamingConventionFormatter _namespaceFormatter; + private readonly INamingConventionFormatter _typeFormatter; + private readonly INamingConventionFormatter _methodFormatter; + private readonly INamingConventionFormatter _propertyFormatter; + private readonly INamingConventionFormatter _fieldFormatter; + private readonly INamingConventionFormatter _enumItemFormatter; + + public OverlayCodeStyle(ICodeStyle defaultStyle, string namespaceFormatterName, string typeFormatterName, string methodFormatterName, + string propertyFormatterName, string fieldFormatterName, string enumItemFormatterName) + { + _defaultStyle = defaultStyle; + _namespaceFormatter = CreateFormatter(namespaceFormatterName); + _typeFormatter = CreateFormatter(typeFormatterName); + _methodFormatter = CreateFormatter(methodFormatterName); + _propertyFormatter = CreateFormatter(propertyFormatterName); + _fieldFormatter = CreateFormatter(fieldFormatterName); + _enumItemFormatter = CreateFormatter(enumItemFormatterName); + } + + private static INamingConventionFormatter CreateFormatter(string formatterName) + { + return string.IsNullOrEmpty(formatterName) ? null : CodeFormatManager.Ins.CreateFormatter(formatterName); + } + + public override string FormatNamespace(string ns) + { + return _namespaceFormatter?.FormatName(ns) ?? _defaultStyle.FormatNamespace(ns); + } + + public override string FormatType(string typeName) + { + return _typeFormatter?.FormatName(typeName) ?? _defaultStyle.FormatType(typeName); + } + + public override string FormatMethod(string methodName) + { + return _methodFormatter?.FormatName(methodName) ?? _defaultStyle.FormatMethod(methodName); + } + + public override string FormatProperty(string propertyName) + { + return _propertyFormatter?.FormatName(propertyName) ?? _defaultStyle.FormatProperty(propertyName); + } + + public override string FormatField(string fieldName) + { + return _fieldFormatter?.FormatName(fieldName) ?? _defaultStyle.FormatField(fieldName); + } + + public override string FormatEnumItemName(string enumItemName) + { + return _enumItemFormatter?.FormatName(enumItemName) ?? _defaultStyle.FormatEnumItemName(enumItemName); + } +} diff --git a/luban/src/Luban.Core/CodeFormat/ICodeStyle.cs b/luban/src/Luban.Core/CodeFormat/ICodeStyle.cs new file mode 100644 index 00000000..5f2efd6f --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/ICodeStyle.cs @@ -0,0 +1,16 @@ +namespace Luban.CodeFormat; + +public interface ICodeStyle +{ + string FormatNamespace(string ns); + + string FormatType(string typeName); + + string FormatMethod(string methodName); + + string FormatProperty(string propertyName); + + string FormatField(string fieldName); + + string FormatEnumItemName(string enumItemName); +} diff --git a/luban/src/Luban.Core/CodeFormat/INamingConventionFormatter.cs b/luban/src/Luban.Core/CodeFormat/INamingConventionFormatter.cs new file mode 100644 index 00000000..018943a9 --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/INamingConventionFormatter.cs @@ -0,0 +1,6 @@ +namespace Luban.CodeFormat; + +public interface INamingConventionFormatter +{ + string FormatName(string name); +} diff --git a/luban/src/Luban.Core/CodeFormat/NamingConventionAttribute.cs b/luban/src/Luban.Core/CodeFormat/NamingConventionAttribute.cs new file mode 100644 index 00000000..c5ab8489 --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/NamingConventionAttribute.cs @@ -0,0 +1,11 @@ +using Luban.CustomBehaviour; + +namespace Luban.CodeFormat; + +[AttributeUsage(AttributeTargets.Class)] +public class NamingConventionAttribute : BehaviourBaseAttribute +{ + public NamingConventionAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/CamelCaseFormatter.cs b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/CamelCaseFormatter.cs new file mode 100644 index 00000000..4148fc90 --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/CamelCaseFormatter.cs @@ -0,0 +1,12 @@ +using Luban.Utils; + +namespace Luban.CodeFormat.NamingConventionFormatters; + +[NamingConvention("camel")] +public class CamelCaseFormatter : INamingConventionFormatter +{ + public string FormatName(string fieldName) + { + return TypeUtil.ToCamelCase(fieldName); + } +} diff --git a/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/NoneFormatter.cs b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/NoneFormatter.cs new file mode 100644 index 00000000..b4c69ac8 --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/NoneFormatter.cs @@ -0,0 +1,10 @@ +namespace Luban.CodeFormat.NamingConventionFormatters; + +[NamingConvention("none")] +public class NoneFormatter : INamingConventionFormatter +{ + public string FormatName(string name) + { + return name; + } +} diff --git a/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/PascalCaseFormatter.cs b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/PascalCaseFormatter.cs new file mode 100644 index 00000000..10cbe20f --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/PascalCaseFormatter.cs @@ -0,0 +1,12 @@ +using Luban.Utils; + +namespace Luban.CodeFormat.NamingConventionFormatters; + +[NamingConvention("pascal")] +public class PascalCaseFormatter : INamingConventionFormatter +{ + public string FormatName(string name) + { + return TypeUtil.ToPascalCase(name); + } +} diff --git a/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/SnakeCaseFormatter.cs b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/SnakeCaseFormatter.cs new file mode 100644 index 00000000..26944a50 --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/SnakeCaseFormatter.cs @@ -0,0 +1,12 @@ +using Luban.Utils; + +namespace Luban.CodeFormat.NamingConventionFormatters; + +[NamingConvention("snake")] +public class SnakeCaseFormatter : INamingConventionFormatter +{ + public string FormatName(string name) + { + return TypeUtil.ToUnderScores(name); + } +} diff --git a/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/UpperCaseFormatter.cs b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/UpperCaseFormatter.cs new file mode 100644 index 00000000..af798ef5 --- /dev/null +++ b/luban/src/Luban.Core/CodeFormat/NamingConventionFormatters/UpperCaseFormatter.cs @@ -0,0 +1,10 @@ +namespace Luban.CodeFormat.NamingConventionFormatters; + +[NamingConvention("upper")] +public class UpperCaseFormatter : INamingConventionFormatter +{ + public string FormatName(string name) + { + return name.ToUpperInvariant(); + } +} diff --git a/luban/src/Luban.Core/CodeTarget/AllInOneTemplateCodeTargetBase.cs b/luban/src/Luban.Core/CodeTarget/AllInOneTemplateCodeTargetBase.cs new file mode 100644 index 00000000..e06dbe5d --- /dev/null +++ b/luban/src/Luban.Core/CodeTarget/AllInOneTemplateCodeTargetBase.cs @@ -0,0 +1,42 @@ +using Luban.CodeFormat; +using Luban.Defs; +using Luban.TemplateExtensions; +using Luban.Tmpl; +using Luban.Utils; +using Scriban; +using Scriban.Runtime; + +namespace Luban.CodeTarget; + +public abstract class AllInOneTemplateCodeTargetBase : TemplateCodeTargetBase +{ + protected abstract string DefaultOutputFileName { get; } + + public override void Handle(GenerationContext ctx, OutputFileManifest manifest) + { + string outputSchemaFileName = EnvManager.Current.GetOptionOrDefault(Name, $"outputFile", true, DefaultOutputFileName); + manifest.AddFile(CreateOutputFile($"{outputSchemaFileName}", GenerateSchema(ctx))); + } + + protected virtual string GenerateSchema(GenerationContext ctx) + { + var writer = new CodeWriter(); + var template = GetTemplate($"schema"); + var tplCtx = CreateTemplateContext(template); + OnCreateTemplateContext(tplCtx); + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__name", ctx.Target.Manager}, + { "__namespace", ctx.Target.TopModule}, + { "__full_name", TypeUtil.MakeFullName(ctx.Target.TopModule, ctx.Target.Manager)}, + { "__tables", ctx.ExportTables}, + { "__beans", ctx.ExportBeans}, + { "__enums", ctx.ExportEnums}, + { "__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + return writer.ToResult(FileHeader); + } +} diff --git a/luban/src/Luban.Core/CodeTarget/CodeTargetAttribute.cs b/luban/src/Luban.Core/CodeTarget/CodeTargetAttribute.cs new file mode 100644 index 00000000..96e5d747 --- /dev/null +++ b/luban/src/Luban.Core/CodeTarget/CodeTargetAttribute.cs @@ -0,0 +1,11 @@ +using Luban.CustomBehaviour; + +namespace Luban.CodeTarget; + +[AttributeUsage(AttributeTargets.Class, Inherited = false)] +public class CodeTargetAttribute : BehaviourBaseAttribute +{ + public CodeTargetAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/CodeTarget/CodeTargetBase.cs b/luban/src/Luban.Core/CodeTarget/CodeTargetBase.cs new file mode 100644 index 00000000..7a079b6b --- /dev/null +++ b/luban/src/Luban.Core/CodeTarget/CodeTargetBase.cs @@ -0,0 +1,202 @@ +using System.Reflection; +using System.Text; +using Luban.CodeFormat; +using Luban.CodeFormat.CodeStyles; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.CodeTarget; + +public abstract class CodeTargetBase : ICodeTarget +{ + public const string FamilyPrefix = "codeTarget"; + + public virtual Encoding FileEncoding + { + get + { + string encoding = EnvManager.Current.GetOptionOrDefault(Name, BuiltinOptionNames.FileEncoding, true, ""); + return string.IsNullOrEmpty(encoding) ? Encoding.UTF8 : System.Text.Encoding.GetEncoding(encoding); + } + } + + protected virtual string GetFileNameWithoutExtByTypeName(string name) + { + return name; + } + + protected virtual ICodeStyle DefaultCodeStyle => CodeFormatManager.Ins.NoneCodeStyle; + + protected virtual ICodeStyle CodeStyle => _codeStyle ??= CreateConfigurableCodeStyle(); + + private ICodeStyle _codeStyle; + + private ICodeStyle CreateConfigurableCodeStyle() + { + var baseStyle = GenerationContext.Current.GetCodeStyle(Name) ?? DefaultCodeStyle; + + var env = EnvManager.Current; + string namingKey = BuiltinOptionNames.NamingConvention; + return new OverlayCodeStyle(baseStyle, + env.GetOptionOrDefault($"{namingKey}.{Name}", "namespace", true, ""), + env.GetOptionOrDefault($"{namingKey}.{Name}", "type", true, ""), + env.GetOptionOrDefault($"{namingKey}.{Name}", "method", true, ""), + env.GetOptionOrDefault($"{namingKey}.{Name}", "property", true, ""), + env.GetOptionOrDefault($"{namingKey}.{Name}", "field", true, ""), + env.GetOptionOrDefault($"{namingKey}.{Name}", "enumItem", true, "") + ); + } + + protected abstract IReadOnlySet PreservedKeyWords { get; } + + protected bool IsPreserveKeyWords(string name) + { + return PreservedKeyWords.Contains(name); + } + + protected virtual bool IsValidateName(string name, NameLocation location) + { + return !string.IsNullOrEmpty(name); + } + + protected virtual void ValidationTypeNames(GenerationContext ctx) + { + foreach (var table in ctx.ExportTables) + { + if (IsPreserveKeyWords(table.Name)) + { + throw new Exception($"table name {table.FullName} is preserved keyword"); + } + if (!IsValidateName(table.Name, NameLocation.TableName)) + { + throw new Exception($"table name {table.FullName} is invalid"); + } + } + + foreach (var bean in ctx.ExportBeans) + { + if (IsPreserveKeyWords(bean.Name)) + { + throw new Exception($"bean name {bean.FullName} is preserved keyword"); + } + if (!IsValidateName(bean.Name, NameLocation.BeanName)) + { + throw new Exception($"bean name {bean.FullName} is invalid"); + } + foreach (var field in bean.Fields) + { + if (IsPreserveKeyWords(field.Name)) + { + throw new Exception($"the name of field {bean.FullName}::{field.Name} is preserved keyword"); + } + if (!IsValidateName(field.Name, NameLocation.BeanFieldName)) + { + throw new Exception($"the name of field {bean.FullName}::{field.Name} is invalid"); + } + } + } + + foreach (var @enum in ctx.ExportEnums) + { + if (IsPreserveKeyWords(@enum.Name)) + { + throw new Exception($"enum name {@enum.FullName} is preserved keyword"); + } + if (!IsValidateName(@enum.Name, NameLocation.EnumName)) + { + throw new Exception($"enum name {@enum.FullName} is invalid"); + } + foreach (var item in @enum.Items) + { + if (IsPreserveKeyWords(item.Name)) + { + throw new Exception($"the name of enum item '{@enum.FullName}::{item.Name}' is preserved keyword"); + } + if (!IsValidateName(item.Name, NameLocation.EnumItemName)) + { + throw new Exception($"the name of enum item '{@enum.FullName}::{item.Name}' is invalid"); + } + } + } + } + + public virtual void ValidateDefinition(GenerationContext ctx) + { + ValidationTypeNames(ctx); + } + + public virtual void Handle(GenerationContext ctx, OutputFileManifest manifest) + { + var tasks = new List>(); + tasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateTables(ctx, ctx.ExportTables, writer); + return CreateOutputFile($"{GetFileNameWithoutExtByTypeName(ctx.Target.Manager)}.{FileSuffixName}", writer.ToResult(FileHeader)); + })); + + foreach (var table in ctx.ExportTables) + { + tasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateTable(ctx, table, writer); + return CreateOutputFile($"{GetFileNameWithoutExtByTypeName(table.FullName)}.{FileSuffixName}", writer.ToResult(FileHeader)); + })); + } + + foreach (var bean in ctx.ExportBeans) + { + tasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateBean(ctx, bean, writer); + return CreateOutputFile($"{GetFileNameWithoutExtByTypeName(bean.FullName)}.{FileSuffixName}", writer.ToResult(FileHeader)); + })); + } + + foreach (var @enum in ctx.ExportEnums) + { + tasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateEnum(ctx, @enum, writer); + return CreateOutputFile($"{GetFileNameWithoutExtByTypeName(@enum.FullName)}.{FileSuffixName}", writer.ToResult(FileHeader)); + })); + } + + Task.WaitAll(tasks.ToArray()); + foreach (var task in tasks) + { + manifest.AddFile(task.Result); + } + } + + public string Name => GetType().GetCustomAttribute().Name; + + public abstract string FileHeader { get; } + + protected abstract string FileSuffixName { get; } + + public virtual string GetPathFromFullName(string fullName) + { + return fullName.Replace('.', '/') + "." + FileSuffixName; + } + + private static string GetLineEnding() + { + string endings = EnvManager.Current.GetOptionOrDefault("code", BuiltinOptionNames.LineEnding, true, "").ToLowerInvariant(); + return StringUtil.GetLineEnding(endings); + } + + protected OutputFile CreateOutputFile(string path, string content) + { + string finalContent = content.ReplaceLineEndings(GetLineEnding()); + return new OutputFile() { File = path, Content = finalContent, Encoding = FileEncoding }; + } + + public abstract void GenerateTables(GenerationContext ctx, List tables, CodeWriter writer); + public abstract void GenerateTable(GenerationContext ctx, DefTable table, CodeWriter writer); + public abstract void GenerateBean(GenerationContext ctx, DefBean bean, CodeWriter writer); + public abstract void GenerateEnum(GenerationContext ctx, DefEnum @enum, CodeWriter writer); +} diff --git a/luban/src/Luban.Core/CodeTarget/CodeTargetManager.cs b/luban/src/Luban.Core/CodeTarget/CodeTargetManager.cs new file mode 100644 index 00000000..358266a7 --- /dev/null +++ b/luban/src/Luban.Core/CodeTarget/CodeTargetManager.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using Luban.CustomBehaviour; + +namespace Luban.CodeTarget; + +public class CodeTargetManager +{ + public static CodeTargetManager Ins { get; } = new(); + + public void Init() + { + + } + + public ICodeTarget CreateCodeTarget(string name) + { + return CustomBehaviourManager.Ins.CreateBehaviour(name); + } +} diff --git a/luban/src/Luban.Core/CodeTarget/CodeWriter.cs b/luban/src/Luban.Core/CodeTarget/CodeWriter.cs new file mode 100644 index 00000000..6daaab54 --- /dev/null +++ b/luban/src/Luban.Core/CodeTarget/CodeWriter.cs @@ -0,0 +1,33 @@ +using Luban.Utils; +using System.Text; + +namespace Luban.CodeTarget; + +public class CodeWriter +{ + private readonly List _lines; + + public CodeWriter(int lineCapacity = 1000) + { + _lines = new List(lineCapacity); + } + + public void Write(string line) + { + _lines.Add(line); + } + + public string ToResult(string header) + { + var sb = new StringBuilder(100 * 1024); + if (!string.IsNullOrEmpty(header)) + { + sb.AppendLine(header); + } + foreach (var line in _lines) + { + sb.AppendLine(line); + } + return sb.ToString(); + } +} diff --git a/luban/src/Luban.Core/CodeTarget/CommonFileHeaders.cs b/luban/src/Luban.Core/CodeTarget/CommonFileHeaders.cs new file mode 100644 index 00000000..da908579 --- /dev/null +++ b/luban/src/Luban.Core/CodeTarget/CommonFileHeaders.cs @@ -0,0 +1,57 @@ +namespace Luban.CodeTarget; + +public class CommonFileHeaders +{ + public const string AUTO_GENERATE_C_LIKE = @" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +"; + + + public const string AUTO_GENERATE_LUA = @" +--[[------------------------------------------------------------------------------ +-- +-- This code was generated by a tool. +-- Changes to this file may cause incorrect behavior and will be lost if +-- the code is regenerated. +-- +--]]------------------------------------------------------------------------------ +"; + + public const string AUTO_GENERATE_PYTHON = @" +#-*- coding: utf-8 -*- +''' + + This code was generated by a tool. + Changes to this file may cause incorrect behavior and will be lost if + the code is regenerated. + +''' +"; + + public const string AUTO_GENERATE_GDSCRIPT = @" +# +# This code was generated by a tool. +# Changes to this file may cause incorrect behavior and will be lost if +# the code is regenerated. +# +"; + + public const string AUTO_GENERATE_PHP = @" + This code was generated by a tool. + Changes to this file may cause incorrect behavior and will be lost if + the code is regenerated. +
+*/ +"; +} \ No newline at end of file diff --git a/luban/src/Luban.Core/CodeTarget/ICodeTarget.cs b/luban/src/Luban.Core/CodeTarget/ICodeTarget.cs new file mode 100644 index 00000000..ed242641 --- /dev/null +++ b/luban/src/Luban.Core/CodeTarget/ICodeTarget.cs @@ -0,0 +1,27 @@ +using Luban.Defs; +using System.Text; + +namespace Luban.CodeTarget; + +public interface ICodeTarget +{ + string Name { get; } + + void ValidateDefinition(GenerationContext ctx); + + void Handle(GenerationContext ctx, OutputFileManifest manifest); + + string FileHeader { get; } + + Encoding FileEncoding { get; } + + string GetPathFromFullName(string fullName); + + void GenerateTables(GenerationContext ctx, List tables, CodeWriter writer); + + void GenerateTable(GenerationContext ctx, DefTable table, CodeWriter writer); + + void GenerateBean(GenerationContext ctx, DefBean bean, CodeWriter writer); + + void GenerateEnum(GenerationContext ctx, DefEnum @enum, CodeWriter writer); +} diff --git a/luban/src/Luban.Core/CodeTarget/NameLocation.cs b/luban/src/Luban.Core/CodeTarget/NameLocation.cs new file mode 100644 index 00000000..709fd258 --- /dev/null +++ b/luban/src/Luban.Core/CodeTarget/NameLocation.cs @@ -0,0 +1,10 @@ +namespace Luban.CodeTarget; + +public enum NameLocation +{ + TableName, + BeanName, + EnumName, + BeanFieldName, + EnumItemName, +} diff --git a/luban/src/Luban.Core/CodeTarget/TemplateCodeTargetBase.cs b/luban/src/Luban.Core/CodeTarget/TemplateCodeTargetBase.cs new file mode 100644 index 00000000..39eba245 --- /dev/null +++ b/luban/src/Luban.Core/CodeTarget/TemplateCodeTargetBase.cs @@ -0,0 +1,130 @@ +using Luban.CodeFormat; +using Luban.Defs; +using Luban.TemplateExtensions; +using Luban.Tmpl; +using Luban.Utils; +using Scriban; +using Scriban.Runtime; + +namespace Luban.CodeTarget; + +public abstract class TemplateCodeTargetBase : CodeTargetBase +{ + protected virtual string CommonTemplateSearchPath => $"common/{FileSuffixName}"; + + protected virtual string TemplateDir => Name; + + protected TemplateContext CreateTemplateContext(Template template) + { + var ctx = new TemplateContext() + { + LoopLimit = 0, + NewLine = "\n", + }; + ctx.PushGlobal(new ContextTemplateExtension()); + ctx.PushGlobal(new TypeTemplateExtension()); + OnCreateTemplateContext(ctx); + return ctx; + } + + protected abstract void OnCreateTemplateContext(TemplateContext ctx); + + protected virtual Scriban.Template GetTemplate(string name) + { + if (TemplateManager.Ins.TryGetTemplate($"{TemplateDir}/{name}", out var template)) + { + return template; + } + + if (!string.IsNullOrWhiteSpace(CommonTemplateSearchPath) && TemplateManager.Ins.TryGetTemplate($"{CommonTemplateSearchPath}/{name}", out template)) + { + return template; + } + throw new Exception($"template:{name} not found"); + } + + public override void GenerateTables(GenerationContext ctx, List tables, CodeWriter writer) + { + var template = GetTemplate("tables"); + var tplCtx = CreateTemplateContext(template); + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__name", ctx.Target.Manager }, + { "__namespace", ctx.Target.TopModule }, + { "__tables", tables }, + { "__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + } + + public override void GenerateTable(GenerationContext ctx, DefTable table, CodeWriter writer) + { + var template = GetTemplate("table"); + var tplCtx = CreateTemplateContext(template); + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__top_module", ctx.Target.TopModule }, + { "__manager_name", ctx.Target.Manager }, + { "__manager_name_with_top_module", TypeUtil.MakeFullName(ctx.TopModule, ctx.Target.Manager) }, + { "__name", table.Name }, + { "__namespace", table.Namespace }, + { "__namespace_with_top_module", table.NamespaceWithTopModule }, + { "__full_name_with_top_module", table.FullNameWithTopModule }, + { "__table", table }, + { "__this", table }, + { "__key_type", table.KeyTType}, + { "__value_type", table.ValueTType}, + { "__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + } + + public override void GenerateBean(GenerationContext ctx, DefBean bean, CodeWriter writer) + { + var template = GetTemplate("bean"); + var tplCtx = CreateTemplateContext(template); + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__top_module", ctx.Target.TopModule }, + { "__manager_name", ctx.Target.Manager }, + { "__manager_name_with_top_module", TypeUtil.MakeFullName(ctx.TopModule, ctx.Target.Manager) }, + { "__name", bean.Name }, + { "__namespace", bean.Namespace }, + { "__namespace_with_top_module", bean.NamespaceWithTopModule }, + { "__full_name_with_top_module", bean.FullNameWithTopModule }, + { "__bean", bean }, + { "__this", bean }, + {"__export_fields", bean.ExportFields}, + {"__hierarchy_export_fields", bean.HierarchyExportFields}, + {"__parent_def_type", bean.ParentDefType}, + { "__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + } + + public override void GenerateEnum(GenerationContext ctx, DefEnum @enum, CodeWriter writer) + { + var template = GetTemplate("enum"); + var tplCtx = CreateTemplateContext(template); + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__name", @enum.Name }, + { "__namespace", @enum.Namespace }, + { "__top_module", ctx.Target.TopModule }, + { "__namespace_with_top_module", @enum.NamespaceWithTopModule }, + { "__full_name_with_top_module", @enum.FullNameWithTopModule }, + { "__enum", @enum }, + { "__this", @enum }, + { "__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + } +} diff --git a/luban/src/Luban.Core/CustomBehaviour/BehaviourBaseAttribute.cs b/luban/src/Luban.Core/CustomBehaviour/BehaviourBaseAttribute.cs new file mode 100644 index 00000000..c732bbd9 --- /dev/null +++ b/luban/src/Luban.Core/CustomBehaviour/BehaviourBaseAttribute.cs @@ -0,0 +1,14 @@ +namespace Luban.CustomBehaviour; + +public abstract class BehaviourBaseAttribute : Attribute, ICustomBehaviour +{ + public string Name { get; } + + public int Priority { get; set; } + + protected BehaviourBaseAttribute(string name) + { + Name = name; + Priority = 0; + } +} diff --git a/luban/src/Luban.Core/CustomBehaviour/CustomBehaviourManager.cs b/luban/src/Luban.Core/CustomBehaviour/CustomBehaviourManager.cs new file mode 100644 index 00000000..671a986d --- /dev/null +++ b/luban/src/Luban.Core/CustomBehaviour/CustomBehaviourManager.cs @@ -0,0 +1,76 @@ +using System.Reflection; + +namespace Luban.CustomBehaviour; + +public class CustomBehaviourManager +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public static CustomBehaviourManager Ins { get; } = new(); + + private class BehaviourInfo + { + public int Priority { get; set; } + + public Func Creator { get; set; } + } + + private readonly Dictionary<(Type, string), BehaviourInfo> _behaviourCreators = new(); + + public void Init() + { + _behaviourCreators.Clear(); + } + + public T CreateBehaviour(string name) where C : Attribute, ICustomBehaviour where T : class + { + if (_behaviourCreators.TryGetValue((typeof(C), name), out var bi)) + { + return (T)bi.Creator(); + } + + throw new Exception($"behaviour:{name} type:{typeof(T)} not exists"); + } + + public bool TryCreateBehaviour(string name, out T behaviour) where C : Attribute, ICustomBehaviour where T : class + { + if (_behaviourCreators.TryGetValue((typeof(C), name), out var bi)) + { + behaviour = (T)bi.Creator(); + return true; + } + + behaviour = null; + return false; + } + + public void RegisterBehaviour(Type type, string name, int priority, Func behaviourCreator) + { + if (_behaviourCreators.TryGetValue((type, name), out var bi)) + { + if (bi.Priority >= priority) + { + s_logger.Warn("Behaviour type:{} name:{} priority:{} is ignored", type, name, priority); + return; + } + s_logger.Debug("Behaviour type:{} name:{} priority:{} is overrided by priority:{}", type, name, bi.Priority, priority); + } + s_logger.Trace("register behaviour type:{} name:{} priority:{}", type, name, priority); + _behaviourCreators[(type, name)] = new BehaviourInfo() { Priority = priority, Creator = behaviourCreator }; + } + + public void ScanRegisterBehaviour(Assembly assembly) + { + foreach (var t in assembly.GetTypes()) + { + if (t.IsAbstract || t.IsInterface) + { + continue; + } + foreach (var attr in t.GetCustomAttributes()) + { + RegisterBehaviour(attr.GetType(), attr.Name, attr.Priority, () => Activator.CreateInstance(t)); + } + } + } +} diff --git a/luban/src/Luban.Core/CustomBehaviour/ICustomBehaviour.cs b/luban/src/Luban.Core/CustomBehaviour/ICustomBehaviour.cs new file mode 100644 index 00000000..22037234 --- /dev/null +++ b/luban/src/Luban.Core/CustomBehaviour/ICustomBehaviour.cs @@ -0,0 +1,8 @@ +namespace Luban.CustomBehaviour; + +public interface ICustomBehaviour +{ + public string Name { get; } + + int Priority { get; } +} diff --git a/luban/src/Luban.Core/CustomBehaviour/IPriorityBehaviour.cs b/luban/src/Luban.Core/CustomBehaviour/IPriorityBehaviour.cs new file mode 100644 index 00000000..0572a1c8 --- /dev/null +++ b/luban/src/Luban.Core/CustomBehaviour/IPriorityBehaviour.cs @@ -0,0 +1,6 @@ +namespace Luban.CustomBehaviour; + +public interface IPriorityBehaviour +{ + int Priority { get; } +} diff --git a/luban/src/Luban.Core/DataLoader/DataCreateException.cs b/luban/src/Luban.Core/DataLoader/DataCreateException.cs new file mode 100644 index 00000000..2efa1440 --- /dev/null +++ b/luban/src/Luban.Core/DataLoader/DataCreateException.cs @@ -0,0 +1,40 @@ +using Luban.Defs; + +namespace Luban.DataLoader; + +public class DataCreateException : System.Exception +{ + private List<(DefBean, DefField)> VariablePath { get; } = new(); + + public string OriginDataLocation { get; set; } + + public string DataLocationInFile { get; } + + public string OriginErrorMsg { get; } + + public string OriginStackTrace { get; } + + public DataCreateException(Exception e, string dataLocation) : base(e.Message, e) + { + this.OriginStackTrace = e.StackTrace; + this.OriginErrorMsg = e.Message; + this.DataLocationInFile = dataLocation; + } + + public override string Message => this.OriginErrorMsg; + + public void Push(DefBean bean, DefField f) + { + VariablePath.Add((bean, f)); + } + + public string VariableFullPathStr + { + get + { + var path = new List<(DefBean, DefField)>(VariablePath); + path.Reverse(); + return string.Join(" => ", path.Select(b => $"{{{b.Item1.FullName}}}.{b.Item2.Name}")); + } + } +} diff --git a/luban/src/Luban.Core/DataLoader/DataLoaderAttribute.cs b/luban/src/Luban.Core/DataLoader/DataLoaderAttribute.cs new file mode 100644 index 00000000..535485b0 --- /dev/null +++ b/luban/src/Luban.Core/DataLoader/DataLoaderAttribute.cs @@ -0,0 +1,11 @@ +using Luban.CustomBehaviour; + +namespace Luban.DataLoader; + +[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] +public class DataLoaderAttribute : BehaviourBaseAttribute +{ + public DataLoaderAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/DataLoader/DataLoaderBase.cs b/luban/src/Luban.Core/DataLoader/DataLoaderBase.cs new file mode 100644 index 00000000..48d68872 --- /dev/null +++ b/luban/src/Luban.Core/DataLoader/DataLoaderBase.cs @@ -0,0 +1,15 @@ +using Luban.Defs; +using Luban.Types; + +namespace Luban.DataLoader; + +public abstract class DataLoaderBase : IDataLoader +{ + public string RawUrl { get; protected set; } + + public abstract Record ReadOne(TBean type); + + public abstract List ReadMulti(TBean type); + + public abstract void Load(string rawUrl, string sheetName, Stream stream); +} diff --git a/luban/src/Luban.Core/DataLoader/DataLoaderManager.cs b/luban/src/Luban.Core/DataLoader/DataLoaderManager.cs new file mode 100644 index 00000000..e1395f42 --- /dev/null +++ b/luban/src/Luban.Core/DataLoader/DataLoaderManager.cs @@ -0,0 +1,126 @@ +using System.Reflection; +using Luban.CustomBehaviour; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; + +namespace Luban.DataLoader; + +public class DataLoaderManager +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public static DataLoaderManager Ins { get; } = new(); + + public void Init() + { + + } + + public void LoadDatas(GenerationContext ctx) + { + var tasks = ctx.Tables.Select(t => Task.Run(() => LoadTable(ctx, t))).ToArray(); + Task.WaitAll(tasks); + } + + private void LoadTable(GenerationContext ctx, DefTable table) + { + string inputDataDir = GenerationContext.GetInputDataPath(); + var tasks = new List>>(); + foreach (var inputFile in table.InputFiles) + { + s_logger.Trace("load table:{} file:{}", table.FullName, inputFile); + var (actualFile, subAssetName) = FileUtil.SplitFileAndSheetName(FileUtil.Standardize(inputFile)); + var options = new Dictionary(); + foreach (var atomFile in FileUtil.GetFileOrDirectory(Path.Combine(inputDataDir, actualFile))) + { + s_logger.Trace("load table:{} atomfile:{}", table.FullName, atomFile); + tasks.Add(Task.Run(() => LoadTableFile(table, atomFile, subAssetName, options))); + } + } + + var records = new List(); + foreach (var task in tasks) + { + records.AddRange(task.Result); + } + ctx.AddDataTable(table, records, null); + } + + public List LoadTableFile(DefTable table, string file, string subAssetName, Dictionary options) + { + try + { + s_logger.Trace("load table:{} file:{}", table.FullName, file); + if (!File.Exists(file) && !Directory.Exists(file)) + { + throw new Exception($"'{table.FullName}'的input文件或目录不存在: {file} "); + } + string loaderName = options.TryGetValue("loader", out var name) ? name : FileUtil.GetExtensionWithDot(file); + var loader = CreateDataLoader(loaderName); + using var stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + loader.Load(file, subAssetName, stream); + if (IsMultiRecordFile(file, subAssetName)) + { + return loader.ReadMulti(table.ValueTType); + } + return new List { loader.ReadOne(table.ValueTType) }; + } + catch (DataCreateException e) + { + if (string.IsNullOrEmpty(e.OriginDataLocation)) + { + e.OriginDataLocation = file; + } + throw; + } + catch (Exception e) + { + throw new Exception($"LoadTableFile fail. {file}", e); + } + } + + public List LoadTableFile(TBean valueType, string file, string subAssetName, Dictionary options) + { + try + { + string loaderName = options.TryGetValue("loader", out var name) ? name : FileUtil.GetExtensionWithDot(file); + var loader = CreateDataLoader(loaderName); + using var stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + loader.Load(file, subAssetName, stream); + if (IsMultiRecordFile(file, subAssetName)) + { + return loader.ReadMulti(valueType); + } + return new List { loader.ReadOne(valueType) }; + } + catch (DataCreateException e) + { + if (string.IsNullOrEmpty(e.OriginDataLocation)) + { + e.OriginDataLocation = file; + } + throw; + } + catch (Exception e) + { + throw new Exception($"LoadTableFile fail. {file}", e); + } + } + + private static bool IsMultiRecordField(string sheet) + { + return !string.IsNullOrEmpty(sheet) && sheet.StartsWith("*"); + } + + private static bool IsMultiRecordFile(string file, string sheetOrFieldName) + { + return FileUtil.IsExcelFile(file) || IsMultiRecordField(sheetOrFieldName); + } + + public IDataLoader CreateDataLoader(string loaderName) + { + return CustomBehaviourManager.Ins.CreateBehaviour(loaderName); + } +} diff --git a/luban/src/Luban.Core/DataLoader/FieldNames.cs b/luban/src/Luban.Core/DataLoader/FieldNames.cs new file mode 100644 index 00000000..af1f113f --- /dev/null +++ b/luban/src/Luban.Core/DataLoader/FieldNames.cs @@ -0,0 +1,23 @@ +namespace Luban.DataLoader; + +public static class FieldNames +{ + public const string FallbackTypeNameKey = "__type__"; + + public const string BeanNullType = "null"; + + public const string BeanNotNullType = "{}"; + + public const string JsonTypeNameKey = "$type"; + + public const string XmlTypeNameKey = "type"; + + public const string LuaTypeNameKey = "_type_"; + + public const string ExcelTypeNameKey = "$type"; + public const string ExcelValueNameKey = "$value"; + + public const string ExcelMapKey = "$key"; + + public const string TagKey = "__tag__"; +} diff --git a/luban/src/Luban.Core/DataLoader/IDataLoader.cs b/luban/src/Luban.Core/DataLoader/IDataLoader.cs new file mode 100644 index 00000000..a2598588 --- /dev/null +++ b/luban/src/Luban.Core/DataLoader/IDataLoader.cs @@ -0,0 +1,15 @@ +using Luban.Defs; +using Luban.Types; + +namespace Luban.DataLoader; + +public interface IDataLoader +{ + string RawUrl { get; } + + Record ReadOne(TBean type); + + List ReadMulti(TBean type); + + void Load(string rawUrl, string subAsset, Stream stream); +} diff --git a/luban/src/Luban.Core/DataTarget/DataExporterAttribute.cs b/luban/src/Luban.Core/DataTarget/DataExporterAttribute.cs new file mode 100644 index 00000000..b064685f --- /dev/null +++ b/luban/src/Luban.Core/DataTarget/DataExporterAttribute.cs @@ -0,0 +1,12 @@ +using Luban.CustomBehaviour; + +namespace Luban.DataTarget; + +[AttributeUsage(AttributeTargets.Class)] +public class DataExporterAttribute : BehaviourBaseAttribute +{ + + public DataExporterAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/DataTarget/DataExporterBase.cs b/luban/src/Luban.Core/DataTarget/DataExporterBase.cs new file mode 100644 index 00000000..241a1b41 --- /dev/null +++ b/luban/src/Luban.Core/DataTarget/DataExporterBase.cs @@ -0,0 +1,57 @@ +using Luban.Defs; + +namespace Luban.DataTarget; + +public abstract class DataExporterBase : IDataExporter +{ + public const string FamilyPrefix = "dataExporter"; + + + public virtual void Handle(GenerationContext ctx, IDataTarget dataTarget, OutputFileManifest manifest) + { + List tables = dataTarget.ExportAllRecords ? ctx.Tables : ctx.ExportTables; + switch (dataTarget.AggregationType) + { + case AggregationType.Table: + { + var tasks = tables.Select(table => Task.Run(() => + { + manifest.AddFile(dataTarget.ExportTable(table, ctx.GetTableExportDataList(table))); + })).ToArray(); + Task.WaitAll(tasks); + break; + } + case AggregationType.Tables: + { + manifest.AddFile(dataTarget.ExportTables(ctx.ExportTables)); + break; + } + case AggregationType.Record: + { + var tasks = new List(); + foreach (var table in tables) + { + foreach (var record in ctx.GetTableExportDataList(table)) + { + tasks.Add(Task.Run(() => + { + manifest.AddFile(dataTarget.ExportRecord(table, record)); + })); + } + } + Task.WaitAll(tasks.ToArray()); + break; + } + case AggregationType.Other: + { + ExportCustom(tables, manifest, dataTarget); + break; + } + } + } + + protected virtual void ExportCustom(List tables, OutputFileManifest manifest, IDataTarget dataTarget) + { + + } +} diff --git a/luban/src/Luban.Core/DataTarget/DataTargetAttribute.cs b/luban/src/Luban.Core/DataTarget/DataTargetAttribute.cs new file mode 100644 index 00000000..1a8cfc9b --- /dev/null +++ b/luban/src/Luban.Core/DataTarget/DataTargetAttribute.cs @@ -0,0 +1,11 @@ +using Luban.CustomBehaviour; + +namespace Luban.DataTarget; + +[AttributeUsage(AttributeTargets.Class)] +public class DataTargetAttribute : BehaviourBaseAttribute +{ + public DataTargetAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/DataTarget/DataTargetBase.cs b/luban/src/Luban.Core/DataTarget/DataTargetBase.cs new file mode 100644 index 00000000..b6326366 --- /dev/null +++ b/luban/src/Luban.Core/DataTarget/DataTargetBase.cs @@ -0,0 +1,80 @@ +using Luban.CodeTarget; +using Luban.Defs; +using Luban.Utils; +using System.Reflection; +using System.Text; + +namespace Luban.DataTarget; + +public abstract class DataTargetBase : IDataTarget +{ + public const string FamilyPrefix = "tableExporter"; + + public string Name => GetType().GetCustomAttribute().Name; + + public virtual Encoding FileEncoding + { + get + { + string encoding = EnvManager.Current.GetOptionOrDefault(Name, BuiltinOptionNames.FileEncoding, true, ""); + return string.IsNullOrEmpty(encoding) ? Encoding.UTF8 : System.Text.Encoding.GetEncoding(encoding); + } + } + + public virtual AggregationType AggregationType => AggregationType.Table; + + public virtual bool ExportAllRecords => false; + + protected abstract string DefaultOutputFileExt { get; } + + protected string OutputFileExt { get; } + + protected DataTargetBase() + { + OutputFileExt = DefaultOutputFileExt; + var dataTargetAttr = GetType().GetCustomAttribute(); + if (dataTargetAttr == null) + { + return; + } + + var namespaze = dataTargetAttr.Name; + var optionName = BuiltinOptionNames.OutputDataExtension; + if (EnvManager.Current.TryGetOption(namespaze, optionName, false, out var optionExt)) + { + if (!string.IsNullOrWhiteSpace(optionExt)) + { + OutputFileExt = optionExt; + } + } + } + + public abstract OutputFile ExportTable(DefTable table, List records); + + public virtual OutputFile ExportTables(List tables) + { + throw new NotSupportedException(); + } + + public virtual OutputFile ExportRecord(DefTable table, Record record) + { + throw new NotSupportedException(); + } + + private static string GetLineEnding() + { + string endings = EnvManager.Current.GetOptionOrDefault("data", BuiltinOptionNames.LineEnding, true, "").ToLowerInvariant(); + return StringUtil.GetLineEnding(endings); + } + + protected OutputFile CreateOutputFile(string path, string content) + { + string finalContent = content.ReplaceLineEndings(GetLineEnding()); + return new OutputFile() { File = path, Content = finalContent, Encoding = FileEncoding }; + } + + protected OutputFile CreateOutputFile(string path, byte[] content) + { + return new OutputFile() { File = path, Content = content, Encoding = FileEncoding }; + } +} diff --git a/luban/src/Luban.Core/DataTarget/DataTargetManager.cs b/luban/src/Luban.Core/DataTarget/DataTargetManager.cs new file mode 100644 index 00000000..bf072bd7 --- /dev/null +++ b/luban/src/Luban.Core/DataTarget/DataTargetManager.cs @@ -0,0 +1,25 @@ +using System.Reflection; +using Luban.CustomBehaviour; +using Luban.Validator; + +namespace Luban.DataTarget; + +public class DataTargetManager +{ + public static DataTargetManager Ins { get; } = new(); + + public void Init() + { + + } + + public IDataExporter CreateDataExporter(string name) + { + return CustomBehaviourManager.Ins.CreateBehaviour(name); + } + + public IDataTarget CreateDataTarget(string name) + { + return CustomBehaviourManager.Ins.CreateBehaviour(name); + } +} diff --git a/luban/src/Luban.Core/DataTarget/IDataExporter.cs b/luban/src/Luban.Core/DataTarget/IDataExporter.cs new file mode 100644 index 00000000..484a6a45 --- /dev/null +++ b/luban/src/Luban.Core/DataTarget/IDataExporter.cs @@ -0,0 +1,7 @@ + +namespace Luban.DataTarget; + +public interface IDataExporter +{ + void Handle(GenerationContext ctx, IDataTarget dataTarget, OutputFileManifest manifest); +} diff --git a/luban/src/Luban.Core/DataTarget/IDataTarget.cs b/luban/src/Luban.Core/DataTarget/IDataTarget.cs new file mode 100644 index 00000000..3a2aaf62 --- /dev/null +++ b/luban/src/Luban.Core/DataTarget/IDataTarget.cs @@ -0,0 +1,27 @@ +using Luban.Defs; +using System.Text; + +namespace Luban.DataTarget; + +public enum AggregationType +{ + Table, + Tables, + Record, + Other, +} + +public interface IDataTarget +{ + AggregationType AggregationType { get; } + + Encoding FileEncoding { get; } + + bool ExportAllRecords { get; } + + OutputFile ExportTable(DefTable table, List records); + + OutputFile ExportTables(List tables); + + OutputFile ExportRecord(DefTable table, Record record); +} diff --git a/luban/src/Luban.Core/DataTransformer/DataTransfomerBase.cs b/luban/src/Luban.Core/DataTransformer/DataTransfomerBase.cs new file mode 100644 index 00000000..0748e7c9 --- /dev/null +++ b/luban/src/Luban.Core/DataTransformer/DataTransfomerBase.cs @@ -0,0 +1,209 @@ +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Types; +using NLog.LayoutRenderers; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.AccessControl; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.DataTransformer; + +public abstract class DataTransfomerBase : IDataTransformer, IDataFuncVisitor2 +{ + public DType Transform(DType originalData, TType type) + { + if (originalData == null) + { + return null; + } + return originalData.Apply(this, type); + } + + DType IDataFuncVisitor2.Accept(DBool data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DByte data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DShort data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DInt data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DLong data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DFloat data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DDouble data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DEnum data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DString data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DDateTime data, TType type) + { + return data; + } + + DType IDataFuncVisitor2.Accept(DBean data, TType type) + { + var defFields = data.ImplType.HierarchyFields; + int i = 0; + List newFields = null; + foreach (var fieldValue in data.Fields) + { + if (fieldValue == null) + { + i++; + continue; + } + var defField = defFields[i]; + var fieldType = defField.CType; + DType newFieldValue = fieldValue.Apply(this, fieldType); + if (newFieldValue != fieldValue) + { + if (newFields == null) + { + newFields = new List(data.Fields); + } + newFields[i] = newFieldValue; + } + ++i; + } + return newFields == null ? data : new DBean(data.TType, data.ImplType, newFields); + } + + DType IDataFuncVisitor2.Accept(DArray data, TType type) + { + TType eleType = type.ElementType; + List newDatas = null; + int index = 0; + foreach (var ele in data.Datas) + { + if (ele == null) + { + ++index; + continue; + } + DType newEle = ele.Apply(this, eleType); + if (newEle != ele) + { + if (newDatas == null) + { + newDatas = new List(data.Datas); + } + newDatas[index] = newEle; + } + ++index; + } + return newDatas == null ? data : new DArray(data.Type, newDatas); + } + + DType IDataFuncVisitor2.Accept(DList data, TType type) + { + TType eleType = type.ElementType; + List newDatas = null; + int index = 0; + foreach (var ele in data.Datas) + { + if (ele == null) + { + ++index; + continue; + } + DType newEle = ele.Apply(this, eleType); + if (newEle != ele) + { + if (newDatas == null) + { + newDatas = new List(data.Datas); + } + newDatas[index] = newEle; + } + ++index; + } + return newDatas == null ? data : new DList(data.Type, newDatas); + } + + DType IDataFuncVisitor2.Accept(DSet data, TType type) + { + TType eleType = type.ElementType; + List newDatas = null; + int index = 0; + foreach (var ele in data.Datas) + { + if (ele == null) + { + ++index; + continue; + } + DType newEle = ele.Apply(this, eleType); + if (newEle != ele) + { + if (newDatas == null) + { + newDatas = new List(data.Datas); + } + newDatas[index] = newEle; + } + ++index; + } + return newDatas == null ? data : new DSet(data.Type, newDatas); + } + + DType IDataFuncVisitor2.Accept(DMap data, TType type) + { + TMap mapType = (TMap)type; + bool dirty = false; + foreach (var ele in data.Datas) + { + DType newKey = ele.Key.Apply(this, mapType.KeyType); + DType newValue = ele.Value.Apply(this, mapType.ValueType); + if (newKey != ele.Key || newValue != ele.Value) + { + dirty = true; + break; + } + } + if (!dirty) + { + return data; + } + + var newDatas = new Dictionary(); + foreach (var ele in data.Datas) + { + DType newKey = ele.Key.Apply(this, mapType.KeyType); + DType newValue = ele.Value.Apply(this, mapType.ValueType); + newDatas[newKey] = newValue; + } + return new DMap(data.Type, newDatas); + } +} diff --git a/luban/src/Luban.Core/DataTransformer/DataTransformerAttribute.cs b/luban/src/Luban.Core/DataTransformer/DataTransformerAttribute.cs new file mode 100644 index 00000000..727b2dc2 --- /dev/null +++ b/luban/src/Luban.Core/DataTransformer/DataTransformerAttribute.cs @@ -0,0 +1,16 @@ +using Luban.CustomBehaviour; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.DataTransformer; + +[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] +public class DataTransformerAttribute : BehaviourBaseAttribute +{ + public DataTransformerAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/DataTransformer/IDataTransformer.cs b/luban/src/Luban.Core/DataTransformer/IDataTransformer.cs new file mode 100644 index 00000000..88be9f03 --- /dev/null +++ b/luban/src/Luban.Core/DataTransformer/IDataTransformer.cs @@ -0,0 +1,14 @@ +using Luban.Datas; +using Luban.Types; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.DataTransformer; + +public interface IDataTransformer +{ + DType Transform(DType originalData, TType type); +} diff --git a/luban/src/Luban.Core/DataVisitors/DataActionHelpVisitor.cs b/luban/src/Luban.Core/DataVisitors/DataActionHelpVisitor.cs new file mode 100644 index 00000000..000a94ce --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/DataActionHelpVisitor.cs @@ -0,0 +1,241 @@ +using Luban.Datas; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static System.Runtime.InteropServices.JavaScript.JSType; + +namespace Luban.DataVisitors; + +public class DataActionHelpVisitor : IDataActionVisitor +{ + private readonly IDataActionVisitor _underlyingVisitor; + + public DataActionHelpVisitor(IDataActionVisitor underlyingVisitor) + { + _underlyingVisitor = underlyingVisitor; + } + + public void Accept(DBool type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DByte type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DShort type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DInt type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DLong type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DFloat type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DDouble type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DEnum type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DString type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DDateTime type, T x) + { + _underlyingVisitor.Accept(type, x); + } + + public void Accept(DBean type, T x) + { + _underlyingVisitor.Accept(type, x); + foreach (var fieldValue in type.Fields) + { + if (fieldValue == null) + { + continue; + } + fieldValue.Apply(this, x); + } + } + + public void Accept(DArray type, T x) + { + _underlyingVisitor.Accept(type, x); + foreach (var e in type.Datas) + { + if (e != null) + { + e.Apply(this, x); + } + } + } + + public void Accept(DList type, T x) + { + _underlyingVisitor.Accept(type, x); + foreach (var e in type.Datas) + { + if (e != null) + { + e.Apply(this, x); + } + } + } + + public void Accept(DSet type, T x) + { + _underlyingVisitor.Accept(type, x); + foreach (var e in type.Datas) + { + e.Apply(this, x); + } + } + + public void Accept(DMap type, T x) + { + _underlyingVisitor.Accept(type, x); + foreach (var e in type.Datas) + { + e.Key.Apply(this, x); + e.Value.Apply(this, x); + } + } +} + +public class DataActionHelpVisitor : IDataActionVisitor +{ + private readonly IDataActionVisitor _underlyingVisitor; + + public DataActionHelpVisitor(IDataActionVisitor underlyingVisitor) + { + _underlyingVisitor = underlyingVisitor; + } + + public void Accept(DBool type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DByte type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DShort type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DInt type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DLong type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DFloat type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DDouble type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DEnum type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DString type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DDateTime type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + } + + public void Accept(DBean type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + foreach (var fieldValue in type.Fields) + { + if (fieldValue == null) + { + continue; + } + fieldValue.Apply(this, x, y); + } + } + + public void Accept(DArray type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + foreach (var e in type.Datas) + { + if (e != null) + { + e.Apply(this, x, y); + } + } + } + + public void Accept(DList type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + foreach (var e in type.Datas) + { + if (e != null) + { + e.Apply(this, x, y); + } + } + } + + public void Accept(DSet type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + foreach (var e in type.Datas) + { + e.Apply(this, x, y); + } + } + + public void Accept(DMap type, T1 x, T2 y) + { + _underlyingVisitor.Accept(type, x, y); + foreach (var e in type.Datas) + { + e.Key.Apply(this, x, y); + e.Value.Apply(this, x, y); + } + } +} diff --git a/luban/src/Luban.Core/DataVisitors/DataActionHelpVisitor2.cs b/luban/src/Luban.Core/DataVisitors/DataActionHelpVisitor2.cs new file mode 100644 index 00000000..69244c51 --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/DataActionHelpVisitor2.cs @@ -0,0 +1,255 @@ +using Luban.Datas; +using Luban.Types; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.DataVisitors; + +public class DataActionHelpVisitor2 : IDataActionVisitor2 +{ + private readonly IDataActionVisitor2 _underlyingVisitor; + + public DataActionHelpVisitor2(IDataActionVisitor2 underlyingVisitor) + { + _underlyingVisitor = underlyingVisitor; + } + + public void Accept(DBool data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DByte data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DShort data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DInt data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DLong data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DFloat data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DDouble data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DEnum data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DString data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DDateTime data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + } + + public void Accept(DBean data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + var defFields = data.ImplType.HierarchyFields; + int i = 0; + foreach (var fieldValue in data.Fields) + { + if (fieldValue == null) + { + i++; + continue; + } + var defField = defFields[i++]; + var fieldType = defField.CType; + fieldValue.Apply(this, fieldType, x); + } + } + + public void Accept(DArray data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + foreach (var ele in data.Datas) + { + if (ele == null) + { + continue; + } + ele.Apply(this, type.ElementType, x); + } + } + + public void Accept(DList data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + foreach (var ele in data.Datas) + { + if (ele == null) + { + continue; + } + ele.Apply(this, type.ElementType, x); + } + } + + public void Accept(DSet data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + foreach (var ele in data.Datas) + { + ele.Apply(this, type.ElementType, x); + } + } + + public void Accept(DMap data, TType type, T x) + { + _underlyingVisitor.Accept(data, type, x); + TMap mapType = (TMap)type; + foreach (var e in data.Datas) + { + e.Key.Apply(this, mapType.KeyType, x); + e.Value.Apply(this, mapType.ValueType, x); + } + } +} + +public class DataActionHelpVisitor2 : IDataActionVisitor2 +{ + private readonly IDataActionVisitor2 _underlyingVisitor; + + public DataActionHelpVisitor2(IDataActionVisitor2 underlyingVisitor) + { + _underlyingVisitor = underlyingVisitor; + } + + public void Accept(DBool data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DByte data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DShort data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DInt data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DLong data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DFloat data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DDouble data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DEnum data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DString data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DDateTime data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + } + + public void Accept(DBean data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + var defFields = data.ImplType.HierarchyFields; + int i = 0; + foreach (var fieldValue in data.Fields) + { + if (fieldValue == null) + { + i++; + continue; + } + var defField = defFields[i++]; + var fieldType = defField.CType; + fieldValue.Apply(this, fieldType, x, y); + } + } + + public void Accept(DArray data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + foreach (var e in data.Datas) + { + if (e != null) + { + e.Apply(this, type.ElementType, x, y); + } + } + } + + public void Accept(DList data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + foreach (var e in data.Datas) + { + if (e != null) + { + e.Apply(this, type.ElementType, x, y); + } + } + } + + public void Accept(DSet data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + foreach (var e in data.Datas) + { + e.Apply(this, type.ElementType, x, y); + } + } + + public void Accept(DMap data, TType type, T1 x, T2 y) + { + _underlyingVisitor.Accept(data, type, x, y); + TMap mapType = (TMap)type; + foreach (var e in data.Datas) + { + e.Key.Apply(this, mapType.KeyType, x, y); + e.Value.Apply(this, mapType.ValueType, x, y); + } + } +} diff --git a/luban/src/Luban.Core/DataVisitors/IDataActionVisitor.cs b/luban/src/Luban.Core/DataVisitors/IDataActionVisitor.cs new file mode 100644 index 00000000..5b92c2b8 --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/IDataActionVisitor.cs @@ -0,0 +1,69 @@ +using Luban.Datas; + +namespace Luban.DataVisitors; + +public interface IDataActionVisitor +{ + void Accept(DBool type, T x); + + void Accept(DByte type, T x); + + void Accept(DShort type, T x); + + void Accept(DInt type, T x); + + void Accept(DLong type, T x); + + void Accept(DFloat type, T x); + + void Accept(DDouble type, T x); + + void Accept(DEnum type, T x); + + void Accept(DString type, T x); + + void Accept(DDateTime type, T x); + + void Accept(DBean type, T x); + + void Accept(DArray type, T x); + + void Accept(DList type, T x); + + void Accept(DSet type, T x); + + void Accept(DMap type, T x); +} + +public interface IDataActionVisitor +{ + void Accept(DBool type, T1 x, T2 y); + + void Accept(DByte type, T1 x, T2 y); + + void Accept(DShort type, T1 x, T2 y); + + void Accept(DInt type, T1 x, T2 y); + + void Accept(DLong type, T1 x, T2 y); + + void Accept(DFloat type, T1 x, T2 y); + + void Accept(DDouble type, T1 x, T2 y); + + void Accept(DEnum type, T1 x, T2 y); + + void Accept(DString type, T1 x, T2 y); + + void Accept(DDateTime type, T1 x, T2 y); + + void Accept(DBean type, T1 x, T2 y); + + void Accept(DArray type, T1 x, T2 y); + + void Accept(DList type, T1 x, T2 y); + + void Accept(DSet type, T1 x, T2 y); + + void Accept(DMap type, T1 x, T2 y); +} diff --git a/luban/src/Luban.Core/DataVisitors/IDataActionVisitor2.cs b/luban/src/Luban.Core/DataVisitors/IDataActionVisitor2.cs new file mode 100644 index 00000000..8157600a --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/IDataActionVisitor2.cs @@ -0,0 +1,70 @@ +using Luban.Datas; +using Luban.Types; + +namespace Luban.DataVisitors; + +public interface IDataActionVisitor2 +{ + void Accept(DBool data, TType type, T x); + + void Accept(DByte data, TType type, T x); + + void Accept(DShort data, TType type, T x); + + void Accept(DInt data, TType type, T x); + + void Accept(DLong data, TType type, T x); + + void Accept(DFloat data, TType type, T x); + + void Accept(DDouble data, TType type, T x); + + void Accept(DEnum data, TType type, T x); + + void Accept(DString data, TType type, T x); + + void Accept(DDateTime data, TType type, T x); + + void Accept(DBean data, TType type, T x); + + void Accept(DArray data, TType type, T x); + + void Accept(DList data, TType type, T x); + + void Accept(DSet data, TType type, T x); + + void Accept(DMap data, TType type, T x); +} + +public interface IDataActionVisitor2 +{ + void Accept(DBool data, TType type, T1 x, T2 y); + + void Accept(DByte data, TType type, T1 x, T2 y); + + void Accept(DShort data, TType type, T1 x, T2 y); + + void Accept(DInt data, TType type, T1 x, T2 y); + + void Accept(DLong data, TType type, T1 x, T2 y); + + void Accept(DFloat data, TType type, T1 x, T2 y); + + void Accept(DDouble data, TType type, T1 x, T2 y); + + void Accept(DEnum data, TType type, T1 x, T2 y); + + void Accept(DString data, TType type, T1 x, T2 y); + + void Accept(DDateTime data, TType type, T1 x, T2 y); + + void Accept(DBean data, TType type, T1 x, T2 y); + + void Accept(DArray data, TType type, T1 x, T2 y); + + void Accept(DList data, TType type, T1 x, T2 y); + + void Accept(DSet data, TType type, T1 x, T2 y); + + void Accept(DMap data, TType type, T1 x, T2 y); +} diff --git a/luban/src/Luban.Core/DataVisitors/IDataFuncVisitor.cs b/luban/src/Luban.Core/DataVisitors/IDataFuncVisitor.cs new file mode 100644 index 00000000..10af1e2c --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/IDataFuncVisitor.cs @@ -0,0 +1,102 @@ +using Luban.Datas; + +namespace Luban.DataVisitors; + +public interface IDataFuncVisitor +{ + TR Accept(DBool type); + + TR Accept(DByte type); + + TR Accept(DShort type); + + TR Accept(DInt type); + + TR Accept(DLong type); + + TR Accept(DFloat type); + + TR Accept(DDouble type); + + TR Accept(DEnum type); + + TR Accept(DString type); + + TR Accept(DDateTime type); + + TR Accept(DBean type); + + TR Accept(DArray type); + + TR Accept(DList type); + + TR Accept(DSet type); + + TR Accept(DMap type); +} + +public interface IDataFuncVisitor +{ + TR Accept(DBool type, T x); + + TR Accept(DByte type, T x); + + TR Accept(DShort type, T x); + + TR Accept(DInt type, T x); + + TR Accept(DLong type, T x); + + TR Accept(DFloat type, T x); + + TR Accept(DDouble type, T x); + + TR Accept(DEnum type, T x); + + TR Accept(DString type, T x); + + TR Accept(DDateTime type, T x); + + TR Accept(DBean type, T x); + + TR Accept(DArray type, T x); + + TR Accept(DList type, T x); + + TR Accept(DSet type, T x); + + TR Accept(DMap type, T x); +} + +public interface IDataFuncVisitor +{ + TR Accept(DBool type, T1 x, T2 y); + + TR Accept(DByte type, T1 x, T2 y); + + TR Accept(DShort type, T1 x, T2 y); + + TR Accept(DInt type, T1 x, T2 y); + TR Accept(DLong type, T1 x, T2 y); + + TR Accept(DFloat type, T1 x, T2 y); + + TR Accept(DDouble type, T1 x, T2 y); + + TR Accept(DEnum type, T1 x, T2 y); + + TR Accept(DString type, T1 x, T2 y); + + TR Accept(DDateTime type, T1 x, T2 y); + + TR Accept(DBean type, T1 x, T2 y); + + TR Accept(DArray type, T1 x, T2 y); + + TR Accept(DList type, T1 x, T2 y); + + TR Accept(DSet type, T1 x, T2 y); + + TR Accept(DMap type, T1 x, T2 y); +} + diff --git a/luban/src/Luban.Core/DataVisitors/IDataFuncVisitor2.cs b/luban/src/Luban.Core/DataVisitors/IDataFuncVisitor2.cs new file mode 100644 index 00000000..28ebc190 --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/IDataFuncVisitor2.cs @@ -0,0 +1,108 @@ +using Luban.Datas; +using Luban.Types; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.DataVisitors; + +public interface IDataFuncVisitor2 +{ + TR Accept(DBool data, TType type); + + TR Accept(DByte data, TType type); + + TR Accept(DShort data, TType type); + + TR Accept(DInt data, TType type); + + TR Accept(DLong data, TType type); + + TR Accept(DFloat data, TType type); + + TR Accept(DDouble data, TType type); + + TR Accept(DEnum data, TType type); + + TR Accept(DString data, TType type); + + TR Accept(DDateTime data, TType type); + + TR Accept(DBean data, TType type); + + TR Accept(DArray data, TType type); + + TR Accept(DList data, TType type); + + TR Accept(DSet data, TType type); + + TR Accept(DMap data, TType type); +} + +public interface IDataFuncVisitor2 +{ + TR Accept(DBool data, TType type, T x); + + TR Accept(DByte data, TType type, T x); + + TR Accept(DShort data, TType type, T x); + + TR Accept(DInt data, TType type, T x); + + TR Accept(DLong data, TType type, T x); + + TR Accept(DFloat data, TType type, T x); + + TR Accept(DDouble data, TType type, T x); + + TR Accept(DEnum data, TType type, T x); + + TR Accept(DString data, TType type, T x); + + TR Accept(DDateTime data, TType type, T x); + + TR Accept(DBean data, TType type, T x); + + TR Accept(DArray data, TType type, T x); + + TR Accept(DList data, TType type, T x); + + TR Accept(DSet data, TType type, T x); + + TR Accept(DMap data, TType type, T x); +} + +public interface IDataFuncVisitor2 +{ + TR Accept(DBool data, TType type, T1 x, T2 y); + + TR Accept(DByte data, TType type, T1 x, T2 y); + + TR Accept(DShort data, TType type, T1 x, T2 y); + + TR Accept(DInt data, TType type, T1 x, T2 y); + TR Accept(DLong data, TType type, T1 x, T2 y); + + TR Accept(DFloat data, TType type, T1 x, T2 y); + + TR Accept(DDouble data, TType type, T1 x, T2 y); + + TR Accept(DEnum data, TType type, T1 x, T2 y); + + TR Accept(DString data, TType type, T1 x, T2 y); + + TR Accept(DDateTime data, TType type, T1 x, T2 y); + + TR Accept(DBean data, TType type, T1 x, T2 y); + + TR Accept(DArray data, TType type, T1 x, T2 y); + + TR Accept(DList data, TType type, T1 x, T2 y); + + TR Accept(DSet data, TType type, T1 x, T2 y); + + TR Accept(DMap data, TType type, T1 x, T2 y); +} + diff --git a/luban/src/Luban.Core/DataVisitors/IsDefaultValueVisitor.cs b/luban/src/Luban.Core/DataVisitors/IsDefaultValueVisitor.cs new file mode 100644 index 00000000..ee5b800a --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/IsDefaultValueVisitor.cs @@ -0,0 +1,84 @@ +using System.Numerics; +using Luban.Datas; + +namespace Luban.DataVisitors; + +public class IsDefaultValueVisitor : IDataFuncVisitor +{ + public static IsDefaultValueVisitor Ins { get; } = new(); + + public bool Accept(DBool type) + { + return type.Value == false; + } + + public bool Accept(DByte type) + { + return type.Value == 0; + } + + public bool Accept(DShort type) + { + return type.Value == 0; + } + + public bool Accept(DInt type) + { + return type.Value == 0; + } + + public bool Accept(DLong type) + { + return type.Value == 0; + } + + public bool Accept(DFloat type) + { + return type.Value == 0; + } + + public bool Accept(DDouble type) + { + return type.Value == 0; + } + + public bool Accept(DEnum type) + { + return type.Value == 0; + } + + public bool Accept(DString type) + { + return string.IsNullOrEmpty(type.Value); + } + + public bool Accept(DBean type) + { + return false; + } + + public bool Accept(DArray type) + { + return type.Datas.Count == 0; + } + + public bool Accept(DList type) + { + return type.Datas.Count == 0; + } + + public bool Accept(DSet type) + { + return type.Datas.Count == 0; + } + + public bool Accept(DMap type) + { + return type.Datas.Count == 0; + } + + public bool Accept(DDateTime type) + { + return false; + } +} diff --git a/luban/src/Luban.Core/DataVisitors/IsSimpleLiteralDataVisitor.cs b/luban/src/Luban.Core/DataVisitors/IsSimpleLiteralDataVisitor.cs new file mode 100644 index 00000000..a12a92cf --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/IsSimpleLiteralDataVisitor.cs @@ -0,0 +1,83 @@ +using Luban.Datas; + +namespace Luban.DataVisitors; + +public class IsSimpleLiteralDataVisitor : IDataFuncVisitor +{ + public static IsSimpleLiteralDataVisitor Ins { get; } = new(); + + public bool Accept(DBool type) + { + return true; + } + + public bool Accept(DByte type) + { + return true; + } + + public bool Accept(DShort type) + { + return true; + } + + public bool Accept(DInt type) + { + return true; + } + + public bool Accept(DLong type) + { + return true; + } + + public bool Accept(DFloat type) + { + return true; + } + + public bool Accept(DDouble type) + { + return true; + } + + public bool Accept(DEnum type) + { + return true; + } + + public bool Accept(DString type) + { + return true; + } + + public bool Accept(DDateTime type) + { + return true; + } + + public bool Accept(DBean type) + { + return false; + } + + public bool Accept(DArray type) + { + return false; + } + + public bool Accept(DList type) + { + return false; + } + + public bool Accept(DSet type) + { + return false; + } + + public bool Accept(DMap type) + { + return false; + } +} diff --git a/luban/src/Luban.Core/DataVisitors/TableVisitor.cs b/luban/src/Luban.Core/DataVisitors/TableVisitor.cs new file mode 100644 index 00000000..cda412b9 --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/TableVisitor.cs @@ -0,0 +1,76 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Utils; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.DataVisitors; + +public class TableVisitor +{ + public static TableVisitor Ins { get; } = new(); + + public void Visit(DefTable table, IDataActionVisitor visitor, T arg) + { + var records = GenerationContext.Current.GetTableAllDataList(table); + Visit(table, records, visitor, arg); + } + + public void Visit(DefTable table, IDataActionVisitor2 visitor, T arg) + { + var records = GenerationContext.Current.GetTableAllDataList(table); + Visit(table, records, visitor, arg); + } + + public void Visit(DefTable table, IDataActionVisitor visitor, T1 a1, T2 a2) + { + var records = GenerationContext.Current.GetTableAllDataList(table); + Visit(table, records, visitor, a1, a2); + } + + public void Visit(DefTable table, IDataActionVisitor2 visitor, T1 a1, T2 a2) + { + var records = GenerationContext.Current.GetTableAllDataList(table); + Visit(table, records, visitor, a1, a2); + } + + public void Visit(DefTable table, List records, IDataActionVisitor visitor, T arg) + { + foreach (Record r in records) + { + DBean data = r.Data; + data.Apply(visitor, arg); + } + } + + public void Visit(DefTable table, List records, IDataActionVisitor2 visitor, T arg) + { + foreach (Record r in records) + { + DBean data = r.Data; + data.Apply(visitor, table.ValueTType, arg); + } + } + + public void Visit(DefTable table, List records, IDataActionVisitor visitor, T1 a1, T2 a2) + { + foreach (Record r in records) + { + DBean data = r.Data; + data.Apply(visitor, a1, a2); + } + } + + public void Visit(DefTable table, List records, IDataActionVisitor2 visitor, T1 a1, T2 a2) + { + foreach (Record r in records) + { + DBean data = r.Data; + data.Apply(visitor, table.ValueTType, a1, a2); + } + } +} diff --git a/luban/src/Luban.Core/DataVisitors/ToLiteralVisitorBase.cs b/luban/src/Luban.Core/DataVisitors/ToLiteralVisitorBase.cs new file mode 100644 index 00000000..12c58e3d --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/ToLiteralVisitorBase.cs @@ -0,0 +1,67 @@ +using Luban.Datas; +using Luban.Utils; + +namespace Luban.DataVisitors; + +public abstract class ToLiteralVisitorBase : IDataFuncVisitor +{ + public virtual string Accept(DBool type) + { + return type.Value ? "true" : "false"; + } + + public string Accept(DByte type) + { + return type.Value.ToString(); + } + + public string Accept(DShort type) + { + return type.Value.ToString(); + } + + public string Accept(DInt type) + { + return type.Value.ToString(); + } + + public string Accept(DLong type) + { + return type.Value.ToString(); + } + + public string Accept(DFloat type) + { + return type.Value.ToString(); + } + + public string Accept(DDouble type) + { + return type.Value.ToString(); + } + + public virtual string Accept(DEnum type) + { + return type.Value.ToString(); + } + + public virtual string Accept(DString type) + { + return "\"" + DataUtil.EscapeString(type.Value) + "\""; + } + + public virtual string Accept(DDateTime type) + { + return type.UnixTimeOfCurrentContext().ToString(); + } + + public abstract string Accept(DBean type); + + public abstract string Accept(DArray type); + + public abstract string Accept(DList type); + + public abstract string Accept(DSet type); + + public abstract string Accept(DMap type); +} diff --git a/luban/src/Luban.Core/DataVisitors/ToStringVisitor.cs b/luban/src/Luban.Core/DataVisitors/ToStringVisitor.cs new file mode 100644 index 00000000..571a47c7 --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/ToStringVisitor.cs @@ -0,0 +1,86 @@ +using System.Text; +using Luban.Datas; + +namespace Luban.DataVisitors; + +public class ToStringVisitor : ToLiteralVisitorBase +{ + public static ToStringVisitor Ins { get; } = new(); + + public override string Accept(DBean type) + { + var x = new StringBuilder(); + if (type.Type.IsAbstractType) + { + x.Append($"{{ _name:\"{type.ImplType.Name}\","); + } + else + { + x.Append('{'); + } + + int index = 0; + foreach (var f in type.Fields) + { + var defField = type.ImplType.HierarchyFields[index++]; + x.Append(defField.Name).Append(':'); + if (f != null) + { + x.Append(f.Apply(this)); + } + else + { + x.Append("null"); + } + x.Append(','); + } + x.Append('}'); + return x.ToString(); + } + + + private void Append(List datas, StringBuilder x) + { + x.Append('['); + foreach (var e in datas) + { + x.Append(e.Apply(this)).Append(','); + } + x.Append(']'); + } + + public override string Accept(DArray type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DList type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DSet type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DMap type) + { + var x = new StringBuilder(); + x.Append('{'); + foreach (var e in type.Datas) + { + x.Append('"').Append(e.Key.ToString()).Append('"'); + x.Append(':'); + x.Append(e.Value.Apply(this)).Append(','); + } + x.Append('}'); + return x.ToString(); + } +} diff --git a/luban/src/Luban.Core/DataVisitors/ToStringVisitor2.cs b/luban/src/Luban.Core/DataVisitors/ToStringVisitor2.cs new file mode 100644 index 00000000..0787b331 --- /dev/null +++ b/luban/src/Luban.Core/DataVisitors/ToStringVisitor2.cs @@ -0,0 +1,14 @@ +using Luban.Datas; +using Luban.Utils; + +namespace Luban.DataVisitors; + +public class ToStringVisitor2 : ToStringVisitor +{ + public new static ToStringVisitor2 Ins { get; } = new(); + + public override string Accept(DString type) + { + return DataUtil.EscapeString(type.Value); + } +} diff --git a/luban/src/Luban.Core/Datas/DArray.cs b/luban/src/Luban.Core/Datas/DArray.cs new file mode 100644 index 00000000..b1ab3985 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DArray.cs @@ -0,0 +1,84 @@ +using Luban.DataVisitors; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Datas; + +public class DArray : DType +{ + public TArray Type { get; } + public List Datas { get; } + + public override string TypeName => "array"; + + public DArray(TArray type, List datas) + { + this.Type = type; + this.Datas = datas; + } + + public override bool Equals(object obj) + { + return obj is DArray d && DataUtil.IsCollectionEqual(Datas, d.Datas); + } + + public override int GetHashCode() + { + throw new System.NotSupportedException(); + } + + public override int CompareTo(DType other) + { + throw new System.NotSupportedException(); + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } +} diff --git a/luban/src/Luban.Core/Datas/DBean.cs b/luban/src/Luban.Core/Datas/DBean.cs new file mode 100644 index 00000000..fd895fdf --- /dev/null +++ b/luban/src/Luban.Core/Datas/DBean.cs @@ -0,0 +1,103 @@ +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Datas; + +public class DBean : DType +{ + public TBean TType { get; } + + public DefBean Type => (DefBean)TType.DefBean; + + public DefBean ImplType { get; } + + public List Fields { get; } + + public override string TypeName => "bean"; + + public DBean(TBean defType, DefBean implType, List fields) + { + this.TType = defType; + this.ImplType = implType; + this.Fields = fields; + } + + public override bool Equals(object obj) + { + return obj is DBean d && string.Equals(ImplType?.FullName, d.ImplType?.FullName) && DataUtil.IsCollectionEqual(Fields, d.Fields); + } + + public override int GetHashCode() + { + throw new System.NotSupportedException(); + } + + public override int CompareTo(DType other) + { + throw new System.NotSupportedException(); + } + + public DType GetField(string fieldName) + { + if (ImplType.TryGetField(fieldName, out var _, out var findex)) + { + return Fields[findex]; + } + else + { + return null; + } + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } +} diff --git a/luban/src/Luban.Core/Datas/DBool.cs b/luban/src/Luban.Core/Datas/DBool.cs new file mode 100644 index 00000000..6bf09530 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DBool.cs @@ -0,0 +1,91 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DBool : DType +{ + + private static readonly DBool s_false = new(false); + private static readonly DBool s_true = new(true); + + public static DBool ValueOf(bool x) + { + return x ? s_true : s_false; + } + + public override string TypeName => "bool"; + + private DBool(bool x) : base(x) + { + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + public override bool Equals(object obj) + { + return obj is DBool o && o.Value == this.Value; + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DBool d) + { + return this.Value.CompareTo(d.Value); + } + throw new System.NotSupportedException(); + } +} diff --git a/luban/src/Luban.Core/Datas/DByte.cs b/luban/src/Luban.Core/Datas/DByte.cs new file mode 100644 index 00000000..be294f71 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DByte.cs @@ -0,0 +1,96 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DByte : DType +{ + public static DByte Default { get; } = new(0); + + public static DByte ValueOf(byte x) + { + if (x == 0) + { + return Default; + } + else + { + return new DByte(x); + } + } + + public override string TypeName => "byte"; + + private DByte(byte x) : base(x) + { + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + public override bool Equals(object obj) + { + return obj is DByte o && o.Value == this.Value; + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DByte d) + { + return this.Value.CompareTo(d.Value); + } + throw new System.NotSupportedException(); + } +} diff --git a/luban/src/Luban.Core/Datas/DDateTime.cs b/luban/src/Luban.Core/Datas/DDateTime.cs new file mode 100644 index 00000000..453b9e76 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DDateTime.cs @@ -0,0 +1,98 @@ +using Luban.DataVisitors; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Datas; + +public class DDateTime : DType +{ + public DateTime Time { get; } + + public override string TypeName => "datetime"; + + public DDateTime(DateTime time) + { + + this.Time = time; + } + + public override bool Equals(object obj) + { + return obj is DDateTime d && Time == d.Time; + } + + public override int GetHashCode() + { + return Time.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DDateTime d) + { + return this.Time.CompareTo(d.Time); + } + throw new System.NotSupportedException(); + } + + public string ToFormatString() + { + return DataUtil.FormatDateTime(Time); + } + + public long GetUnixTime(TimeZoneInfo asTimeZone) + { + var destDateTime = TimeZoneInfo.ConvertTime(Time, asTimeZone, TimeZoneInfo.Utc); + return new DateTimeOffset(destDateTime).ToUnixTimeSeconds(); + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } +} diff --git a/luban/src/Luban.Core/Datas/DDouble.cs b/luban/src/Luban.Core/Datas/DDouble.cs new file mode 100644 index 00000000..c3addd92 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DDouble.cs @@ -0,0 +1,89 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DDouble : DType +{ + public static DDouble Default { get; } = new(0); + + public static DDouble ValueOf(double x) + { + return x == 0 ? Default : new DDouble(x); + } + + public override string TypeName => "double"; + + private DDouble(double x) : base(x) + { + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + public override bool Equals(object obj) + { + return obj is DDouble o && o.Value == this.Value; + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DDouble d) + { + return this.Value.CompareTo(d.Value); + } + throw new System.NotSupportedException(); + } +} diff --git a/luban/src/Luban.Core/Datas/DEnum.cs b/luban/src/Luban.Core/Datas/DEnum.cs new file mode 100644 index 00000000..b6c5af8d --- /dev/null +++ b/luban/src/Luban.Core/Datas/DEnum.cs @@ -0,0 +1,105 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DEnum : DType +{ + public int Value { get; } + + public string StrValue { get; } + + public TEnum Type { get; } + + public override string TypeName => "enum"; + + public DEnum(TEnum type, string value) + { + Type = type; + StrValue = value; + + Value = type.DefEnum.GetValueByNameOrAlias(value); + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + public override string ToString() + { + return $"{StrValue}({Value})"; + } + + public override bool Equals(object obj) + { + switch (obj) + { + case DInt dint: + return this.Value == dint.Value; + case DEnum denum: + return this.Value == denum.Value; + default: + return false; + } + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DEnum d) + { + return this.Value.CompareTo(d.Value); + } + throw new System.NotSupportedException(); + } +} diff --git a/luban/src/Luban.Core/Datas/DFloat.cs b/luban/src/Luban.Core/Datas/DFloat.cs new file mode 100644 index 00000000..0c9b3a0b --- /dev/null +++ b/luban/src/Luban.Core/Datas/DFloat.cs @@ -0,0 +1,93 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DFloat : DType +{ + public static DFloat Default { get; } = new(0); + + public override string TypeName => "float"; + + public static DFloat ValueOf(float x) + { + if (x == 0) + { + return Default; + } + return new DFloat(x); + } + + private DFloat(float x) : base(x) + { + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + public override bool Equals(object obj) + { + return obj is DFloat o && o.Value == this.Value; + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DFloat d) + { + return this.Value.CompareTo(d.Value); + } + throw new System.NotSupportedException(); + } +} diff --git a/luban/src/Luban.Core/Datas/DInt.cs b/luban/src/Luban.Core/Datas/DInt.cs new file mode 100644 index 00000000..0445b9ca --- /dev/null +++ b/luban/src/Luban.Core/Datas/DInt.cs @@ -0,0 +1,112 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DInt : DType +{ + private const int POOL_SIZE = 128; + private static readonly DInt[] s_pool = new DInt[POOL_SIZE]; + + static DInt() + { + for (int i = 0; i < POOL_SIZE; i++) + { + s_pool[i] = new DInt(i); + } + } + + public static DInt Default => s_pool[0]; + + public static DInt ValueOf(int x) + { + if (x >= 0 && x < POOL_SIZE) + { + return s_pool[x]; + } + return new DInt(x); + } + + public override string TypeName => "int"; + + private DInt(int x) : base(x) + { + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + public override bool Equals(object obj) + { + switch (obj) + { + case DInt dint: + return this.Value == dint.Value; + case DEnum denum: + return this.Value == denum.Value; + default: + return false; + } + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DInt d) + { + return this.Value.CompareTo(d.Value); + } + throw new System.NotSupportedException(); + } +} diff --git a/luban/src/Luban.Core/Datas/DList.cs b/luban/src/Luban.Core/Datas/DList.cs new file mode 100644 index 00000000..9894c1ef --- /dev/null +++ b/luban/src/Luban.Core/Datas/DList.cs @@ -0,0 +1,92 @@ +using Luban.DataVisitors; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Datas; + +public class DList : DType +{ + public TList Type { get; } + public List Datas { get; } + + public override string TypeName => "list"; + + public DList(TList type, List datas) + { + this.Type = type; + this.Datas = datas; + } + + + public override bool Equals(object obj) + { + return obj is DList d && DataUtil.IsCollectionEqual(Datas, d.Datas); + } + + public override int GetHashCode() + { + throw new System.NotSupportedException(); + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + //public override bool Equals(object obj) + //{ + // if (obj is DList o) + // { + // return o.Datas.Count == this.Datas.Count && o.Datas.SequenceEqual(this.Datas); + // } + // else + // { + // return false; + // } + //} +} diff --git a/luban/src/Luban.Core/Datas/DLong.cs b/luban/src/Luban.Core/Datas/DLong.cs new file mode 100644 index 00000000..43380fe6 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DLong.cs @@ -0,0 +1,103 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DLong : DType +{ + public static DLong Default { get; } = new(0); + private const int POOL_SIZE = 128; + private static readonly DLong[] s_pool = new DLong[POOL_SIZE]; + + static DLong() + { + for (int i = 0; i < POOL_SIZE; i++) + { + s_pool[i] = new DLong(i); + } + } + + public static DLong ValueOf(long x) + { + if (x >= 0 && x < POOL_SIZE) + { + return s_pool[x]; + } + return new DLong(x); + } + + public override string TypeName => "long"; + + private DLong(long x) : base(x) + { + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + public override bool Equals(object obj) + { + return obj is DLong o && o.Value == this.Value; + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DLong d) + { + return this.Value.CompareTo(d.Value); + } + throw new System.NotSupportedException(); + } +} diff --git a/luban/src/Luban.Core/Datas/DMap.cs b/luban/src/Luban.Core/Datas/DMap.cs new file mode 100644 index 00000000..01a04998 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DMap.cs @@ -0,0 +1,87 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DMap : DType +{ + public TMap Type { get; } + public Dictionary Datas { get; } + + public override string TypeName => "map"; + + public DMap(TMap type, Dictionary datas) + { + this.Type = type; + this.Datas = datas; + + var set = new HashSet(); + foreach (var key in datas.Keys) + { + if (!set.Add(key)) + { + throw new Exception($"set 的 value:{key} 重复"); + } + } + } + + public override bool Equals(object obj) + { + return obj is DMap d && Datas.Count == d.Datas.Count && Datas.All(e => d.Datas.TryGetValue(e.Key, out var v) && object.Equals(e.Value, v)); + } + + public override int GetHashCode() + { + throw new System.NotSupportedException(); + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } +} diff --git a/luban/src/Luban.Core/Datas/DSet.cs b/luban/src/Luban.Core/Datas/DSet.cs new file mode 100644 index 00000000..4d6503f1 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DSet.cs @@ -0,0 +1,88 @@ +using Luban.DataVisitors; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Datas; + +public class DSet : DType +{ + public TSet Type { get; } + public List Datas { get; } + + public override string TypeName => "set"; + + public DSet(TSet type, List datas) + { + this.Type = type; + this.Datas = datas; + + var set = new HashSet(); + foreach (var data in datas) + { + if (!set.Add(data)) + { + throw new Exception($"set 的 value:{data} 重复"); + } + } + } + + public override bool Equals(object obj) + { + return obj is DList d && DataUtil.IsCollectionEqual(Datas, d.Datas); + } + + public override int GetHashCode() + { + throw new System.NotSupportedException(); + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } +} diff --git a/luban/src/Luban.Core/Datas/DShort.cs b/luban/src/Luban.Core/Datas/DShort.cs new file mode 100644 index 00000000..261e5188 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DShort.cs @@ -0,0 +1,89 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DShort : DType +{ + public static DShort Default { get; } = new(0); + + public static DShort ValueOf(short x) + { + return x == 0 ? Default : new DShort(x); + } + + public override string TypeName => "short"; + + private DShort(short x) : base(x) + { + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + public override bool Equals(object obj) + { + return obj is DShort o && o.Value == this.Value; + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DShort d) + { + return this.Value.CompareTo(d.Value); + } + throw new System.NotSupportedException(); + } +} diff --git a/luban/src/Luban.Core/Datas/DString.cs b/luban/src/Luban.Core/Datas/DString.cs new file mode 100644 index 00000000..52aef3a9 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DString.cs @@ -0,0 +1,105 @@ +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public class DString : DType +{ + private static readonly DString s_empty = new(""); + + public static DString ValueOf(TType type, string s) + { + if (s.Length == 0) + { + return s_empty; + } + + string escapeMode = type.GetTagOrDefault("escape", "0")?.ToLowerInvariant(); + switch (escapeMode) + { + case "0": + case "false": + return new DString(s); + case "1": + case "true": + return new DString(System.Text.RegularExpressions.Regex.Unescape(s)); + default: + throw new Exception($"unknown escape mode:{escapeMode}"); + } + } + + public override string TypeName => "string"; + + private DString(string x) : base(x) + { + } + + public override void Apply(IDataActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(IDataActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T x) + { + visitor.Accept(this, type, x); + } + + public override void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y) + { + visitor.Accept(this, type, x, y); + } + + public override TR Apply(IDataFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(IDataFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(IDataFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type) + { + return visitor.Accept(this, type); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T x) + { + return visitor.Accept(this, type, x); + } + + public override TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y) + { + return visitor.Accept(this, type, x, y); + } + + public override bool Equals(object obj) + { + return obj is DString o && o.Value == this.Value; + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override int CompareTo(DType other) + { + if (other is DString d) + { + return String.Compare(this.Value, d.Value, StringComparison.Ordinal); + } + throw new System.NotSupportedException(); + } +} diff --git a/luban/src/Luban.Core/Datas/DType.cs b/luban/src/Luban.Core/Datas/DType.cs new file mode 100644 index 00000000..9d7720e4 --- /dev/null +++ b/luban/src/Luban.Core/Datas/DType.cs @@ -0,0 +1,50 @@ + +using Luban.DataVisitors; +using Luban.Types; + +namespace Luban.Datas; + +public abstract class DType : System.IComparable +{ + public abstract void Apply(IDataActionVisitor visitor, T x); + + public abstract void Apply(IDataActionVisitor visitor, T1 x, T2 y); + + public abstract void Apply(IDataActionVisitor2 visitor, TType type, T x); + + public abstract void Apply(IDataActionVisitor2 visitor, TType type, T1 x, T2 y); + + public abstract TR Apply(IDataFuncVisitor visitor); + + public abstract TR Apply(IDataFuncVisitor visitor, T x); + + public abstract TR Apply(IDataFuncVisitor visitor, T1 x, T2 y); + + public abstract TR Apply(IDataFuncVisitor2 visitor, TType type); + + public abstract TR Apply(IDataFuncVisitor2 visitor, TType type, T x); + + public abstract TR Apply(IDataFuncVisitor2 visitor, TType type, T1 x, T2 y); + + public abstract string TypeName { get; } + + public override string ToString() + { + return this.Apply(ToStringVisitor.Ins); + } + + public virtual int CompareTo(DType other) + { + throw new System.NotSupportedException(); + } +} + +public abstract class DType : DType +{ + public T Value { get; } + + protected DType(T value) + { + Value = value; + } +} diff --git a/luban/src/Luban.Core/Defs/DefAssembly.cs b/luban/src/Luban.Core/Defs/DefAssembly.cs new file mode 100644 index 00000000..baf395d1 --- /dev/null +++ b/luban/src/Luban.Core/Defs/DefAssembly.cs @@ -0,0 +1,420 @@ +using Luban.RawDefs; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Defs; + +public class DefAssembly +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public Dictionary Types { get; } = new(); + + public List TypeList { get; } = new(); + + private readonly Dictionary _notCaseSenseTypes = new(); + + private readonly HashSet _namespaces = new(); + + private readonly Dictionary _notCaseSenseNamespaces = new(); + + private readonly List _targets; + + public RawTarget Target { get; } + + public IReadOnlyList Targets => _targets; + + public RawTarget GetTarget(string targetName) + { + return _targets.Find(t => t.Name == targetName); + } + + private readonly List _exportTables; + + public List ExportTables => _exportTables; + + private Dictionary _variants; + + public bool TryGetVariantName(string variantKey, out string variantName) + { + if (_variants == null) + { + variantName = ""; + return false; + } + return _variants.TryGetValue(variantKey, out variantName); + } + + public DefAssembly(RawAssembly assembly, string target, List outputTables, List groupDefs, Dictionary variants) + { + _targets = assembly.Targets; + Target = GetTarget(target); + if (Target == null) + { + throw new Exception($"target:{target} is invalid"); + } + _variants = variants; + + foreach (var g in assembly.RefGroups) + { + AddRefGroup(g); + } + + foreach (var e in assembly.Enums) + { + AddType(new DefEnum(e)); + } + + foreach (var b in assembly.Beans) + { + AddType(new DefBean(b)); + } + + foreach (var p in assembly.Tables) + { + var table = new DefTable(p); + AddType(table); + AddCfgTable(table); + } + + _targets.AddRange(assembly.Targets); + + List originTables = GetAllTables(); + if (outputTables.Count == 0) + { + _exportTables = originTables.Where(t => NeedExport(t.Groups, groupDefs)).ToList(); + } + else + { + _exportTables = new List(); + foreach (var tableName in outputTables) + { + DefTable table = GetCfgTable(tableName); + if (table != null) + { + _exportTables.Add(table); + } + else + { + throw new Exception($"outputTable:{tableName} not found"); + } + } + } + + foreach (var table in _exportTables) + { + table.IsExported = true; + } + + foreach (var type in TypeList) + { + type.Assembly = this; + } + + foreach (var type in TypeList) + { + type.PreCompile(); + } + foreach (var type in TypeList) + { + type.Compile(); + } + + foreach (var type in TypeList) + { + type.PostCompile(); + } + } + + public bool NeedExport(List groups, List groupDefs) + { + if (groups.Count == 0) + { + return groupDefs == null || Target.Groups.Any(g => groupDefs.FirstOrDefault(gd => gd.Names.Contains(g))?.IsDefault == true); + } + return groups.Any(g => Target.Groups.Contains(g)); + } + + + private readonly Dictionary _refGroups = new(); + + public Dictionary TablesByName { get; } = new(); + + public Dictionary TablesByFullName { get; } = new(); + + + private readonly Dictionary<(DefTypeBase, bool), TType> _cacheDefTTypes = new(); + + public void AddCfgTable(DefTable table) + { + if (!TablesByFullName.TryAdd(table.FullName, table)) + { + throw new Exception($"table:'{table.FullName}' duplicated"); + } + if (!TablesByName.TryAdd(table.Name, table)) + { + throw new Exception($"table:'{table.FullName} 与 table:'{TablesByName[table.Name].FullName}' 的表名重复(不同模块下也不允许定义同名表,将来可能会放开限制)"); + } + } + + public DefTable GetCfgTable(string name) + { + return TablesByFullName.TryGetValue(name, out var t) ? t : null; + } + + + public List GetAllTables() + { + return TypeList.Where(t => t is DefTable).Cast().ToList(); + } + + private void AddRefGroup(RawRefGroup g) + { + if (_refGroups.ContainsKey(g.Name)) + { + throw new Exception($"refgroup:{g.Name} 重复"); + } + _refGroups.Add(g.Name, new DefRefGroup(g)); + } + + public DefRefGroup GetRefGroup(string groupName) + { + return _refGroups.TryGetValue(groupName, out var refGroup) ? refGroup : null; + } + + public void AddType(DefTypeBase type) + { + string fullName = type.FullName; + if (Types.ContainsKey(fullName)) + { + throw new Exception($"type:'{fullName}' duplicate"); + } + + if (!_notCaseSenseTypes.TryAdd(fullName.ToLower(), type)) + { + throw new Exception($"type:'{fullName}' 和 type:'{_notCaseSenseTypes[fullName.ToLower()].FullName}' 类名小写重复. 在win平台有问题"); + } + + string namespaze = type.Namespace; + if (_namespaces.Add(namespaze) && !_notCaseSenseNamespaces.TryAdd(namespaze.ToLower(), type)) + { + throw new Exception($"type:'{fullName}' 和 type:'{_notCaseSenseNamespaces[namespaze.ToLower()].FullName}' 命名空间小写重复. 在win平台有问题,请修改定义并删除生成的代码目录后再重新生成"); + } + + Types.Add(fullName, type); + TypeList.Add(type); + } + + public DefTypeBase GetDefType(string fullName) + { + return Types.TryGetValue(fullName, out var type) ? type : null; + } + + public DefTypeBase GetDefType(string module, string type) + { + if (Types.TryGetValue(TypeUtil.MakeFullName(module, type), out var t)) + { + return t; + } + else if (Types.TryGetValue(type, out t)) + { + return t; + } + else + { + return null; + } + } + + TType GetOrCreateTEnum(DefEnum defType, bool nullable, Dictionary tags) + { + if (tags == null || tags.Count == 0) + { + if (_cacheDefTTypes.TryGetValue((defType, nullable), out var t)) + { + return t; + } + else + { + return _cacheDefTTypes[(defType, nullable)] = TEnum.Create(nullable, defType, tags); + } + } + else + { + return TEnum.Create(nullable, defType, tags); + ; + } + } + + TType GetOrCreateTBean(DefTypeBase defType, bool nullable, Dictionary tags) + { + if (tags == null || tags.Count == 0) + { + if (_cacheDefTTypes.TryGetValue((defType, nullable), out var t)) + { + return t; + } + else + { + return _cacheDefTTypes[(defType, nullable)] = TBean.Create(nullable, (DefBean)defType, tags); + } + } + else + { + return TBean.Create(nullable, (DefBean)defType, tags); + } + } + + public TType GetDefTType(string module, string type, bool nullable, Dictionary tags) + { + var defType = GetDefType(module, type); + switch (defType) + { + case DefBean d: + return GetOrCreateTBean(d, nullable, tags); + case DefEnum d: + return GetOrCreateTEnum(d, nullable, tags); + default: + return null; + } + } + + public TType CreateType(string module, string type, bool containerElementType) + { + type = DefUtil.TrimBracePairs(type); + int sepIndex = DefUtil.IndexOfBaseTypeEnd(type); + if (sepIndex > 0) + { + string containerTypeAndTags = DefUtil.TrimBracePairs(type.Substring(0, sepIndex)); + var elementTypeAndTags = type.Substring(sepIndex + 1); + var (containerType, containerTags) = DefUtil.ParseTypeAndVaildAttrs(containerTypeAndTags); + return CreateContainerType(module, containerType, containerTags, elementTypeAndTags.Trim()); + } + else + { + return CreateNotContainerType(module, type, containerElementType); + } + } + + protected TType CreateNotContainerType(string module, string rawType, bool containerElementType) + { + bool defaultAble = true; + bool nullable = false; + // 去掉 rawType 两侧的匹配的 () + rawType = DefUtil.TrimBracePairs(rawType); + var (type, tags) = DefUtil.ParseTypeAndVaildAttrs(rawType); + + while (true) + { + if (type.EndsWith('?')) + { + if (containerElementType) + { + throw new Exception($"container element type can't be nullable type:'{module}.{type}'"); + } + nullable = true; + type = type[..^1]; + continue; + } + + if (type.EndsWith("!")) + { + defaultAble = false; + type = type[..^1]; + continue; + } + break; + } + + if (!defaultAble) + { + tags.TryAdd("not-default", "1"); + } + + switch (type) + { + case "bool": + return TBool.Create(nullable, tags); + case "uint8": + case "byte": + return TByte.Create(nullable, tags); + case "int16": + case "short": + return TShort.Create(nullable, tags); + case "int32": + case "int": + return TInt.Create(nullable, tags); + case "int64": + case "long": + return TLong.Create(nullable, tags, false); + case "bigint": + return TLong.Create(nullable, tags, true); + case "float32": + case "float": + return TFloat.Create(nullable, tags); + case "float64": + case "double": + return TDouble.Create(nullable, tags); + case "string": + return TString.Create(nullable, tags); + case "text": + tags.Add("text", "1"); + return TString.Create(nullable, tags); + case "time": + case "datetime": + return TDateTime.Create(nullable, tags); + default: + { + var dtype = GetDefTType(module, type, nullable, tags); + if (dtype != null) + { + return dtype; + } + else + { + throw new ArgumentException($"invalid type. module:'{module}' type:'{type}'"); + } + } + } + } + + TMap CreateMapType(string module, Dictionary tags, string keyValueType, bool isTreeMap) + { + int typeSepIndex = DefUtil.IndexOfElementTypeSep(keyValueType); + if (typeSepIndex <= 0 || typeSepIndex >= keyValueType.Length - 1) + { + throw new ArgumentException($"invalid map element type:'{keyValueType}'"); + } + return TMap.Create(false, tags, + CreateNotContainerType(module, keyValueType.Substring(0, typeSepIndex).Trim(), true), + CreateType(module, keyValueType.Substring(typeSepIndex + 1).Trim(), true), isTreeMap); + } + + TType CreateContainerType(string module, string containerType, Dictionary containerTags, string elementType) + { + switch (containerType) + { + case "array": + { + return TArray.Create(false, containerTags, CreateType(module, elementType, true)); + } + case "list": + return TList.Create(false, containerTags, CreateType(module, elementType, true), true); + case "set": + { + TType type = CreateType(module, elementType, true); + if (type.IsCollection) + { + throw new Exception("set的元素不支持容器类型"); + } + return TSet.Create(false, containerTags, type, false); + } + case "map": + return CreateMapType(module, containerTags, elementType, false); + default: + { + throw new ArgumentException($"invalid container type. module:'{module}' container:'{containerType}' element:'{elementType}'"); + } + } + } +} diff --git a/luban/src/Luban.Core/Defs/DefBean.cs b/luban/src/Luban.Core/Defs/DefBean.cs new file mode 100644 index 00000000..3b8fdc8f --- /dev/null +++ b/luban/src/Luban.Core/Defs/DefBean.cs @@ -0,0 +1,225 @@ +using Luban.RawDefs; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Defs; + +public class DefBean : DefTypeBase +{ + public int Id { get; } + + public int AutoId { get; private set; } // for protobuf + + public string Parent { get; } + + public DefBean ParentDefType { get; private set; } + + public DefBean RootDefType => this.ParentDefType == null ? this : this.ParentDefType.RootDefType; + + public List Children { get; set; } + + public List HierarchyNotAbstractChildren { get; set; } + + public IEnumerable GetHierarchyChildren() + { + yield return this; + if (Children == null) + { + yield break; + } + foreach (var child in Children) + { + foreach (var c2 in child.GetHierarchyChildren()) + { + yield return c2; + } + } + } + + public bool IsAbstractType => Children != null; + + public List HierarchyFields { get; private set; } = new(); + + public List Fields { get; } = new(); + + public string Alias { get; } + + public bool IsMultiRow { get; set; } + + public string Sep { get; } + + public bool IsValueType { get; } + + + private List _hierarchyExportFields; + + public List HierarchyExportFields => _hierarchyExportFields ??= HierarchyFields.Where(f => f.NeedExport()).ToList(); + + private List _exportFields; + + public List ExportFields => _exportFields ??= Fields.Where(f => f.NeedExport()).ToList(); + + public bool IsAssignableFrom(DefBean b) + { + while (b != null) + { + if (b == this) + { + return true; + } + b = b.ParentDefType; + } + return false; + } + + public bool IsDefineEquals(DefBean b) + { + return DeepCompareTypeDefine.Ins.Compare(this, b, new Dictionary(), new HashSet()); + } + + public DefBean(RawBean b) + { + Name = b.Name; + Namespace = b.Namespace; + Parent = b.Parent; + Id = TypeUtil.ComputeCfgHashIdByName(FullName); + Comment = b.Comment; + Tags = b.Tags; + foreach (var field in b.Fields) + { + Fields.Add(CreateField(field, 0)); + } + Alias = b.Alias; + Sep = b.Sep; + IsValueType = b.IsValueType; + Groups = b.Groups; + TypeMappers = b.TypeMappers is { Count: > 0 } ? b.TypeMappers : null; + } + + protected DefField CreateField(RawField f, int idOffset) + { + return new DefField(this, f, idOffset); + } + + public DefField GetField(string index) + { + return HierarchyFields.FirstOrDefault(f => f.Name == index); + } + + public bool TryGetField(string index, out DefField field, out int fieldIndexId) + { + for (int i = 0; i < HierarchyFields.Count; i++) + { + if (HierarchyFields[i].Name == index) + { + field = HierarchyFields[i]; + fieldIndexId = i; + return true; + } + } + field = null; + fieldIndexId = 0; + return false; + } + + public DefBean GetNotAbstractChildType(string typeNameOrAliasName) + { + if (string.IsNullOrWhiteSpace(typeNameOrAliasName)) + { + return null; + } + foreach (DefBean c in HierarchyNotAbstractChildren) + { + if (c.Name == typeNameOrAliasName || c.Alias == typeNameOrAliasName) + { + return c; + } + } + return null; + } + + public override void PreCompile() + { + base.PreCompile(); + SetupParentRecursively(); + CollectHierarchyFields(HierarchyFields); + } + + public override void Compile() + { + var cs = new List(); + if (Children != null) + { + CollectHierarchyNotAbstractChildren(cs); + } + HierarchyNotAbstractChildren = cs; + // 检查别名是否重复 + HashSet nameOrAliasName = cs.Select(b => b.Name).ToHashSet(); + foreach (DefBean c in cs) + { + if (!string.IsNullOrWhiteSpace(c.Alias) && !nameOrAliasName.Add(c.Alias)) + { + throw new Exception($"bean:'{FullName}' alias:{c.Alias} 重复"); + } + } + DefField.CompileFields(this, HierarchyFields); + } + + public override void PostCompile() + { + foreach (var field in HierarchyFields) + { + field.PostCompile(); + } + + if (IsAbstractType && ParentDefType == null) + { + int autoId = 1; + foreach (DefBean child in HierarchyNotAbstractChildren) + { + child.AutoId = autoId++; + } + } + } + + public void CollectHierarchyNotAbstractChildren(List children) + { + if (IsAbstractType) + { + foreach (var c in Children) + { + c.CollectHierarchyNotAbstractChildren(children); + } + } + else + { + children.Add(this); + } + } + + protected void CollectHierarchyFields(List fields) + { + if (ParentDefType != null) + { + ParentDefType.CollectHierarchyFields(fields); + } + fields.AddRange(Fields); + } + + private void SetupParentRecursively() + { + if (ParentDefType == null && !string.IsNullOrEmpty(Parent)) + { + if ((ParentDefType = (DefBean)Assembly.GetDefType(Namespace, Parent)) == null) + { + throw new Exception($"bean:'{FullName}' parent:'{Parent}' not exist"); + } + if (ParentDefType.Children == null) + { + ParentDefType.Children = new List(); + } + ParentDefType.Children.Add(this); + ParentDefType.SetupParentRecursively(); + } + } +} diff --git a/luban/src/Luban.Core/Defs/DefEnum.cs b/luban/src/Luban.Core/Defs/DefEnum.cs new file mode 100644 index 00000000..01796003 --- /dev/null +++ b/luban/src/Luban.Core/Defs/DefEnum.cs @@ -0,0 +1,195 @@ +using Luban.RawDefs; +using Luban.Utils; + +namespace Luban.Defs; + +public class DefEnum : DefTypeBase +{ + public class Item + { + public string Name { get; set; } + + public string Value { get; set; } + + public string Alias { get; set; } + + public string AliasOrName => string.IsNullOrWhiteSpace(Alias) ? Name : Alias; + + public int IntValue { get; set; } + + public string Comment { get; set; } + + public string CommentOrAlias => string.IsNullOrEmpty(Comment) ? Alias : Comment; + + public Dictionary Tags { get; set; } + + public bool HasTag(string attrName) + { + return Tags != null && Tags.ContainsKey(attrName); + } + + public string GetTag(string attrName) + { + return Tags != null && Tags.TryGetValue(attrName, out var value) ? value : null; + } + } + + public bool IsFlags { get; } + + public bool IsUniqueItemId { get; } + + public List Items { get; } = new(); + + private readonly Dictionary _nameOrAlias2Value = new(); + + private readonly Dictionary _vaule2Name = new(); + + public bool HasZeroValueItem => this.Items.Any(item => item.IntValue == 0); + + public bool TryValueByNameOrAlias(string name, out int value) + { + return _nameOrAlias2Value.TryGetValue(name, out value); + } + + public int GetValueByNameOrAlias(string name) + { + // TODO flags ? + if (!name.Contains('|')) + { + return GetBasicValueByNameOrAlias(name); + } + int combindValue = 0; + foreach (var s in name.Split('|')) + { + combindValue |= GetBasicValueByNameOrAlias(s.Trim()); + } + return combindValue; + } + + private int GetBasicValueByNameOrAlias(string name) + { + if (_nameOrAlias2Value.TryGetValue(name, out var value)) + { + return value; + } + else if (int.TryParse(name, out value)) + { + if (!_vaule2Name.ContainsKey(value) && !IsFlags) + { + throw new Exception($"{value} 不是 enum:'{FullName}'的有效枚举值"); + } + return value; + } + else + { + throw new Exception($"'{name}' 不是enum:'{FullName}'的有效枚举值"); + } + } + + public DefEnum(RawEnum e) + { + Name = e.Name; + Namespace = e.Namespace; + IsFlags = e.IsFlags; + IsUniqueItemId = e.IsUniqueItemId; + Comment = e.Comment; + Tags = e.Tags; + Groups = e.Groups; + TypeMappers = e.TypeMappers is { Count: > 0 } ? e.TypeMappers : null; + foreach (var item in e.Items) + { + Items.Add(new Item + { + Name = + item.Name, + Alias = item.Alias, + Value = item.Value, + Comment = string.IsNullOrWhiteSpace(item.Comment) ? item.Alias : item.Comment, + Tags = item.Tags, + }); + } + } + + public override void Compile() + { + var fullName = FullName; + + int lastEnumValue = -1; + var names = new HashSet(); + foreach (var item in Items) + { + string value = item.Value.ToLower(); + if (!names.Add(item.Name)) + { + throw new Exception($"enum:'{fullName}' 字段:'{item.Name}' 重复"); + } + if (string.IsNullOrEmpty(value)) + { + // A, + item.IntValue = ++lastEnumValue; + item.Value = item.IntValue.ToString(); + } + else if (int.TryParse(item.Value, out var v)) + { + // A = 5, + item.IntValue = v; + lastEnumValue = v; + } + else if (value.StartsWith("0x")) + { + + if (int.TryParse(value.Substring(2), System.Globalization.NumberStyles.HexNumber, null, out var x)) + { + item.IntValue = x; + lastEnumValue = x; + } + else + { + throw new Exception($"enum:'{fullName}' 枚举名:'{item.Name}' value:'{item.Value}' 非法"); + } + } + else if (IsFlags) + { + // D = A | B | C, + string[] itemNames = item.Value.Split('|').Select(s => s.Trim()).ToArray(); + foreach (var n in itemNames) + { + var index = Items.FindIndex(i => i.Name == n); + if (index < 0) + { + throw new Exception($"enum:'{fullName}' 枚举名:'{item.Name}' 值:'{item.Value}' 非法"); + } + item.IntValue |= Items[index].IntValue; + } + } + else + { + throw new Exception($"enum:'{fullName}' 枚举名:'{item.Name}' value:'{item.Value}' 非法"); + } + + if (!string.IsNullOrWhiteSpace(item.Name) && !_nameOrAlias2Value.TryAdd(item.Name, item.IntValue)) + { + throw new Exception($"enum:'{fullName}' 枚举名:'{Name}' 重复"); + } + + if (!string.IsNullOrWhiteSpace(item.Alias) && !_nameOrAlias2Value.TryAdd(item.Alias, item.IntValue)) + { + throw new Exception($"enum:'{fullName}' 枚举名:'{Name}' alias:'{item.Alias}' 重复"); + } + if (_vaule2Name.TryGetValue(item.IntValue, out var itemName)) + { + if (IsUniqueItemId) + { + throw new Exception($"enum:'{fullName}' 枚举值:{item.IntValue} 重复. 枚举名:'{itemName}' <=> '{item.Name}'"); + } + } + else + { + _vaule2Name.Add(item.IntValue, item.Name); + } + } + + + } + +} diff --git a/luban/src/Luban.Core/Defs/DefField.cs b/luban/src/Luban.Core/Defs/DefField.cs new file mode 100644 index 00000000..37f0f5c0 --- /dev/null +++ b/luban/src/Luban.Core/Defs/DefField.cs @@ -0,0 +1,179 @@ +using Luban.RawDefs; +using Luban.Types; +using Luban.Utils; +using Luban.Validator; + +namespace Luban.Defs; + +public class DefField +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public DefAssembly Assembly => HostType.Assembly; + + public DefBean HostType { get; } + + public string Name { get; } + + public string Alias { get; } + + public string Type { get; } + + public TType CType { get; private set; } + + public bool IsNullable => CType.IsNullable; + + public string Comment { get; } + + public int AutoId { get; set; } + + // public string EscapeComment => DefUtil.EscapeCommentByCurrentLanguage(Comment); + + public Dictionary Tags { get; } + + public List Variants { get; } + + public string CurrentVariantNameWithoutFieldName { get; private set; } + + public string CurrentVariantNameWithFieldName { get; private set; } + + public string CurrentVariantNameWithFieldNameOrOrigin => CurrentVariantNameWithFieldName ?? Name; + + public bool IgnoreNameValidation { get; set; } + + public bool HasTag(string attrName) + { + return Tags != null && Tags.ContainsKey(attrName); + } + + public string GetTag(string attrName) + { + return Tags != null && Tags.TryGetValue(attrName, out var value) ? value : null; + } + + public List Groups { get; } + + public RawField RawField { get; } + + + public DefField(DefBean host, RawField f, int idOffset) + { + HostType = host; + Name = f.Name; + Alias = f.Alias; + Type = f.Type; + Comment = f.Comment; + Tags = f.Tags; + Variants = f.Variants; + IgnoreNameValidation = f.NotNameValidation; + this.Groups = f.Groups; + this.RawField = f; + } + + public override string ToString() + { + return $"{HostType.FullName}.{Name}"; + } + + public void Compile() + { + if (Variants != null && Variants.Count > 0) + { + string variantKey = $"{HostType.FullName}.{Name}"; + if (HostType.Assembly.TryGetVariantName(variantKey, out var variantName)) + { + if (!Variants.Contains(variantName)) + { + throw new Exception($"type:'{HostType.FullName}' field:'{Name}' variantKey:'{variantKey}' exists, but variantName'{variantName}' not in {string.Join(",", Variants)}"); + } + CurrentVariantNameWithoutFieldName = variantName; + CurrentVariantNameWithFieldName = $"{Name}@{variantName}"; + } + else + { + s_logger.Warn($"type:'{HostType.FullName}' field:'{Name}' not set variant. please set variant by command line option '--variant {variantKey}='"); + } + } + try + { + CType = Assembly.CreateType(HostType.Namespace, Type, false); + } + catch (Exception e) + { + throw new Exception($"type:'{HostType.FullName}' field:'{Name}' type:'{Type}' is invalid", e); + } + + //if (IsNullable && (CType.IsCollection || (CType is TBean))) + //{ + // throw new Exception($"type:{HostType.FullName} field:{Name} type:{Type} is collection or bean. not support nullable"); + //} + + switch (CType) + { + case TArray t: + { + if (t.ElementType is TBean e && !e.IsDynamic && e.DefBean.HierarchyFields.Count == 0) + { + throw new Exception($"container element type:'{e.DefBean.FullName}' can't be empty bean"); + } + break; + } + case TList t: + { + if (t.ElementType is TBean e && !e.IsDynamic && e.DefBean.HierarchyFields.Count == 0) + { + throw new Exception($"container element type:'{e.DefBean.FullName}' can't be empty bean"); + } + break; + } + } + + ValidatorManager.Ins.InitValidatorsRecursive(CType); + } + + public void PostCompile() + { + CType.PostCompile(this); + ValidatorManager.Ins.CompileValidatorsRecursive(CType, this); + } + + public static void CompileFields(DefTypeBase hostType, List fields) where T : DefField + { + var names = new HashSet(); + int nextAutoId = 1; + foreach (var f in fields) + { + var name = f.Name; + if (name.Length == 0) + { + throw new Exception($"type:'{hostType.FullName}' field name can't be empty"); + } + if (!names.Add(name)) + { + throw new Exception($"type:'{hostType.FullName}' 'field:{name}' duplicate"); + } + if (TypeUtil.ToCsStyleName(name) == hostType.Name) + { + throw new Exception($"type:'{hostType.FullName}' field:'{name}' 生成的c#字段名与类型名相同,会引起编译错误"); + } + f.AutoId = nextAutoId++; + } + + var aliasNames = new Dictionary(); + foreach (var f in fields) + { + if (!string.IsNullOrEmpty(f.Alias)) + { + if (!aliasNames.TryAdd(f.Alias, f)) + { + throw new Exception($"type:'{hostType.FullName}' field:'{f.Name}' alias:'{f.Alias}' duplicate with field:{aliasNames[f.Alias].Name}"); + } + if (names.Contains(f.Alias)) + { + throw new Exception($"type:'{hostType.FullName}' field:'{f.Name}' alias:'{f.Alias}' duplicate with other field name"); + } + } + f.Compile(); + } + } +} diff --git a/luban/src/Luban.Core/Defs/DefRefGroup.cs b/luban/src/Luban.Core/Defs/DefRefGroup.cs new file mode 100644 index 00000000..aabb934b --- /dev/null +++ b/luban/src/Luban.Core/Defs/DefRefGroup.cs @@ -0,0 +1,16 @@ +using Luban.RawDefs; + +namespace Luban.Defs; + +public class DefRefGroup +{ + public string Name { get; } + + public List Refs { get; } + + public DefRefGroup(RawRefGroup group) + { + this.Name = group.Name; + this.Refs = group.Refs; + } +} diff --git a/luban/src/Luban.Core/Defs/DefTable.cs b/luban/src/Luban.Core/Defs/DefTable.cs new file mode 100644 index 00000000..32dc97b7 --- /dev/null +++ b/luban/src/Luban.Core/Defs/DefTable.cs @@ -0,0 +1,160 @@ +using Luban.RawDefs; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; +using Luban.Validator; + +namespace Luban.Defs; + +public record class IndexInfo(TType Type, DefField IndexField, int IndexFieldIdIndex); + +public class DefTable : DefTypeBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public DefTable(RawTable b) + { + Name = b.Name; + Namespace = b.Namespace; + Index = b.Index; + ValueType = b.ValueType; + Mode = b.Mode; + InputFiles = b.InputFiles; + Groups = b.Groups; + Comment = b.Comment; + ReadSchemaFromFile = b.ReadSchemaFromFile; + Tags = b.Tags; + _outputFile = b.OutputFile; + } + + public string Index { get; private set; } + + public string ValueType { get; } + + public TableMode Mode { get; } + + public bool ReadSchemaFromFile { get; } + + public bool IsSingletonTable => Mode == TableMode.ONE; + + public bool IsMapTable => Mode == TableMode.MAP; + + public bool IsListTable => Mode == TableMode.LIST; + + public bool IsExported { get; set; } + + public List InputFiles { get; } + + private readonly string _outputFile; + + public TType KeyTType { get; private set; } + + public DefField IndexField { get; private set; } + + public int IndexFieldIdIndex { get; private set; } + + public TBean ValueTType { get; private set; } + + public TType Type { get; private set; } + + public bool IsUnionIndex { get; private set; } + + public bool MultiKey { get; private set; } + + public List IndexList { get; } = new(); + + public List Validators { get; } = new(); + + public string OutputDataFile => string.IsNullOrWhiteSpace(_outputFile) ? FullName.Replace('.', '_').ToLower() : _outputFile; + + public override void Compile() + { + var ass = Assembly; + + if ((ValueTType = (TBean)ass.CreateType(Namespace, ValueType, false)) == null) + { + throw new Exception($"table:'{FullName}' 的 value类型:'{ValueType}' 不存在"); + } + + switch (Mode) + { + case TableMode.ONE: + { + IsUnionIndex = false; + KeyTType = null; + Type = ValueTType; + break; + } + case TableMode.MAP: + { + IsUnionIndex = true; + if (!string.IsNullOrWhiteSpace(Index)) + { + if (ValueTType.DefBean.TryGetField(Index, out var f, out var i)) + { + IndexField = f; + IndexFieldIdIndex = i; + } + else + { + throw new Exception($"table:'{FullName}' index:'{Index}' 字段不存在"); + } + } + else if (ValueTType.DefBean.HierarchyFields.Count == 0) + { + throw new Exception($"table:'{FullName}' 必须定义至少一个字段"); + } + else + { + IndexField = ValueTType.DefBean.HierarchyFields[0]; + Index = IndexField.Name; + IndexFieldIdIndex = 0; + } + KeyTType = IndexField.CType; + Type = TMap.Create(false, null, KeyTType, ValueTType, false); + this.IndexList.Add(new IndexInfo(KeyTType, IndexField, IndexFieldIdIndex)); + break; + } + case TableMode.LIST: + { + var indexs = Index.Split('+', ',').Where(s => !string.IsNullOrWhiteSpace(s)).Select(s => s.Trim()).ToList(); + foreach (var idx in indexs) + { + if (ValueTType.DefBean.TryGetField(idx, out var f, out var i)) + { + if (IndexField == null) + { + IndexField = f; + IndexFieldIdIndex = i; + } + this.IndexList.Add(new IndexInfo(f.CType, f, i)); + } + else + { + throw new Exception($"table:'{FullName}' index:'{idx}' 字段不存在"); + } + } + // 如果不是 union index, 每个key必须唯一,否则 (key1,..,key n)唯一 + IsUnionIndex = IndexList.Count > 1 && !Index.Contains(','); + MultiKey = IndexList.Count > 1 && Index.Contains(','); + break; + } + default: + throw new Exception($"unknown mode:'{Mode}'"); + } + + foreach (var index in IndexList) + { + TType indexType = index.Type; + string idxName = index.IndexField.Name; + if (indexType.IsNullable) + { + throw new Exception($"table:'{FullName}' index:'{idxName}' 不能为 nullable类型"); + } + if (!indexType.Apply(IsValidTableKeyTypeVisitor.Ins)) + { + throw new Exception($"table:'{FullName}' index:'{idxName}' 的类型:'{index.IndexField.Type}' 不能作为index"); + } + } + } +} diff --git a/luban/src/Luban.Core/Defs/DefTypeBase.cs b/luban/src/Luban.Core/Defs/DefTypeBase.cs new file mode 100644 index 00000000..d7d7df0e --- /dev/null +++ b/luban/src/Luban.Core/Defs/DefTypeBase.cs @@ -0,0 +1,65 @@ +using Luban.RawDefs; +using Luban.Schema; +using Luban.Utils; + +namespace Luban.Defs; + +public abstract class DefTypeBase +{ + public DefAssembly Assembly { get; set; } + + public string Name { get; set; } + + public string Namespace { get; set; } + + public string FullName => TypeUtil.MakeFullName(Namespace, Name); + + public string NamespaceWithTopModule => TypeUtil.MakeNamespace(GenerationContext.Current.TopModule, Namespace); + + public string FullNameWithTopModule => TypeUtil.MakeNamespace(GenerationContext.Current.TopModule, FullName); + + public List Groups { get; set; } + + public string Comment { get; protected set; } + + public Dictionary Tags { get; protected set; } + + public List TypeMappers { get; protected set; } + + public bool HasTag(string attrName) + { + return Tags != null && Tags.ContainsKey(attrName); + } + + public string GetTag(string attrName) + { + return Tags != null && Tags.TryGetValue(attrName, out var value) ? value : null; + } + + public virtual void PreCompile() + { + if (Groups != null && Groups.Count > 0) + { + LubanConfig c = GenerationContext.GlobalConf; + if (Groups.Contains("*")) + { + Groups.Clear(); + Groups.AddRange(c.Groups.SelectMany(g => g.Names)); + } + else + { + foreach (var g in Groups) + { + if (c.Groups.All(gg => !gg.Names.Contains(g))) + { + throw new Exception($"type:{FullName} group:{g} not found"); + } + } + } + } + } + + public abstract void Compile(); + + public virtual void PostCompile() { } +} diff --git a/luban/src/Luban.Core/Defs/LoadDefException.cs b/luban/src/Luban.Core/Defs/LoadDefException.cs new file mode 100644 index 00000000..f09820e1 --- /dev/null +++ b/luban/src/Luban.Core/Defs/LoadDefException.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; + +namespace Luban.Defs; + +public class LoadDefException : Exception +{ + public LoadDefException() + { + } + + public LoadDefException(string message) : base(message) + { + } + + public LoadDefException(string message, Exception innerException) : base(message, innerException) + { + } +} diff --git a/luban/src/Luban.Core/Defs/Record.cs b/luban/src/Luban.Core/Defs/Record.cs new file mode 100644 index 00000000..d764a698 --- /dev/null +++ b/luban/src/Luban.Core/Defs/Record.cs @@ -0,0 +1,34 @@ +using Luban.Datas; + +namespace Luban.Defs; + +public class Record +{ + public int AutoIndex { get; set; } + + public DBean Data { get; set; } + + public string Source { get; } + + public List Tags { get; } + + public bool IsNotFiltered(List includeTags, List excludeTags) + { + if (Tags == null || Tags.Count == 0) + { + return true; + } + if (includeTags != null && includeTags.Count > 0) + { + return Tags.Any(includeTags.Contains); + } + return !Tags.Any(excludeTags.Contains); + } + + public Record(DBean data, string source, List tags) + { + Data = data; + Source = source; + Tags = tags; + } +} diff --git a/luban/src/Luban.Core/Defs/TableDataInfo.cs b/luban/src/Luban.Core/Defs/TableDataInfo.cs new file mode 100644 index 00000000..4ffb110c --- /dev/null +++ b/luban/src/Luban.Core/Defs/TableDataInfo.cs @@ -0,0 +1,185 @@ +using Luban.Datas; +using Luban.Utils; + +namespace Luban.Defs; + +public class TableDataInfo +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public DefTable Table { get; } + + public List MainRecords { get; } + + public List PatchRecords { get; } + + public List FinalRecords { get; private set; } + + public Dictionary FinalRecordMap { get; private set; } + + public Dictionary> FinalRecordMapByIndexs { get; private set; } + + public TableDataInfo(DefTable table, List mainRecords, List patchRecords) + { + Table = table; + MainRecords = mainRecords; + PatchRecords = patchRecords; + + BuildIndexs(); + + int index = 0; + foreach (var record in FinalRecords) + { + record.AutoIndex = index++; + } + + if (table.IsSingletonTable && FinalRecords.Count != 1) + { + throw new Exception($"配置表 {table.FullName} 是单值表 mode=one,但数据个数:{FinalRecords.Count} != 1"); + } + } + + private void BuildIndexs() + { + List mainRecords = MainRecords; + List patchRecords = PatchRecords; + + // 这么大费周张是为了保证被覆盖的id仍然保持原来的顺序,而不是出现在最后 + int index = 0; + var recordIndex = new Dictionary(); + var overrideRecords = new HashSet(); + foreach (var r in mainRecords) + { + if (recordIndex.TryAdd(r, index)) + { + index++; + } + } + if (patchRecords != null) + { + foreach (var r in patchRecords) + { + if (recordIndex.TryAdd(r, index)) + { + index++; + } + } + } + + var table = Table; + // TODO 有一个微妙的问题,ref检查虽然通过,但ref的记录有可能未导出 + switch (Table.Mode) + { + case TableMode.ONE: + { + // TODO 如果此单例表使用tag,有多个记录,则patchRecords会覆盖全部。 + // 好像也挺有道理的,毕竟没有key,无法区分覆盖哪个 + if (patchRecords != null && patchRecords.Count > 0) + { + mainRecords = patchRecords; + } + FinalRecords = mainRecords; + break; + } + case TableMode.MAP: + { + var recordMap = new Dictionary(); + foreach (Record r in mainRecords) + { + DType key = r.Data.Fields[table.IndexFieldIdIndex]; + if (!recordMap.TryAdd(key, r)) + { + throw new Exception($@"配置表 '{table.FullName}' 主文件 主键字段:'{table.Index}' 主键值:'{key}' 重复. + 记录1 来自文件:{r.Source} + 记录2 来自文件:{recordMap[key].Source} +"); + } + } + if (patchRecords != null && patchRecords.Count > 0) + { + foreach (Record r in patchRecords) + { + DType key = r.Data.Fields[table.IndexFieldIdIndex]; + if (recordMap.TryGetValue(key, out var old)) + { + if (overrideRecords.Contains(old)) + { + throw new Exception($"配置表 '{table.FullName}' 主文件 主键字段:'{table.Index}' 主键值:'{key}' 被patch多次覆盖,请检查patch是否有重复记录"); + } + s_logger.Debug("配置表 {} 分支文件 主键:{} 覆盖 主文件记录", table.FullName, key); + mainRecords[recordIndex[old]] = r; + } + else + { + mainRecords.Add(r); + } + overrideRecords.Add(r); + recordMap[key] = r; + } + } + FinalRecords = mainRecords; + FinalRecordMap = recordMap; + break; + } + case TableMode.LIST: + { + if (patchRecords != null && patchRecords.Count > 0) + { + throw new Exception($"配置表 '{table.FullName}' 是list表.不支持patch"); + } + var recordMapByIndexs = new Dictionary>(); + if (table.IsUnionIndex) + { + var unionRecordMap = new Dictionary, Record>(ListEqualityComparer.Default); // comparetor + foreach (Record r in mainRecords) + { + var unionKeys = table.IndexList.Select(idx => r.Data.Fields[idx.IndexFieldIdIndex]).ToList(); + if (!unionRecordMap.TryAdd(unionKeys, r)) + { + throw new Exception($@"配置表 '{table.FullName}' 主文件 主键字段:'{table.Index}' 主键值:'{StringUtil.CollectionToString(unionKeys)}' 重复. + 记录1 来自文件:{r.Source} + 记录2 来自文件:{unionRecordMap[unionKeys].Source} +"); + } + } + + // 联合索引的 独立子索引允许有重复key + foreach (var indexInfo in table.IndexList) + { + var recordMap = new Dictionary(); + foreach (Record r in mainRecords) + { + DType key = r.Data.Fields[indexInfo.IndexFieldIdIndex]; + recordMap[key] = r; + } + recordMapByIndexs.Add(indexInfo.IndexField.Name, recordMap); + } + } + else + { + foreach (var indexInfo in table.IndexList) + { + var recordMap = new Dictionary(); + foreach (Record r in mainRecords) + { + DType key = r.Data.Fields[indexInfo.IndexFieldIdIndex]; + if (!recordMap.TryAdd(key, r)) + { + throw new Exception($@"配置表 '{table.FullName}' 主文件 主键字段:'{indexInfo.IndexField.Name}' 主键值:'{key}' 重复. + 记录1 来自文件:{r.Source} + 记录2 来自文件:{recordMap[key].Source} +"); + } + } + recordMapByIndexs.Add(indexInfo.IndexField.Name, recordMap); + } + } + this.FinalRecordMapByIndexs = recordMapByIndexs; + FinalRecords = mainRecords; + break; + } + default: + throw new Exception($"unknown mode:{Table.Mode}"); + } + } +} diff --git a/luban/src/Luban.Core/Defs/TableMode.cs b/luban/src/Luban.Core/Defs/TableMode.cs new file mode 100644 index 00000000..d689e12a --- /dev/null +++ b/luban/src/Luban.Core/Defs/TableMode.cs @@ -0,0 +1,8 @@ +namespace Luban.Defs; + +public enum TableMode +{ + ONE, + MAP, + LIST, +} diff --git a/luban/src/Luban.Core/EnvManager.cs b/luban/src/Luban.Core/EnvManager.cs new file mode 100644 index 00000000..be80aea3 --- /dev/null +++ b/luban/src/Luban.Core/EnvManager.cs @@ -0,0 +1,86 @@ +namespace Luban; + +public class EnvManager +{ + public static EnvManager Current { get; set; } + + private readonly Dictionary _options; + + public EnvManager(Dictionary options) + { + _options = options; + } + + public bool HasOptionRaw(string optionName) + { + return _options.ContainsKey(optionName); + } + + public string GetOptionRaw(string optionName) + { + return _options.TryGetValue(optionName, out var value) ? value : null; + } + + public string GetOptionOrDefaultRaw(string optionName, string defaultValue) + { + return _options.TryGetValue(optionName, out var value) ? value : defaultValue; + } + + + public string GetOption(string namespaze, string name, bool useGlobalIfNotExits) + { + return TryGetOption(namespaze, name, useGlobalIfNotExits, out var value) ? value : throw new Exception($"option '{name}' not exists"); + } + + public bool TryGetOption(string namespaze, string name, bool useGlobalIfNotExits, out string value) + { + while (true) + { + string fullOptionName = string.IsNullOrEmpty(namespaze) ? name : namespaze + "." + name; + if (_options.TryGetValue(fullOptionName, out value)) + { + return true; + } + + if (string.IsNullOrEmpty(namespaze) || !useGlobalIfNotExits) + { + return false; + } + + int index = namespaze.LastIndexOf('.'); + if (index < 0) + { + namespaze = ""; + } + else + { + namespaze = namespaze.Substring(0, index); + } + } + } + + public string GetOptionOrDefault(string namespaze, string name, bool useGlobalIfNotExits, string defaultValue) + { + return TryGetOption(namespaze, name, useGlobalIfNotExits, out string value) ? value : defaultValue; + } + + public bool GetBoolOptionOrDefault(string namespaze, string name, bool useGlobalIfNotExits, bool defaultValue) + { + if (TryGetOption(namespaze, name, useGlobalIfNotExits, out string value)) + { + switch (value.ToLowerInvariant()) + { + case "0": + case "false": + return false; + case "1": + case "true": + return true; + default: + throw new Exception($"invalid bool option value:{value}"); + } + } + return defaultValue; + } + +} diff --git a/luban/src/Luban.Core/GenerationContext.cs b/luban/src/Luban.Core/GenerationContext.cs new file mode 100644 index 00000000..1d97ad37 --- /dev/null +++ b/luban/src/Luban.Core/GenerationContext.cs @@ -0,0 +1,292 @@ +using System.Collections.Concurrent; +using System.Diagnostics; +using System.Reflection; +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.DataLoader; +using Luban.Datas; +using Luban.Defs; +using Luban.L10N; +using Luban.RawDefs; +using Luban.Schema; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; +using Luban.Validator; + +namespace Luban; + +public class GenerationContextBuilder +{ + public DefAssembly Assembly { get; set; } + + public List IncludeTags { get; set; } + + public List ExcludeTags { get; set; } + + public string TimeZone { get; set; } +} + +public class GenerationContext +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public static GenerationContext Current { get; private set; } + + public static ICodeTarget CurrentCodeTarget { get; set; } + + public static LubanConfig GlobalConf { get; set; } + + public DefAssembly Assembly { get; private set; } + + public RawTarget Target => Assembly.Target; + + public List IncludeTags { get; private set; } + + public List ExcludeTags { get; private set; } + + private readonly ConcurrentDictionary _recordsByTables = new(); + + public string TopModule => Target.TopModule; + + public List Tables => Assembly.GetAllTables(); + + private List ExportTypes { get; set; } + + public List ExportTables { get; private set; } + + public List ExportBeans { get; private set; } + + public List ExportEnums { get; private set; } + + public TimeZoneInfo TimeZone { get; private set; } + + public ITextProvider TextProvider { get; private set; } + + private readonly Dictionary _uniqueObjects = new(); + + private readonly HashSet _failedValidatorTypes = new(); + + private bool _exportEmptyGroupsTypes; + + public void LoadDatas() + { + s_logger.Info("load datas begin"); + TextProvider?.Load(); + DataLoaderManager.Ins.LoadDatas(this); + s_logger.Info("load datas end"); + } + + public GenerationContext() + { + Current = this; + } + + public void Init(GenerationContextBuilder builder) + { + Assembly = builder.Assembly; + IncludeTags = builder.IncludeTags; + ExcludeTags = builder.ExcludeTags; + if (IncludeTags != null && IncludeTags.Count != 0 && ExcludeTags != null && ExcludeTags.Count > 0) + { + throw new Exception("option '--includeTag ' and '--excludeTag ' can not be set at the same time"); + } + TimeZone = TimeZoneUtil.GetTimeZone(builder.TimeZone); + _exportEmptyGroupsTypes = builder.Assembly.Target.Groups.Any(g => GlobalConf.Groups.First(gd => gd.Names.Contains(g))?.IsDefault == true); + + TextProvider = EnvManager.Current.TryGetOption(BuiltinOptionNames.L10NFamily, BuiltinOptionNames.L10NProviderName, false, out string providerName) ? + L10NManager.Ins.CreateTextProvider(providerName) : null; + + ExportTables = Assembly.ExportTables; + ExportTypes = CalculateExportTypes(); + ExportBeans = SortBeanTypes(ExportTypes.OfType().ToList()); + ExportEnums = ExportTypes.OfType().ToList(); + } + + private void AddChildrenByOrder(List list, DefBean bean) + { + list.Add(bean); + if (bean.Children == null || bean.Children.Count == 0) + { + return; + } + var children = new List(bean.Children); + children.Sort((a, b) => a.FullName.CompareTo(b.FullName)); + foreach (var child in children) + { + AddChildrenByOrder(list, child); + } + } + + /// + /// some languages like c++ have dependencies on the order of type definitions, so we need to sort the types here + /// + /// + /// + private List SortBeanTypes(List types) + { + var sortedBeans = new List(); + foreach (var bean in types) + { + if (bean.ParentDefType == null) + { + AddChildrenByOrder(sortedBeans, bean); + } + } + Debug.Assert(types.Count == sortedBeans.Count); + return sortedBeans; + } + + private bool NeedExportNotDefault(List groups) + { + if (groups.Count == 0) + { + return _exportEmptyGroupsTypes; + } + return groups.Any(Target.Groups.Contains); + } + + private List CalculateExportTypes() + { + var refTypes = new Dictionary(); + var types = Assembly.TypeList; + foreach (var t in types) + { + if (!refTypes.ContainsKey(t.FullName)) + { + if (t is DefBean bean && NeedExportNotDefault(t.Groups)) + { + TBean.Create(false, bean, null).Apply(RefTypeVisitor.Ins, refTypes); + } + else if (t is DefEnum && NeedExportNotDefault(t.Groups)) + { + refTypes.Add(t.FullName, t); + } + } + } + + foreach (var table in ExportTables) + { + refTypes[table.FullName] = table; + table.ValueTType.Apply(RefTypeVisitor.Ins, refTypes); + } + + return refTypes.OrderBy(p => p.Key).Select(p => p.Value).ToList(); + } + + public static string GetInputDataPath() + { + return GlobalConf.InputDataDir; + } + + public void AddDataTable(DefTable table, List mainRecords, List patchRecords) + { + s_logger.Debug("AddDataTable name:{} record count:{}", table.FullName, mainRecords.Count); + _recordsByTables[table.FullName] = new TableDataInfo(table, + mainRecords.Where(r => r.IsNotFiltered(IncludeTags, ExcludeTags)).ToList(), + patchRecords != null ? patchRecords.Where(r => r.IsNotFiltered(IncludeTags, ExcludeTags)).ToList() : null); + } + + public List GetTableAllDataList(DefTable table) + { + return _recordsByTables[table.FullName].FinalRecords; + } + + public List GetTableExportDataList(DefTable table) + { + return _recordsByTables[table.FullName].FinalRecords; + } + + public static List ToSortByKeyDataList(DefTable table, List originRecords) + { + var sortedRecords = new List(originRecords); + + DefField keyField = table.IndexField; + if (keyField != null && (keyField.CType is TInt || keyField.CType is TLong)) + { + string keyFieldName = keyField.Name; + sortedRecords.Sort((a, b) => + { + DType keya = a.Data.GetField(keyFieldName); + DType keyb = b.Data.GetField(keyFieldName); + switch (keya) + { + case DInt ai: + return ai.Value.CompareTo((keyb as DInt).Value); + case DLong al: + return al.Value.CompareTo((keyb as DLong).Value); + default: + throw new NotSupportedException(); + } + }); + } + return sortedRecords; + } + + public TableDataInfo GetTableDataInfo(DefTable table) + { + return _recordsByTables[table.FullName]; + } + + public ICodeStyle GetCodeStyle(string family) + { + if (EnvManager.Current.TryGetOption(family, BuiltinOptionNames.CodeStyle, true, out var codeStyleName)) + { + return CodeFormatManager.Ins.GetCodeStyle(codeStyleName); + } + return null; + } + + public object GetUniqueObject(string key) + { + lock (this) + { + return _uniqueObjects[key]; + } + } + + public object TryGetUniqueObject(string key) + { + lock (this) + { + _uniqueObjects.TryGetValue(key, out var obj); + return obj; + } + } + + public object GetOrAddUniqueObject(string key, Func factory) + { + lock (this) + { + if (_uniqueObjects.TryGetValue(key, out var obj)) + { + return obj; + } + else + { + obj = factory(); + _uniqueObjects.Add(key, obj); + return obj; + } + } + } + + public void LogValidatorFail(IDataValidator validator) + { + lock (this) + { + _failedValidatorTypes.Add(validator.GetType()); + } + } + + public bool AnyValidatorFail + { + get + { + lock (this) + { + return _failedValidatorTypes.Count > 0; + } + } + } +} diff --git a/luban/src/Luban.Core/GlobalConfigLoader.cs b/luban/src/Luban.Core/GlobalConfigLoader.cs new file mode 100644 index 00000000..a34c9b30 --- /dev/null +++ b/luban/src/Luban.Core/GlobalConfigLoader.cs @@ -0,0 +1,105 @@ +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using Luban.RawDefs; +using Luban.Schema; +using Luban.Utils; + +namespace Luban; + +public class GlobalConfigLoader : IConfigLoader +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private string _curDir; + + public GlobalConfigLoader() + { + + } + + + private class Group + { + public List Names { get; set; } + + public bool Default { get; set; } + } + + private class SchemaFile + { + public string FileName { get; set; } + + public string Type { get; set; } + } + + private class Target + { + public string Name { get; set; } + + public string Manager { get; set; } + + public List Groups { get; set; } + + public string TopModule { get; set; } + } + + private class LubanConf + { + public List Groups { get; set; } + + public List SchemaFiles { get; set; } + + public string DataDir { get; set; } + + public List Targets { get; set; } + + public List Xargs { get; set; } + } + + public LubanConfig Load(string fileName) + { + s_logger.Debug("load config file:{}", fileName); + _curDir = Directory.GetParent(fileName).FullName; + + var options = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + AllowTrailingCommas = true, + ReadCommentHandling = JsonCommentHandling.Skip, + }; + var globalConf = JsonSerializer.Deserialize(File.ReadAllText(fileName, Encoding.UTF8), options); + + var configFileName = Path.GetFileName(fileName); + var dataInputDir = Path.Combine(_curDir, globalConf.DataDir); + List groups = globalConf.Groups.Select(g => new RawGroup() { Names = g.Names, IsDefault = g.Default }).ToList(); + List targets = globalConf.Targets.Select(t => new RawTarget() { Name = t.Name, Manager = t.Manager, Groups = t.Groups, TopModule = t.TopModule }).ToList(); + + List importFiles = new(); + foreach (var schemaFile in globalConf.SchemaFiles) + { + string fileOrDirectory = Path.Combine(_curDir, schemaFile.FileName); + if (string.IsNullOrEmpty(schemaFile.Type)) + { + if (!Directory.Exists(fileOrDirectory) && !File.Exists(fileOrDirectory)) + { + throw new Exception($"failed to load schema file:'{fileOrDirectory}': directory or file doesn't exists!"); + } + } + foreach (var subFile in FileUtil.GetFileOrDirectory(fileOrDirectory)) + { + importFiles.Add(new SchemaFileInfo() { FileName = subFile, Type = schemaFile.Type }); + } + } + return new LubanConfig() + { + ConfigFileName = configFileName, + InputDataDir = dataInputDir, + Groups = groups, + Targets = targets, + Imports = importFiles, + Xargs = globalConf.Xargs, + }; + } + +} diff --git a/luban/src/Luban.Core/IGenerationContext.cs b/luban/src/Luban.Core/IGenerationContext.cs new file mode 100644 index 00000000..63870d26 --- /dev/null +++ b/luban/src/Luban.Core/IGenerationContext.cs @@ -0,0 +1,12 @@ +namespace Luban; + +// public interface IGenerationContext +// { +// public static IGenerationContext Ins { get; set; } +// +// bool NeedExport(List groups); +// +// string TopModule { get; } +// +// public GenerationArguments Arguments { get; } +// } diff --git a/luban/src/Luban.Core/L10N/ITextProvider.cs b/luban/src/Luban.Core/L10N/ITextProvider.cs new file mode 100644 index 00000000..997afddd --- /dev/null +++ b/luban/src/Luban.Core/L10N/ITextProvider.cs @@ -0,0 +1,16 @@ +namespace Luban.L10N; + +public interface ITextProvider +{ + void Load(); + + void ProcessDatas(); + + bool IsValidKey(string key); + + bool TryGetText(string key, out string text); + + void AddUnknownKey(string key); + + bool ConvertTextKeyToValue { get; } +} diff --git a/luban/src/Luban.Core/L10N/L10NManager.cs b/luban/src/Luban.Core/L10N/L10NManager.cs new file mode 100644 index 00000000..8ad4a34c --- /dev/null +++ b/luban/src/Luban.Core/L10N/L10NManager.cs @@ -0,0 +1,18 @@ +using Luban.CustomBehaviour; + +namespace Luban.L10N; + +public class L10NManager +{ + public static L10NManager Ins { get; } = new(); + + public void Init() + { + + } + + public ITextProvider CreateTextProvider(string name) + { + return CustomBehaviourManager.Ins.CreateBehaviour(name); + } +} diff --git a/luban/src/Luban.Core/L10N/TextProviderAttribute.cs b/luban/src/Luban.Core/L10N/TextProviderAttribute.cs new file mode 100644 index 00000000..583e9642 --- /dev/null +++ b/luban/src/Luban.Core/L10N/TextProviderAttribute.cs @@ -0,0 +1,11 @@ +using Luban.CustomBehaviour; + +namespace Luban.L10N; + +[AttributeUsage(AttributeTargets.Class)] +public class TextProviderAttribute : BehaviourBaseAttribute +{ + public TextProviderAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/Luban.Core.csproj b/luban/src/Luban.Core/Luban.Core.csproj new file mode 100644 index 00000000..8d723c32 --- /dev/null +++ b/luban/src/Luban.Core/Luban.Core.csproj @@ -0,0 +1,47 @@ + + + + + + net8.0 + enable + disable + Luban + + + + true + + + + true + + + + + + + + diff --git a/luban/src/Luban.Core/OutputFile.cs b/luban/src/Luban.Core/OutputFile.cs new file mode 100644 index 00000000..d0a87060 --- /dev/null +++ b/luban/src/Luban.Core/OutputFile.cs @@ -0,0 +1,24 @@ +using System.Text; + +namespace Luban; + +public class OutputFile +{ + public string File { get; init; } + + /// + /// Data type: string or byte[] + /// + public object Content { get; init; } + + public Encoding Encoding { get; set; } = Encoding.UTF8; + + public byte[] GetContentBytes() + { + if (Content is byte[] bytes) + { + return bytes; + } + return this.Encoding.GetBytes((string)Content); + } +} diff --git a/luban/src/Luban.Core/OutputFileManifest.cs b/luban/src/Luban.Core/OutputFileManifest.cs new file mode 100644 index 00000000..a726ae2a --- /dev/null +++ b/luban/src/Luban.Core/OutputFileManifest.cs @@ -0,0 +1,34 @@ +using System.Text; + +namespace Luban; + +public enum OutputType +{ + Code, + Data, +} + +public class OutputFileManifest +{ + public string TargetName { get; } + + public OutputType OutputType { get; } + + private readonly List _dataFiles = new(); + + public IReadOnlyList DataFiles => _dataFiles; + + public OutputFileManifest(string targetName, OutputType outputType) + { + TargetName = targetName; + OutputType = outputType; + } + + public void AddFile(OutputFile file) + { + lock (this) + { + _dataFiles.Add(file); + } + } +} diff --git a/luban/src/Luban.Core/OutputSaver/IOutputSaver.cs b/luban/src/Luban.Core/OutputSaver/IOutputSaver.cs new file mode 100644 index 00000000..70cd08ef --- /dev/null +++ b/luban/src/Luban.Core/OutputSaver/IOutputSaver.cs @@ -0,0 +1,10 @@ +namespace Luban.OutputSaver; + +public interface IOutputSaver +{ + string Name { get; } + + void Save(OutputFileManifest outputFileManifest); + + void SaveFile(OutputFileManifest fileManifest, string outputDir, OutputFile outputFile); +} diff --git a/luban/src/Luban.Core/OutputSaver/LocalFileSaver.cs b/luban/src/Luban.Core/OutputSaver/LocalFileSaver.cs new file mode 100644 index 00000000..f63c527e --- /dev/null +++ b/luban/src/Luban.Core/OutputSaver/LocalFileSaver.cs @@ -0,0 +1,30 @@ +using Luban.Utils; + +namespace Luban.OutputSaver; + +[OutputSaver("local")] +public class LocalFileSaver : OutputSaverBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + protected override void BeforeSave(OutputFileManifest outputFileManifest, string outputDir) + { + if (!EnvManager.Current.GetBoolOptionOrDefault($"{BuiltinOptionNames.OutputSaver}.{outputFileManifest.TargetName}", BuiltinOptionNames.CleanUpOutputDir, + true, true)) + { + return; + } + FileCleaner.Clean(outputDir, outputFileManifest.DataFiles.Select(f => f.File).ToList()); + } + + public override void SaveFile(OutputFileManifest fileManifest, string outputDir, OutputFile outputFile) + { + string fullOutputPath = $"{outputDir}/{outputFile.File}"; + Directory.CreateDirectory(Path.GetDirectoryName(fullOutputPath)); + string tag = File.Exists(fullOutputPath) ? "overwrite" : "new"; + if (FileUtil.WriteAllBytes(fullOutputPath, outputFile.GetContentBytes())) + { + s_logger.Info("[{0}] {1} ", tag, fullOutputPath); + } + } +} diff --git a/luban/src/Luban.Core/OutputSaver/NullSaver.cs b/luban/src/Luban.Core/OutputSaver/NullSaver.cs new file mode 100644 index 00000000..daa9a2cc --- /dev/null +++ b/luban/src/Luban.Core/OutputSaver/NullSaver.cs @@ -0,0 +1,15 @@ +namespace Luban.OutputSaver; + +[OutputSaver("null")] +public class NullSaver : OutputSaverBase +{ + public override void Save(OutputFileManifest outputFileManifest) + { + + } + + public override void SaveFile(OutputFileManifest fileManifest, string outputDir, OutputFile outputFile) + { + + } +} diff --git a/luban/src/Luban.Core/OutputSaver/OutputSaverAttribute.cs b/luban/src/Luban.Core/OutputSaver/OutputSaverAttribute.cs new file mode 100644 index 00000000..52c84c90 --- /dev/null +++ b/luban/src/Luban.Core/OutputSaver/OutputSaverAttribute.cs @@ -0,0 +1,11 @@ +using Luban.CustomBehaviour; + +namespace Luban.OutputSaver; + +[AttributeUsage(AttributeTargets.Class)] +public class OutputSaverAttribute : BehaviourBaseAttribute +{ + public OutputSaverAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/OutputSaver/OutputSaverBase.cs b/luban/src/Luban.Core/OutputSaver/OutputSaverBase.cs new file mode 100644 index 00000000..b770ffc8 --- /dev/null +++ b/luban/src/Luban.Core/OutputSaver/OutputSaverBase.cs @@ -0,0 +1,44 @@ +using System.Reflection; + +namespace Luban.OutputSaver; + +public abstract class OutputSaverBase : IOutputSaver +{ + public virtual string Name => GetType().GetCustomAttribute().Name; + + protected virtual string GetOutputDir(OutputFileManifest manifest) + { + string optionName = manifest.OutputType == OutputType.Code + ? BuiltinOptionNames.OutputCodeDir + : BuiltinOptionNames.OutputDataDir; + return EnvManager.Current.GetOption($"{manifest.TargetName}", optionName, true); + } + + protected virtual void BeforeSave(OutputFileManifest outputFileManifest, string outputDir) + { + + } + + protected virtual void PostSave(OutputFileManifest outputFileManifest, string outputDir) + { + + } + + public virtual void Save(OutputFileManifest outputFileManifest) + { + string outputDir = GetOutputDir(outputFileManifest); + BeforeSave(outputFileManifest, outputDir); + var tasks = new List(); + foreach (var outputFile in outputFileManifest.DataFiles) + { + tasks.Add(Task.Run(() => + { + SaveFile(outputFileManifest, outputDir, outputFile); + })); + } + Task.WaitAll(tasks.ToArray()); + PostSave(outputFileManifest, outputDir); + } + + public abstract void SaveFile(OutputFileManifest fileManifest, string outputDir, OutputFile outputFile); +} diff --git a/luban/src/Luban.Core/OutputSaver/OutputSaverManager.cs b/luban/src/Luban.Core/OutputSaver/OutputSaverManager.cs new file mode 100644 index 00000000..114f2d04 --- /dev/null +++ b/luban/src/Luban.Core/OutputSaver/OutputSaverManager.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using Luban.CustomBehaviour; + +namespace Luban.OutputSaver; + +public class OutputSaverManager +{ + public static OutputSaverManager Ins { get; } = new(); + + public void Init() + { + + } + + public IOutputSaver GetOutputSaver(string name) + { + return CustomBehaviourManager.Ins.CreateBehaviour(name); + } +} diff --git a/luban/src/Luban.Core/Pipeline/DefaultPipeline.cs b/luban/src/Luban.Core/Pipeline/DefaultPipeline.cs new file mode 100644 index 00000000..87709487 --- /dev/null +++ b/luban/src/Luban.Core/Pipeline/DefaultPipeline.cs @@ -0,0 +1,166 @@ +using Luban.CodeTarget; +using Luban.DataTarget; +using Luban.Defs; +using Luban.L10N; +using Luban.OutputSaver; +using Luban.PostProcess; +using Luban.RawDefs; +using Luban.Schema; +using Luban.Validator; +using NLog; + +namespace Luban.Pipeline; + +[Pipeline("default")] +public class DefaultPipeline : IPipeline +{ + private static readonly Logger s_logger = LogManager.GetCurrentClassLogger(); + + private LubanConfig _config; + + private PipelineArguments _args; + + private RawAssembly _rawAssembly; + + private DefAssembly _defAssembly; + + private GenerationContext _genCtx; + + public DefaultPipeline() + { + } + + public void Run(PipelineArguments args) + { + _args = args; + _config = args.Config; + LoadSchema(); + PrepareGenerationContext(); + ProcessTargets(); + } + + protected void LoadSchema() + { + string schemaCollectorName = _args.SchemaCollector; + s_logger.Info("load schema. collector: {}", schemaCollectorName); + var schemaCollector = SchemaManager.Ins.CreateSchemaCollector(schemaCollectorName); + schemaCollector.Load(_config); + _rawAssembly = schemaCollector.CreateRawAssembly(); + } + + protected void PrepareGenerationContext() + { + s_logger.Debug("prepare generation context"); + _genCtx = new GenerationContext(); + _defAssembly = new DefAssembly(_rawAssembly, _args.Target, _args.OutputTables, _config.Groups, _args.Variants); + + var generationCtxBuilder = new GenerationContextBuilder + { + Assembly = _defAssembly, + IncludeTags = _args.IncludeTags, + ExcludeTags = _args.ExcludeTags, + TimeZone = _args.TimeZone, + }; + _genCtx.Init(generationCtxBuilder); + } + + protected void LoadDatas() + { + _genCtx.LoadDatas(); + DoValidate(); + ProcessL10N(); + } + + protected void DoValidate() + { + s_logger.Info("validation begin"); + var v = new DataValidatorContext(_defAssembly); + v.ValidateTables(_genCtx.Tables); + s_logger.Info("validation end"); + } + + protected void ProcessL10N() + { + if (_genCtx.TextProvider != null) + { + _genCtx.TextProvider.ProcessDatas(); + } + } + + protected void ProcessTargets() + { + var tasks = new List(); + tasks.Add(Task.Run(() => + { + foreach (string target in _args.CodeTargets) + { + // code target doesn't support run in parallel + ICodeTarget m = CodeTargetManager.Ins.CreateCodeTarget(target); + ProcessCodeTarget(target, m); + } + })); + + if (_args.ForceLoadTableDatas || _args.DataTargets.Count > 0) + { + LoadDatas(); + } + + if (_args.DataTargets.Count > 0) + { + string dataExporterName = EnvManager.Current.GetOptionOrDefault("", BuiltinOptionNames.DataExporter, true, "default"); + s_logger.Debug("dataExporter: {}", dataExporterName); + IDataExporter dataExporter = DataTargetManager.Ins.CreateDataExporter(dataExporterName); + foreach (string mission in _args.DataTargets) + { + IDataTarget dataTarget = DataTargetManager.Ins.CreateDataTarget(mission); + tasks.Add(Task.Run(() => ProcessDataTarget(mission, dataExporter, dataTarget))); + } + } + Task.WaitAll(tasks.ToArray()); + } + + protected void ProcessCodeTarget(string name, ICodeTarget codeTarget) + { + s_logger.Info("process code target:{} begin", name); + var outputManifest = new OutputFileManifest(name, OutputType.Code); + GenerationContext.CurrentCodeTarget = codeTarget; + codeTarget.ValidateDefinition(_genCtx); + codeTarget.Handle(_genCtx, outputManifest); + + outputManifest = PostProcess(BuiltinOptionNames.CodePostprocess, outputManifest); + Save(outputManifest); + s_logger.Info("process code target:{} end", name); + } + + protected OutputFileManifest PostProcess(string familyName, OutputFileManifest manifest) + { + string name = manifest.TargetName; + if (EnvManager.Current.TryGetOption(name, familyName, true, out string postProcessName)) + { + var newManifest = new OutputFileManifest(name, manifest.OutputType); + PostProcessManager.Ins.GetPostProcess(postProcessName).PostProcess(manifest, newManifest); + return newManifest; + } + return manifest; + } + + protected void ProcessDataTarget(string name, IDataExporter mission, IDataTarget dataTarget) + { + s_logger.Info("process data target:{} begin", name); + var outputManifest = new OutputFileManifest(name, OutputType.Data); + mission.Handle(_genCtx, dataTarget, outputManifest); + + var newManifest = PostProcess(BuiltinOptionNames.DataPostprocess, outputManifest); + Save(newManifest); + s_logger.Info("process data target:{} end", name); + } + + private void Save(OutputFileManifest manifest) + { + string name = manifest.TargetName; + string outputSaverName = EnvManager.Current.GetOptionOrDefault(name, BuiltinOptionNames.OutputSaver, true, "local"); + var saver = OutputSaverManager.Ins.GetOutputSaver(outputSaverName); + saver.Save(manifest); + } + +} diff --git a/luban/src/Luban.Core/Pipeline/IPipeline.cs b/luban/src/Luban.Core/Pipeline/IPipeline.cs new file mode 100644 index 00000000..cf11fabe --- /dev/null +++ b/luban/src/Luban.Core/Pipeline/IPipeline.cs @@ -0,0 +1,9 @@ +using Luban.Defs; +using Luban.RawDefs; + +namespace Luban.Pipeline; + +public interface IPipeline +{ + void Run(PipelineArguments args); +} diff --git a/luban/src/Luban.Core/Pipeline/PipelineArguments.cs b/luban/src/Luban.Core/Pipeline/PipelineArguments.cs new file mode 100644 index 00000000..ebbea285 --- /dev/null +++ b/luban/src/Luban.Core/Pipeline/PipelineArguments.cs @@ -0,0 +1,30 @@ +using Luban.Schema; + +namespace Luban.Pipeline; + +public class PipelineArguments +{ + public string Target { get; set; } + + public bool ForceLoadTableDatas { get; set; } + + public List IncludeTags { get; set; } + + public List ExcludeTags { get; set; } + + public List CodeTargets { get; set; } + + public List DataTargets { get; set; } + + public string SchemaCollector { get; set; } + + public LubanConfig Config { get; set; } + + public List OutputTables { get; set; } + + public string TimeZone { get; set; } + + public Dictionary CustomArgs { get; set; } + + public Dictionary Variants { get; set; } +} diff --git a/luban/src/Luban.Core/Pipeline/PipelineAttribute.cs b/luban/src/Luban.Core/Pipeline/PipelineAttribute.cs new file mode 100644 index 00000000..0b001bbd --- /dev/null +++ b/luban/src/Luban.Core/Pipeline/PipelineAttribute.cs @@ -0,0 +1,12 @@ +using Luban.CustomBehaviour; + +namespace Luban.Pipeline; + +[AttributeUsage(AttributeTargets.Class)] +public class PipelineAttribute : BehaviourBaseAttribute +{ + public PipelineAttribute(string name) : base(name) + { + + } +} diff --git a/luban/src/Luban.Core/Pipeline/PipelineManager.cs b/luban/src/Luban.Core/Pipeline/PipelineManager.cs new file mode 100644 index 00000000..2e9b798e --- /dev/null +++ b/luban/src/Luban.Core/Pipeline/PipelineManager.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using Luban.CustomBehaviour; + +namespace Luban.Pipeline; + +public class PipelineManager +{ + public static PipelineManager Ins { get; } = new(); + + public void Init() + { + + } + + public IPipeline CreatePipeline(string name) + { + return CustomBehaviourManager.Ins.CreateBehaviour(name); + } +} diff --git a/luban/src/Luban.Core/PostProcess/IPostProcess.cs b/luban/src/Luban.Core/PostProcess/IPostProcess.cs new file mode 100644 index 00000000..ee9e604c --- /dev/null +++ b/luban/src/Luban.Core/PostProcess/IPostProcess.cs @@ -0,0 +1,7 @@ +namespace Luban.PostProcess; + +public interface IPostProcess +{ + void PostProcess(OutputFileManifest oldOutputFileManifest, OutputFileManifest newOutputFileManifest); + void PostProcess(OutputFileManifest oldOutputFileManifest, OutputFileManifest newOutputFileManifest, OutputFile outputFile); +} diff --git a/luban/src/Luban.Core/PostProcess/PostProcessAttribute.cs b/luban/src/Luban.Core/PostProcess/PostProcessAttribute.cs new file mode 100644 index 00000000..ae3ff670 --- /dev/null +++ b/luban/src/Luban.Core/PostProcess/PostProcessAttribute.cs @@ -0,0 +1,22 @@ +using Luban.CustomBehaviour; + +namespace Luban.PostProcess; + +[Flags] +public enum TargetFileType +{ + None = 0, + Code = 0x1, + DataExport = 0x2, + DataConvert = 0x4, +} + +public class PostProcessAttribute : BehaviourBaseAttribute +{ + public TargetFileType TargetFileType { get; } + + public PostProcessAttribute(string name, TargetFileType targetFileType) : base(name) + { + TargetFileType = targetFileType; + } +} diff --git a/luban/src/Luban.Core/PostProcess/PostProcessBase.cs b/luban/src/Luban.Core/PostProcess/PostProcessBase.cs new file mode 100644 index 00000000..15ca9613 --- /dev/null +++ b/luban/src/Luban.Core/PostProcess/PostProcessBase.cs @@ -0,0 +1,15 @@ +namespace Luban.PostProcess; + +public abstract class PostProcessBase : IPostProcess +{ + public virtual void PostProcess(OutputFileManifest oldOutputFileManifest, OutputFileManifest newOutputFileManifest) + { + foreach (var outputFile in oldOutputFileManifest.DataFiles) + { + PostProcess(oldOutputFileManifest, newOutputFileManifest, outputFile); + } + } + + public abstract void PostProcess(OutputFileManifest oldOutputFileManifest, OutputFileManifest newOutputFileManifest, + OutputFile outputFile); +} diff --git a/luban/src/Luban.Core/PostProcess/PostProcessManager.cs b/luban/src/Luban.Core/PostProcess/PostProcessManager.cs new file mode 100644 index 00000000..df29bb4e --- /dev/null +++ b/luban/src/Luban.Core/PostProcess/PostProcessManager.cs @@ -0,0 +1,18 @@ +using Luban.CustomBehaviour; + +namespace Luban.PostProcess; + +public class PostProcessManager +{ + public static PostProcessManager Ins { get; } = new(); + + public void Init() + { + + } + + public IPostProcess GetPostProcess(string name) + { + return CustomBehaviourManager.Ins.CreateBehaviour(name); + } +} diff --git a/luban/src/Luban.Core/RawDefs/RawAssembly.cs b/luban/src/Luban.Core/RawDefs/RawAssembly.cs new file mode 100644 index 00000000..9531f5c8 --- /dev/null +++ b/luban/src/Luban.Core/RawDefs/RawAssembly.cs @@ -0,0 +1,16 @@ +namespace Luban.RawDefs; + +public class RawAssembly +{ + public List Beans { get; set; } = new(); + + public List Enums { get; set; } = new(); + + public List Tables { get; set; } = new(); + + public List Groups { get; set; } = new(); + + public List Targets { get; set; } = new(); + + public List RefGroups { get; set; } = new(); +} diff --git a/luban/src/Luban.Core/RawDefs/RawBean.cs b/luban/src/Luban.Core/RawDefs/RawBean.cs new file mode 100644 index 00000000..7f3f3953 --- /dev/null +++ b/luban/src/Luban.Core/RawDefs/RawBean.cs @@ -0,0 +1,28 @@ +namespace Luban.RawDefs; + +public class RawBean +{ + public string Namespace { get; set; } + + public string Name { get; set; } + + public string FullName => Namespace.Length > 0 ? Namespace + "." + Name : Name; + + public string Parent { get; set; } + + public bool IsValueType { get; set; } + + public string Comment { get; set; } + + public Dictionary Tags { get; set; } + + public string Alias { get; set; } + + public string Sep { get; set; } + + public List Groups { get; set; } + + public List Fields { get; set; } + + public List TypeMappers { get; set; } +} diff --git a/luban/src/Luban.Core/RawDefs/RawEnum.cs b/luban/src/Luban.Core/RawDefs/RawEnum.cs new file mode 100644 index 00000000..d7d04943 --- /dev/null +++ b/luban/src/Luban.Core/RawDefs/RawEnum.cs @@ -0,0 +1,37 @@ +namespace Luban.RawDefs; + +public class EnumItem +{ + public string Name { get; set; } + + public string Alias { get; set; } + + public string Value { get; set; } + + public string Comment { get; set; } + + public Dictionary Tags { get; set; } +} + +public class RawEnum +{ + public string Namespace { get; set; } + + public string Name { get; set; } + + public string FullName => Namespace.Length > 0 ? Namespace + "." + Name : Name; + + public bool IsFlags { get; set; } + + public bool IsUniqueItemId { get; set; } + + public string Comment { get; set; } + + public Dictionary Tags { get; set; } + + public List Items { get; set; } + + public List Groups { get; set; } + + public List TypeMappers { get; set; } +} diff --git a/luban/src/Luban.Core/RawDefs/RawField.cs b/luban/src/Luban.Core/RawDefs/RawField.cs new file mode 100644 index 00000000..5462d060 --- /dev/null +++ b/luban/src/Luban.Core/RawDefs/RawField.cs @@ -0,0 +1,20 @@ +namespace Luban.RawDefs; + +public class RawField +{ + public string Name { get; set; } + + public string Alias { get; set; } + + public string Type { get; set; } + + public string Comment { get; set; } + + public Dictionary Tags { get; set; } + + public List Variants { get; set; } + + public bool NotNameValidation { get; set; } + + public List Groups { get; set; } +} diff --git a/luban/src/Luban.Core/RawDefs/RawGroup.cs b/luban/src/Luban.Core/RawDefs/RawGroup.cs new file mode 100644 index 00000000..60c98de6 --- /dev/null +++ b/luban/src/Luban.Core/RawDefs/RawGroup.cs @@ -0,0 +1,8 @@ +namespace Luban.RawDefs; + +public class RawGroup +{ + public bool IsDefault { get; set; } + + public List Names { get; set; } +} diff --git a/luban/src/Luban.Core/RawDefs/RawRefGroup.cs b/luban/src/Luban.Core/RawDefs/RawRefGroup.cs new file mode 100644 index 00000000..e6ff3c5a --- /dev/null +++ b/luban/src/Luban.Core/RawDefs/RawRefGroup.cs @@ -0,0 +1,8 @@ +namespace Luban.RawDefs; + +public class RawRefGroup +{ + public string Name { get; set; } + + public List Refs { get; set; } +} diff --git a/luban/src/Luban.Core/RawDefs/RawTable.cs b/luban/src/Luban.Core/RawDefs/RawTable.cs new file mode 100644 index 00000000..6a83adaa --- /dev/null +++ b/luban/src/Luban.Core/RawDefs/RawTable.cs @@ -0,0 +1,28 @@ +using Luban.Defs; + +namespace Luban.RawDefs; + +public class RawTable +{ + public string Namespace { get; set; } + + public string Name { get; set; } + + public string Index { get; set; } + + public string ValueType { get; set; } + + public bool ReadSchemaFromFile { get; set; } + + public TableMode Mode { get; set; } + + public string Comment { get; set; } + + public Dictionary Tags { get; set; } + + public List Groups { get; set; } = new(); + + public List InputFiles { get; set; } = new(); + + public string OutputFile { get; set; } +} diff --git a/luban/src/Luban.Core/RawDefs/RawTarget.cs b/luban/src/Luban.Core/RawDefs/RawTarget.cs new file mode 100644 index 00000000..f8e93f03 --- /dev/null +++ b/luban/src/Luban.Core/RawDefs/RawTarget.cs @@ -0,0 +1,12 @@ +namespace Luban.RawDefs; + +public class RawTarget +{ + public string Name { get; set; } + + public string Manager { get; set; } + + public string TopModule { get; set; } + + public List Groups { get; set; } = new(); +} diff --git a/luban/src/Luban.Core/RawDefs/TypeMapper.cs b/luban/src/Luban.Core/RawDefs/TypeMapper.cs new file mode 100644 index 00000000..cda46a70 --- /dev/null +++ b/luban/src/Luban.Core/RawDefs/TypeMapper.cs @@ -0,0 +1,10 @@ +namespace Luban.RawDefs; + +public class TypeMapper +{ + public List Targets { get; set; } + + public List CodeTargets { get; set; } + + public Dictionary Options { get; set; } +} diff --git a/luban/src/Luban.Core/RegisterBehaviourAttribute.cs b/luban/src/Luban.Core/RegisterBehaviourAttribute.cs new file mode 100644 index 00000000..7858254a --- /dev/null +++ b/luban/src/Luban.Core/RegisterBehaviourAttribute.cs @@ -0,0 +1,7 @@ +namespace Luban; + +[AttributeUsage(AttributeTargets.Assembly)] +public class RegisterBehaviourAttribute : Attribute +{ + +} diff --git a/luban/src/Luban.Core/Schema/BeanSchemaLoaderAttribute.cs b/luban/src/Luban.Core/Schema/BeanSchemaLoaderAttribute.cs new file mode 100644 index 00000000..9ce8c892 --- /dev/null +++ b/luban/src/Luban.Core/Schema/BeanSchemaLoaderAttribute.cs @@ -0,0 +1,11 @@ +using Luban.CustomBehaviour; + +namespace Luban.Schema; + +[AttributeUsage(AttributeTargets.Class, Inherited = false)] +public class BeanSchemaLoaderAttribute : BehaviourBaseAttribute +{ + public BeanSchemaLoaderAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/Schema/IBeanSchemaLoader.cs b/luban/src/Luban.Core/Schema/IBeanSchemaLoader.cs new file mode 100644 index 00000000..468c743e --- /dev/null +++ b/luban/src/Luban.Core/Schema/IBeanSchemaLoader.cs @@ -0,0 +1,9 @@ +using Luban.Defs; +using Luban.RawDefs; + +namespace Luban.Schema; + +public interface IBeanSchemaLoader +{ + RawBean Load(string fileName, string beanFullName, RawTable table); +} diff --git a/luban/src/Luban.Core/Schema/IConfigLoader.cs b/luban/src/Luban.Core/Schema/IConfigLoader.cs new file mode 100644 index 00000000..23ed5ae5 --- /dev/null +++ b/luban/src/Luban.Core/Schema/IConfigLoader.cs @@ -0,0 +1,6 @@ +namespace Luban.Schema; + +public interface IConfigLoader +{ + LubanConfig Load(string fileName); +} diff --git a/luban/src/Luban.Core/Schema/ISchemaCollector.cs b/luban/src/Luban.Core/Schema/ISchemaCollector.cs new file mode 100644 index 00000000..c3f94d6b --- /dev/null +++ b/luban/src/Luban.Core/Schema/ISchemaCollector.cs @@ -0,0 +1,19 @@ +using Luban.RawDefs; + +namespace Luban.Schema; + +public interface ISchemaCollector +{ + void Load(LubanConfig config); + + RawAssembly CreateRawAssembly(); + + void Add(RawTable table); + + void Add(RawBean bean); + + void Add(RawEnum @enum); + + void Add(RawRefGroup refGroup); + +} diff --git a/luban/src/Luban.Core/Schema/ISchemaLoader.cs b/luban/src/Luban.Core/Schema/ISchemaLoader.cs new file mode 100644 index 00000000..32e2094d --- /dev/null +++ b/luban/src/Luban.Core/Schema/ISchemaLoader.cs @@ -0,0 +1,10 @@ +namespace Luban.Schema; + +public interface ISchemaLoader +{ + string Type { get; set; } + + ISchemaCollector Collector { get; set; } + + void Load(string fileName); +} diff --git a/luban/src/Luban.Core/Schema/ITableImporter.cs b/luban/src/Luban.Core/Schema/ITableImporter.cs new file mode 100644 index 00000000..85179bfb --- /dev/null +++ b/luban/src/Luban.Core/Schema/ITableImporter.cs @@ -0,0 +1,13 @@ +using Luban.RawDefs; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.Schema; + +public interface ITableImporter +{ + List LoadImportTables(); +} diff --git a/luban/src/Luban.Core/Schema/LubanConfig.cs b/luban/src/Luban.Core/Schema/LubanConfig.cs new file mode 100644 index 00000000..94ca32c1 --- /dev/null +++ b/luban/src/Luban.Core/Schema/LubanConfig.cs @@ -0,0 +1,17 @@ +using Luban.RawDefs; + +namespace Luban.Schema; + +public class LubanConfig +{ + public string ConfigFileName { get; set; } + public List Groups { get; set; } + + public List Targets { get; set; } + + public List Imports { get; set; } + + public List Xargs { get; set; } + + public string InputDataDir { get; set; } +} diff --git a/luban/src/Luban.Core/Schema/SchemaCollectorAttribute.cs b/luban/src/Luban.Core/Schema/SchemaCollectorAttribute.cs new file mode 100644 index 00000000..a6c928d5 --- /dev/null +++ b/luban/src/Luban.Core/Schema/SchemaCollectorAttribute.cs @@ -0,0 +1,11 @@ +using Luban.CustomBehaviour; + +namespace Luban.Schema; + +[AttributeUsage(AttributeTargets.Class)] +public class SchemaCollectorAttribute : BehaviourBaseAttribute +{ + public SchemaCollectorAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/Schema/SchemaCollectorBase.cs b/luban/src/Luban.Core/Schema/SchemaCollectorBase.cs new file mode 100644 index 00000000..807e8d5f --- /dev/null +++ b/luban/src/Luban.Core/Schema/SchemaCollectorBase.cs @@ -0,0 +1,66 @@ +using Luban.RawDefs; + +namespace Luban.Schema; + +public abstract class SchemaCollectorBase : ISchemaCollector +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private readonly List _enums = new(); + private readonly List _beans = new(); + + private readonly List _tables = new(); + + private readonly List _refGroups = new(); + + protected List Tables => _tables; + + public abstract void Load(LubanConfig config); + + public abstract RawAssembly CreateRawAssembly(); + + protected RawAssembly CreateRawAssembly(LubanConfig config) + { + return new RawAssembly() + { + Tables = _tables, + Targets = config.Targets.ToList(), + Groups = config.Groups.ToList(), + RefGroups = _refGroups, + Enums = _enums, + Beans = _beans, + }; + } + + public void Add(RawTable table) + { + lock (this) + { + _tables.Add(table); + } + } + + public void Add(RawBean bean) + { + lock (this) + { + _beans.Add(bean); + } + } + + public void Add(RawEnum @enum) + { + lock (this) + { + _enums.Add(@enum); + } + } + + public void Add(RawRefGroup refGroup) + { + lock (this) + { + _refGroups.Add(refGroup); + } + } +} diff --git a/luban/src/Luban.Core/Schema/SchemaFileInfo.cs b/luban/src/Luban.Core/Schema/SchemaFileInfo.cs new file mode 100644 index 00000000..e5c531b8 --- /dev/null +++ b/luban/src/Luban.Core/Schema/SchemaFileInfo.cs @@ -0,0 +1,8 @@ +namespace Luban.Schema; + +public class SchemaFileInfo +{ + public string FileName { get; set; } + + public string Type { get; set; } +} diff --git a/luban/src/Luban.Core/Schema/SchemaLoaderAttribute.cs b/luban/src/Luban.Core/Schema/SchemaLoaderAttribute.cs new file mode 100644 index 00000000..4eea18ed --- /dev/null +++ b/luban/src/Luban.Core/Schema/SchemaLoaderAttribute.cs @@ -0,0 +1,17 @@ +namespace Luban.Schema; + +[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] +public class SchemaLoaderAttribute : System.Attribute +{ + public string Type { get; } + + public string[] ExtNames { get; } + + public int Priority { get; set; } + + public SchemaLoaderAttribute(string type, params string[] extNames) + { + Type = type; + ExtNames = extNames; + } +} diff --git a/luban/src/Luban.Core/Schema/SchemaLoaderBase.cs b/luban/src/Luban.Core/Schema/SchemaLoaderBase.cs new file mode 100644 index 00000000..b54ee8d6 --- /dev/null +++ b/luban/src/Luban.Core/Schema/SchemaLoaderBase.cs @@ -0,0 +1,10 @@ +namespace Luban.Schema; + +public abstract class SchemaLoaderBase : ISchemaLoader +{ + public string Type { get; set; } + + public ISchemaCollector Collector { get; set; } + + public abstract void Load(string fileName); +} diff --git a/luban/src/Luban.Core/Schema/SchemaManager.cs b/luban/src/Luban.Core/Schema/SchemaManager.cs new file mode 100644 index 00000000..ef4e5abc --- /dev/null +++ b/luban/src/Luban.Core/Schema/SchemaManager.cs @@ -0,0 +1,95 @@ +using System.Reflection; +using Luban.CustomBehaviour; +using Luban.Utils; + +namespace Luban.Schema; + +public class SchemaManager +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public static SchemaManager Ins { get; } = new(); + + private class LoaderInfo + { + public string Type { get; init; } + + public string ExtName { get; init; } + + public int Priority { get; init; } + + public Func Creator { get; init; } + } + + private readonly Dictionary<(string, string), LoaderInfo> _schemaLoaders = new(); + + public void Init() + { + _schemaLoaders.Clear(); + } + + public void ScanRegisterAll(Assembly assembly) + { + ScanRegisterSchemaLoaderCreator(assembly); + } + + public ISchemaCollector CreateSchemaCollector(string name) + { + return CustomBehaviourManager.Ins.CreateBehaviour(name); + } + + public ISchemaLoader CreateSchemaLoader(string extName, string type, ISchemaCollector collector) + { + if (!_schemaLoaders.TryGetValue((extName, type), out var loader)) + { + throw new Exception($"can't find schema loader for type:{type} extName:{extName}"); + } + + ISchemaLoader schemaLoader = loader.Creator(); + schemaLoader.Type = type; + schemaLoader.Collector = collector; + return schemaLoader; + } + + public void RegisterSchemaLoaderCreator(string type, string extName, int priority, Func creator) + { + if (_schemaLoaders.TryGetValue((extName, type), out var loader)) + { + if (loader.Priority >= priority) + { + s_logger.Warn("schema loader creator already exist. type:{} priority:{} extName:{}", type, priority, extName); + return; + } + } + s_logger.Trace("add schema loader creator. type:{} priority:{} extName:{}", type, priority, extName); + _schemaLoaders[(extName, type)] = new LoaderInfo() { Type = type, ExtName = extName, Priority = priority, Creator = creator }; + } + + public void ScanRegisterSchemaLoaderCreator(Assembly assembly) + { + foreach (var t in assembly.GetTypes()) + { + if (t.IsDefined(typeof(SchemaLoaderAttribute), false)) + { + foreach (var attr in t.GetCustomAttributes()) + { + var creator = () => (ISchemaLoader)Activator.CreateInstance(t); + foreach (var extName in attr.ExtNames) + { + RegisterSchemaLoaderCreator(attr.Type, extName, attr.Priority, creator); + } + } + } + } + } + + public IBeanSchemaLoader CreateBeanSchemaLoader(string type) + { + return CustomBehaviourManager.Ins.CreateBehaviour(type); + } + + public ITableImporter CreateTableImporter(string type) + { + return CustomBehaviourManager.Ins.CreateBehaviour(type); + } +} diff --git a/luban/src/Luban.Core/Schema/TableImporterAttribute.cs b/luban/src/Luban.Core/Schema/TableImporterAttribute.cs new file mode 100644 index 00000000..9170237e --- /dev/null +++ b/luban/src/Luban.Core/Schema/TableImporterAttribute.cs @@ -0,0 +1,16 @@ +using Luban.CustomBehaviour; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.Schema; + +[AttributeUsage(AttributeTargets.Class)] +public class TableImporterAttribute : BehaviourBaseAttribute +{ + public TableImporterAttribute(string name) : base(name) + { + } +} diff --git a/luban/src/Luban.Core/Serialization/BeanBase.cs b/luban/src/Luban.Core/Serialization/BeanBase.cs new file mode 100644 index 00000000..2a48aef0 --- /dev/null +++ b/luban/src/Luban.Core/Serialization/BeanBase.cs @@ -0,0 +1,10 @@ +namespace Luban.Serialization; + +public abstract class BeanBase : ITypeId, ISerializable +{ + public abstract int GetTypeId(); + + public abstract void Serialize(ByteBuf os); + + public abstract void Deserialize(ByteBuf os); +} diff --git a/luban/src/Luban.Core/Serialization/ByteBuf.cs b/luban/src/Luban.Core/Serialization/ByteBuf.cs new file mode 100644 index 00000000..47e9378f --- /dev/null +++ b/luban/src/Luban.Core/Serialization/ByteBuf.cs @@ -0,0 +1,1690 @@ +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace Luban.Serialization; + +public readonly struct SegmentSaveState +{ + public SegmentSaveState(int readerIndex, int writerIndex) + { + ReaderIndex = readerIndex; + WriterIndex = writerIndex; + } + + public int ReaderIndex { get; } + + public int WriterIndex { get; } +} + +public sealed class ByteBuf : ICloneable, IEquatable +{ + public ByteBuf() + { + Bytes = Array.Empty(); + ReaderIndex = WriterIndex = 0; + } + + public ByteBuf(int capacity) + { + Bytes = capacity > 0 ? new byte[capacity] : Array.Empty(); + ReaderIndex = 0; + WriterIndex = 0; + } + + public ByteBuf(byte[] bytes) + { + Bytes = bytes; + ReaderIndex = 0; + WriterIndex = Capacity; + } + + public ByteBuf(byte[] bytes, int readIndex, int writeIndex) + { + Bytes = bytes; + ReaderIndex = readIndex; + WriterIndex = writeIndex; + } + + public ByteBuf(int capacity, Action releaser) : this(capacity) + { + _releaser = releaser; + } + + public static ByteBuf Wrap(byte[] bytes) + { + return new ByteBuf(bytes, 0, bytes.Length); + } + + public void Replace(byte[] bytes) + { + Bytes = bytes; + ReaderIndex = 0; + WriterIndex = Capacity; + } + + public void Replace(byte[] bytes, int beginPos, int endPos) + { + Bytes = bytes; + ReaderIndex = beginPos; + WriterIndex = endPos; + } + + public int ReaderIndex { get; set; } + + public int WriterIndex { get; set; } + + private readonly Action _releaser; + + public int Capacity => Bytes.Length; + + public int Size { get { return WriterIndex - ReaderIndex; } } + + public bool Empty => WriterIndex <= ReaderIndex; + + public bool NotEmpty => WriterIndex > ReaderIndex; + + + public void AddWriteIndex(int add) + { + WriterIndex += add; + } + + public void AddReadIndex(int add) + { + ReaderIndex += add; + } + +#pragma warning disable CA1819 // 属性不应返回数组 + public byte[] Bytes { get; private set; } +#pragma warning restore CA1819 // 属性不应返回数组 + + public byte[] CopyData() + { + var n = Remaining; + if (n > 0) + { + var arr = new byte[n]; + Buffer.BlockCopy(Bytes, ReaderIndex, arr, 0, n); + return arr; + } + else + { + return Array.Empty(); + } + } + + public int Remaining { get { return WriterIndex - ReaderIndex; } } + + public void DiscardReadBytes() + { + WriterIndex -= ReaderIndex; + Array.Copy(Bytes, ReaderIndex, Bytes, 0, WriterIndex); + ReaderIndex = 0; + } + + public int NotCompactWritable { get { return Capacity - WriterIndex; } } + + public void WriteBytesWithoutSize(byte[] bs) + { + WriteBytesWithoutSize(bs, 0, bs.Length); + } + + public void WriteBytesWithoutSize(byte[] bs, int offset, int len) + { + EnsureWrite(len); + Buffer.BlockCopy(bs, offset, Bytes, WriterIndex, len); + WriterIndex += len; + } + + public void Clear() + { + ReaderIndex = WriterIndex = 0; + } + + private const int MIN_CAPACITY = 16; + + private static int PropSize(int initSize, int needSize) + { + for (int i = Math.Max(initSize, MIN_CAPACITY); ; i <<= 1) + { + if (i >= needSize) + { + return i; + } + } + } + + private void EnsureWrite0(int size) + { + var needSize = WriterIndex + size - ReaderIndex; + if (needSize < Capacity) + { + WriterIndex -= ReaderIndex; + Array.Copy(Bytes, ReaderIndex, Bytes, 0, WriterIndex); + ReaderIndex = 0; + } + else + { + int newCapacity = PropSize(Capacity, needSize); + var newBytes = new byte[newCapacity]; + WriterIndex -= ReaderIndex; + Buffer.BlockCopy(Bytes, ReaderIndex, newBytes, 0, WriterIndex); + ReaderIndex = 0; + Bytes = newBytes; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void EnsureWrite(int size) + { + if (WriterIndex + size > Capacity) + { + EnsureWrite0(size); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void EnsureRead(int size) + { + if (ReaderIndex + size > WriterIndex) + { + throw new SerializationException(); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private bool CanRead(int size) + { + return (ReaderIndex + size <= WriterIndex); + } + + public void Append(byte x) + { + EnsureWrite(1); + Bytes[WriterIndex++] = x; + } + + public void WriteBool(bool b) + { + EnsureWrite(1); + Bytes[WriterIndex++] = (byte)(b ? 1 : 0); + } + + public bool ReadBool() + { + EnsureRead(1); + return Bytes[ReaderIndex++] != 0; + } + + public void WriteByte(byte x) + { + EnsureWrite(1); + Bytes[WriterIndex++] = x; + } + + public byte ReadByte() + { + EnsureRead(1); + return Bytes[ReaderIndex++]; + } + + + public void WriteShort(short x) + { + if (x >= 0) + { + if (x < 0x80) + { + EnsureWrite(1); + Bytes[WriterIndex++] = (byte)x; + return; + } + else if (x < 0x4000) + { + EnsureWrite(2); + Bytes[WriterIndex + 1] = (byte)x; + Bytes[WriterIndex] = (byte)((x >> 8) | 0x80); + WriterIndex += 2; + return; + } + } + EnsureWrite(3); + Bytes[WriterIndex] = 0xff; + Bytes[WriterIndex + 2] = (byte)x; + Bytes[WriterIndex + 1] = (byte)(x >> 8); + WriterIndex += 3; + } + + public short ReadShort() + { + EnsureRead(1); + int h = Bytes[ReaderIndex]; + if (h < 0x80) + { + ReaderIndex++; + return (short)h; + } + else if (h < 0xc0) + { + EnsureRead(2); + int x = ((h & 0x3f) << 8) | Bytes[ReaderIndex + 1]; + ReaderIndex += 2; + return (short)x; + } + else if ((h == 0xff)) + { + EnsureRead(3); + int x = (Bytes[ReaderIndex + 1] << 8) | Bytes[ReaderIndex + 2]; + ReaderIndex += 3; + return (short)x; + } + else + { + throw new SerializationException(); + } + } + + public short ReadFshort() + { + EnsureRead(2); + short x; +#if CPU_SUPPORT_MEMORY_NOT_ALIGN + unsafe + { + fixed (byte* b = &Bytes[ReaderIndex]) + { + x = *(short*)b; + } + } +#else + x = (short)((Bytes[ReaderIndex + 1] << 8) | Bytes[ReaderIndex]); + +#endif + ReaderIndex += 2; + return x; + } + + public void WriteFshort(short x) + { + EnsureWrite(2); +#if CPU_SUPPORT_MEMORY_NOT_ALIGN + unsafe + { + fixed (byte* b = &Bytes[WriterIndex]) + { + *(short*)b = x; + } + } +#else + Bytes[WriterIndex] = (byte)x; + Bytes[WriterIndex + 1] = (byte)(x >> 8); +#endif + WriterIndex += 2; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void WriteInt(int x) + { + WriteUint((uint)x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int ReadInt() + { + return (int)ReadUint(); + } + + + public void WriteUint(uint x) + { + // 如果有修改,记得也把 EndWriteSegment改了 + // 0 111 1111 + if (x < 0x80) + { + EnsureWrite(1); + Bytes[WriterIndex++] = (byte)x; + } + else if (x < 0x4000) // 10 11 1111, - + { + EnsureWrite(2); + Bytes[WriterIndex + 1] = (byte)x; + Bytes[WriterIndex] = (byte)((x >> 8) | 0x80); + WriterIndex += 2; + } + else if (x < 0x20_0000) // 110 1 1111, -,- + { + EnsureWrite(3); + Bytes[WriterIndex + 2] = (byte)x; + Bytes[WriterIndex + 1] = (byte)(x >> 8); + Bytes[WriterIndex] = (byte)((x >> 16) | 0xc0); + WriterIndex += 3; + } + else if (x < 0x1000_0000) // 1110 1111,-,-,- + { + EnsureWrite(4); + Bytes[WriterIndex + 3] = (byte)x; + Bytes[WriterIndex + 2] = (byte)(x >> 8); + Bytes[WriterIndex + 1] = (byte)(x >> 16); + Bytes[WriterIndex] = (byte)((x >> 24) | 0xe0); + WriterIndex += 4; + } + else + { + EnsureWrite(5); + Bytes[WriterIndex] = 0xf0; + Bytes[WriterIndex + 4] = (byte)x; + Bytes[WriterIndex + 3] = (byte)(x >> 8); + Bytes[WriterIndex + 2] = (byte)(x >> 16); + Bytes[WriterIndex + 1] = (byte)(x >> 24); + WriterIndex += 5; + } + } + + public uint ReadUint() + { + /// + /// 警告! 如有修改,记得调整 TryDeserializeInplaceOctets + EnsureRead(1); + uint h = Bytes[ReaderIndex]; + if (h < 0x80) + { + ReaderIndex++; + return h; + } + else if (h < 0xc0) + { + EnsureRead(2); + uint x = ((h & 0x3f) << 8) | Bytes[ReaderIndex + 1]; + ReaderIndex += 2; + return x; + } + else if (h < 0xe0) + { + EnsureRead(3); + uint x = ((h & 0x1f) << 16) | ((uint)Bytes[ReaderIndex + 1] << 8) | Bytes[ReaderIndex + 2]; + ReaderIndex += 3; + return x; + } + else if (h < 0xf0) + { + + EnsureRead(4); + uint x = ((h & 0x0f) << 24) | ((uint)Bytes[ReaderIndex + 1] << 16) | ((uint)Bytes[ReaderIndex + 2] << 8) | Bytes[ReaderIndex + 3]; + ReaderIndex += 4; + return x; + } + else + { + EnsureRead(5); + uint x = ((uint)Bytes[ReaderIndex + 1] << 24) | ((uint)(Bytes[ReaderIndex + 2] << 16)) | ((uint)Bytes[ReaderIndex + 3] << 8) | Bytes[ReaderIndex + 4]; + ReaderIndex += 5; + return x; + } + } + + public unsafe void WriteUint_Unsafe(uint x) + { + // 0 111 1111 + if (x < 0x80) + { + EnsureWrite(1); + Bytes[WriterIndex++] = (byte)(x << 1); + } + else if (x < 0x4000)// 10 11 1111, - + { + EnsureWrite(2); + + fixed (byte* wb = &Bytes[WriterIndex]) + { + *(uint*)(wb) = (x << 2 | 0b01); + } + + WriterIndex += 2; + } + else if (x < 0x20_0000) // 110 1 1111, -,- + { + EnsureWrite(3); + + fixed (byte* wb = &Bytes[WriterIndex]) + { + *(uint*)(wb) = (x << 3 | 0b011); + } + WriterIndex += 3; + } + else if (x < 0x1000_0000) // 1110 1111,-,-,- + { + EnsureWrite(4); + fixed (byte* wb = &Bytes[WriterIndex]) + { + *(uint*)(wb) = (x << 4 | 0b0111); + } + WriterIndex += 4; + } + else + { + EnsureWrite(5); + fixed (byte* wb = &Bytes[WriterIndex]) + { + *(uint*)(wb) = (x << 5 | 0b01111); + } + WriterIndex += 5; + } + } + + public unsafe uint ReadUint_Unsafe() + { + /// + /// 警告! 如有修改,记得调整 TryDeserializeInplaceOctets + EnsureRead(1); + uint h = Bytes[ReaderIndex]; + if ((h & 0b1) == 0b0) + { + ReaderIndex++; + return (h >> 1); + } + else if ((h & 0b11) == 0b01) + { + EnsureRead(2); + fixed (byte* rb = &Bytes[ReaderIndex]) + { + ReaderIndex += 2; + return (*(uint*)rb) >> 2; + } + } + else if ((h & 0b111) == 0b011) + { + EnsureRead(3); + fixed (byte* rb = &Bytes[ReaderIndex]) + { + ReaderIndex += 3; + return (*(uint*)rb) >> 3; + } + } + else if ((h & 0b1111) == 0b0111) + { + EnsureRead(4); + fixed (byte* rb = &Bytes[ReaderIndex]) + { + ReaderIndex += 4; + return (*(uint*)rb) >> 4; + } + } + else + { + EnsureRead(5); + fixed (byte* rb = &Bytes[ReaderIndex]) + { + ReaderIndex += 5; + return (*(uint*)rb) >> 5; + } + } + } + + public int ReadFint() + { + EnsureRead(4); + int x; +#if CPU_SUPPORT_MEMORY_NOT_ALIGN + unsafe + { + fixed (byte* b = &Bytes[ReaderIndex]) + { + x = *(int*)b; + } + } +#else + x = (Bytes[ReaderIndex + 3] << 24) | (Bytes[ReaderIndex + 2] << 16) | (Bytes[ReaderIndex + 1] << 8) | (Bytes[ReaderIndex]); + +#endif + ReaderIndex += 4; + return x; + } + + + public void WriteFint(int x) + { + EnsureWrite(4); +#if CPU_SUPPORT_MEMORY_NOT_ALIGN + unsafe + { + fixed (byte* b = &Bytes[WriterIndex]) + { + *(int*)b = x; + } + } +#else + Bytes[WriterIndex] = (byte)x; + Bytes[WriterIndex + 1] = (byte)(x >> 8); + Bytes[WriterIndex + 2] = (byte)(x >> 16); + Bytes[WriterIndex + 3] = (byte)(x >> 24); +#endif + WriterIndex += 4; + } + + public int ReadFint_Safe() + { + EnsureRead(4); + int x; + + x = (Bytes[ReaderIndex + 3] << 24) | (Bytes[ReaderIndex + 2] << 16) | (Bytes[ReaderIndex + 1] << 8) | (Bytes[ReaderIndex]); + + ReaderIndex += 4; + return x; + } + + + public void WriteFint_Safe(int x) + { + EnsureWrite(4); + Bytes[WriterIndex] = (byte)x; + Bytes[WriterIndex + 1] = (byte)(x >> 8); + Bytes[WriterIndex + 2] = (byte)(x >> 16); + Bytes[WriterIndex + 3] = (byte)(x >> 24); + WriterIndex += 4; + } + + public void WriteLong(long x) + { + WriteUlong((ulong)x); + } + + public long ReadLong() + { + return (long)ReadUlong(); + } + + public void WriteNumberAsLong(double x) + { + WriteLong((long)x); + } + + public double ReadLongAsNumber() + { + return ReadLong(); + } + + private void WriteUlong(ulong x) + { + // 0 111 1111 + if (x < 0x80) + { + EnsureWrite(1); + Bytes[WriterIndex++] = (byte)x; + } + else if (x < 0x4000) // 10 11 1111, - + { + EnsureWrite(2); + Bytes[WriterIndex + 1] = (byte)x; + Bytes[WriterIndex] = (byte)((x >> 8) | 0x80); + WriterIndex += 2; + } + else if (x < 0x20_0000) // 110 1 1111, -,- + { + EnsureWrite(3); + Bytes[WriterIndex + 2] = (byte)x; + Bytes[WriterIndex + 1] = (byte)(x >> 8); + Bytes[WriterIndex] = (byte)((x >> 16) | 0xc0); + WriterIndex += 3; + } + else if (x < 0x1000_0000) // 1110 1111,-,-,- + { + EnsureWrite(4); + Bytes[WriterIndex + 3] = (byte)x; + Bytes[WriterIndex + 2] = (byte)(x >> 8); + Bytes[WriterIndex + 1] = (byte)(x >> 16); + Bytes[WriterIndex] = (byte)((x >> 24) | 0xe0); + WriterIndex += 4; + } + else if (x < 0x8_0000_0000L) // 1111 0xxx,-,-,-,- + { + EnsureWrite(5); + Bytes[WriterIndex + 4] = (byte)x; + Bytes[WriterIndex + 3] = (byte)(x >> 8); + Bytes[WriterIndex + 2] = (byte)(x >> 16); + Bytes[WriterIndex + 1] = (byte)(x >> 24); + Bytes[WriterIndex] = (byte)((x >> 32) | 0xf0); + WriterIndex += 5; + } + else if (x < 0x400_0000_0000L) // 1111 10xx, + { + EnsureWrite(6); + Bytes[WriterIndex + 5] = (byte)x; + Bytes[WriterIndex + 4] = (byte)(x >> 8); + Bytes[WriterIndex + 3] = (byte)(x >> 16); + Bytes[WriterIndex + 2] = (byte)(x >> 24); + Bytes[WriterIndex + 1] = (byte)(x >> 32); + Bytes[WriterIndex] = (byte)((x >> 40) | 0xf8); + WriterIndex += 6; + } + else if (x < 0x2_0000_0000_0000L) // 1111 110x, + { + EnsureWrite(7); + Bytes[WriterIndex + 6] = (byte)x; + Bytes[WriterIndex + 5] = (byte)(x >> 8); + Bytes[WriterIndex + 4] = (byte)(x >> 16); + Bytes[WriterIndex + 3] = (byte)(x >> 24); + Bytes[WriterIndex + 2] = (byte)(x >> 32); + Bytes[WriterIndex + 1] = (byte)(x >> 40); + Bytes[WriterIndex] = (byte)((x >> 48) | 0xfc); + WriterIndex += 7; + } + else if (x < 0x100_0000_0000_0000L) // 1111 1110 + { + EnsureWrite(8); + Bytes[WriterIndex + 7] = (byte)x; + Bytes[WriterIndex + 6] = (byte)(x >> 8); + Bytes[WriterIndex + 5] = (byte)(x >> 16); + Bytes[WriterIndex + 4] = (byte)(x >> 24); + Bytes[WriterIndex + 3] = (byte)(x >> 32); + Bytes[WriterIndex + 2] = (byte)(x >> 40); + Bytes[WriterIndex + 1] = (byte)(x >> 48); + Bytes[WriterIndex] = 0xfe; + WriterIndex += 8; + } + else // 1111 1111 + { + EnsureWrite(9); + Bytes[WriterIndex] = 0xff; + Bytes[WriterIndex + 8] = (byte)x; + Bytes[WriterIndex + 7] = (byte)(x >> 8); + Bytes[WriterIndex + 6] = (byte)(x >> 16); + Bytes[WriterIndex + 5] = (byte)(x >> 24); + Bytes[WriterIndex + 4] = (byte)(x >> 32); + Bytes[WriterIndex + 3] = (byte)(x >> 40); + Bytes[WriterIndex + 2] = (byte)(x >> 48); + Bytes[WriterIndex + 1] = (byte)(x >> 56); + WriterIndex += 9; + } + } + + public ulong ReadUlong() + { + EnsureRead(1); + uint h = Bytes[ReaderIndex]; + if (h < 0x80) + { + ReaderIndex++; + return h; + } + else if (h < 0xc0) + { + EnsureRead(2); + uint x = ((h & 0x3f) << 8) | Bytes[ReaderIndex + 1]; + ReaderIndex += 2; + return x; + } + else if (h < 0xe0) + { + EnsureRead(3); + uint x = ((h & 0x1f) << 16) | ((uint)Bytes[ReaderIndex + 1] << 8) | Bytes[ReaderIndex + 2]; + ReaderIndex += 3; + return x; + } + else if (h < 0xf0) + { + EnsureRead(4); + uint x = ((h & 0x0f) << 24) | ((uint)Bytes[ReaderIndex + 1] << 16) | ((uint)Bytes[ReaderIndex + 2] << 8) | Bytes[ReaderIndex + 3]; + ReaderIndex += 4; + return x; + } + else if (h < 0xf8) + { + EnsureRead(5); + uint xl = ((uint)Bytes[ReaderIndex + 1] << 24) | ((uint)(Bytes[ReaderIndex + 2] << 16)) | ((uint)Bytes[ReaderIndex + 3] << 8) | (Bytes[ReaderIndex + 4]); + uint xh = h & 0x07; + ReaderIndex += 5; + return ((ulong)xh << 32) | xl; + } + else if (h < 0xfc) + { + EnsureRead(6); + uint xl = ((uint)Bytes[ReaderIndex + 2] << 24) | ((uint)(Bytes[ReaderIndex + 3] << 16)) | ((uint)Bytes[ReaderIndex + 4] << 8) | (Bytes[ReaderIndex + 5]); + uint xh = ((h & 0x03) << 8) | Bytes[ReaderIndex + 1]; + ReaderIndex += 6; + return ((ulong)xh << 32) | xl; + } + else if (h < 0xfe) + { + EnsureRead(7); + uint xl = ((uint)Bytes[ReaderIndex + 3] << 24) | ((uint)(Bytes[ReaderIndex + 4] << 16)) | ((uint)Bytes[ReaderIndex + 5] << 8) | (Bytes[ReaderIndex + 6]); + uint xh = ((h & 0x01) << 16) | ((uint)Bytes[ReaderIndex + 1] << 8) | Bytes[ReaderIndex + 2]; + ReaderIndex += 7; + return ((ulong)xh << 32) | xl; + } + else if (h < 0xff) + { + EnsureRead(8); + uint xl = ((uint)Bytes[ReaderIndex + 4] << 24) | ((uint)(Bytes[ReaderIndex + 5] << 16)) | ((uint)Bytes[ReaderIndex + 6] << 8) | (Bytes[ReaderIndex + 7]); + uint xh = /*((h & 0x01) << 24) |*/ ((uint)Bytes[ReaderIndex + 1] << 16) | ((uint)Bytes[ReaderIndex + 2] << 8) | Bytes[ReaderIndex + 3]; + ReaderIndex += 8; + return ((ulong)xh << 32) | xl; + } + else + { + EnsureRead(9); + uint xl = ((uint)Bytes[ReaderIndex + 5] << 24) | ((uint)(Bytes[ReaderIndex + 6] << 16)) | ((uint)Bytes[ReaderIndex + 7] << 8) | (Bytes[ReaderIndex + 8]); + uint xh = ((uint)Bytes[ReaderIndex + 1] << 24) | ((uint)Bytes[ReaderIndex + 2] << 16) | ((uint)Bytes[ReaderIndex + 3] << 8) | Bytes[ReaderIndex + 4]; + ReaderIndex += 9; + return ((ulong)xh << 32) | xl; + } + } + + + public void WriteFlong(long x) + { + EnsureWrite(8); +#if CPU_SUPPORT_MEMORY_NOT_ALIGN + unsafe + { + fixed (byte* b = &Bytes[WriterIndex]) + { + *(long*)b = x; + } + } +#else + + Bytes[WriterIndex] = (byte)x; + Bytes[WriterIndex + 1] = (byte)(x >> 8); + Bytes[WriterIndex + 2] = (byte)(x >> 16); + Bytes[WriterIndex + 3] = (byte)(x >> 24); + Bytes[WriterIndex + 4] = (byte)(x >> 32); + Bytes[WriterIndex + 5] = (byte)(x >> 40); + Bytes[WriterIndex + 6] = (byte)(x >> 48); + Bytes[WriterIndex + 7] = (byte)(x >> 56); +#endif + WriterIndex += 8; + } + + public long ReadFlong() + { + EnsureRead(8); + long x; +#if CPU_SUPPORT_MEMORY_NOT_ALIGN + unsafe + { + fixed (byte* b = &Bytes[ReaderIndex]) + { + x = *(long*)b; + } + } +#else + int xl = (Bytes[ReaderIndex + 3] << 24) | ((Bytes[ReaderIndex + 2] << 16)) | (Bytes[ReaderIndex + 1] << 8) | (Bytes[ReaderIndex]); + int xh = (Bytes[ReaderIndex + 7] << 24) | (Bytes[ReaderIndex + 6] << 16) | (Bytes[ReaderIndex + 5] << 8) | Bytes[ReaderIndex + 4]; + x = ((long)xh << 32) | (long)xl; +#endif + ReaderIndex += 8; + return x; + } + + private static unsafe void Copy8(byte* dst, byte* src) + { + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + dst[4] = src[4]; + dst[5] = src[5]; + dst[6] = src[6]; + dst[7] = src[7]; + } + + private static unsafe void Copy4(byte* dst, byte* src) + { + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + } + + + //const bool isLittleEndian = true; + public void WriteFloat(float x) + { + EnsureWrite(4); + unsafe + { + fixed (byte* b = &Bytes[WriterIndex]) + { +#if !CPU_SUPPORT_MEMORY_NOT_ALIGN + if ((long)b % 4 == 0) + { + *(float*)b = x; + } + else + { + Copy4(b, (byte*)&x); + } +#else + *(float*)b = x; +#endif + } + } + + //if (!BitConverter.IsLittleEndian) + //{ + // Array.Reverse(data, endPos, 4); + //} + WriterIndex += 4; + } + + public float ReadFloat() + { + EnsureRead(4); + //if (!BitConverter.IsLittleEndian) + //{ + // Array.Reverse(data, beginPos, 4); + //} + float x; + unsafe + { + fixed (byte* b = &Bytes[ReaderIndex]) + { +#if !CPU_SUPPORT_MEMORY_NOT_ALIGN + if ((long)b % 4 == 0) + { + x = *(float*)b; + } + else + { + *((int*)&x) = (b[0]) | (b[1] << 8) | (b[2] << 16) | (b[3] << 24); + } +#else + x = *(float*)b; +#endif + } + } + + ReaderIndex += 4; + return x; + } + + public void WriteDouble(double x) + { + EnsureWrite(8); + unsafe + { + fixed (byte* b = &Bytes[WriterIndex]) + { +#if !CPU_SUPPORT_MEMORY_NOT_ALIGN + if ((long)b % 8 == 0) + { + *(double*)b = x; + } + else + { + Copy8(b, (byte*)&x); + } +#else + *(double*)b = x; +#endif + } + //if (!BitConverter.IsLittleEndian) + //{ + // Array.Reverse(data, endPos, 8); + //} + } + + WriterIndex += 8; + } + + public double ReadDouble() + { + EnsureRead(8); + //if (!BitConverter.IsLittleEndian) + //{ + // Array.Reverse(data, beginPos, 8); + //} + double x; + unsafe + { + fixed (byte* b = &Bytes[ReaderIndex]) + { +#if !CPU_SUPPORT_MEMORY_NOT_ALIGN + if ((long)b % 8 == 0) + { + x = *(double*)b; + } + else + { + int low = (b[0]) | (b[1] << 8) | (b[2] << 16) | (b[3] << 24); + int high = (b[4]) | (b[5] << 8) | (b[6] << 16) | (b[7] << 24); + *((long*)&x) = ((long)high << 32) | (uint)low; + } +#else + x = *(double*)b; +#endif + } + } + + ReaderIndex += 8; + return x; + } + + public void WriteSize(int n) + { + WriteUint((uint)n); + } + + public int ReadSize() + { + return (int)ReadUint(); + } + + // marshal int + // n -> (n << 1) ^ (n >> 31) + // Read + // (x >>> 1) ^ ((x << 31) >> 31) + // (x >>> 1) ^ -(n&1) + public void WriteSint(int x) + { + WriteUint(((uint)x << 1) ^ ((uint)x >> 31)); + } + + public int ReadSint() + { + uint x = ReadUint(); + return (int)((x >> 1) ^ ((x & 1) << 31)); + } + + + // marshal long + // n -> (n << 1) ^ (n >> 63) + // Read + // (x >>> 1) ^((x << 63) >> 63) + // (x >>> 1) ^ -(n&1L) + public void WriteSlong(long x) + { + WriteUlong(((ulong)x << 1) ^ ((ulong)x >> 63)); + } + + public long ReadSlong() + { + long x = ReadLong(); + return ((long)((ulong)x >> 1) ^ ((x & 1) << 63)); + } + + public void WriteString(string x) + { + var n = x != null ? Encoding.UTF8.GetByteCount(x) : 0; + WriteSize(n); + if (n > 0) + { + EnsureWrite(n); + Encoding.UTF8.GetBytes(x, 0, x.Length, Bytes, WriterIndex); + WriterIndex += n; + } + } + + // byte[], [start, end) + public static Func, string> StringCacheFinder { get; set; } + + public string ReadString() + { + var n = ReadSize(); + if (n > 0) + { + EnsureRead(n); + string s; + + if (StringCacheFinder == null) + { + s = Encoding.UTF8.GetString(Bytes, ReaderIndex, n); + } + else + { + // 只缓存比较小的字符串 + s = StringCacheFinder(new ReadOnlyMemory(Bytes, ReaderIndex, n)); + } + ReaderIndex += n; + return s; + } + else + { + return string.Empty; + } + } + + public void WriteBytes(byte[] x) + { + var n = x != null ? x.Length : 0; + WriteSize(n); + if (n > 0) + { + EnsureWrite(n); + x.CopyTo(Bytes, WriterIndex); + WriterIndex += n; + } + } + + public byte[] ReadBytes() + { + var n = ReadSize(); + if (n > 0) + { + EnsureRead(n); + var x = new byte[n]; + Buffer.BlockCopy(Bytes, ReaderIndex, x, 0, n); + ReaderIndex += n; + return x; + } + else + { + return Array.Empty(); + } + } + + // 以下是一些特殊类型 + + public void WriteComplex(Complex x) + { + WriteDouble(x.Real); + WriteDouble(x.Imaginary); + } + + public Complex ReadComplex() + { + var x = ReadDouble(); + var y = ReadDouble(); + return new Complex(x, y); + } + + public void WriteVector2(Vector2 x) + { + WriteFloat(x.X); + WriteFloat(x.Y); + } + + public Vector2 ReadVector2() + { + float x = ReadFloat(); + float y = ReadFloat(); + return new Vector2(x, y); + } + + public void WriteVector3(Vector3 x) + { + WriteFloat(x.X); + WriteFloat(x.Y); + WriteFloat(x.Z); + } + + public Vector3 ReadVector3() + { + float x = ReadFloat(); + float y = ReadFloat(); + float z = ReadFloat(); + return new Vector3(x, y, z); + } + + public void WriteVector4(Vector4 x) + { + WriteFloat(x.X); + WriteFloat(x.Y); + WriteFloat(x.Z); + WriteFloat(x.W); + } + + public Vector4 ReadVector4() + { + float x = ReadFloat(); + float y = ReadFloat(); + float z = ReadFloat(); + float w = ReadFloat(); + return new Vector4(x, y, z, w); + } + + + public void WriteQuaternion(Quaternion x) + { + WriteFloat(x.X); + WriteFloat(x.Y); + WriteFloat(x.Z); + WriteFloat(x.W); + } + + public Quaternion ReadQuaternion() + { + float x = ReadFloat(); + float y = ReadFloat(); + float z = ReadFloat(); + float w = ReadFloat(); + return new Quaternion(x, y, z, w); + } + + + public void WriteMatrix4x4(Matrix4x4 x) + { + WriteFloat(x.M11); + WriteFloat(x.M12); + WriteFloat(x.M13); + WriteFloat(x.M14); + WriteFloat(x.M21); + WriteFloat(x.M22); + WriteFloat(x.M23); + WriteFloat(x.M24); + WriteFloat(x.M31); + WriteFloat(x.M32); + WriteFloat(x.M33); + WriteFloat(x.M34); + WriteFloat(x.M41); + WriteFloat(x.M42); + WriteFloat(x.M43); + WriteFloat(x.M44); + } + + public Matrix4x4 ReadMatrix4x4() + { + float m11 = ReadFloat(); + float m12 = ReadFloat(); + float m13 = ReadFloat(); + float m14 = ReadFloat(); + float m21 = ReadFloat(); + float m22 = ReadFloat(); + float m23 = ReadFloat(); + float m24 = ReadFloat(); + float m31 = ReadFloat(); + float m32 = ReadFloat(); + float m33 = ReadFloat(); + float m34 = ReadFloat(); + float m41 = ReadFloat(); + float m42 = ReadFloat(); + float m43 = ReadFloat(); + float m44 = ReadFloat(); + return new Matrix4x4(m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34, + m41, m42, m43, m44); + } + + public void WriteObjectWithFieldTag(T obj) + { + switch (obj) + { + case int i: + { WriteByte(FieldTag.INT); WriteInt(i); break; } + case long l: + { WriteByte(FieldTag.LONG); WriteLong(l); break; } + case string s: + { WriteByte(FieldTag.STRING); WriteString(s); break; } + case bool b: + { WriteByte(FieldTag.BOOL); WriteBool(b); break; } + case short s2: + { WriteByte(FieldTag.SHORT); WriteShort(s2); break; } + case float f: + { WriteByte(FieldTag.FLOAT); WriteFloat(f); break; } + case double d: + { WriteByte(FieldTag.DOUBLE); WriteDouble(d); break; } + case byte b2: + { WriteByte(FieldTag.BYTE); WriteByte(b2); break; } + case byte[] b3: + { WriteByte(FieldTag.BYTES); WriteBytes(b3); break; } + case Vector2 v2: + { WriteByte(FieldTag.VECTOR2); WriteVector2(v2); break; } + case Vector3 v3: + { WriteByte(FieldTag.VECTOR3); WriteVector3(v3); break; } + case Vector4 v4: + { WriteByte(FieldTag.VECTOR4); WriteVector4(v4); break; } + default: + throw new SerializationException("unknown object:" + obj); + } + } + + public object ReadObjectWithFieldTag() + { + return (ReadByte()) switch + { + FieldTag.INT => ReadInt(), + FieldTag.LONG => ReadLong(), + FieldTag.STRING => ReadString(), + FieldTag.BOOL => ReadBool(), + FieldTag.SHORT => ReadShort(), + FieldTag.FLOAT => ReadFloat(), + FieldTag.DOUBLE => ReadDouble(), + FieldTag.BYTE => ReadByte(), + FieldTag.BYTES => ReadBytes(), + FieldTag.VECTOR2 => ReadVector2(), + FieldTag.VECTOR3 => ReadVector3(), + FieldTag.VECTOR4 => ReadVector4(), + _ => throw new SerializationException("unknown support field tag"), + }; + } + + internal void SkipBytes() + { + int n = ReadSize(); + EnsureRead(n); + ReaderIndex += n; + } + + + public void WriteByteBufWithSize(ByteBuf o) + { + int n = o.Size; + if (n > 0) + { + WriteSize(n); + WriteBytesWithoutSize(o.Bytes, o.ReaderIndex, n); + } + else + { + WriteByte(0); + } + } + + public void WriteByteBufWithoutSize(ByteBuf o) + { + int n = o.Size; + if (n > 0) + { + WriteBytesWithoutSize(o.Bytes, o.ReaderIndex, n); + } + } + + // 有Segment相关函数后,此函数暂时废弃 + //public ByteBuf ReadInplaceByteBufWithSize() + //{ + // int n = ReadSize(); + // EnsureRead(n); + // int curReadIndex = ReaderIndex; + // ReaderIndex += n; + // return new ByteBuf(Bytes, curReadIndex, ReaderIndex); + //} + + + public bool TryReadByte(out byte x) + { + if (CanRead(1)) + { + x = Bytes[ReaderIndex++]; + return true; + } + else + { + x = 0; + return false; + } + } + + //public EDeserializeError TryDeserialize(Func action) + //{ + // var oldReadIndex = ReaderIndex; + // EDeserializeError ret = EDeserializeError.UNMARSHAL_ERR; + // try + // { + // ret = action(this); + // return ret; + // } + // finally + // { + // if (ret != EDeserializeError.OK) + // { + // ReaderIndex = oldReadIndex; + // } + // } + //} + + public EDeserializeError TryDeserializeInplaceByteBuf(int maxSize, ByteBuf inplaceTempBody) + { + //if (!CanRead(1)) { return EDeserializeError.NOT_ENOUGH; } + int oldReadIndex = ReaderIndex; + bool commit = false; + try + { + int n; + int h = Bytes[ReaderIndex]; + if (h < 0x80) + { + ReaderIndex++; + n = h; + } + else if (h < 0xc0) + { + if (!CanRead(2)) + { return EDeserializeError.NOT_ENOUGH; } + n = ((h & 0x3f) << 8) | Bytes[ReaderIndex + 1]; + ReaderIndex += 2; + } + else if (h < 0xe0) + { + if (!CanRead(3)) + { return EDeserializeError.NOT_ENOUGH; } + n = ((h & 0x1f) << 16) | (Bytes[ReaderIndex + 1] << 8) | Bytes[ReaderIndex + 2]; + ReaderIndex += 3; + } + else if (h < 0xf0) + { + if (!CanRead(4)) + { return EDeserializeError.NOT_ENOUGH; } + n = ((h & 0x0f) << 24) | (Bytes[ReaderIndex + 1] << 16) | (Bytes[ReaderIndex + 2] << 8) | Bytes[ReaderIndex + 3]; + ReaderIndex += 4; + } + else + { + return EDeserializeError.EXCEED_SIZE; + } + + if (n > maxSize) + { + return EDeserializeError.EXCEED_SIZE; + } + if (Remaining < n) + { + return EDeserializeError.NOT_ENOUGH; + } + + int inplaceReadIndex = ReaderIndex; + ReaderIndex += n; + + inplaceTempBody.Replace(Bytes, inplaceReadIndex, ReaderIndex); + commit = true; + } + finally + { + if (!commit) + { + ReaderIndex = oldReadIndex; + } + } + + return EDeserializeError.OK; + } + + + // TODO + // 优化 未知大小的对象,比如 bean 的序列化 + public void SkipUnknownField(int tagId) + { + int tagType = tagId & FieldTag.TAG_MASK; + switch (tagType) + { + case FieldTag.BOOL: + ReadBool(); + break; + case FieldTag.BYTE: + ReadByte(); + break; + case FieldTag.SHORT: + ReadShort(); + break; + case FieldTag.FSHORT: + ReadFshort(); + break; + case FieldTag.INT: + ReadInt(); + break; + case FieldTag.FINT: + ReadFint(); + break; + case FieldTag.LONG: + ReadLong(); + break; + case FieldTag.FLONG: + ReadFlong(); + break; + case FieldTag.FLOAT: + ReadFloat(); + break; + case FieldTag.DOUBLE: + ReadDouble(); + break; + case FieldTag.VECTOR2: + ReadVector2(); + break; + case FieldTag.VECTOR3: + ReadVector3(); + break; + case FieldTag.VECTOR4: + ReadVector4(); + break; + case FieldTag.STRING: + case FieldTag.BYTES: + case FieldTag.ARRAY: + case FieldTag.LIST: + case FieldTag.SET: + case FieldTag.MAP: + case FieldTag.BEAN: + { + SkipBytes(); + break; + } + case FieldTag.DYNAMIC_BEAN: + { + int type = ReadInt(); + if (type != 0) + { + SkipBytes(); + } + break; + } + default: + throw new SerializationException(); + } + } + + public void WriteRawTag(byte b1) + { + EnsureWrite(1); + Bytes[WriterIndex++] = b1; + } + + public void WriteRawTag(byte b1, byte b2) + { + EnsureWrite(2); + Bytes[WriterIndex] = b1; + Bytes[WriterIndex + 1] = b2; + WriterIndex += 2; + } + + public void WriteRawTag(byte b1, byte b2, byte b3) + { + EnsureWrite(3); + Bytes[WriterIndex] = b1; + Bytes[WriterIndex + 1] = b2; + Bytes[WriterIndex + 2] = b3; + WriterIndex += 3; + } + + #region segment + + + public void BeginWriteSegment(out int oldSize) + { + oldSize = Size; + EnsureWrite(1); + WriterIndex += 1; + } + + public void EndWriteSegment(int oldSize) + { + int startPos = ReaderIndex + oldSize; + int segmentSize = WriterIndex - startPos - 1; + + // 0 111 1111 + if (segmentSize < 0x80) + { + Bytes[startPos] = (byte)segmentSize; + } + else if (segmentSize < 0x4000) // 10 11 1111, - + { + EnsureWrite(1); + Bytes[WriterIndex] = Bytes[startPos + 1]; + Bytes[startPos + 1] = (byte)segmentSize; + + Bytes[startPos] = (byte)((segmentSize >> 8) | 0x80); + WriterIndex += 1; + } + else if (segmentSize < 0x20_0000) // 110 1 1111, -,- + { + EnsureWrite(2); + Bytes[WriterIndex + 1] = Bytes[startPos + 2]; + Bytes[startPos + 2] = (byte)segmentSize; + + Bytes[WriterIndex] = Bytes[startPos + 1]; + Bytes[startPos + 1] = (byte)(segmentSize >> 8); + + Bytes[startPos] = (byte)((segmentSize >> 16) | 0xc0); + WriterIndex += 2; + } + else if (segmentSize < 0x1000_0000) // 1110 1111,-,-,- + { + EnsureWrite(3); + Bytes[WriterIndex + 2] = Bytes[startPos + 3]; + Bytes[startPos + 3] = (byte)segmentSize; + + Bytes[WriterIndex + 1] = Bytes[startPos + 2]; + Bytes[startPos + 2] = (byte)(segmentSize >> 8); + + Bytes[WriterIndex] = Bytes[startPos + 1]; + Bytes[startPos + 1] = (byte)(segmentSize >> 16); + + Bytes[startPos] = (byte)((segmentSize >> 24) | 0xe0); + WriterIndex += 3; + } + else + { + throw new SerializationException("exceed max segment size"); + } + } + + public void ReadSegment(out int startIndex, out int segmentSize) + { + EnsureRead(1); + int h = Bytes[ReaderIndex++]; + + startIndex = ReaderIndex; + + if (h < 0x80) + { + segmentSize = h; + ReaderIndex += segmentSize; + } + else if (h < 0xc0) + { + EnsureRead(1); + segmentSize = ((h & 0x3f) << 8) | Bytes[ReaderIndex]; + int endPos = ReaderIndex + segmentSize; + Bytes[ReaderIndex] = Bytes[endPos]; + ReaderIndex += segmentSize + 1; + } + else if (h < 0xe0) + { + EnsureRead(2); + segmentSize = ((h & 0x1f) << 16) | ((int)Bytes[ReaderIndex] << 8) | Bytes[ReaderIndex + 1]; + int endPos = ReaderIndex + segmentSize; + Bytes[ReaderIndex] = Bytes[endPos]; + Bytes[ReaderIndex + 1] = Bytes[endPos + 1]; + ReaderIndex += segmentSize + 2; + } + else if (h < 0xf0) + { + EnsureRead(3); + segmentSize = ((h & 0x0f) << 24) | ((int)Bytes[ReaderIndex] << 16) | ((int)Bytes[ReaderIndex + 1] << 8) | Bytes[ReaderIndex + 2]; + int endPos = ReaderIndex + segmentSize; + Bytes[ReaderIndex] = Bytes[endPos]; + Bytes[ReaderIndex + 1] = Bytes[endPos + 1]; + Bytes[ReaderIndex + 2] = Bytes[endPos + 2]; + ReaderIndex += segmentSize + 3; + } + else + { + throw new SerializationException("exceed max size"); + } + if (ReaderIndex > WriterIndex) + { + throw new SerializationException("segment data not enough"); + } + } + + public void ReadSegment(ByteBuf buf) + { + ReadSegment(out int startPos, out var size); + buf.Bytes = Bytes; + buf.ReaderIndex = startPos; + buf.WriterIndex = startPos + size; + } + + public void EnterSegment(out SegmentSaveState saveState) + { + ReadSegment(out int startPos, out int size); + + saveState = new SegmentSaveState(ReaderIndex, WriterIndex); + ReaderIndex = startPos; + WriterIndex = startPos + size; + } + + public void LeaveSegment(SegmentSaveState saveState) + { + ReaderIndex = saveState.ReaderIndex; + WriterIndex = saveState.WriterIndex; + } + + #endregion + + public override string ToString() + { + string[] datas = new string[WriterIndex - ReaderIndex]; + for (var i = ReaderIndex; i < WriterIndex; i++) + { + datas[i - ReaderIndex] = Bytes[i].ToString("X2"); + } + return string.Join(".", datas); + } + + public override bool Equals(object obj) + { + return (obj is ByteBuf other) && Equals(other); + } + + public bool Equals(ByteBuf other) + { + if (other == null) + { + return false; + } + if (Size != other.Size) + { + return false; + } + for (int i = 0, n = Size; i < n; i++) + { + if (Bytes[ReaderIndex + i] != other.Bytes[other.ReaderIndex + i]) + { + return false; + } + } + return true; + } + + public object Clone() + { + return new ByteBuf(CopyData()); + } + + + public static ByteBuf FromString(string value) + { + var ss = value.Split(","); + byte[] data = new byte[ss.Length]; + for (int i = 0; i < data.Length; i++) + { + data[i] = byte.Parse(ss[i]); + } + return new ByteBuf(data); + } + + public override int GetHashCode() + { + int hash = 17; + for (int i = ReaderIndex; i < WriterIndex; i++) + { + hash = hash * 23 + Bytes[i]; + } + return hash; + } + + public void Release() + { + _releaser?.Invoke(this); + } +} diff --git a/luban/src/Luban.Core/Serialization/ByteBufPool.cs b/luban/src/Luban.Core/Serialization/ByteBufPool.cs new file mode 100644 index 00000000..690e6ec6 --- /dev/null +++ b/luban/src/Luban.Core/Serialization/ByteBufPool.cs @@ -0,0 +1,38 @@ +namespace Luban.Serialization; + +public class ByteBufPool +{ + private readonly Stack _bufs = new(); + private readonly int _maxCacheNum; + + private readonly Action _freeAction; + + public ByteBufPool(int maxCacheNum) + { + _maxCacheNum = maxCacheNum; + _freeAction = this.Free; + } + + public ByteBuf Alloc(int? hintSize) + { + if (_bufs.TryPop(out var b)) + { + return b; + } + else + { + return new ByteBuf(hintSize ?? 64, this._freeAction); + } + } + + public void Free(ByteBuf buf) + { + buf.Clear(); + if (_bufs.Count < _maxCacheNum) + { + _bufs.Push(buf); + } + } + + public Stack GetByteBufsForTest() => _bufs; +} diff --git a/luban/src/Luban.Core/Serialization/EUnmarshalError.cs b/luban/src/Luban.Core/Serialization/EUnmarshalError.cs new file mode 100644 index 00000000..4235defe --- /dev/null +++ b/luban/src/Luban.Core/Serialization/EUnmarshalError.cs @@ -0,0 +1,9 @@ +namespace Luban.Serialization; + +public enum EDeserializeError +{ + OK, + NOT_ENOUGH, + EXCEED_SIZE, + // UNMARSHAL_ERR, +} diff --git a/luban/src/Luban.Core/Serialization/FieldTag.cs b/luban/src/Luban.Core/Serialization/FieldTag.cs new file mode 100644 index 00000000..c8d51697 --- /dev/null +++ b/luban/src/Luban.Core/Serialization/FieldTag.cs @@ -0,0 +1,40 @@ +namespace Luban.Serialization; + +// 把 int,long,string,bool 调整到最小 +// 这样 marshal compatible write(field_id << tag_shift | tag_id) < 2^7 能在一个字节 +// 内序列化, 优化序列化最终大小 +#pragma warning disable CA1720 // 标识符包含类型名称 +public static class FieldTag +{ + public const int + INT = 0, + LONG = 1, + STRING = 2, + BOOL = 3, + + BYTE = 4, + SHORT = 5, + FSHORT = 6, + FINT = 7, + FLONG = 8, + FLOAT = 9, + DOUBLE = 10, + BYTES = 11, + ARRAY = 12, + LIST = 13, + SET = 14, + MAP = 15, + BEAN = 16, + TEXT = 17, + VECTOR2 = 18, + VECTOR3 = 19, + VECTOR4 = 20, + DYNAMIC_BEAN = 21, + + NOT_USE = 22; + + + public const int TAG_SHIFT = 5; + public const int TAG_MASK = (1 << TAG_SHIFT) - 1; +} +#pragma warning restore CA1720 // 标识符包含类型名称 diff --git a/luban/src/Luban.Core/Serialization/ISerializable.cs b/luban/src/Luban.Core/Serialization/ISerializable.cs new file mode 100644 index 00000000..2041912d --- /dev/null +++ b/luban/src/Luban.Core/Serialization/ISerializable.cs @@ -0,0 +1,11 @@ +namespace Luban.Serialization; + +/// +/// 非兼容binary序列化 +/// +public interface ISerializable +{ + void Serialize(ByteBuf os); + + void Deserialize(ByteBuf os); +} diff --git a/luban/src/Luban.Core/Serialization/ITypeId.cs b/luban/src/Luban.Core/Serialization/ITypeId.cs new file mode 100644 index 00000000..408610aa --- /dev/null +++ b/luban/src/Luban.Core/Serialization/ITypeId.cs @@ -0,0 +1,6 @@ +namespace Luban.Serialization; + +public interface ITypeId +{ + int GetTypeId(); +} diff --git a/luban/src/Luban.Core/Serialization/SerializationException.cs b/luban/src/Luban.Core/Serialization/SerializationException.cs new file mode 100644 index 00000000..8dd1bc62 --- /dev/null +++ b/luban/src/Luban.Core/Serialization/SerializationException.cs @@ -0,0 +1,23 @@ +#define CPU_SUPPORT_MEMORY_NOT_ALIGN //CPU 是否支持读取非对齐内存 + + + + +/// +/// TODO +/// 1. 整理代码 +/// 2. 优化序列化 (像这样 data[endPos + 1] = (byte)(x >> 8) 挨个字节赋值总感觉很低效,能优化吗) +/// + + +namespace Luban.Serialization; + +public class SerializationException : Exception +{ + public SerializationException() { } + public SerializationException(string msg) : base(msg) { } + + public SerializationException(string message, Exception innerException) : base(message, innerException) + { + } +} diff --git a/luban/src/Luban.Core/Serialization/ThreadLocalTemporalByteBufPool.cs b/luban/src/Luban.Core/Serialization/ThreadLocalTemporalByteBufPool.cs new file mode 100644 index 00000000..2c402321 --- /dev/null +++ b/luban/src/Luban.Core/Serialization/ThreadLocalTemporalByteBufPool.cs @@ -0,0 +1,78 @@ +namespace Luban.Serialization; + +public readonly struct TemporalByteBuf : IDisposable +{ + public ByteBuf Buf { get; } + + public TemporalByteBuf(ByteBuf buf) + { + Buf = buf; + } + + public void Dispose() + { + ThreadLocalTemporalByteBufPool.Free(Buf); + } +} + +public class ThreadLocalTemporalByteBufPool +{ + + [ThreadStatic] + private static ByteBufPool s_pool; + + [ThreadStatic] + private static ByteBuf s_fastBuf; + + public static int MaxPoolCacheNum { get; set; } = 100; + + private static ByteBufPool Pool => s_pool ??= new ByteBufPool(MaxPoolCacheNum); + + public static TemporalByteBuf GuardAlloc(int? hintSize) + { + return new TemporalByteBuf(Alloc(hintSize)); + } + + public static ByteBuf Alloc(int? hintSize) + { + var buf = s_fastBuf; + if (buf != null) + { + s_fastBuf = null; + return buf; + } + return Pool.Alloc(hintSize); + } + + public static void Free(ByteBuf buf) + { + buf.Clear(); + if (s_fastBuf == null) + { + s_fastBuf = buf; + } + else + { + Pool.Free(buf); + } + } + + public static byte[] CopyDataThenFree(ByteBuf buf) + { + var bytes = buf.CopyData(); + Free(buf); + return bytes; + } + + #region unit test + internal static void ResetForTest() + { + s_fastBuf = null; + s_pool = null; + } + + internal static ByteBuf GetFastBufForTest() => s_fastBuf; + + internal static Stack GetByteBufsForTest() => Pool.GetByteBufsForTest(); + #endregion +} diff --git a/luban/src/Luban.Core/SimpleLauncher.cs b/luban/src/Luban.Core/SimpleLauncher.cs new file mode 100644 index 00000000..24fa253f --- /dev/null +++ b/luban/src/Luban.Core/SimpleLauncher.cs @@ -0,0 +1,77 @@ +using System.Reflection; +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.CustomBehaviour; +using Luban.DataLoader; +using Luban.DataTarget; +using Luban.L10N; +using Luban.OutputSaver; +using Luban.Pipeline; +using Luban.PostProcess; +using Luban.Schema; +using Luban.Tmpl; +using Luban.Validator; + +namespace Luban; + +public class SimpleLauncher +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public void Start(Dictionary options) + { + EnvManager.Current = new EnvManager(options); + InitManagers(); + ScanRegisterAssemblyBehaviours(); + PostInitManagers(); + } + + private void InitManagers() + { + SchemaManager.Ins.Init(); + TemplateManager.Ins.Init(); + CodeFormatManager.Ins.Init(); + CodeTargetManager.Ins.Init(); + PostProcessManager.Ins.Init(); + OutputSaverManager.Ins.Init(); + DataLoaderManager.Ins.Init(); + ValidatorManager.Ins.Init(); + DataTargetManager.Ins.Init(); + PipelineManager.Ins.Init(); + L10NManager.Ins.Init(); + CustomBehaviourManager.Ins.Init(); + } + + private void PostInitManagers() + { + CodeFormatManager.Ins.PostInit(); + } + + private void ScanRegisterAssemblyBehaviours() + { + string dllDir = Path.GetDirectoryName(AppContext.BaseDirectory); + foreach (var dllFile in Directory.GetFiles(dllDir, "*.dll", SearchOption.TopDirectoryOnly)) + { + string dllName = Path.GetFileNameWithoutExtension(dllFile); + if (dllName.Contains("Luban") && AppDomain.CurrentDomain.GetAssemblies().All(a => a.GetName().Name != dllName)) + { + s_logger.Trace("load dll:{dll}", dllFile); + Assembly.Load(dllName); + } + } + + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + if (assembly.GetCustomAttribute() != null) + { + ScanRegisterAssembly(assembly); + } + } + } + + public void ScanRegisterAssembly(Assembly assembly) + { + CustomBehaviourManager.Ins.ScanRegisterBehaviour(assembly); + SchemaManager.Ins.ScanRegisterAll(assembly); + } +} diff --git a/luban/src/Luban.Core/TemplateExtensions/ContextTemplateExtension.cs b/luban/src/Luban.Core/TemplateExtensions/ContextTemplateExtension.cs new file mode 100644 index 00000000..43950e7e --- /dev/null +++ b/luban/src/Luban.Core/TemplateExtensions/ContextTemplateExtension.cs @@ -0,0 +1,33 @@ +using Scriban.Runtime; + +namespace Luban.TemplateExtensions; + +public class ContextTemplateExtension : ScriptObject +{ + + + public static bool HasTag(dynamic obj, string attrName) + { + return obj.HasTag(attrName); + } + + public static string GetTag(dynamic obj, string attrName) + { + return obj.GetTag(attrName); + } + + public static bool HasOption(string name) + { + return EnvManager.Current.HasOptionRaw(name); + } + + public static string GetOption(string name) + { + return EnvManager.Current.GetOptionRaw(name); + } + + public static string GetOptionOrDefault(string name, string defaultValue) + { + return EnvManager.Current.GetOptionOrDefaultRaw(name, defaultValue); + } +} diff --git a/luban/src/Luban.Core/TemplateExtensions/TypeTemplateExtension.cs b/luban/src/Luban.Core/TemplateExtensions/TypeTemplateExtension.cs new file mode 100644 index 00000000..2fc4e970 --- /dev/null +++ b/luban/src/Luban.Core/TemplateExtensions/TypeTemplateExtension.cs @@ -0,0 +1,134 @@ +using Luban.CodeFormat; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.TemplateExtensions; + +public class TypeTemplateExtension : ScriptObject +{ + public static bool NeedMarshalBoolPrefix(TType type) + { + return type.IsNullable; + } + + public static string FormatMethodName(ICodeStyle codeStyle, string name) + { + return codeStyle.FormatMethod(name); + } + + public static string FormatFieldName(ICodeStyle codeStyle, string name) + { + return codeStyle.FormatField(name); + } + + public static string FormatPropertyName(ICodeStyle codeStyle, string name) + { + return codeStyle.FormatProperty(name); + } + + public static string FormatEnumItemName(ICodeStyle codeStyle, string name) + { + return codeStyle.FormatEnumItemName(name); + } + + public static bool CanGenerateRef(DefField field) + { + if (field.CType.IsCollection) + { + return false; + } + + return GetRefTable(field) != null; + } + + public static bool CanGenerateCollectionRef(DefField field) + { + if (!field.CType.IsCollection) + { + return false; + } + return GetCollectionRefTable(field) != null; + } + + public static DefTable GetCollectionRefTable(DefField field) + { + var refTag = field.CType.GetTag("ref"); + if (refTag == null) + { + refTag = field.CType.ElementType.GetTag("ref"); + } + if (refTag == null) + { + return null; + } + if (GenerationContext.Current.Assembly.GetCfgTable(refTag.Replace("?", "")) is { } cfgTable) + { + return cfgTable; + } + return null; + } + + public static DefTable GetRefTable(DefField field) + { + if (field.CType.GetTag("ref") is { } value && GenerationContext.Current.Assembly.GetCfgTable(value.Replace("?", "")) is { } cfgTable) + { + return cfgTable; + } + return null; + } + + public static TType GetRefType(DefField field) + { + return GetRefTable(field)?.ValueTType; + } + + public static bool IsFieldBeanNeedResolveRef(DefField field) + { + return field.CType is TBean bean && bean.DefBean.TypeMappers == null && !bean.DefBean.IsValueType; + } + + public static bool IsFieldArrayLikeNeedResolveRef(DefField field) + { + return field.CType.ElementType is TBean bean && bean.DefBean.TypeMappers == null && !bean.DefBean.IsValueType && field.CType is not TMap; + } + + public static bool IsFieldMapNeedResolveRef(DefField field) + { + return field.CType is TMap { ValueType: TBean bean } && bean.DefBean.TypeMappers == null && !bean.DefBean.IsValueType; + } + + public static bool HasIndex(DefField field) + { + TType type = field.CType; + return type.HasTag("index") && type is TArray or TList; + } + + public static string GetIndexName(DefField field) + { + return field.CType.GetTag("index"); + } + + public static DefField GetIndexField(DefField field) + { + string indexName = GetIndexName(field); + return ((TBean)field.CType.ElementType).DefBean.GetField(indexName); + } + + public static TMap GetIndexMapType(DefField field) + { + DefField indexField = GetIndexField(field); + return TMap.Create(false, null, indexField.CType, field.CType.ElementType, false); + } + + public static string ImplDataType(DefBean type, DefBean parent) + { + return DataUtil.GetImplTypeName(type, parent); + } + + public static string EscapeComment(string comment) + { + return System.Web.HttpUtility.HtmlEncode(comment).Replace("\n", "
"); + } +} diff --git a/luban/src/Luban.Core/Tmpl/TemplateManager.cs b/luban/src/Luban.Core/Tmpl/TemplateManager.cs new file mode 100644 index 00000000..0ef15670 --- /dev/null +++ b/luban/src/Luban.Core/Tmpl/TemplateManager.cs @@ -0,0 +1,100 @@ +using System.Collections.Concurrent; +using System.Reflection; +using System.Text; +using Scriban; + +namespace Luban.Tmpl; + +public class TemplateManager +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public static TemplateManager Ins { get; } = new(); + + + private readonly List _templateSearchPaths = new(); + + private readonly ConcurrentDictionary _templates = new(); + + private readonly ConcurrentDictionary _templateStrings = new(); + + public void Init() + { + string curDir = Path.GetDirectoryName(AppContext.BaseDirectory); + AddTemplateSearchPath($"{curDir}/Templates", true); + } + + public void AddTemplateSearchPath(string templateSearchPath, bool sureExists = false, bool addFirst = false) + { + if (!Directory.Exists(templateSearchPath)) + { + if (sureExists) + { + s_logger.Error("template search path:{} not exists", templateSearchPath); + } + return; + } + if (addFirst) + { + _templateSearchPaths.Insert(0, templateSearchPath); + } + else + { + _templateSearchPaths.Add(templateSearchPath); + } + } + + public bool TryGetTemplateString(string templateName, out string result) + { + if (_templateStrings.TryGetValue(templateName, out result)) + { + return true; + } + foreach (var searchPath in _templateSearchPaths) + { + var fullPath = $"{searchPath}/{templateName}.sbn"; + if (File.Exists(fullPath)) + { + result = File.ReadAllText(fullPath, Encoding.UTF8); + _templateStrings[templateName] = result; + return true; + } + } + result = null; + return false; + } + + public string GetTemplateString(string templateName) + { + if (TryGetTemplateString(templateName, out var strTpl)) + { + return strTpl; + } + throw new FileNotFoundException($"can't find {templateName}.sbn in paths:{string.Join(';', _templateSearchPaths)}"); + } + + public Scriban.Template GetTemplate(string templateName) + { + return _templates.GetOrAdd(templateName, tn => Template.Parse(GetTemplateString(tn))); + } + + public bool TryGetTemplate(string templateName, out Template template) + { + if (_templates.TryGetValue(templateName, out template)) + { + return true; + } + if (TryGetTemplateString(templateName, out var strTpm)) + { + template = _templates.GetOrAdd(templateName, tn => Template.Parse(strTpm)); + return true; + } + template = null; + return false; + } + + public Template GetOrAddTemplate(string templateName, Func creator) + { + return _templates.GetOrAdd(templateName, creator); + } +} diff --git a/luban/src/Luban.Core/TypeVisitors/AllFalseVisitor.cs b/luban/src/Luban.Core/TypeVisitors/AllFalseVisitor.cs new file mode 100644 index 00000000..0e27f1b6 --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/AllFalseVisitor.cs @@ -0,0 +1,11 @@ +using Luban.Types; + +namespace Luban.TypeVisitors; + +public abstract class AllFalseVisitor : DecoratorFuncVisitor +{ + public override bool DoAccept(TType type) + { + return false; + } +} diff --git a/luban/src/Luban.Core/TypeVisitors/AllTrueVisitor.cs b/luban/src/Luban.Core/TypeVisitors/AllTrueVisitor.cs new file mode 100644 index 00000000..f8ad2e49 --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/AllTrueVisitor.cs @@ -0,0 +1,11 @@ +using Luban.Types; + +namespace Luban.TypeVisitors; + +public abstract class AllTrueVisitor : DecoratorFuncVisitor +{ + public override bool DoAccept(TType type) + { + return true; + } +} diff --git a/luban/src/Luban.Core/TypeVisitors/DecoratorActionVisitor.cs b/luban/src/Luban.Core/TypeVisitors/DecoratorActionVisitor.cs new file mode 100644 index 00000000..e110d7c5 --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/DecoratorActionVisitor.cs @@ -0,0 +1,165 @@ +using Luban.Types; + +namespace Luban.TypeVisitors; + +public abstract class DecoratorActionVisitor : ITypeActionVisitor +{ + public abstract void DoAccept(TType type, T x); + + public virtual void Accept(TBool type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TByte type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TShort type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TInt type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TLong type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TFloat type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TDouble type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TEnum type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TString type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TDateTime type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TBean type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TArray type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TList type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TSet type, T x) + { + DoAccept(type, x); + } + + public virtual void Accept(TMap type, T x) + { + DoAccept(type, x); + } + +} + +public abstract class DecoratorActionVisitor : ITypeActionVisitor +{ + + public abstract void DoAccept(TType type, T1 x, T2 y); + + public virtual void Accept(TBool type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TByte type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TShort type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TInt type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TLong type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TFloat type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TDouble type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TEnum type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TString type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TDateTime type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TBean type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TArray type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TList type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TSet type, T1 x, T2 y) + { + DoAccept(type, x, y); + } + + public virtual void Accept(TMap type, T1 x, T2 y) + { + DoAccept(type, x, y); + } +} diff --git a/luban/src/Luban.Core/TypeVisitors/DecoratorFuncVisitor.cs b/luban/src/Luban.Core/TypeVisitors/DecoratorFuncVisitor.cs new file mode 100644 index 00000000..29ae2521 --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/DecoratorFuncVisitor.cs @@ -0,0 +1,407 @@ +using Luban.Types; + +namespace Luban.TypeVisitors; + +public abstract class DecoratorFuncVisitor : ITypeFuncVisitor +{ + public abstract TR DoAccept(TType type); + + public virtual TR Accept(TBool type) + { + return DoAccept(type); + } + + public virtual TR Accept(TByte type) + { + return DoAccept(type); + } + + public virtual TR Accept(TShort type) + { + return DoAccept(type); + } + + public virtual TR Accept(TInt type) + { + return DoAccept(type); + } + + public virtual TR Accept(TLong type) + { + return DoAccept(type); + } + + public virtual TR Accept(TFloat type) + { + return DoAccept(type); + } + + public virtual TR Accept(TDouble type) + { + return DoAccept(type); + } + + public virtual TR Accept(TEnum type) + { + return DoAccept(type); + } + + public virtual TR Accept(TString type) + { + return DoAccept(type); + } + + public virtual TR Accept(TDateTime type) + { + return DoAccept(type); + } + + public virtual TR Accept(TBean type) + { + return DoAccept(type); + } + + public virtual TR Accept(TArray type) + { + return DoAccept(type); + } + + public virtual TR Accept(TList type) + { + return DoAccept(type); + } + + public virtual TR Accept(TSet type) + { + return DoAccept(type); + } + + public virtual TR Accept(TMap type) + { + return DoAccept(type); + } +} + +public abstract class DecoratorFuncVisitor : ITypeFuncVisitor +{ + public abstract TR DoAccept(TType tpye, T1 x); + + public virtual TR Accept(TBool type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TByte type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TShort type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TInt type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TLong type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TFloat type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TDouble type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TEnum type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TString type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TDateTime type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TBean type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TArray type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TList type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TSet type, T1 x) + { + return DoAccept(type, x); + } + + public virtual TR Accept(TMap type, T1 x) + { + return DoAccept(type, x); + } +} + +public abstract class DecoratorFuncVisitor : ITypeFuncVisitor +{ + public abstract TR DoAccept(TType tpye, T1 x, T2 y); + + public virtual TR Accept(TBool type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TByte type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TShort type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TInt type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TLong type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TFloat type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TDouble type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TEnum type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TString type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TDateTime type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TBean type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TArray type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TList type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TSet type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } + + public virtual TR Accept(TMap type, T1 x, T2 y) + { + return DoAccept(type, x, y); + } +} + +public abstract class DecoratorFuncVisitor : ITypeFuncVisitor +{ + + public abstract TR DoAccept(TType tpye, T1 x, T2 y, T3 z); + + public virtual TR Accept(TBool type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TByte type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TShort type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TInt type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TLong type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TFloat type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TDouble type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TEnum type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TString type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TDateTime type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TBean type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TArray type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TList type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TSet type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + + public virtual TR Accept(TMap type, T1 x, T2 y, T3 z) + { + return DoAccept(type, x, y, z); + } + +} + +public abstract class DecoratorFuncVisitor : ITypeFuncVisitor +{ + + public abstract TR DoAccept(TType tpye, T1 a, T2 b, T3 c, T4 d); + + public virtual TR Accept(TBool type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TByte type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TShort type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TInt type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TLong type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TFloat type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TDouble type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TEnum type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TString type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TDateTime type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TBean type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TArray type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TList type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TSet type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + + public virtual TR Accept(TMap type, T1 a, T2 b, T3 c, T4 d) + { + return DoAccept(type, a, b, c, d); + } + +} diff --git a/luban/src/Luban.Core/TypeVisitors/DeepCompareTypeDefine.cs b/luban/src/Luban.Core/TypeVisitors/DeepCompareTypeDefine.cs new file mode 100644 index 00000000..c1967580 --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/DeepCompareTypeDefine.cs @@ -0,0 +1,239 @@ +using Luban.Defs; +using Luban.Types; +using Luban.Utils; + +namespace Luban.TypeVisitors; + +class DeepCompareTypeDefine : ITypeFuncVisitor, HashSet, bool> +{ + public static DeepCompareTypeDefine Ins { get; } = new(); + + private bool IsBaseDefineEqual(DefBean a, DefBean b) + { + if (!a.Name.Equals(b.Name)) + { + return false; + } + if (!a.Namespace.Equals(b.Namespace)) + { + return false; + } + + if (a.Parent != b.Parent) + { + return false; + } + + if (a.Alias != b.Alias) + { + return false; + } + if (a.IsMultiRow != b.IsMultiRow) + { + return false; + } + if (a.Sep != b.Sep) + { + return false; + } + return true; + } + + public bool Compare(DefBean a, DefBean b, Dictionary ctx, HashSet inWalk) + { + bool setupNotEqual() + { + ctx.Add(a, false); + return false; + } + + if (ctx.TryGetValue(a, out var e)) + { + return e; + } + if (inWalk.Contains(a)) + { + return true; + } + + if (!IsBaseDefineEqual(a, b)) + { + return setupNotEqual(); + } + + inWalk.Add(a); + + try + { + if (a.Fields.Count != b.Fields.Count) + { + return setupNotEqual(); + } + + for (int i = 0; i < a.Fields.Count; i++) + { + var f1 = a.Fields[i]; + var f2 = b.Fields[i]; + if (f1.Name != f2.Name + || f1.NeedExport() != f2.NeedExport() + || f1.CType.IsNullable != f2.CType.IsNullable + || f1.CType.GetType() != f2.CType.GetType() + ) + { + return setupNotEqual(); + } + + if (!f1.CType.Apply(this, f2.CType, ctx, inWalk)) + { + return setupNotEqual(); + } + } + + + var parentType = (DefBean)a.ParentDefType; + if (parentType != null && !Compare(parentType, (DefBean)b.ParentDefType, ctx, inWalk)) + { + return setupNotEqual(); + } + if (a.Children == null) + { + if (b.Children != null) + { + return setupNotEqual(); + } + } + else + { + if (b.Children == null || a.Children.Count != b.Children.Count) + { + return setupNotEqual(); + } + else + { + int index = 0; + foreach (var c in a.Children) + { + if (!Compare((DefBean)c, (DefBean)b.Children[index++], ctx, inWalk)) + { + return setupNotEqual(); + } + } + } + } + + ctx.Add(a, true); + return true; + } + finally + { + //inWalk.Remove(a); + } + } + + public bool Accept(TBool type, TType x, Dictionary y, HashSet z) + { + return true; + } + + public bool Accept(TByte type, TType x, Dictionary y, HashSet z) + { + return true; + } + + public bool Accept(TShort type, TType x, Dictionary y, HashSet z) + { + return true; + } + + public bool Accept(TInt type, TType x, Dictionary y, HashSet z) + { + return true; + } + + public bool Accept(TLong type, TType x, Dictionary y, HashSet z) + { + return true; + } + + public bool Accept(TFloat type, TType x, Dictionary y, HashSet z) + { + return true; + } + + public bool Accept(TDouble type, TType x, Dictionary y, HashSet z) + { + return true; + } + + public bool Accept(TEnum type, TType x, Dictionary y, HashSet z) + { + var a = type.DefEnum; + var b = ((TEnum)x).DefEnum; + if (y.TryGetValue(a, out var v)) + { + return v; + } + + + var same = a.FullName == b.FullName + && a.IsFlags == b.IsFlags + && a.IsUniqueItemId == b.IsUniqueItemId + && IsEnumItemEquals(a.Items, b.Items); + y.Add(a, same); + return same; + } + + private bool IsEnumItemEquals(List a, List b) + { + if (a.Count != b.Count) + { + return false; + } + for (int i = 0; i < a.Count; i++) + { + var ia = a[i]; + var ib = b[i]; + if (ia.Name != ib.Name || ia.Value != ib.Value || ia.Alias != ib.Alias) + { + return false; + } + } + return true; + } + + public bool Accept(TString type, TType x, Dictionary y, HashSet z) + { + return true; + } + + public bool Accept(TDateTime type, TType x, Dictionary y, HashSet z) + { + return true; + } + + public bool Accept(TBean type, TType x, Dictionary y, HashSet z) + { + return Compare(type.DefBean, ((TBean)x).DefBean, y, z); + } + + public bool Accept(TArray type, TType x, Dictionary y, HashSet z) + { + return type.ElementType.Apply(this, ((TArray)x).ElementType, y, z); + } + + public bool Accept(TList type, TType x, Dictionary y, HashSet z) + { + return type.ElementType.Apply(this, ((TList)x).ElementType, y, z); + } + + public bool Accept(TSet type, TType x, Dictionary y, HashSet z) + { + return type.ElementType.Apply(this, ((TSet)x).ElementType, y, z); + } + + public bool Accept(TMap type, TType x, Dictionary y, HashSet z) + { + TMap m = (TMap)x; + return type.KeyType.Apply(this, m.KeyType, y, z) && type.ValueType.Apply(this, m.ValueType, y, z); + } +} diff --git a/luban/src/Luban.Core/TypeVisitors/ITypeActionVisitor.cs b/luban/src/Luban.Core/TypeVisitors/ITypeActionVisitor.cs new file mode 100644 index 00000000..61b9c481 --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/ITypeActionVisitor.cs @@ -0,0 +1,69 @@ +using Luban.Types; + +namespace Luban.TypeVisitors; + +public interface ITypeActionVisitor +{ + void Accept(TBool type, T x); + + void Accept(TByte type, T x); + + void Accept(TShort type, T x); + + void Accept(TInt type, T x); + + void Accept(TLong type, T x); + + void Accept(TFloat type, T x); + + void Accept(TDouble type, T x); + + void Accept(TEnum type, T x); + + void Accept(TString type, T x); + + void Accept(TDateTime type, T x); + + void Accept(TBean type, T x); + + void Accept(TArray type, T x); + + void Accept(TList type, T x); + + void Accept(TSet type, T x); + + void Accept(TMap type, T x); +} + +public interface ITypeActionVisitor +{ + void Accept(TBool type, T1 x, T2 y); + + void Accept(TByte type, T1 x, T2 y); + + void Accept(TShort type, T1 x, T2 y); + + void Accept(TInt type, T1 x, T2 y); + + void Accept(TLong type, T1 x, T2 y); + + void Accept(TFloat type, T1 x, T2 y); + + void Accept(TDouble type, T1 x, T2 y); + + void Accept(TEnum type, T1 x, T2 y); + + void Accept(TString type, T1 x, T2 y); + + void Accept(TDateTime type, T1 x, T2 y); + + void Accept(TBean type, T1 x, T2 y); + + void Accept(TArray type, T1 x, T2 y); + + void Accept(TList type, T1 x, T2 y); + + void Accept(TSet type, T1 x, T2 y); + + void Accept(TMap type, T1 x, T2 y); +} diff --git a/luban/src/Luban.Core/TypeVisitors/ITypeFuncVisitor.cs b/luban/src/Luban.Core/TypeVisitors/ITypeFuncVisitor.cs new file mode 100644 index 00000000..213f2451 --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/ITypeFuncVisitor.cs @@ -0,0 +1,168 @@ +using Luban.Types; + +namespace Luban.TypeVisitors; + +public interface ITypeFuncVisitor +{ + TR Accept(TBool type); + + TR Accept(TByte type); + + TR Accept(TShort type); + + TR Accept(TInt type); + + TR Accept(TLong type); + + TR Accept(TFloat type); + + TR Accept(TDouble type); + + TR Accept(TEnum type); + + TR Accept(TString type); + + TR Accept(TDateTime type); + + TR Accept(TBean type); + + TR Accept(TArray type); + + TR Accept(TList type); + + TR Accept(TSet type); + + TR Accept(TMap type); +} + +public interface ITypeFuncVisitor +{ + TR Accept(TBool type, T x); + + TR Accept(TByte type, T x); + + TR Accept(TShort type, T x); + + TR Accept(TInt type, T x); + + TR Accept(TLong type, T x); + + TR Accept(TFloat type, T x); + + TR Accept(TDouble type, T x); + + TR Accept(TEnum type, T x); + + TR Accept(TString type, T x); + + TR Accept(TDateTime type, T x); + + TR Accept(TBean type, T x); + + TR Accept(TArray type, T x); + + TR Accept(TList type, T x); + + TR Accept(TSet type, T x); + + TR Accept(TMap type, T x); +} + +public interface ITypeFuncVisitor +{ + TR Accept(TBool type, T x, T2 y); + + TR Accept(TByte type, T x, T2 y); + + TR Accept(TShort type, T x, T2 y); + + TR Accept(TInt type, T x, T2 y); + + TR Accept(TLong type, T x, T2 y); + + TR Accept(TFloat type, T x, T2 y); + + TR Accept(TDouble type, T x, T2 y); + + TR Accept(TEnum type, T x, T2 y); + + TR Accept(TString type, T x, T2 y); + + TR Accept(TDateTime type, T x, T2 y); + + TR Accept(TBean type, T x, T2 y); + + TR Accept(TArray type, T x, T2 y); + + TR Accept(TList type, T x, T2 y); + + TR Accept(TSet type, T x, T2 y); + + TR Accept(TMap type, T x, T2 y); +} + +public interface ITypeFuncVisitor +{ + TR Accept(TBool type, T x, T2 y, T3 z); + + TR Accept(TByte type, T x, T2 y, T3 z); + + TR Accept(TShort type, T x, T2 y, T3 z); + + TR Accept(TInt type, T x, T2 y, T3 z); + + TR Accept(TLong type, T x, T2 y, T3 z); + + TR Accept(TFloat type, T x, T2 y, T3 z); + + TR Accept(TDouble type, T x, T2 y, T3 z); + + TR Accept(TEnum type, T x, T2 y, T3 z); + + TR Accept(TString type, T x, T2 y, T3 z); + + TR Accept(TDateTime type, T x, T2 y, T3 z); + + TR Accept(TBean type, T x, T2 y, T3 z); + + TR Accept(TArray type, T x, T2 y, T3 z); + + TR Accept(TList type, T x, T2 y, T3 z); + + TR Accept(TSet type, T x, T2 y, T3 z); + + TR Accept(TMap type, T x, T2 y, T3 z); +} + +public interface ITypeFuncVisitor +{ + TR Accept(TBool type, T x, T2 y, T3 z, T4 w); + + TR Accept(TByte type, T x, T2 y, T3 z, T4 w); + + TR Accept(TShort type, T x, T2 y, T3 z, T4 w); + + TR Accept(TInt type, T x, T2 y, T3 z, T4 w); + + TR Accept(TLong type, T x, T2 y, T3 z, T4 w); + + TR Accept(TFloat type, T x, T2 y, T3 z, T4 w); + + TR Accept(TDouble type, T x, T2 y, T3 z, T4 w); + + TR Accept(TEnum type, T x, T2 y, T3 z, T4 w); + + TR Accept(TString type, T x, T2 y, T3 z, T4 w); + + TR Accept(TDateTime type, T x, T2 y, T3 z, T4 w); + + TR Accept(TBean type, T x, T2 y, T3 z, T4 w); + + TR Accept(TArray type, T x, T2 y, T3 z, T4 w); + + TR Accept(TList type, T x, T2 y, T3 z, T4 w); + + TR Accept(TSet type, T x, T2 y, T3 z, T4 w); + + TR Accept(TMap type, T x, T2 y, T3 z, T4 w); +} diff --git a/luban/src/Luban.Core/TypeVisitors/IsValidTableKeyTypeVisitor.cs b/luban/src/Luban.Core/TypeVisitors/IsValidTableKeyTypeVisitor.cs new file mode 100644 index 00000000..54ad912d --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/IsValidTableKeyTypeVisitor.cs @@ -0,0 +1,38 @@ +using Luban.Types; + +namespace Luban.TypeVisitors; + +class IsValidTableKeyTypeVisitor : AllTrueVisitor +{ + public static IsValidTableKeyTypeVisitor Ins { get; } = new(); + + public override bool Accept(TDateTime type) + { + return false; + } + + public override bool Accept(TBean type) + { + return false; + } + + public override bool Accept(TArray type) + { + return false; + } + + public override bool Accept(TList type) + { + return false; + } + + public override bool Accept(TSet type) + { + return false; + } + + public override bool Accept(TMap type) + { + return false; + } +} diff --git a/luban/src/Luban.Core/TypeVisitors/RawDefineTypeNameVisitor.cs b/luban/src/Luban.Core/TypeVisitors/RawDefineTypeNameVisitor.cs new file mode 100644 index 00000000..5afdf96a --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/RawDefineTypeNameVisitor.cs @@ -0,0 +1,83 @@ +using Luban.Types; + +namespace Luban.TypeVisitors; + +public class RawDefineTypeNameVisitor : ITypeFuncVisitor +{ + public static RawDefineTypeNameVisitor Ins { get; } = new(); + + public string Accept(TBool type) + { + return "bool"; + } + + public string Accept(TByte type) + { + return "byte"; + } + + public string Accept(TShort type) + { + return "short"; + } + + public string Accept(TInt type) + { + return "int"; + } + + public string Accept(TLong type) + { + return "long"; + } + + public string Accept(TFloat type) + { + return "float"; + } + + public string Accept(TDouble type) + { + return "double"; + } + + public string Accept(TEnum type) + { + return type.DefEnum.FullName; + } + + public string Accept(TString type) + { + return "string"; + } + + public virtual string Accept(TDateTime type) + { + return "datetime"; + } + + public string Accept(TBean type) + { + return type.DefBean.FullName; + } + + public string Accept(TArray type) + { + return $"array,{type.ElementType.Apply(this)}"; + } + + public string Accept(TList type) + { + return $"list,{type.ElementType.Apply(this)}"; + } + + public string Accept(TSet type) + { + return $"set,{type.ElementType.Apply(this)}"; + } + + public string Accept(TMap type) + { + return $"map,{type.KeyType.Apply(this)},{type.ValueType.Apply(this)}"; + } +} diff --git a/luban/src/Luban.Core/TypeVisitors/RefTypeVisitor.cs b/luban/src/Luban.Core/TypeVisitors/RefTypeVisitor.cs new file mode 100644 index 00000000..5bb11cc2 --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/RefTypeVisitor.cs @@ -0,0 +1,104 @@ +using Luban.Defs; +using Luban.Types; + +namespace Luban.TypeVisitors; + +class RefTypeVisitor : ITypeActionVisitor> +{ + public static RefTypeVisitor Ins { get; } = new(); + + public void Accept(TBool type, Dictionary x) + { + + } + + public void Accept(TByte type, Dictionary x) + { + + } + + public void Accept(TShort type, Dictionary x) + { + + } + + public void Accept(TInt type, Dictionary x) + { + + } + + public void Accept(TLong type, Dictionary x) + { + + } + + public void Accept(TFloat type, Dictionary x) + { + + } + + public void Accept(TDouble type, Dictionary x) + { + + } + + public void Accept(TEnum type, Dictionary x) + { + x.TryAdd(type.DefEnum.FullName, type.DefEnum); + } + + public void Accept(TString type, Dictionary x) + { + + } + + public void Accept(TDateTime type, Dictionary x) + { + + } + + void Walk(DefBean type, Dictionary types) + { + if (types.TryAdd(type.FullName, type)) + { + foreach (var f in type.Fields) + { + f.CType.Apply(this, types); + } + if (type.Children != null) + { + foreach (DefBean c in type.Children) + { + Walk(c, types); + } + } + } + } + + public void Accept(TBean type, Dictionary x) + { + var root = (DefBean)type.DefBean.RootDefType; + Walk(root, x); + } + + public void Accept(TArray type, Dictionary x) + { + type.ElementType.Apply(this, x); + } + + public void Accept(TList type, Dictionary x) + { + type.ElementType.Apply(this, x); + } + + public void Accept(TSet type, Dictionary x) + { + type.ElementType.Apply(this, x); + } + + public void Accept(TMap type, Dictionary x) + { + type.KeyType.Apply(this, x); + type.ValueType.Apply(this, x); + } +} diff --git a/luban/src/Luban.Core/TypeVisitors/TypeActionVisitorAdaptor.cs b/luban/src/Luban.Core/TypeVisitors/TypeActionVisitorAdaptor.cs new file mode 100644 index 00000000..23c4696e --- /dev/null +++ b/luban/src/Luban.Core/TypeVisitors/TypeActionVisitorAdaptor.cs @@ -0,0 +1,81 @@ +using Luban.Types; + +namespace Luban.TypeVisitors; + +public abstract class TypeActionVisitorAdaptor : ITypeActionVisitor +{ + public virtual void Accept(TBool type, T x) + { + + } + + public virtual void Accept(TByte type, T x) + { + + } + + public virtual void Accept(TShort type, T x) + { + + } + + public virtual void Accept(TInt type, T x) + { + + } + + public virtual void Accept(TLong type, T x) + { + + } + + public virtual void Accept(TFloat type, T x) + { + + } + + public virtual void Accept(TDouble type, T x) + { + + } + + public virtual void Accept(TEnum type, T x) + { + + } + + public virtual void Accept(TString type, T x) + { + + } + + public virtual void Accept(TBean type, T x) + { + + } + + public virtual void Accept(TArray type, T x) + { + + } + + public virtual void Accept(TList type, T x) + { + + } + + public virtual void Accept(TSet type, T x) + { + + } + + public virtual void Accept(TMap type, T x) + { + + } + + public virtual void Accept(TDateTime type, T x) + { + + } +} diff --git a/luban/src/Luban.Core/Types/TArray.cs b/luban/src/Luban.Core/Types/TArray.cs new file mode 100644 index 00000000..7da90ab0 --- /dev/null +++ b/luban/src/Luban.Core/Types/TArray.cs @@ -0,0 +1,86 @@ +using Luban.Defs; +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TArray : TType +{ + public static TArray Create(bool isNullable, Dictionary tags, TType elementType) + { + return new TArray(isNullable, tags, elementType); + } + + public override TType ElementType { get; } + + public override string TypeName => "array"; + + public int Dimension { get; } = 1; + + public TType FinalElementType { get; protected set; } + + private TArray(bool isNullable, Dictionary tags, TType elementType) : base(isNullable, tags) + { + ElementType = elementType; + if (ElementType.TypeName == "array") + { + Dimension = (ElementType as TArray).Dimension + 1; + FinalElementType = (ElementType as TArray).FinalElementType; + } + else + { + FinalElementType = elementType; + } + } + + public override bool TryParseFrom(string s) + { + throw new NotSupportedException(); + } + + public override bool IsCollection => true; + + public override void PostCompile(DefField field) + { + base.PostCompile(field); + + if (ElementType is TBean e && !e.IsDynamic && e.DefBean.HierarchyFields.Count == 0) + { + throw new Exception($"container element type:'{e.DefBean.FullName}' can't be empty bean"); + } + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TBean.cs b/luban/src/Luban.Core/Types/TBean.cs new file mode 100644 index 00000000..2c881aa7 --- /dev/null +++ b/luban/src/Luban.Core/Types/TBean.cs @@ -0,0 +1,67 @@ +using Luban.Defs; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Types; + +public class TBean : TType +{ + public static TBean Create(bool isNullable, DefBean defBean, Dictionary tags) + { + // TODO + return new TBean(isNullable, DefUtil.MergeTags(defBean.Tags, tags), defBean); + } + + public DefBean DefBean { get; set; } + + public override string TypeName => "bean"; + + private TBean(bool isNullable, Dictionary attrs, DefBean defBean) : base(isNullable, attrs) + { + this.DefBean = defBean; + } + + public override bool TryParseFrom(string s) + { + throw new NotSupportedException(); + } + + public bool IsDynamic => DefBean.IsAbstractType; + + public override bool IsBean => true; + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TBool.cs b/luban/src/Luban.Core/Types/TBool.cs new file mode 100644 index 00000000..a96faab8 --- /dev/null +++ b/luban/src/Luban.Core/Types/TBool.cs @@ -0,0 +1,59 @@ +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TBool : TType +{ + public static TBool Create(bool isNullable, Dictionary tags) + { + return new TBool(isNullable, tags); + } + + private TBool(bool isNullable, Dictionary tags) : base(isNullable, tags) + { + } + + public bool IsBool => true; + + public override string TypeName => "bool"; + + public override bool TryParseFrom(string s) + { + return bool.TryParse(s, out _); + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TByte.cs b/luban/src/Luban.Core/Types/TByte.cs new file mode 100644 index 00000000..b474651f --- /dev/null +++ b/luban/src/Luban.Core/Types/TByte.cs @@ -0,0 +1,57 @@ +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TByte : TType +{ + public static TByte Create(bool isNullable, Dictionary tags) + { + return new TByte(isNullable, tags); + } + + public override string TypeName => "byte"; + + private TByte(bool isNullable, Dictionary tags) : base(isNullable, tags) + { + } + + public override bool TryParseFrom(string s) + { + return byte.TryParse(s, out _); + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TDateTime.cs b/luban/src/Luban.Core/Types/TDateTime.cs new file mode 100644 index 00000000..4132e635 --- /dev/null +++ b/luban/src/Luban.Core/Types/TDateTime.cs @@ -0,0 +1,57 @@ +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TDateTime : TType +{ + public static TDateTime Create(bool isNullable, Dictionary tags) + { + return new TDateTime(isNullable, tags); + } + + public override string TypeName => "datetime"; + + private TDateTime(bool isNullable, Dictionary tags) : base(isNullable, tags) + { + } + + public override bool TryParseFrom(string s) + { + throw new NotSupportedException(); + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TDouble.cs b/luban/src/Luban.Core/Types/TDouble.cs new file mode 100644 index 00000000..ed238d44 --- /dev/null +++ b/luban/src/Luban.Core/Types/TDouble.cs @@ -0,0 +1,57 @@ +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TDouble : TType +{ + public static TDouble Create(bool isNullable, Dictionary tags) + { + return new TDouble(isNullable, tags); + } + + public override string TypeName => "double"; + + private TDouble(bool isNullable, Dictionary tags) : base(isNullable, tags) + { + } + + public override bool TryParseFrom(string s) + { + return double.TryParse(s, out _); + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TEnum.cs b/luban/src/Luban.Core/Types/TEnum.cs new file mode 100644 index 00000000..e8194660 --- /dev/null +++ b/luban/src/Luban.Core/Types/TEnum.cs @@ -0,0 +1,64 @@ +using Luban.Defs; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Types; + +public class TEnum : TType +{ + public static TEnum Create(bool isNullable, DefEnum defEnum, Dictionary tags) + { + return new TEnum(isNullable, DefUtil.MergeTags(defEnum.Tags, tags), defEnum); + } + + public override string TypeName => "enum"; + + public override bool IsEnum => true; + + public DefEnum DefEnum { get; } + + private TEnum(bool isNullable, Dictionary tags, DefEnum defEnum) : base(isNullable, tags) + { + this.DefEnum = defEnum; + } + + public override bool TryParseFrom(string s) + { + throw new NotSupportedException(); + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} \ No newline at end of file diff --git a/luban/src/Luban.Core/Types/TFloat.cs b/luban/src/Luban.Core/Types/TFloat.cs new file mode 100644 index 00000000..d1813bfa --- /dev/null +++ b/luban/src/Luban.Core/Types/TFloat.cs @@ -0,0 +1,59 @@ +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TFloat : TType +{ + public static TFloat Ins { get; } = new(false, null); + + public static TFloat Create(bool isNullable, Dictionary tags) + { + return new TFloat(isNullable, tags); + } + + public override string TypeName => "float"; + + private TFloat(bool isNullable, Dictionary tags) : base(isNullable, tags) + { + } + + public override bool TryParseFrom(string s) + { + return float.TryParse(s, out _); + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TInt.cs b/luban/src/Luban.Core/Types/TInt.cs new file mode 100644 index 00000000..00b1bffc --- /dev/null +++ b/luban/src/Luban.Core/Types/TInt.cs @@ -0,0 +1,57 @@ +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TInt : TType +{ + public static TInt Create(bool isNullable, Dictionary tags) + { + return new TInt(isNullable, tags); + } + + public override string TypeName => "int"; + + private TInt(bool isNullable, Dictionary tags) : base(isNullable, tags) + { + } + + public override bool TryParseFrom(string s) + { + return int.TryParse(s, out _); + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TList.cs b/luban/src/Luban.Core/Types/TList.cs new file mode 100644 index 00000000..d3a1e7d0 --- /dev/null +++ b/luban/src/Luban.Core/Types/TList.cs @@ -0,0 +1,76 @@ +using Luban.Defs; +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TList : TType +{ + public static TList Create(bool isNullable, Dictionary tags, TType elementType, bool isArrayList) + { + return new TList(isNullable, tags, elementType, isArrayList); + } + + public override string TypeName => "list"; + + public override TType ElementType { get; } + + public bool IsArrayList { get; } + + private TList(bool isNullable, Dictionary tags, TType elementType, bool isArrayList) : base(isNullable, tags) + { + ElementType = elementType; + IsArrayList = isArrayList; + } + + public override bool TryParseFrom(string s) + { + throw new NotSupportedException(); + } + + public override bool IsCollection => true; + + public override void PostCompile(DefField field) + { + base.PostCompile(field); + + if (ElementType is TBean e && !e.IsDynamic && e.DefBean.HierarchyFields.Count == 0) + { + throw new Exception($"container element type:'{e.DefBean.FullName}' can't be empty bean"); + } + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TLong.cs b/luban/src/Luban.Core/Types/TLong.cs new file mode 100644 index 00000000..879db13a --- /dev/null +++ b/luban/src/Luban.Core/Types/TLong.cs @@ -0,0 +1,60 @@ +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TLong : TType +{ + public static TLong Create(bool isNullable, Dictionary tags, bool isBigInt) + { + return new TLong(isNullable, tags, isBigInt); + } + + public override string TypeName => "long"; + + public bool IsBigInt { get; } + + private TLong(bool isNullable, Dictionary tags, bool isBigInt) : base(isNullable, tags) + { + IsBigInt = isBigInt; + } + + public override bool TryParseFrom(string s) + { + return long.TryParse(s, out _); + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TMap.cs b/luban/src/Luban.Core/Types/TMap.cs new file mode 100644 index 00000000..d1af30cc --- /dev/null +++ b/luban/src/Luban.Core/Types/TMap.cs @@ -0,0 +1,83 @@ +using Luban.Defs; +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TMap : TType +{ + public static TMap Create(bool isNullable, Dictionary tags, TType keyType, TType valueType, bool isOrderedMap) + { + return new TMap(isNullable, tags, keyType, valueType, isOrderedMap); + } + + public override string TypeName => "map"; + + public bool IsMap => true; + + public TType KeyType { get; } + + public TType ValueType { get; } + + public override TType ElementType => ValueType; + + public bool IsOrderedMap { get; } + + private TMap(bool isNullable, Dictionary tags, TType keyType, TType valueType, bool isOrderedMap) : base(isNullable, tags) + { + KeyType = keyType; + ValueType = valueType; + IsOrderedMap = isOrderedMap; + } + + public override bool TryParseFrom(string s) + { + throw new NotSupportedException(); + } + + public override bool IsCollection => true; + + public override void PostCompile(DefField field) + { + base.PostCompile(field); + + if (ElementType is TBean e && !e.IsDynamic && e.DefBean.HierarchyFields.Count == 0) + { + throw new Exception($"container element type:'{e.DefBean.FullName}' can't be empty bean"); + } + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TSet.cs b/luban/src/Luban.Core/Types/TSet.cs new file mode 100644 index 00000000..791a0b9f --- /dev/null +++ b/luban/src/Luban.Core/Types/TSet.cs @@ -0,0 +1,76 @@ +using Luban.Defs; +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TSet : TType +{ + public static TSet Create(bool isNullable, Dictionary tags, TType elementType, bool isOrdered) + { + return new TSet(isNullable, tags, elementType, isOrdered); + } + + public override string TypeName => "set"; + + public override TType ElementType { get; } + + public bool IsOrderSet { get; } + + private TSet(bool isNullable, Dictionary tags, TType elementType, bool isOrderSet) : base(isNullable, tags) + { + ElementType = elementType; + IsOrderSet = isOrderSet; + } + + public override bool TryParseFrom(string s) + { + throw new NotSupportedException(); + } + + public override bool IsCollection => true; + + public override void PostCompile(DefField field) + { + base.PostCompile(field); + + if (ElementType is TBean beanType) + { + throw new Exception($"bean:{field.HostType.FullName} field:{field.Name} element type can't be bean:{beanType.DefBean.FullName}"); + } + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TShort.cs b/luban/src/Luban.Core/Types/TShort.cs new file mode 100644 index 00000000..259254d8 --- /dev/null +++ b/luban/src/Luban.Core/Types/TShort.cs @@ -0,0 +1,57 @@ +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TShort : TType +{ + public static TShort Create(bool isNullable, Dictionary tags) + { + return new TShort(isNullable, tags); + } + + public override string TypeName => "short"; + + private TShort(bool isNullable, Dictionary tags) : base(isNullable, tags) + { + } + + public override bool TryParseFrom(string s) + { + return short.TryParse(s, out _); + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TString.cs b/luban/src/Luban.Core/Types/TString.cs new file mode 100644 index 00000000..9a36ce10 --- /dev/null +++ b/luban/src/Luban.Core/Types/TString.cs @@ -0,0 +1,58 @@ +using Luban.TypeVisitors; + +namespace Luban.Types; + +public class TString : TType +{ + public static TString Create(bool isNullable, Dictionary tags) + { + return new TString(isNullable, tags); + } + + public override string TypeName => "string"; + + private TString(bool isNullable, Dictionary tags) : base(isNullable, tags) + { + } + + public override bool TryParseFrom(string s) + { + return true; + } + + public override void Apply(ITypeActionVisitor visitor, T x) + { + visitor.Accept(this, x); + } + + public override void Apply(ITypeActionVisitor visitor, T1 x, T2 y) + { + visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor) + { + return visitor.Accept(this); + } + + public override TR Apply(ITypeFuncVisitor visitor, T x) + { + return visitor.Accept(this, x); + } + + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y) + { + return visitor.Accept(this, x, y); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z) + { + return visitor.Accept(this, x, y, z); + } + + public override TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w) + { + return visitor.Accept(this, x, y, z, w); + } +} diff --git a/luban/src/Luban.Core/Types/TType.cs b/luban/src/Luban.Core/Types/TType.cs new file mode 100644 index 00000000..2d80f715 --- /dev/null +++ b/luban/src/Luban.Core/Types/TType.cs @@ -0,0 +1,66 @@ +using Luban.Defs; +using Luban.TypeVisitors; +using Luban.Validator; + +namespace Luban.Types; + +public abstract class TType +{ + public bool IsNullable { get; } + + public Dictionary Tags { get; } + + public List Validators { get; } = new(); + + protected TType(bool isNullable, Dictionary tags) + { + IsNullable = isNullable; + Tags = tags ?? new Dictionary(); + } + + public abstract string TypeName { get; } + + public bool HasTag(string attrName) + { + return Tags != null && Tags.ContainsKey(attrName); + } + + public string GetTag(string attrName) + { + return Tags != null && Tags.TryGetValue(attrName, out var value) ? value : null; + } + + public string GetTagOrDefault(string attrName, string defaultValue) + { + return Tags != null && Tags.TryGetValue(attrName, out var value) ? value : defaultValue; + } + + public abstract bool TryParseFrom(string s); + + public virtual void PostCompile(DefField field) + { + + } + + public virtual bool IsCollection => false; + + public virtual bool IsBean => false; + + public virtual bool IsEnum => false; + + public virtual TType ElementType => null; + + public abstract void Apply(ITypeActionVisitor visitor, T x); + + public abstract void Apply(ITypeActionVisitor visitor, T1 x, T2 y); + + public abstract TR Apply(ITypeFuncVisitor visitor); + + public abstract TR Apply(ITypeFuncVisitor visitor, T x); + + public abstract TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y); + + public abstract TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z); + + public abstract TR Apply(ITypeFuncVisitor visitor, T1 x, T2 y, T3 z, T4 w); +} \ No newline at end of file diff --git a/luban/src/Luban.Core/Utils/AtomicLong.cs b/luban/src/Luban.Core/Utils/AtomicLong.cs new file mode 100644 index 00000000..a77f3184 --- /dev/null +++ b/luban/src/Luban.Core/Utils/AtomicLong.cs @@ -0,0 +1,33 @@ +namespace Luban.Utils; + +public class AtomicLong +{ + private long _value; + public AtomicLong(long initValue = 0) + { + _value = initValue; + } + + public long IncrementAndGet() + { + return Interlocked.Add(ref _value, 1); + } + + public long AddAndGet(long step) + { + return Interlocked.Add(ref _value, step); + } + + public long GetAndAdd(long step) + { + return Interlocked.Add(ref _value, step); + } + + public long Value { get => Interlocked.Read(ref _value); set => Interlocked.Exchange(ref _value, value); } + + + public override string ToString() + { + return _value.ToString(); + } +} diff --git a/luban/src/Luban.Core/Utils/CollectionExtensions.cs b/luban/src/Luban.Core/Utils/CollectionExtensions.cs new file mode 100644 index 00000000..80dd1f51 --- /dev/null +++ b/luban/src/Luban.Core/Utils/CollectionExtensions.cs @@ -0,0 +1,12 @@ +namespace Luban.Utils; + +public static class CollectionExtensions +{ + public static void AddAll(this Dictionary resultDic, Dictionary addDic) where K : notnull + { + foreach (var e in addDic) + { + resultDic[e.Key] = e.Value; + } + } +} diff --git a/luban/src/Luban.Core/Utils/DataExtensions.cs b/luban/src/Luban.Core/Utils/DataExtensions.cs new file mode 100644 index 00000000..a63c3faa --- /dev/null +++ b/luban/src/Luban.Core/Utils/DataExtensions.cs @@ -0,0 +1,16 @@ +using Luban.Datas; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.Utils; + +public static class DataExtensions +{ + public static long UnixTimeOfCurrentContext(this DDateTime dateTime) + { + return dateTime.GetUnixTime(GenerationContext.Current.TimeZone); + } +} diff --git a/luban/src/Luban.Core/Utils/DataUtil.cs b/luban/src/Luban.Core/Utils/DataUtil.cs new file mode 100644 index 00000000..4244ed10 --- /dev/null +++ b/luban/src/Luban.Core/Utils/DataUtil.cs @@ -0,0 +1,193 @@ +using System.Text; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; + +namespace Luban.Utils; + +public static class DataUtil +{ + public static bool ParseBool(string s) + { + s = s.ToLower().Trim(); + switch (s) + { + case "true": + case "1": + return true; + case "false": + case "0": + return false; + default: + throw new Exception($"{s} 不是 bool 类型的值 (true|1 或 false|0)"); + } + } + + private static readonly string[] dateTimeFormats = new string[] { + "yyyy-M-d HH:mm:ss", "yyyy-M-d HH:mm", "yyyy-M-d HH", "yyyy-M-d", + //"yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM/dd HH", "yyyy/MM/dd", + }; + public static DDateTime CreateDateTime(string x) + { + DateTime dateTime = DateTime.ParseExact(x, dateTimeFormats, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None); + //return new DDateTime(TimeZoneInfo.ConvertTime(dateTime, TimeZoneUtil.DefaultTimeZone, TimeZoneInfo.Utc)); + return new DDateTime(dateTime); + } + + public static string FormatDateTime(DateTime datetime) + { + return datetime.ToString("yyyy-M-d HH:mm:ss"); + } + + public static byte[] StreamToBytes(Stream stream) + { + byte[] bytes = new byte[stream.Length]; + stream.Seek(0, SeekOrigin.Begin); + stream.Read(bytes, 0, bytes.Length); + return bytes; + } + + public static string UnEscapeRawString(string s) + { + switch (s) + { + case "null": + return null; + case "\"\"": + return string.Empty; + default: + return s; + } + } + + public static string EscapeString(string s) + { + return s.Replace("\\", "\\\\").Replace("\"", "\\\""); + } + public static string UnEscapeString(string s) + { + return s.Replace("\\\"", "\"").Replace("\\\"", "\""); + } + + public static string EscapeLuaStringWithQuote(string s) + { + if (!s.Contains('\"') && !s.Contains('\\') && !s.Contains('\n')) + { + return "\"" + s + "\""; + } + + var multiEqaulChars = new StringBuilder(); + var result = new StringBuilder(); + var startIndex = s.EndsWith(']') ? 1 : 0; + for (int i = startIndex; i < 100; i++) + { + if (i > 0) + { + multiEqaulChars.Append('='); + } + var multiEqualStr = multiEqaulChars.ToString(); + if (i == 0 || s.Contains(multiEqualStr)) + { + if (s.Contains("[" + multiEqualStr + "[") || s.Contains("]" + multiEqualStr + "]")) + { + continue; + } + } + result.Clear(); + result.Append('[').Append(multiEqualStr).Append('['); + result.Append(s); + result.Append(']').Append(multiEqualStr).Append(']'); + return result.ToString(); + } + throw new Exception($"too complex string:'{s}'"); + } + + //public static string EscapeStringWithQuote(string s) + //{ + // return "\"" + s.Replace("\\", "\\\\") + "\""; + //} + + public static bool IsIgnoreTag(string tagName) + { + return tagName == "##"; + } + + public static List ParseTags(string rawTagStr) + { + if (string.IsNullOrWhiteSpace(rawTagStr)) + { + return null; + } + var tags = new List(rawTagStr.Split(',').Select(t => t.Trim().ToLower()).Where(t => !string.IsNullOrEmpty(t))); + return tags.Count > 0 ? tags : null; + } + + //public const string SimpleContainerSep = ",;|"; + + public static string GetBeanSep(TBean type) + { + if (type.Tags != null && type.Tags.TryGetValue("sep", out var s) && !string.IsNullOrWhiteSpace(s)) + { + return s; + } + return ((DefBean)type.DefBean).Sep; + } + + public static bool IsCollectionEqual(List a, List b) + { + if (a.Count == b.Count) + { + for (int i = 0, n = a.Count; i < n; i++) + { + if (!object.Equals(a[i], b[i])) + { + return false; + } + } + return true; + } + return false; + } + + public static string GetImplTypeName(DBean bean) + { + return GetImplTypeName(bean.ImplType, bean.Type); + } + + public static string GetImplTypeName(DefBean implType, DefBean baseType) + { + if (implType.Namespace == baseType.Namespace) + { + return implType.Name; + } + else + { + return implType.FullName; + } + } + + public static DefBean GetImplTypeByNameOrAlias(DefBean bean, string subType) + { + if (string.IsNullOrEmpty(subType)) + { + throw new Exception($"module:'{bean.Namespace}' 多态数据type不能为空"); + } + DefBean defType = bean.GetHierarchyChildren().FirstOrDefault(c => c.Alias == subType || c.Name == subType || c.FullName == subType); + if (defType == null) + { + throw new Exception($"module:'{bean.Namespace}' type:'{subType}' 不是合法类型"); + } + if (defType.IsAbstractType) + { + throw new Exception($"module:'{bean.Namespace}' type:'{subType}' 是抽象类. 不能创建实例"); + } + return defType; + } + + private const string TAG_UNCHECKED = "unchecked"; + + public static bool IsUnchecked(Record rec) + { + return rec.Tags != null && rec.Tags.Count > 0 && rec.Tags.Contains(TAG_UNCHECKED); + } +} diff --git a/luban/src/Luban.Core/Utils/DefExtensions.cs b/luban/src/Luban.Core/Utils/DefExtensions.cs new file mode 100644 index 00000000..9f17ef96 --- /dev/null +++ b/luban/src/Luban.Core/Utils/DefExtensions.cs @@ -0,0 +1,89 @@ +using Luban.CodeTarget; +using Luban.Defs; +using Luban.RawDefs; +using NLog.Targets; +using System.Text.RegularExpressions; + +namespace Luban.Utils; + +public static class DefExtensions +{ + public static bool NeedExport(this DefField field) + { + //return field.Assembly.NeedExport(field.Groups, GenerationContext.GlobalConf.Groups); + var groupDefs = GenerationContext.GlobalConf.Groups; + if (field.Groups.Count == 0) + { + return true; + } + var exportGroups = field.Assembly.Target.Groups; + return field.Groups.Any(exportGroups.Contains); + } + + public static List GetExportFields(this DefBean bean) + { + return bean.Fields.Where(f => f.NeedExport()).ToList(); + } + + public static List GetHierarchyExportFields(this DefBean bean) + { + return bean.HierarchyFields.Where(f => f.NeedExport()).ToList(); + } + + public static bool NeedExport(this DefTable table) + { + return table.Assembly.NeedExport(table.Groups, GenerationContext.GlobalConf.Groups); + } + + + public static string TypeNameWithTypeMapper(this DefTypeBase type) + { + if (type.TypeMappers != null) + { + string targetName = GenerationContext.Current.Target.Name; + string codeTargetName = GenerationContext.CurrentCodeTarget.Name; + foreach (var typeMapper in type.TypeMappers) + { + if (typeMapper.Targets.Contains(targetName) && typeMapper.CodeTargets.Contains(codeTargetName)) + { + return typeMapper.Options.TryGetValue(BuiltinOptionNames.TypeMapperType, out var typeName) ? typeName : throw new Exception($"option 'type' not found in type mapper of type {type.FullName} target:{targetName} codeTarget:{codeTargetName}"); + } + } + } + return null; + } + + public static string TypeConstructorWithTypeMapper(this DefTypeBase type) + { + if (type.TypeMappers != null) + { + string targetName = GenerationContext.Current.Target.Name; + string codeTargetName = GenerationContext.CurrentCodeTarget.Name; + foreach (var typeMapper in type.TypeMappers) + { + if (typeMapper.Targets.Contains(targetName) && typeMapper.CodeTargets.Contains(codeTargetName)) + { + return typeMapper.Options.TryGetValue(BuiltinOptionNames.TypeMapperConstructor, out var typeName) ? typeName : throw new Exception($"option 'constructor' not found in type mapper of type {type.FullName} target:{targetName} codeTarget:{codeTargetName}"); + } + } + } + return null; + } + + public static string GetTypeMapperOption(this DefTypeBase type, string option) + { + if (type.TypeMappers != null) + { + string targetName = GenerationContext.Current.Target.Name; + string codeTargetName = GenerationContext.CurrentCodeTarget.Name; + foreach (var typeMapper in type.TypeMappers) + { + if (typeMapper.Targets.Contains(targetName) && typeMapper.CodeTargets.Contains(codeTargetName)) + { + return typeMapper.Options.TryGetValue(option, out var typeName) ? typeName : throw new Exception($"option '{option}' not found in type mapper of type {type.FullName} target:{targetName} codeTarget:{codeTargetName}"); + } + } + } + return null; + } +} diff --git a/luban/src/Luban.Core/Utils/DefUtil.cs b/luban/src/Luban.Core/Utils/DefUtil.cs new file mode 100644 index 00000000..4028e99e --- /dev/null +++ b/luban/src/Luban.Core/Utils/DefUtil.cs @@ -0,0 +1,346 @@ +namespace Luban.Utils; + +public static class DefUtil +{ + private static readonly char[] s_attrSep = new char[] { '#' }; + + private static readonly char[] s_attrKeyValueSep = new char[] { '=', ':' }; + + private static void AddAttr(Dictionary attrs, string rawPair) + { + var pair = TrimBracePairs(rawPair); + int sepIndex = pair.IndexOfAny(s_attrKeyValueSep); + string key; + string value; + if (sepIndex >= 0) + { + key = pair.Substring(0, sepIndex).Trim(); + value = pair.Substring(sepIndex + 1).Trim(); + } + else + { + key = value = pair.Trim(); + } + attrs.Add(key, value); + } + + public static Dictionary ParseAttrs(string tags) + { + var am = new Dictionary(); + if (string.IsNullOrWhiteSpace(tags)) + { + return am; + } + + int braceDepth = 0; + int pairStart = 0; + for (int i = 0; i < tags.Length; i++) + { + var c = tags[i]; + if (c == '(' || c == '[' || c == '{') + { + ++braceDepth; + } + else if (c == ')' || c == ']' || c == '}') + { + --braceDepth; + } + + if (braceDepth == 0 && c == '#') + { + string rawPair = tags.Substring(pairStart, i - pairStart); + pairStart = i + 1; + AddAttr(am, rawPair); + } + } + if (braceDepth != 0) + { + throw new Exception($"非法tags:{tags}"); + } + if (pairStart < tags.Length) + { + AddAttr(am, tags.Substring(pairStart)); + } + return am; + } + + public static int IndexOfBaseTypeEnd(string s) + { + int braceDepth = 0; + int firstSharpIndex = -1;// '#' + for (int i = 0; i < s.Length; i++) + { + var c = s[i]; + if (c == '(' || c == '[' || c == '{') + { + ++braceDepth; + } + else if (c == ')' || c == ']' || c == '}') + { + --braceDepth; + } + if (c == '#' && firstSharpIndex == -1) + { + firstSharpIndex = i; + } + + if (braceDepth == 0 && (c == ',' || c == ';')) + { + var strContainBaseType = firstSharpIndex > 0 ? s.Substring(0, firstSharpIndex) : s.Substring(0, i); + strContainBaseType = strContainBaseType.Replace("(", "").Replace(")", "").Replace("[", "").Replace("]", ""); + + if (strContainBaseType == "array" || strContainBaseType == "list" || strContainBaseType == "set" || strContainBaseType == "map") + { + return i; + } + else + { + return -1; + } + } + } + return -1; + } + + public static int IndexOfElementTypeSep(string s) + { + int braceDepth = 0; + int firstSharpIndex = -1;// '#' + for (int i = 0; i < s.Length; i++) + { + var c = s[i]; + if (c == '(' || c == '[' || c == '{') + { + ++braceDepth; + } + else if (c == ')' || c == ']' || c == '}') + { + --braceDepth; + } + if (c == '#' && firstSharpIndex == -1) + { + firstSharpIndex = i; + } + + if (braceDepth == 0 && (c == ',' || c == ';')) + { + return i; + } + } + return -1; + } + + public static string TrimBracePairs(string rawType) + { + while (rawType.Length > 0 && rawType[0] == '(') + { + int braceDepth = 0; + int level1Left = -1; + int level1Right = -1; + for (int i = 0; i < rawType.Length; i++) + { + char c = rawType[i]; + if (c == '(' || c == '[' || c == '{') + { + braceDepth++; + if (level1Left < 0) + { + level1Left = i; + } + } + if (c == ')' || c == ']' || c == '}') + { + braceDepth--; + if (level1Right < 0 && braceDepth == 0 && c == ')') + { + level1Right = i; + break; + } + } + } + if (level1Left >= 0 && level1Right == rawType.Length - 1) + { + rawType = rawType.Substring(1, rawType.Length - 2); + } + else + { + break; + } + } + return rawType; + } + public static string TrimBracePairs2(string rawType, bool soft = false) + { + while (rawType.Length > 0 && rawType[0] == '(') + { + if (rawType[rawType.Length - 1] == ')') + { + rawType = rawType.Substring(1, rawType.Length - 2); + } + else + { + if (soft) + { + return rawType; + } + else + { + throw new Exception($"type:{rawType} brace not match"); + } + } + } + return rawType; + } + + public static (string, Dictionary) ParseType(string s) + { + int sepIndex = s.IndexOfAny(s_attrSep); + if (sepIndex < 0) + { + return (s, new Dictionary()); + } + else + { + int braceDepth = 0; + for (int i = 0; i < s.Length; i++) + { + var c = s[i]; + if (c == '(' || c == '[' || c == '{') + { + ++braceDepth; + } + else if (c == ')' || c == ']' || c == '}') + { + --braceDepth; + } + + if (braceDepth == 0 && (c == '#')) + { + return (s.Substring(0, i), ParseAttrs(s.Substring(i + 1))); + } + } + return (s, new Dictionary()); + } + } + + public static (string, Dictionary) ParseTypeAndVaildAttrs(string s) + { + var (typeStr, attrs) = ParseType(s); + + if (attrs.ContainsKey("group")) + { + throw new Exception("group为保留属性,只能用于table或var定义,是否用错? 如在excel中请使用&group=xxx"); + } + + if (attrs.ContainsKey("seq")) + { + throw new Exception("字段切割应该用'sep',而不是'seq',请检查是否拼写错误"); + } + + return (typeStr, attrs); + } + + public static bool ParseOrientation(string value) + { + switch (value.Trim()) + { + case "": + case "r": + case "row": + return true; + case "c": + case "column": + return false; + default: + { + throw new Exception($"orientation 属性值只能为row|r|column|c"); + } + } + } + + public static bool IsNormalFieldName(string name) + { + return !name.StartsWith("__") && !name.StartsWith("#") && !name.StartsWith("$"); + } + + public static Dictionary MergeTags(Dictionary tags1, Dictionary tags2) + { + if (tags2 != null && tags2.Count > 0) + { + if (tags1 != null) + { + if (tags1.Count == 0) + { + return tags2; + } + else + { + var result = new Dictionary(tags1); + result.AddAll(tags2); + return result; + } + } + else + { + return tags2; + } + } + else + { + return tags1; + } + } + + public static List ParseVariant(string s) + { + return s.Split(',', ';').Select(x => x.Trim()).Where(x => !string.IsNullOrWhiteSpace(x)).ToList(); + } + + // public static string EscapeCommentByCurrentLanguage(string comment) + // { + // var curLan = DefAssembly.LocalAssebmly.CurrentLanguage; + // switch (curLan) + // { + // case ELanguage.INVALID: throw new Exception($"not set current language. can't get recommend naming convention name"); + // case ELanguage.CS: + // case ELanguage.JAVA: + // case ELanguage.GO: + // case ELanguage.CPP: + // case ELanguage.LUA: + // case ELanguage.JAVASCRIPT: + // case ELanguage.TYPESCRIPT: + // case ELanguage.PYTHON: + // case ELanguage.RUST: + // case ELanguage.PROTOBUF: + // case ELanguage.GDSCRIPT: + // return System.Web.HttpUtility.HtmlEncode(comment).Replace("\n", "
"); + // default: throw new Exception($"unknown language:{curLan}"); + // } + // } + // + // public static ELanguage ParseLanguage(string lan) + // { + // switch (lan.ToLower()) + // { + // case "cs": + // case "c#": + // case "csharp": return ELanguage.CS; + // case "java": return ELanguage.JAVA; + // case "go": + // case "golang": return ELanguage.GO; + // case "cpp": + // case "c++": return ELanguage.CPP; + // case "lua": return ELanguage.LUA; + // case "js": + // case "javascript": return ELanguage.JAVASCRIPT; + // case "ts": + // case "typescript": return ELanguage.TYPESCRIPT; + // case "python": return ELanguage.PYTHON; + // case "rust": return ELanguage.RUST; + // case "pb": + // case "protobuf": return ELanguage.PROTOBUF; + // case "gdscript": return ELanguage.GDSCRIPT; + // default: throw new ArgumentException($"parse lan:'{lan}' fail"); + // } + // } +} diff --git a/luban/src/Luban.Core/Utils/ExceptionUtil.cs b/luban/src/Luban.Core/Utils/ExceptionUtil.cs new file mode 100644 index 00000000..a6b838b1 --- /dev/null +++ b/luban/src/Luban.Core/Utils/ExceptionUtil.cs @@ -0,0 +1,16 @@ +namespace Luban.Utils; + +public static class ExceptionUtil +{ + public static string ExtractMessage(Exception e) + { + var lines = new List(); + do + { + lines.Add("===> " + e.Message); + e = e.InnerException; + } while (e != null); + + return string.Join('\n', lines); + } +} diff --git a/luban/src/Luban.Core/Utils/ExternalTypeUtil.cs b/luban/src/Luban.Core/Utils/ExternalTypeUtil.cs new file mode 100644 index 00000000..b9a2a101 --- /dev/null +++ b/luban/src/Luban.Core/Utils/ExternalTypeUtil.cs @@ -0,0 +1,45 @@ +namespace Luban.Utils; + +public static class ExternalTypeUtil +{ + + //protected void ResolveExternalType() + //{ + // if (!string.IsNullOrEmpty(_externalTypeName)) + // { + // if (Assembly.TryGetExternalType(_externalTypeName, out var type)) + // { + // this.ExternalType = type; + // } + // else + // { + // throw new Exception($"enum:'{FullName}' 对应的 externaltype:{_externalTypeName} 不存在"); + // } + // } + //} + + // public static ExternalTypeMapper GetExternalTypeMappfer(string typeName) + // { + // return GenerationContext.Ins.GetExternalTypeMapper(typeName); + // } + + // public static string CsMapperToExternalType(DefTypeBase type) + // { + // var mapper = DefAssembly.LocalAssebmly.GetExternalTypeMapper(type.FullName); + // return mapper != null ? mapper.TargetTypeName : type.CsFullName; + // } + // + // public static string CsCloneToExternal(string typeName, string src) + // { + // var mapper = DefAssembly.LocalAssebmly.GetExternalTypeMapper(typeName); + // if (mapper == null) + // { + // return src; + // } + // if (string.IsNullOrWhiteSpace(mapper.CreateExternalObjectFunction)) + // { + // throw new Exception($"type:{typeName} externaltype:{DefAssembly.LocalAssebmly.GetExternalType(typeName)} lan:{mapper.Lan} selector:{mapper.Selector} 未定义 create_external_object_function 属性"); + // } + // return $"{mapper.CreateExternalObjectFunction}({src})"; + // } +} diff --git a/luban/src/Luban.Core/Utils/FileCleaner.cs b/luban/src/Luban.Core/Utils/FileCleaner.cs new file mode 100644 index 00000000..d259afbe --- /dev/null +++ b/luban/src/Luban.Core/Utils/FileCleaner.cs @@ -0,0 +1,106 @@ +namespace Luban.Utils; + +public class FileCleaner +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private readonly HashSet _outputDirs = new(); + private readonly HashSet _savedFileOrDirs = new(); + private readonly HashSet _ignoreFileExtensions = new(); + + + public void AddIgnoreExtension(string ext) + { + _ignoreFileExtensions.Add(ext); + } + + public void AddOutputDir(string dir) + { + dir = Path.TrimEndingDirectorySeparator(dir); + _outputDirs.Add(dir); + } + + public void AddSavedFile(string file) + { + file = file.Replace('\\', '/'); + while (true) + { + _savedFileOrDirs.Add(file); + s_logger.Trace("add save file:{file}", file); + int sepIndex = file.LastIndexOf('/'); + if (sepIndex < 0) + { + break; + } + + file = file[..sepIndex]; + } + } + + + public void RemoveUnusedFiles() + { + foreach (var dir in _outputDirs) + { + RemoveUnusedFileInDir(dir); + } + } + + private void RemoveUnusedFileInDir(string dir) + { + if (!Directory.Exists(dir)) + { + return; + } + + var fullRootPath = Path.GetFullPath(dir); + s_logger.Trace("full path:{path}", fullRootPath); + + foreach (var file in Directory.GetFiles(dir, "*", SearchOption.AllDirectories)) + { + s_logger.Trace("file:{file}", file); + string fullSubFilePath = Path.GetFullPath(file); + var relateFile = fullSubFilePath[(fullRootPath.Length + 1)..].Replace('\\', '/'); + if (_savedFileOrDirs.Contains(relateFile)) + { + s_logger.Trace("remain file:{file}", file); + } + else if (!_ignoreFileExtensions.Contains(FileUtil.GetFileExtension(file))) + { + s_logger.Info("[remove] {0}", file); + File.Delete(file); + } + } + + // 清除空目录 + var subDirs = new List(Directory.GetDirectories(dir, "*", SearchOption.AllDirectories)); + subDirs.Sort((a, b) => -string.Compare(a, b, StringComparison.Ordinal)); + foreach (var subDir in subDirs) + { + string fullSubDirPath = Path.GetFullPath(subDir); + var relateDir = fullSubDirPath[(fullRootPath.Length + 1)..].Replace('\\', '/'); + if (_savedFileOrDirs.Contains(relateDir)) + { + s_logger.Trace("remain directory:{dir}", relateDir); + } + else + { + s_logger.Info("[remove] dir: {dir}", subDir); + FileUtil.DeleteDirectoryRecursive(subDir); + } + } + } + + public static void Clean(string outputDir, List savedFiles) + { + var cleaner = new FileCleaner(); + cleaner.AddOutputDir(outputDir); + cleaner.AddIgnoreExtension("meta"); // for unity + foreach (var file in savedFiles) + { + cleaner.AddSavedFile(file); + } + + cleaner.RemoveUnusedFiles(); + } +} diff --git a/luban/src/Luban.Core/Utils/FileUtil.cs b/luban/src/Luban.Core/Utils/FileUtil.cs new file mode 100644 index 00000000..39ffa42c --- /dev/null +++ b/luban/src/Luban.Core/Utils/FileUtil.cs @@ -0,0 +1,266 @@ +using System.Collections; +using System.Security.Cryptography; +using System.Text; + +namespace Luban.Utils; + +public static class FileUtil +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public static string GetApplicationDirectory() + { + return AppContext.BaseDirectory; + } + + public static string GetPathRelateApplicationDirectory(string relatePath) + { + return Path.Combine(GetApplicationDirectory(), relatePath); + } + + public static string GetFileName(string path) + { + int index = path.Replace('\\', '/').LastIndexOf('/'); + return index >= 0 ? path[(index + 1)..] : path; + } + + public static string GetParent(string path) + { + int index = path.Replace('\\', '/').LastIndexOf('/'); + return index >= 0 ? path[..index] : "."; + } + + public static string GetFileNameWithoutExt(string file) + { + int index = file.LastIndexOf('.'); + return index >= 0 ? file.Substring(0, index) : file; + } + + public static string GetFileExtension(string file) + { + int index = file.LastIndexOf('.'); + return index >= 0 ? file.Substring(index + 1) : ""; + } + + public static string GetPathRelateRootFile(string rootFile, string file) + { + return Combine(GetParent(rootFile), file); + } + + public static bool IsFileExistsSenseCase(string path) + { + if (!File.Exists(path)) + { + return false; + } + if (OperatingSystem.IsWindows()) + { + var fileName = Path.GetFileName(path); + var files = Directory.GetFiles(Path.GetDirectoryName(path), fileName, new EnumerationOptions() { MatchCasing = MatchCasing.CaseSensitive }); + return files.Length > 0; + } + else + { + return true; + } + } + + /// + /// 忽略以 文件名以 '.' '_' '~' 开头的文件 + /// + /// + /// + public static bool IsValidInputFile(string file) + { + if (!File.Exists(file)) + { + return false; + } + var f = new FileInfo(file); + string fname = f.Name; + return !fname.StartsWith('.') && !fname.StartsWith('_') && !fname.StartsWith('~'); + } + + public static string CalcMD5(byte[] srcBytes) + { + using MD5 md5 = MD5.Create(); + var md5Bytes = md5.ComputeHash(srcBytes); + var s = new StringBuilder(md5Bytes.Length * 2); + foreach (var b in md5Bytes) + { + s.Append(b.ToString("X")); + } + return s.ToString(); + } + + public static string Standardize(string path) + { + return path.Replace('\\', '/'); + } + + public static string Combine(string parent, string sub) + { + return Standardize(Path.Combine(parent, sub)); + } + + public static bool IsExcelFile(string fullName) + { + return fullName.EndsWith(".csv", StringComparison.Ordinal) + || fullName.EndsWith(".xls", StringComparison.Ordinal) + || fullName.EndsWith(".xlsx", StringComparison.Ordinal) + || fullName.EndsWith(".xlsm", StringComparison.Ordinal); + } + + public static (string, string) SplitFileAndSheetName(string url) + { + int sheetSepIndex = url.IndexOf('@'); + if (sheetSepIndex < 0) + { + return (url, null); + } + else + { + int lastPathSep = url.LastIndexOf('/', sheetSepIndex); + if (lastPathSep >= 0) + { + return (url[0..(lastPathSep + 1)] + url[(sheetSepIndex + 1)..], url[(lastPathSep + 1)..sheetSepIndex]); + } + else + { + return (url[(sheetSepIndex + 1)..], url[(lastPathSep + 1)..sheetSepIndex]); + } + } + } + + public static async Task SaveFileAsync(string relateDir, string filePath, byte[] content) + { + // 调用此接口时,已保证 文件必然是改变的,不用再检查对比文件 + var outputPath = Standardize(relateDir != null ? System.IO.Path.Combine(relateDir, filePath) : filePath); + Directory.GetParent(outputPath).Create(); + if (File.Exists(outputPath)) + { + s_logger.Info("[override] {file}", outputPath); + if (File.GetAttributes(outputPath).HasFlag(FileAttributes.ReadOnly)) + { + File.SetAttributes(outputPath, FileAttributes.Normal); + } + } + else + { + s_logger.Info("[new] {file}", outputPath); + } + + await WriteAllBytesAsync(outputPath, content); + } + + public static async Task ReadAllBytesAsync(string file) + { + // File.ReadAllBytesAsync 无法读取被打开的excel文件,只好重新实现了一个 + using var fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + long count = fs.Length; + var bytes = new byte[count]; + int writeIndex = 0; + while (writeIndex < count) + { + int n = await fs.ReadAsync(bytes, writeIndex, (int)count - writeIndex, default); + writeIndex += n; + } + return bytes; + } + + public static byte[] ReadAllBytes(string file) + { + // File.ReadAllBytesAsync 无法读取被打开的excel文件,只好重新实现了一个 + using var fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + long count = fs.Length; + var bytes = new byte[count]; + int writeIndex = 0; + while (writeIndex < count) + { + int n = fs.Read(bytes, writeIndex, (int)count - writeIndex); + writeIndex += n; + } + return bytes; + } + + public static bool WriteAllBytes(string file, byte[] bytes) + { + if (File.Exists(file)) + { + var oldBytes = ReadAllBytes(file); + if (oldBytes.Length == bytes.Length && + StructuralComparisons.StructuralEqualityComparer.Equals(bytes, oldBytes)) + { + return false; + } + } + File.WriteAllBytes(file, bytes); + return true; + } + + public static async Task WriteAllBytesAsync(string file, byte[] bytes) + { + using var fs = new FileStream(file, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite); + long count = bytes.LongLength; + fs.SetLength(count); + fs.Seek(0, SeekOrigin.Begin); + await fs.WriteAsync(bytes); + } + + public static void DeleteDirectoryRecursive(string rootDir) + { + string[] files = Directory.GetFiles(rootDir); + string[] dirs = Directory.GetDirectories(rootDir); + + foreach (string file in files) + { + File.SetAttributes(file, FileAttributes.Normal); + File.Delete(file); + } + + foreach (string dir in dirs) + { + DeleteDirectoryRecursive(dir); + } + + Directory.Delete(rootDir, false); + } + + public static bool IsIgnoreFile(string file) + { + file = Path.GetFullPath(file); + return file.Split('\\', '/').Any(fileName => fileName.StartsWith(".") || fileName.StartsWith("_") || fileName.StartsWith("~")); + } + + public static List GetFileOrDirectory(string fileOrDirectory) + { + var files = new List(); + if (Directory.Exists(fileOrDirectory)) + { + foreach (var file in Directory.GetFiles(fileOrDirectory, "*", SearchOption.AllDirectories)) + { + if (IsIgnoreFile(file)) + { + continue; + } + if (file.EndsWith(".meta", StringComparison.Ordinal)) + { + continue; + } + files.Add(file.Replace('\\', '/')); + } + // must sort files for making generation stable. + files.Sort(string.CompareOrdinal); + } + else + { + files.Add(fileOrDirectory); + } + return files; + } + + public static string GetExtensionWithDot(string file) + { + return Path.GetExtension(file).Substring(1); + } +} diff --git a/luban/src/Luban.Core/Utils/ListEqualityComparer.cs b/luban/src/Luban.Core/Utils/ListEqualityComparer.cs new file mode 100644 index 00000000..62e15aca --- /dev/null +++ b/luban/src/Luban.Core/Utils/ListEqualityComparer.cs @@ -0,0 +1,23 @@ +using System.Diagnostics.CodeAnalysis; + +namespace Luban.Utils; + +public class ListEqualityComparer : IEqualityComparer> +{ + public static ListEqualityComparer Default { get; } = new(); + + public bool Equals(List x, List y) + { + return x.Count == y.Count && System.Linq.Enumerable.SequenceEqual(x, y); + } + + public int GetHashCode([DisallowNull] List obj) + { + int hash = 17; + foreach (T x in obj) + { + hash = hash * 23 + x.GetHashCode(); + } + return hash; + } +} diff --git a/luban/src/Luban.Core/Utils/LoadXmlException.cs b/luban/src/Luban.Core/Utils/LoadXmlException.cs new file mode 100644 index 00000000..dcbea4e0 --- /dev/null +++ b/luban/src/Luban.Core/Utils/LoadXmlException.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; + +namespace Luban.Utils; + +public class LoadXmlException : Exception +{ + public LoadXmlException() + { + } + + public LoadXmlException(string message) : base(message) + { + } + + public LoadXmlException(string message, Exception innerException) : base(message, innerException) + { + } +} diff --git a/luban/src/Luban.Core/Utils/StringUtil.cs b/luban/src/Luban.Core/Utils/StringUtil.cs new file mode 100644 index 00000000..3c18503d --- /dev/null +++ b/luban/src/Luban.Core/Utils/StringUtil.cs @@ -0,0 +1,38 @@ +using System.Collections.Specialized; + +namespace Luban.Utils; + +public static class StringUtil +{ + public static string CollectionToString(IEnumerable collection) + { + return string.Join(",", collection); + } + + public static string RepeatString(string str, int count) + { + return count == 0 ? "" : string.Concat(Enumerable.Repeat(str, count)); + } + + public static string RepeatSpaceAsTab(int count) + { + return count == 0 ? "" : string.Concat(Enumerable.Repeat(" ", count)); + } + + public static string GetLineEnding(string endings) + { + switch (endings) + { + case "": + return Environment.NewLine; + case "crlf": + return "\r\n"; + case "lf": + return "\n"; + case "cr": + return "\r"; + default: + throw new Exception($"unknown line ending: {endings}"); + } + } +} diff --git a/luban/src/Luban.Core/Utils/TemplateUtil.cs b/luban/src/Luban.Core/Utils/TemplateUtil.cs new file mode 100644 index 00000000..db997a78 --- /dev/null +++ b/luban/src/Luban.Core/Utils/TemplateUtil.cs @@ -0,0 +1,15 @@ +using Scriban; + +namespace Luban.Utils; + +public static class TemplateUtil +{ + public static TemplateContext CreateDefaultTemplateContext() + { + return new TemplateContext() + { + LoopLimit = 0, + NewLine = "\n", + }; + } +} diff --git a/luban/src/Luban.Core/Utils/TimeUtil.cs b/luban/src/Luban.Core/Utils/TimeUtil.cs new file mode 100644 index 00000000..13b3bfef --- /dev/null +++ b/luban/src/Luban.Core/Utils/TimeUtil.cs @@ -0,0 +1,8 @@ +namespace Luban.Utils; + +public static class TimeUtil +{ + public static int Now => (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; + + public static long NowMillis => (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalMilliseconds; +} diff --git a/luban/src/Luban.Core/Utils/TimeZoneUtil.cs b/luban/src/Luban.Core/Utils/TimeZoneUtil.cs new file mode 100644 index 00000000..5cadb4d7 --- /dev/null +++ b/luban/src/Luban.Core/Utils/TimeZoneUtil.cs @@ -0,0 +1,38 @@ +namespace Luban.Utils; + +public static class TimeZoneUtil +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public static TimeZoneInfo GetTimeZone(string timeZoneName) + { + + if (string.IsNullOrEmpty(timeZoneName)) + { + try + { + return TimeZoneInfo.FindSystemTimeZoneById("Asia/Shanghai"); + } + catch (Exception) + { + try + { + return TimeZoneInfo.FindSystemTimeZoneById("China Standard Time"); + } + catch (Exception) + { + throw new ArgumentException("The default timezone ID 'Asia/Shanghai' and 'China Standard Time' was not found on local computer. please set valid timezone manually."); + } + } + } + if (timeZoneName.ToLower() == "local") + { + return TimeZoneInfo.Local; + } + if (timeZoneName.ToLower() == "utc") + { + return TimeZoneInfo.Utc; + } + return TimeZoneInfo.FindSystemTimeZoneById(timeZoneName); + } +} diff --git a/luban/src/Luban.Core/Utils/TypeUtil.cs b/luban/src/Luban.Core/Utils/TypeUtil.cs new file mode 100644 index 00000000..3b3ac410 --- /dev/null +++ b/luban/src/Luban.Core/Utils/TypeUtil.cs @@ -0,0 +1,297 @@ +using System.Text; + +namespace Luban.Utils; + +public static class TypeUtil +{ + + public static (string, string) SplitFullName(string fullName) + { + int index = fullName.LastIndexOf('.'); + return (fullName.Substring(0, index), fullName.Substring(index + 1)); + } + + public static string MakeFullName(Stack path) + { + var reverse = new List(); + int index = 0; + foreach (var e in path.Reverse()) + { + if (!(e is string)) + { + reverse.Add("[" + e + "]"); + } + else + { + // 索引 0 是 table名, 不应该加 . + if (index >= 1) + { + reverse.Add("."); + } + reverse.Add(e.ToString()); + } + ++index; + } + return string.Join("", reverse); + } + + public static string MakeCppNamespaceBegin(string module) + { + if (string.IsNullOrEmpty(module)) + { + return ""; + } + return string.Join("", module.Split('.').Select(n => $"namespace {n} {{")); + } + + public static string MakeCppNamespaceEnd(string module) + { + if (string.IsNullOrEmpty(module)) + { + return ""; + } + return string.Join("", module.Split('.').Select(n => $"}}")); + } + + public static string MakeCppFullName(string module, string name) + { + return string.Join("::", MakeFullName(module, name).Split('.')); + } + + public static string MakeCppJoinedFullName(string module, string ueName) + { + return string.Join("", module.Split('.').Select(n => $"{n}_")) + ueName; + } + + public static string MakeTypescriptNamespaceBegin(string module) + { + if (string.IsNullOrEmpty(module)) + { + return ""; + } + return string.Join("", module.Split('.').Select(n => $"export namespace {n} {{")); + } + + public static string MakeTypescriptNamespaceEnd(string module) + { + if (string.IsNullOrEmpty(module)) + { + return ""; + } + return MakeCppNamespaceEnd(module); + } + + public static string MakeFullName(string module, string name) + { + if (string.IsNullOrEmpty(module)) + { + return name; + } + if (string.IsNullOrEmpty(name)) + { + return module; + } + return module + "." + name; + } + + public static string MakeGoPkgName(string module) + { + int index = module.LastIndexOf('.'); + return index >= 0 ? module.Substring(index + 1) : module; + } + + public static string MakeGoNamespace(string module) + { + if (string.IsNullOrEmpty(module)) + { + return ""; + } + return string.Join("", module.Split('.').Where(s => !string.IsNullOrWhiteSpace(s)).Select(s => UpperCaseFirstChar(s))); + } + + public static string MakeGoFullName(string module, string name) + { + return MakeGoNamespace(module) + name; + } + + public static string MakePyFullName(string module, string name) + { + return MakeFullName(module, name).Replace('.', '_'); + } + + public static string MakeGDScriptFullName(string module, string name) + { + return ToPascalCase(module.Replace('.', '_') + "_" + name); + } + + public static string MakeRustFullName(string module, string name) + { + return MakeGoNamespace(module) + name; + } + + public static string MakePbFullName(string module, string name) + { + return MakeGoNamespace(module) + name; + } + + public static string MakeFlatBuffersFullName(string module, string name) + { + return MakeGoNamespace(module) + name; + } + + public static string MakeNamespace(string module, string subModule) + { + if (string.IsNullOrWhiteSpace(module)) + { + return subModule; + } + if (string.IsNullOrWhiteSpace(subModule)) + { + return module; + } + return module + "." + subModule; + } + + /// + /// the return value in range [offset, 2^14) + /// + /// + /// + public static uint ComputeProtoHashIdByName(string name) + { + uint id = 0; + foreach (char c in name) + { + id = 31 * id + c; + } + + uint maxId = 2 << 14; + uint offset = 1000; + return id % (maxId - offset) + offset; + } + + public static int ComputeCfgHashIdByName(string name) + { + int id = 0; + foreach (char c in name) + { + id = 31 * id + c; + } + + return id; + } + + private static readonly HashSet s_reserveNames = new() + { + "end", + "base", + "super", + "const", + "is", + "as", + "of", + "typeid", + "typeof", + "object", + "ref", + "out", + "in", + "os", + "sb", + "if", + "ele", + "new", + "friend", + "public", + "protected", + "private", + "internal", + "return", + "static", + }; + + public static bool IsValidName(string name) + { + name = name.Trim(); + return name.Length > 0 && !s_reserveNames.Contains(name); + } + + public static string UpperCaseFirstChar(string s) + { + return char.ToUpper(s[0]) + s.Substring(1); + } + + public static string ToCamelCase(string name) + { + var words = name.Split('_').Where(s => !string.IsNullOrWhiteSpace(s)).ToArray(); + var s = new StringBuilder(); + s.Append(words[0]); + for (int i = 1; i < words.Length; i++) + { + s.Append(UpperCaseFirstChar(words[i])); + } + return s.ToString(); + } + + public static string ToPascalCase(string name) + { + return string.Join("", name.Split('_').Where(s => !string.IsNullOrWhiteSpace(s)).Select(c => UpperCaseFirstChar(c))); + } + + public static string ToUnderScores(string name) + { + return name; + } + + public static string ToCsStyleName(string orginName) + { + return string.Join("", orginName.Split('_').Where(s => !string.IsNullOrWhiteSpace(s)).Select(c => UpperCaseFirstChar(c))); + } + + public static string ToJavaStyleName(string orginName) + { + var words = orginName.Split('_').Where(s => !string.IsNullOrWhiteSpace(s)).ToArray(); + var s = new StringBuilder(); + s.Append(words[0]); + for (int i = 1; i < words.Length; i++) + { + s.Append(UpperCaseFirstChar(words[i])); + } + return s.ToString(); + } + + public static string ToJavaGetterName(string orginName) + { + var words = orginName.Split('_').Where(s => !string.IsNullOrWhiteSpace(s)).ToArray(); + var s = new StringBuilder("get"); + foreach (var word in words) + { + s.Append(UpperCaseFirstChar(word)); + } + return s.ToString(); + } + + public static string ToConventionGetterName(string orginName) + { + var words = orginName.Split('_').Where(s => !string.IsNullOrWhiteSpace(s)).ToArray(); + var s = new StringBuilder("get"); + foreach (var word in words) + { + s.Append(UpperCaseFirstChar(word)); + } + return s.ToString(); + } + + public static string GetNamespace(string fullName) + { + var index = fullName.LastIndexOf('.'); + return index >= 0 ? fullName.Substring(0, index) : ""; + } + + + public static string GetName(string fullName) + { + var index = fullName.LastIndexOf('.'); + return index >= 0 ? fullName.Substring(index + 1, fullName.Length - index - 1) : fullName; + } +} diff --git a/luban/src/Luban.Core/Utils/XmlUtil.cs b/luban/src/Luban.Core/Utils/XmlUtil.cs new file mode 100644 index 00000000..8e8f6682 --- /dev/null +++ b/luban/src/Luban.Core/Utils/XmlUtil.cs @@ -0,0 +1,89 @@ +using System.Xml.Linq; + +namespace Luban.Utils; + +public static class XmlUtil +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public static XElement Open(string xmlFile) + { + try + { + s_logger.Trace("open {xml}", xmlFile); + return XElement.Load(xmlFile); + } + catch (Exception e) + { + throw new LoadXmlException($"打开定义文件:{xmlFile} 失败 --> {e.Message}"); + } + } + + public static XElement Open(string xmlFile, byte[] content) + { + try + { + s_logger.Trace("open {xml}", xmlFile); + return XElement.Load(new MemoryStream(content)); + } + catch (Exception e) + { + throw new LoadXmlException($"打开定义文件:{xmlFile} 失败 --> {e.Message}"); + } + } + + public static string GetRequiredAttribute(XElement ele, string key) + { + if (ele.Attribute(key) != null) + { + var value = ele.Attribute(key).Value.Trim(); + if (value.Length != 0) + { + return value; + } + } + throw new ArgumentException($"ele:{ele} key {key} 为空或未定义"); + } + + public static string GetOptionalAttribute(XElement ele, string key) + { + return ele.Attribute(key)?.Value ?? ""; + } + + public static bool GetOptionBoolAttribute(XElement ele, string key, bool defaultValue = false) + { + var attr = ele.Attribute(key)?.Value?.ToLower(); + if (attr == null) + { + return defaultValue; + } + return attr == "1" || attr == "true"; + } + + public static int GetOptionIntAttribute(XElement ele, string key, int defaultValue = 0) + { + if (ele.Attribute(key) == null) + { + return defaultValue; + } + return int.Parse(ele.Attribute(key).Value); + } + + public static int GetRequiredIntAttribute(XElement ele, string key) + { + var attr = ele.Attribute(key); + try + { + return int.Parse(attr.Value); + } + catch (Exception) + { + throw new FormatException($"{ele} 属性:{key}=>{attr?.Value} 不是整数"); + } + } + + public static XElement OpenRelate(string relatePath, string toOpenXmlFile) + { + return Open(FileUtil.Combine(relatePath, toOpenXmlFile)); + } +} diff --git a/luban/src/Luban.Core/Validator/DataValidatorBase.cs b/luban/src/Luban.Core/Validator/DataValidatorBase.cs new file mode 100644 index 00000000..1c135404 --- /dev/null +++ b/luban/src/Luban.Core/Validator/DataValidatorBase.cs @@ -0,0 +1,18 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Types; + +namespace Luban.Validator; + +public abstract class DataValidatorBase : IDataValidator +{ + public string Args { get; set; } + + public abstract void Compile(DefField field, TType type); + + public abstract void Validate(DataValidatorContext ctx, TType type, DType data); + + protected static string Source => DataValidatorContext.CurrentVisitor.CurrentValidateRecord.Source; + + protected static string RecordPath => DataValidatorContext.CurrentRecordPath; +} diff --git a/luban/src/Luban.Core/Validator/DataValidatorContext.cs b/luban/src/Luban.Core/Validator/DataValidatorContext.cs new file mode 100644 index 00000000..7d501196 --- /dev/null +++ b/luban/src/Luban.Core/Validator/DataValidatorContext.cs @@ -0,0 +1,45 @@ +using Luban.Defs; +using Luban.Utils; + +namespace Luban.Validator; + +public class DataValidatorContext +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + [field: ThreadStatic] + public static DataValidatorVisitor CurrentVisitor { get; set; } + + public static string CurrentRecordPath => TypeUtil.MakeFullName(CurrentVisitor.Path); + + public DefAssembly Assembly { get; } + + public DataValidatorContext(DefAssembly ass) + { + this.Assembly = ass; + } + + public void ValidateTables(IEnumerable tables) + { + var tasks = new List(); + foreach (var t in tables) + { + tasks.Add(Task.Run(() => + { + var records = GenerationContext.Current.GetTableAllDataList(t); + var visitor = new DataValidatorVisitor(this); + try + { + CurrentVisitor = visitor; + visitor.ValidateTable(t, records); + } + finally + { + CurrentVisitor = null; + } + })); + } + + Task.WaitAll(tasks.ToArray()); + } +} diff --git a/luban/src/Luban.Core/Validator/DataValidatorVisitor.cs b/luban/src/Luban.Core/Validator/DataValidatorVisitor.cs new file mode 100644 index 00000000..528c3143 --- /dev/null +++ b/luban/src/Luban.Core/Validator/DataValidatorVisitor.cs @@ -0,0 +1,178 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Validator; + +public class DataValidatorVisitor : TypeActionVisitorAdaptor +{ + private readonly Stack _path = new(); + + public Stack Path => _path; + + public DataValidatorContext Ctx { get; } + + public Record CurrentValidateRecord { get; set; } + + public DataValidatorVisitor(DataValidatorContext ctx) + { + Ctx = ctx; + } + + public void ValidateTable(DefTable table, List records) + { + var keyIndex = table.IndexFieldIdIndex; + + foreach (Record r in records) + { + if (DataUtil.IsUnchecked(r)) + { + continue; + } + CurrentValidateRecord = r; + DBean data = r.Data; + _path.Clear(); + _path.Push(table.FullName); + if (table.IsMapTable) + { + _path.Push(data.Fields[keyIndex]); + } + if (table.ValueTType.Validators.Count > 0) + { + foreach (var p in table.ValueTType.Validators) + { + p.Validate(Ctx, table.ValueTType, data); + } + } + table.ValueTType.Apply(this, data); + } + } + + private void AcceptListLike(TType elementType, List eles) + { + if (elementType.Validators.Count > 0) + { + int index = 0; + foreach (var value in eles) + { + _path.Push(index++); + foreach (var v in elementType.Validators) + { + if (value == null) + { + continue; + } + v.Validate(Ctx, elementType, value); + elementType.Apply(this, value); + } + _path.Pop(); + } + } + + if (elementType.IsBean || elementType.IsCollection) + { + int index = 0; + foreach (var value in eles) + { + if (value == null) + { + continue; + } + _path.Push(index++); + elementType.Apply(this, value); + _path.Pop(); + } + } + } + + public override void Accept(TBean type, DType x) + { + var beanData = (DBean)x; + var defFields = ((DefBean)type.DefBean.Assembly.GetDefType(beanData.ImplType.FullName)).HierarchyFields;// beanData.ImplType.HierarchyFields; + int i = 0; + foreach (var fieldValue in beanData.Fields) + { + if (fieldValue == null) + { + i++; + continue; + } + var defField = defFields[i++]; + _path.Push(defField.Name); + + var fieldType = defField.CType; + + if (fieldType.Validators.Count > 0) + { + foreach (var p in fieldType.Validators) + { + p.Validate(Ctx, fieldType, fieldValue); + } + } + fieldType.Apply(this, fieldValue); + _path.Pop(); + } + } + + public override void Accept(TArray type, DType x) + { + AcceptListLike(type.ElementType, ((DArray)x).Datas); + } + + public override void Accept(TList type, DType x) + { + AcceptListLike(type.ElementType, ((DList)x).Datas); + } + + public override void Accept(TSet type, DType x) + { + AcceptListLike(type.ElementType, ((DSet)x).Datas); + } + + public override void Accept(TMap type, DType x) + { + var keyType = type.KeyType; + var valueType = type.ValueType; + if (keyType.Validators.Count > 0 || valueType.Validators.Count > 0) + { + foreach (var e in ((DMap)x).Datas) + { + _path.Push(e.Key); + if (e.Key != null && keyType.Validators.Count > 0) + { + foreach (var v in keyType.Validators) + { + v.Validate(Ctx, keyType, e.Key); + keyType.Apply(this, e.Key); + } + } + if (valueType != null && valueType.Validators.Count > 0) + { + foreach (var v in valueType.Validators) + { + v.Validate(Ctx, valueType, e.Value); + if (e.Value != null) + { + valueType.Apply(this, e.Value); + } + } + } + _path.Pop(); + } + } + if (valueType is TBean) + { + foreach (var e in ((DMap)x).Datas) + { + _path.Push(e.Key); + if (e.Value != null) + { + valueType.Apply(this, e.Value); + } + _path.Pop(); + } + } + } +} diff --git a/luban/src/Luban.Core/Validator/IDataValidator.cs b/luban/src/Luban.Core/Validator/IDataValidator.cs new file mode 100644 index 00000000..c63e6fe6 --- /dev/null +++ b/luban/src/Luban.Core/Validator/IDataValidator.cs @@ -0,0 +1,14 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Types; + +namespace Luban.Validator; + +public interface IDataValidator +{ + string Args { get; set; } + + void Compile(DefField owner, TType type); + + void Validate(DataValidatorContext ctx, TType type, DType data); +} diff --git a/luban/src/Luban.Core/Validator/ITableValidator.cs b/luban/src/Luban.Core/Validator/ITableValidator.cs new file mode 100644 index 00000000..b07682b0 --- /dev/null +++ b/luban/src/Luban.Core/Validator/ITableValidator.cs @@ -0,0 +1,8 @@ +using Luban.Defs; + +namespace Luban.Validator; + +public interface ITableValidator +{ + void Validate(DefTable table, List records); +} diff --git a/luban/src/Luban.Core/Validator/ValidatorAttribute.cs b/luban/src/Luban.Core/Validator/ValidatorAttribute.cs new file mode 100644 index 00000000..e4fcadeb --- /dev/null +++ b/luban/src/Luban.Core/Validator/ValidatorAttribute.cs @@ -0,0 +1,14 @@ +using Luban.CustomBehaviour; + +namespace Luban.Validator; + +[AttributeUsage(AttributeTargets.Class)] +public class ValidatorAttribute : BehaviourBaseAttribute +{ + public ValidatorType Type { get; } + + public ValidatorAttribute(string name, ValidatorType type = ValidatorType.Data) : base(name) + { + this.Type = type; + } +} diff --git a/luban/src/Luban.Core/Validator/ValidatorManager.cs b/luban/src/Luban.Core/Validator/ValidatorManager.cs new file mode 100644 index 00000000..ba88a41f --- /dev/null +++ b/luban/src/Luban.Core/Validator/ValidatorManager.cs @@ -0,0 +1,86 @@ +using System.Reflection; +using Luban.CustomBehaviour; +using Luban.Defs; +using Luban.Types; + +namespace Luban.Validator; + +public class ValidatorManager +{ + public static ValidatorManager Ins { get; } = new(); + + public void Init() + { + + } + + public void InitValidatorsRecursive(TType type) + { + foreach (var (tagName, tagValue) in type.Tags) + { + if (TryCreateDataValidator(tagName, tagValue, out var validator)) + { + type.Validators.Add(validator); + } + } + if (type is TArray array) + { + InitValidatorsRecursive(array.ElementType); + } + else if (type is TList list) + { + InitValidatorsRecursive(list.ElementType); + } + else if (type is TSet set) + { + InitValidatorsRecursive(set.ElementType); + } + else if (type is TMap map) + { + InitValidatorsRecursive(map.KeyType); + InitValidatorsRecursive(map.ValueType); + } + } + + public void CompileValidatorsRecursive(TType type, DefField field) + { + foreach (var validator in type.Validators) + { + validator.Compile(field, type); + } + if (type is TArray array) + { + CompileValidatorsRecursive(array.ElementType, field); + } + else if (type is TList list) + { + CompileValidatorsRecursive(list.ElementType, field); + } + else if (type is TSet set) + { + CompileValidatorsRecursive(set.ElementType, field); + } + else if (type is TMap map) + { + CompileValidatorsRecursive(map.KeyType, field); + CompileValidatorsRecursive(map.ValueType, field); + } + } + + public IDataValidator CreateDataValidator(string name, string args) + { + var validator = CustomBehaviourManager.Ins.CreateBehaviour(name); + validator.Args = args; + return validator; + } + + public bool TryCreateDataValidator(string name, string args, out IDataValidator validator) + { + if (CustomBehaviourManager.Ins.TryCreateBehaviour(name, out validator)) + { + validator.Args = args; + return true; + } + return false; + } +} diff --git a/luban/src/Luban.Core/Validator/ValidatorType.cs b/luban/src/Luban.Core/Validator/ValidatorType.cs new file mode 100644 index 00000000..0e1bc41d --- /dev/null +++ b/luban/src/Luban.Core/Validator/ValidatorType.cs @@ -0,0 +1,7 @@ +namespace Luban.Validator; + +public enum ValidatorType +{ + Data, + Table, +} diff --git a/luban/src/Luban.Cpp/AssemblyInfo.cs b/luban/src/Luban.Cpp/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Cpp/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Cpp/CodeTarget/CppBinRawptrCodeTarget.cs b/luban/src/Luban.Cpp/CodeTarget/CppBinRawptrCodeTarget.cs new file mode 100644 index 00000000..ea017a74 --- /dev/null +++ b/luban/src/Luban.Cpp/CodeTarget/CppBinRawptrCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Cpp.TemplateExtensions; +using Scriban; + +namespace Luban.Cpp.CodeTarget; + +[CodeTarget("cpp-rawptr-bin")] +public class CppBinRawptrCodeTarget : CppCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new CppRawptrBinTemplateExtension()); + } +} diff --git a/luban/src/Luban.Cpp/CodeTarget/CppBinSharedptrCodeTarget.cs b/luban/src/Luban.Cpp/CodeTarget/CppBinSharedptrCodeTarget.cs new file mode 100644 index 00000000..e05a5866 --- /dev/null +++ b/luban/src/Luban.Cpp/CodeTarget/CppBinSharedptrCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Cpp.TemplateExtensions; +using Scriban; + +namespace Luban.Cpp.CodeTarget; + +[CodeTarget("cpp-sharedptr-bin")] +public class CppBinSharedptrCodeTarget : CppCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new CppSharedptrBinTemplateExtension()); + } +} diff --git a/luban/src/Luban.Cpp/CodeTarget/CppCodeTargetBase.cs b/luban/src/Luban.Cpp/CodeTarget/CppCodeTargetBase.cs new file mode 100644 index 00000000..59ad8439 --- /dev/null +++ b/luban/src/Luban.Cpp/CodeTarget/CppCodeTargetBase.cs @@ -0,0 +1,149 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.Cpp.TemplateExtensions; +using Luban.Defs; +using Scriban; +using Scriban.Runtime; + +namespace Luban.Cpp.CodeTarget; + +public abstract class CppCodeTargetBase : TemplateCodeTargetBase +{ + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_C_LIKE; + + protected override string FileSuffixName => "cpp"; + + protected override ICodeStyle DefaultCodeStyle => CodeFormatManager.Ins.CppDefaultCodeStyle; + + private static readonly HashSet s_preservedKeyWords = new HashSet + { + // cpp preserved key words + "alignas", "alignof", "and", "and_eq", "asm", "atomic_cancel", "atomic_commit", "atomic_noexcept", + "auto", "bitand", "bitor", "bool", "break", "case", "catch", "char", "char8_t", "char16_t", "char32_t", + "class", "compl", "concept", "const", "consteval", "constexpr", "constinit", "const_cast", "continue", + "co_await", "co_return", "co_yield", "decltype", "default", "delete", "do", "double", "dynamic_cast", + "else", "enum", "explicit", "export", "extern", "false", "float", "for", "friend", "goto", "if", "import", + "inline", "int", "long", "module", "mutable", "namespace", "new", "noexcept", "not", "not_eq", "nullptr", + "operator", "or", "or_eq", "private", "protected", "public", "reflexpr", "register", "reinterpret_cast", + "requires", "return", "short", "signed", "sizeof", "static", "static_assert", "static_cast", "struct", + "switch", "synchronized", "template", "this", "thread_local", "throw", "true", "try", "typedef", "typeid", + "typename", "union", "unsigned", "using", "virtual", "void", "volatile", "wchar_t", "while", "xor", "xor_eq" + }; + + protected override IReadOnlySet PreservedKeyWords => s_preservedKeyWords; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new CppTemplateExtension()); + } + + private OutputFile GenerateSchemaHeader(GenerationContext ctx, string outputFileName) + { + var enumTasks = new List>(); + foreach (var @enum in ctx.ExportEnums) + { + enumTasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateEnum(ctx, @enum, writer); + return writer.ToResult(null); + })); + } + + var beanTasks = new List>(); + foreach (var bean in ctx.ExportBeans) + { + beanTasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateBean(ctx, bean, writer); + return writer.ToResult(null); + })); + } + + var tableTasks = new List>(); + foreach (var table in ctx.ExportTables) + { + tableTasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateTable(ctx, table, writer); + return writer.ToResult(null); + })); + } + + var tablesWriter = new CodeWriter(); + GenerateTables(ctx, ctx.ExportTables, tablesWriter); + + + Task.WaitAll(enumTasks.ToArray()); + Task.WaitAll(beanTasks.ToArray()); + Task.WaitAll(tableTasks.ToArray()); + + var template = GetTemplate("schema_h"); + var tplCtx = CreateTemplateContext(template); + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__top_module", ctx.Target.TopModule }, + { "__enum_codes", string.Join('\n', enumTasks.Select(t => t.Result))}, + { "__bean_codes", string.Join('\n', beanTasks.Select(t => t.Result))}, + { "__table_codes", string.Join('\n', tableTasks.Select(t => t.Result))}, + { "__tables_code", tablesWriter.ToResult(null)}, + { "__beans", ctx.ExportBeans}, + { "__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + var schemaHeader = new CodeWriter(); + schemaHeader.Write(template.Render(tplCtx)); + + return CreateOutputFile(outputFileName, schemaHeader.ToResult(FileHeader)); + } + + private OutputFile GenerateSchemaCpp(GenerationContext ctx, List beans, string schemaHeaderFileName, string outputFileName) + { + var template = GetTemplate("schema_cpp"); + var tplCtx = CreateTemplateContext(template); + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__top_module", ctx.Target.TopModule }, + { "__beans", beans}, + { "__schema_header_file", schemaHeaderFileName}, + { "__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + var schemaCpp = new CodeWriter(); + schemaCpp.Write(template.Render(tplCtx)); + + return CreateOutputFile(outputFileName, schemaCpp.ToResult(FileHeader)); + } + + public override void Handle(GenerationContext ctx, OutputFileManifest manifest) + { + string schemaFileNameWithoutExt = EnvManager.Current.GetOptionOrDefault(Name, "schemaFileNameWithoutExt", true, "schema"); + string schemaFileName = $"{schemaFileNameWithoutExt}.h"; + manifest.AddFile(GenerateSchemaHeader(ctx, schemaFileName)); + + var cppTasks = new List>(); + var beanTypes = ctx.ExportBeans; + + int typeCountPerStubFile = int.Parse(EnvManager.Current.GetOptionOrDefault(Name, "typeCountPerStubFile", true, "100")); + + for (int i = 0, n = beanTypes.Count; i < n; i += typeCountPerStubFile) + { + int startIndex = i; + cppTasks.Add(Task.Run(() => + GenerateSchemaCpp(ctx, + beanTypes.GetRange(startIndex, Math.Min(typeCountPerStubFile, beanTypes.Count - startIndex)), + schemaFileName, + $"{schemaFileNameWithoutExt}_{startIndex / typeCountPerStubFile}.cpp"))); + } + + Task.WaitAll(cppTasks.ToArray()); + foreach (var cppTask in cppTasks) + { + manifest.AddFile(cppTask.Result); + } + } +} diff --git a/luban/src/Luban.Cpp/Luban.Cpp.csproj b/luban/src/Luban.Cpp/Luban.Cpp.csproj new file mode 100644 index 00000000..8f4984b2 --- /dev/null +++ b/luban/src/Luban.Cpp/Luban.Cpp.csproj @@ -0,0 +1,70 @@ + + + + net8.0 + enable + disable + + + + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + diff --git a/luban/src/Luban.Cpp/TemplateExtensions/CppRawptrBinTemplateExtension.cs b/luban/src/Luban.Cpp/TemplateExtensions/CppRawptrBinTemplateExtension.cs new file mode 100644 index 00000000..c76acabf --- /dev/null +++ b/luban/src/Luban.Cpp/TemplateExtensions/CppRawptrBinTemplateExtension.cs @@ -0,0 +1,18 @@ +using Luban.Cpp.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.Cpp.TemplateExtensions; + +public class CppRawptrBinTemplateExtension : ScriptObject +{ + public static string Deserialize(string bufName, string fieldName, TType type) + { + return type.Apply(CppRawptrDeserializeVisitor.Ins, bufName, fieldName, 0); + } + + public static string DeclaringTypeName(TType type) + { + return type.Apply(CppRawptrDeclaringTypeNameVisitor.Ins); + } +} diff --git a/luban/src/Luban.Cpp/TemplateExtensions/CppSharedptrBinTemplateExtension.cs b/luban/src/Luban.Cpp/TemplateExtensions/CppSharedptrBinTemplateExtension.cs new file mode 100644 index 00000000..f6498892 --- /dev/null +++ b/luban/src/Luban.Cpp/TemplateExtensions/CppSharedptrBinTemplateExtension.cs @@ -0,0 +1,18 @@ +using Luban.Cpp.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.Cpp.TemplateExtensions; + +public class CppSharedptrBinTemplateExtension : ScriptObject +{ + public static string Deserialize(string bufName, string fieldName, TType type) + { + return type.Apply(CppSharedptrDeserializeVisitor.Ins, bufName, fieldName,0); + } + + public static string DeclaringTypeName(TType type) + { + return type.Apply(CppSharedptrDeclaringTypeNameVisitor.Ins); + } +} diff --git a/luban/src/Luban.Cpp/TemplateExtensions/CppTemplateExtension.cs b/luban/src/Luban.Cpp/TemplateExtensions/CppTemplateExtension.cs new file mode 100644 index 00000000..449638b8 --- /dev/null +++ b/luban/src/Luban.Cpp/TemplateExtensions/CppTemplateExtension.cs @@ -0,0 +1,48 @@ +using System.Text; +using Luban.Cpp.TypeVisitors; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Cpp.TemplateExtensions; + +public class CppTemplateExtension : ScriptObject +{ + public static string MakeTypeCppName(DefTypeBase type) + { + return TypeUtil.MakeCppFullName(type.Namespace, type.Name); + } + + public static string MakeCppName(string typeName) + { + return TypeUtil.MakeCppFullName("", typeName); + } + + public static string GetterName(string originName) + { + var words = originName.Split('_').Where(s => !string.IsNullOrWhiteSpace(s)).ToArray(); + var s = new StringBuilder("get"); + foreach (var word in words) + { + s.Append(TypeUtil.UpperCaseFirstChar(word)); + } + return s.ToString(); + } + + public static string NamespaceWithGraceBegin(string ns) + { + return TypeUtil.MakeCppNamespaceBegin(ns); + } + + public static string NamespaceWithGraceEnd(string ns) + { + return TypeUtil.MakeCppNamespaceEnd(ns); + } + + public static string GetValueOfNullableType(TType type, string varName) + { + return $"(*({varName}))"; + } + +} diff --git a/luban/src/Luban.Cpp/Templates/common/cpp/enum.sbn b/luban/src/Luban.Cpp/Templates/common/cpp/enum.sbn new file mode 100644 index 00000000..b9f3b0a5 --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/common/cpp/enum.sbn @@ -0,0 +1,23 @@ +{{~ + comment = __enum.comment + items = __enum.items +~}} +{{namespace_with_grace_begin __namespace}} +{{~if comment != '' ~}} + /// + /// {{escape_comment comment}} + /// +{{~end~}} + enum class {{__name}} + { + {{~ for item in items ~}} +{{~if item.comment != '' ~}} + /// + /// {{escape_comment item.comment_or_alias}} + /// +{{~end~}} + {{format_enum_item_name __code_style item.name}} = {{item.value}}, + {{~end~}} + }; + +{{namespace_with_grace_end __namespace}} diff --git a/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/bean.sbn b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/bean.sbn new file mode 100644 index 00000000..2b856b0a --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/bean.sbn @@ -0,0 +1,32 @@ +{{namespace_with_grace_begin __namespace}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +struct {{__name}} : public{{if __parent_def_type}} {{make_cpp_name __parent_def_type.full_name}} {{else}} luban::CfgBean {{end}} +{ + static bool deserialize{{__name}}(::luban::ByteBuf& _buf, {{__name}}*& _out); + + virtual ~{{__name}}() {} + + bool deserialize(::luban::ByteBuf& _buf); + + {{~ for field in __export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + {{~end~}} + +{{~if !__this.is_abstract_type~}} + static constexpr int __ID__ = {{__this.id}}; + + int getTypeId() const override { return __ID__; } +{{~end~}} +}; + +{{namespace_with_grace_end __namespace}} diff --git a/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/schema_cpp.sbn b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/schema_cpp.sbn new file mode 100644 index 00000000..18c15312 --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/schema_cpp.sbn @@ -0,0 +1,45 @@ +#include "{{__schema_header_file}}" + +{{namespace_with_grace_begin __top_module}} + +{{~for bean in __beans~}} + +bool {{make_cpp_name bean.full_name}}::deserialize(::luban::ByteBuf& _buf) +{ + {{~if bean.parent_def_type~}} + if (!{{make_cpp_name bean.parent_def_type.full_name}}::deserialize(_buf)) + { + return false; + } + {{~end~}} + + {{~ for field in bean.export_fields ~}} + {{deserialize '_buf' (format_field_name __code_style field.name) field.ctype}} + {{~end~}} + + return true; +} + +{{~if bean.is_abstract_type~}} +bool {{make_cpp_name bean.full_name}}::deserialize{{bean.name}}(::luban::ByteBuf& _buf, {{make_cpp_name bean.full_name}}*& _out) +{ + int32_t id; + if (!_buf.readInt(id)) return false; + switch (id) + { + {{~for child in bean.hierarchy_not_abstract_children~}} + case {{make_type_cpp_name child}}::__ID__: { _out = LUBAN_NEW({{make_type_cpp_name child}}); if (_out->deserialize(_buf)) { return true; } else { _out = nullptr; return false;} } + {{~end~}} + default: { _out = nullptr; return false;} + } +} +{{~else~}} +bool {{make_cpp_name bean.full_name}}::deserialize{{bean.name}}(::luban::ByteBuf& _buf, {{make_cpp_name bean.full_name}}*& _out) +{ + _out = LUBAN_NEW({{make_type_cpp_name bean}}); + return _out->deserialize(_buf); +} +{{~end~}} + +{{~end~}} +{{namespace_with_grace_end __top_module}} diff --git a/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/schema_h.sbn b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/schema_h.sbn new file mode 100644 index 00000000..90ba84cb --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/schema_h.sbn @@ -0,0 +1,21 @@ +#pragma once +#include +#include + +#include "CfgBean.h" + +{{namespace_with_grace_begin __top_module}} + +{{__enum_codes~}} + +{{~for b in __beans~}} +{{namespace_with_grace_begin b.namespace}} struct {{b.name}}; {{namespace_with_grace_end b.namespace}} +{{~end~}} + +{{~__bean_codes~}} + +{{~__table_codes~}} + +{{__tables_code}} + +{{namespace_with_grace_end __top_module}} diff --git a/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/table.sbn b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/table.sbn new file mode 100644 index 00000000..511a5463 --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/table.sbn @@ -0,0 +1,134 @@ +{{namespace_with_grace_begin __namespace}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} + +class {{__name}} +{ + {{~if __this.is_map_table ~}} + private: + ::luban::HashMap<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + ::luban::Vector<{{declaring_type_name __value_type}}> _dataList; + + public: + ~{{__name}}() + { + for (auto& _v : _dataList) + { + LUBAN_FREE(_v); + } + } + + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + for(; n > 0 ; --n) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.push_back(_v); + _dataMap[_v->{{format_field_name __code_style __this.index_field.name}}] = _v; + } + return true; + } + + const ::luban::HashMap<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>& getDataMap() const { return _dataMap; } + const ::luban::Vector<{{declaring_type_name __value_type}}>& getDataList() const { return _dataList; } + + {{declaring_type_name __value_type}} get({{declaring_type_name __key_type}} key) + { + auto it = _dataMap.find(key); + return it != _dataMap.end() ? it->second : nullptr; + } + + {{~else if __this.is_list_table~}} + private: + ::luban::Vector<{{declaring_type_name __value_type}}> _dataList; + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + ::luban::HashMap<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~else~}} + {{~end~}} + + public: + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + for(; n > 0 ; --n) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.push_back(_v); + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + _dataMap_{{idx.index_field.name}}[_v->{{idx.index_field.name}}] = _v; + {{~end~}} + {{~else~}} + {{~end~}} + } + return true; + } + + const ::luban::Vector<{{declaring_type_name __value_type}}>& getDataList() const { return _dataList; } + + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + ::luban::HashMap<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>& getDataMapBy{{idx.index_field.name}}() + { + return _dataMap_{{idx.index_field.name}}; + } + + {{declaring_type_name __value_type}} getBy{{idx.index_field.name}}({{declaring_type_name idx.type}} key) + { + auto it = _dataMap_{{idx.index_field.name}}.find(key); + return it != _dataMap_{{idx.index_field.name}}.end() ? it->second : nullptr; + } + {{~end~}} + {{~else~}} + + {{declaring_type_name __value_type}} get(size_t index) const + { + return _dataList[index]; + } + {{~end~}} + {{~else~}} + private: + {{declaring_type_name __value_type}} _data; + + public: + {{declaring_type_name __value_type}} data() const { return _data; } + + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + if (n != 1) return false; + {{deserialize '_buf' '_data' __value_type}} + return true; + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + {{declaring_type_name field.ctype}}& {{getter_name field.name}}() const { return _data->{{format_field_name __code_style field.name}}; } + {{~end~}} + {{~end~}} +}; + +{{namespace_with_grace_end __namespace}} diff --git a/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/tables.sbn b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/tables.sbn new file mode 100644 index 00000000..76354d59 --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-rawptr-bin/tables.sbn @@ -0,0 +1,23 @@ +class {{__name}} +{ + public: + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + {{make_cpp_name table.full_name}} {{table.name}}; + {{~end~}} + + bool load(::luban::Loader<::luban::ByteBuf> loader) + { + ::luban::ByteBuf buf; + {{~for table in __tables~}} + buf.clear(); + if (!loader(buf, "{{table.output_data_file}}")) return false; + if (!{{table.name}}.load(buf)) return false; + {{~end~}} + return true; + } +}; diff --git a/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/bean.sbn b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/bean.sbn new file mode 100644 index 00000000..f55cd315 --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/bean.sbn @@ -0,0 +1,32 @@ +{{namespace_with_grace_begin __namespace}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +struct {{__name}} : public{{if __parent_def_type}} {{make_cpp_name __parent_def_type.full_name}} {{else}} luban::CfgBean {{end}} +{ + static bool deserialize{{__name}}(::luban::ByteBuf& _buf, ::luban::SharedPtr<{{__name}}>& _out); + + virtual ~{{__name}}() {} + + bool deserialize(::luban::ByteBuf& _buf); + + {{~ for field in __export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + {{~end~}} + +{{~if !__this.is_abstract_type~}} + static constexpr int __ID__ = {{__this.id}}; + + int getTypeId() const override { return __ID__; } +{{~end~}} +}; + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/schema_cpp.sbn b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/schema_cpp.sbn new file mode 100644 index 00000000..1d1a92c1 --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/schema_cpp.sbn @@ -0,0 +1,50 @@ +#include "{{__schema_header_file}}" + +{{namespace_with_grace_begin __top_module}} + +{{~for bean in __beans~}} + +bool {{make_cpp_name bean.full_name}}::deserialize(::luban::ByteBuf& _buf) +{ + {{~if bean.parent_def_type~}} + if (!{{make_cpp_name bean.parent_def_type.full_name}}::deserialize(_buf)) + { + return false; + } + {{~end~}} + + {{~ for field in bean.export_fields ~}} + {{deserialize '_buf' (format_field_name __code_style field.name) field.ctype}} + {{~end~}} + + return true; +} + +bool {{make_cpp_name bean.full_name}}::deserialize{{bean.name}}(::luban::ByteBuf& _buf, ::luban::SharedPtr<{{make_cpp_name bean.full_name}}>& _out) +{ +{{~if bean.is_abstract_type~}} + int32_t id; + if (!_buf.readInt(id)) return false; + switch (id) + { + {{~for child in bean.hierarchy_not_abstract_children~}} + case {{make_type_cpp_name child}}::__ID__: { _out.reset(LUBAN_NEW({{make_type_cpp_name child}})); if (_out->deserialize(_buf)) { return true; } else { _out.reset(); return false;} } + {{~end~}} + default: { _out = nullptr; return false;} + } +{{~else~}} + _out.reset(LUBAN_NEW({{make_type_cpp_name bean}})); + if (_out->deserialize(_buf)) + { + return true; + } + else + { + _out.reset(); + return false; + } +{{~end~}} +} + +{{~end~}} +{{namespace_with_grace_end __top_module}} diff --git a/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/schema_h.sbn b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/schema_h.sbn new file mode 100644 index 00000000..90ba84cb --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/schema_h.sbn @@ -0,0 +1,21 @@ +#pragma once +#include +#include + +#include "CfgBean.h" + +{{namespace_with_grace_begin __top_module}} + +{{__enum_codes~}} + +{{~for b in __beans~}} +{{namespace_with_grace_begin b.namespace}} struct {{b.name}}; {{namespace_with_grace_end b.namespace}} +{{~end~}} + +{{~__bean_codes~}} + +{{~__table_codes~}} + +{{__tables_code}} + +{{namespace_with_grace_end __top_module}} diff --git a/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/table.sbn b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/table.sbn new file mode 100644 index 00000000..f8838472 --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/table.sbn @@ -0,0 +1,140 @@ +{{namespace_with_grace_begin __namespace}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} + +class {{__name}} +{ + {{~if __this.is_map_table ~}} + private: + ::luban::HashMap<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}> _dataMap; + ::luban::Vector<{{declaring_type_name __value_type}}> _dataList; + + public: + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + for(; n > 0 ; --n) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.push_back(_v); + _dataMap[_v->{{format_field_name __code_style __this.index_field.name}}] = _v; + } + return true; + } + + const ::luban::HashMap<{{declaring_type_name __key_type}}, {{declaring_type_name __value_type}}>& getDataMap() const { return _dataMap; } + const ::luban::Vector<{{declaring_type_name __value_type}}>& getDataList() const { return _dataList; } + + {{make_type_cpp_name __value_type.def_bean}}* getRaw({{declaring_type_name __key_type}} key) + { + auto it = _dataMap.find(key); + return it != _dataMap.end() ? it->second.get() : nullptr; + } + + {{declaring_type_name __value_type}} get({{declaring_type_name __key_type}} key) + { + auto it = _dataMap.find(key); + return it != _dataMap.end() ? it->second : nullptr; + } + + {{~else if __this.is_list_table~}} + private: + ::luban::Vector<{{declaring_type_name __value_type}}> _dataList; + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + ::luban::HashMap<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}> _dataMap_{{idx.index_field.name}}; + {{~end~}} + {{~else~}} + {{~end~}} + + public: + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + for(; n > 0 ; --n) + { + {{declaring_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.push_back(_v); + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + _dataMap_{{idx.index_field.name}}[_v->{{idx.index_field.name}}] = _v; + {{~end~}} + {{~else~}} + {{~end~}} + } + return true; + } + + const ::luban::Vector<{{declaring_type_name __value_type}}>& getDataList() const { return _dataList; } + + {{~if __this.is_union_index~}} + + {{~else if !__this.index_list.empty?~}} + {{~for idx in __this.index_list~}} + ::luban::HashMap<{{declaring_type_name idx.type}}, {{declaring_type_name __value_type}}>& getDataMapBy{{idx.index_field.name}}() + { + return _dataMap_{{idx.index_field.name}}; + } + {{make_type_cpp_name __value_type.def_bean}}* getRawBy{{idx.index_field.name}}({{declaring_type_name idx.type}} key) + { + auto it = _dataMap_{{idx.index_field.name}}.find(key); + return it != _dataMap_{{idx.index_field.name}}.end() ? it->second.get() : nullptr; + } + {{declaring_type_name __value_type}} getBy{{idx.index_field.name}}({{declaring_type_name idx.type}} key) + { + auto it = _dataMap_{{idx.index_field.name}}.find(key); + return it != _dataMap_{{idx.index_field.name}}.end() ? it->second : nullptr; + } + {{~end~}} + {{~else~}} + {{make_type_cpp_name __value_type.def_bean}}* getRaw(size_t index) const + { + return _dataList[index].get(); + } + + {{declaring_type_name __value_type}} get(size_t index) const + { + return _dataList[index]; + } + {{~end~}} + {{~else~}} + private: + {{declaring_type_name __value_type}} _data; + + public: + {{declaring_type_name __value_type}} data() const { return _data; } + + bool load(::luban::ByteBuf& _buf) + { + int n; + if (!_buf.readSize(n)) return false; + if (n != 1) return false; + {{deserialize '_buf' '_data' __value_type}} + return true; + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + {{declaring_type_name field.ctype}}& {{getter_name field.name}}() const { return _data->{{format_field_name __code_style field.name}}; } + {{~end~}} + {{~end~}} +}; + +{{namespace_with_grace_end __namespace}} \ No newline at end of file diff --git a/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/tables.sbn b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/tables.sbn new file mode 100644 index 00000000..76354d59 --- /dev/null +++ b/luban/src/Luban.Cpp/Templates/cpp-sharedptr-bin/tables.sbn @@ -0,0 +1,23 @@ +class {{__name}} +{ + public: + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + {{make_cpp_name table.full_name}} {{table.name}}; + {{~end~}} + + bool load(::luban::Loader<::luban::ByteBuf> loader) + { + ::luban::ByteBuf buf; + {{~for table in __tables~}} + buf.clear(); + if (!loader(buf, "{{table.output_data_file}}")) return false; + if (!{{table.name}}.load(buf)) return false; + {{~end~}} + return true; + } +}; diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppRawptrDeclaringTypeNameVisitor.cs b/luban/src/Luban.Cpp/TypeVisitors/CppRawptrDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..fe81344c --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppRawptrDeclaringTypeNameVisitor.cs @@ -0,0 +1,14 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Cpp.TypeVisitors; + +public class CppRawptrDeclaringTypeNameVisitor : DecoratorFuncVisitor +{ + public static CppRawptrDeclaringTypeNameVisitor Ins { get; } = new CppRawptrDeclaringTypeNameVisitor(); + + public override string DoAccept(TType type) + { + return type.IsNullable && !type.IsBean ? $"{type.Apply(CppRawptrUnderlyingDeclaringTypeNameVisitor.Ins)}*" : type.Apply(CppRawptrUnderlyingDeclaringTypeNameVisitor.Ins); + } +} diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppRawptrDeserializeVisitor.cs b/luban/src/Luban.Cpp/TypeVisitors/CppRawptrDeserializeVisitor.cs new file mode 100644 index 00000000..8f7f995b --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppRawptrDeserializeVisitor.cs @@ -0,0 +1,21 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Cpp.TypeVisitors; + +public class CppRawptrDeserializeVisitor : DecoratorFuncVisitor +{ + public static CppRawptrDeserializeVisitor Ins { get; } = new CppRawptrDeserializeVisitor(); + + public override string DoAccept(TType type, string bufName, string fieldName, int depth) + { + if (type.IsNullable) + { + return $"{{ bool _has_value_; if(!{bufName}.readBool(_has_value_)){{return false;}} if(_has_value_) {{ {fieldName} = {(type.IsBean ? "nullptr" : $"new {type.Apply(CppUnderlyingDeclaringTypeNameVisitor.Ins)}{{}}")}; {type.Apply(CppRawptrUnderlyingDeserializeVisitor.Ins, bufName, type.IsBean ? fieldName : $"*{fieldName}",depth + 1, CppRawptrDeclaringTypeNameVisitor.Ins)} }} else {{ {fieldName} = nullptr; }} }}"; + } + else + { + return type.Apply(CppRawptrUnderlyingDeserializeVisitor.Ins, bufName, fieldName, depth, CppRawptrDeclaringTypeNameVisitor.Ins); + } + } +} diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppRawptrUnderlyingDeclaringTypeNameVisitor.cs b/luban/src/Luban.Cpp/TypeVisitors/CppRawptrUnderlyingDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..0684d9b7 --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppRawptrUnderlyingDeclaringTypeNameVisitor.cs @@ -0,0 +1,15 @@ +using Luban.Cpp.TemplateExtensions; +using Luban.Types; + +namespace Luban.Cpp.TypeVisitors; + +public class CppRawptrUnderlyingDeclaringTypeNameVisitor : CppUnderlyingDeclaringTypeNameVisitor +{ + public new static CppRawptrUnderlyingDeclaringTypeNameVisitor Ins { get; } = new(); + + public override string Accept(TBean type) + { + string typeName = CppTemplateExtension.MakeTypeCppName(type.DefBean); + return $"{typeName}*"; + } +} diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppRawptrUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Cpp/TypeVisitors/CppRawptrUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..495f18f9 --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppRawptrUnderlyingDeserializeVisitor.cs @@ -0,0 +1,10 @@ +using Luban.Cpp.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Cpp.TypeVisitors; + +public class CppRawptrUnderlyingDeserializeVisitor : CppUnderlyingDeserializeVisitorBase +{ + public static CppRawptrUnderlyingDeserializeVisitor Ins { get; } = new(); +} diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppSharedPtrUnderlyingDeclaringTypeNameVisitor.cs b/luban/src/Luban.Cpp/TypeVisitors/CppSharedPtrUnderlyingDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..81ef2684 --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppSharedPtrUnderlyingDeclaringTypeNameVisitor.cs @@ -0,0 +1,14 @@ +using Luban.Cpp.TemplateExtensions; +using Luban.Types; + +namespace Luban.Cpp.TypeVisitors; + +public class CppSharedptrUnderlyingDeclaringTypeNameVisitor : CppUnderlyingDeclaringTypeNameVisitor +{ + public new static CppSharedptrUnderlyingDeclaringTypeNameVisitor Ins { get; } = new(); + + public override string Accept(TBean type) + { + return $"::luban::SharedPtr<{CppTemplateExtension.MakeTypeCppName(type.DefBean)}>"; + } +} diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppSharedptrDeclaringTypeNameVisitor.cs b/luban/src/Luban.Cpp/TypeVisitors/CppSharedptrDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..199a3de9 --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppSharedptrDeclaringTypeNameVisitor.cs @@ -0,0 +1,19 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Cpp.TypeVisitors; + +public class CppSharedptrDeclaringTypeNameVisitor : DecoratorFuncVisitor +{ + public static CppSharedptrDeclaringTypeNameVisitor Ins { get; } = new CppSharedptrDeclaringTypeNameVisitor(); + + public override string DoAccept(TType type) + { + return type.IsNullable ? $"::luban::SharedPtr<{type.Apply(CppSharedptrUnderlyingDeclaringTypeNameVisitor.Ins)}>" : type.Apply(CppSharedptrUnderlyingDeclaringTypeNameVisitor.Ins); + } + + public override string Accept(TBean type) + { + return type.Apply(CppSharedptrUnderlyingDeclaringTypeNameVisitor.Ins); + } +} diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppSharedptrDeserializeVisitor.cs b/luban/src/Luban.Cpp/TypeVisitors/CppSharedptrDeserializeVisitor.cs new file mode 100644 index 00000000..83139ee8 --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppSharedptrDeserializeVisitor.cs @@ -0,0 +1,21 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Cpp.TypeVisitors; + +public class CppSharedptrDeserializeVisitor : DecoratorFuncVisitor +{ + public static CppSharedptrDeserializeVisitor Ins { get; } = new CppSharedptrDeserializeVisitor(); + + public override string DoAccept(TType type, string bufName, string fieldName, int depth) + { + if (type.IsNullable) + { + return $"{{ bool _has_value_; if(!{bufName}.readBool(_has_value_)){{return false;}} if(_has_value_) {{ {fieldName}.reset({(type.IsBean ? "" : $"new {type.Apply(CppUnderlyingDeclaringTypeNameVisitor.Ins)}()")}); {type.Apply(CppSharedptrUnderlyingDeserializeVisitor.Ins, bufName, $"{(type.IsBean ? "" : "*")}{fieldName}",depth+1, CppSharedptrDeclaringTypeNameVisitor.Ins)} }} else {{ {fieldName}.reset(); }} }}"; + } + else + { + return type.Apply(CppSharedptrUnderlyingDeserializeVisitor.Ins, bufName, fieldName, depth ,CppSharedptrDeclaringTypeNameVisitor.Ins); + } + } +} diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppSharedptrUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Cpp/TypeVisitors/CppSharedptrUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..7fdef170 --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppSharedptrUnderlyingDeserializeVisitor.cs @@ -0,0 +1,31 @@ +using Luban.Cpp.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Cpp.TypeVisitors; + +public class CppSharedptrUnderlyingDeserializeVisitor : CppUnderlyingDeserializeVisitorBase +{ + public static CppSharedptrUnderlyingDeserializeVisitor Ins { get; } = new CppSharedptrUnderlyingDeserializeVisitor(); + + //public string Accept(TArray type, string bufName, string fieldName) + //{ + // return $"{{::luban::int32 n; if(!{bufName}.readSize(n)) return false; n = std::min(n, ::luban::int32({bufName}.size()));{fieldName}.reserve(n);for(int i = 0 ; i < n ; i++) {{ {type.ElementType.Apply(CppSharedptrDeclaringTypeNameVisitor.Ins)} _e;{type.ElementType.Apply(this, bufName, "_e")} {fieldName}.push_back(_e);}}}}"; + //} + + //public string Accept(TList type, string bufName, string fieldName) + //{ + // return $"{{::luban::int32 n; if(!{bufName}.readSize(n)) return false; n = std::min(n, ::luban::int32({bufName}.size())); {fieldName}.reserve(n);for(int i = 0 ; i < n ; i++) {{ {type.ElementType.Apply(CppSharedptrDeclaringTypeNameVisitor.Ins)} _e; {type.ElementType.Apply(this, bufName, "_e")} {fieldName}.push_back(_e);}}}}"; + //} + + //public string Accept(TSet type, string bufName, string fieldName) + //{ + // return $"{{::luban::int32 n; if(!{bufName}.readSize(n)) return false; n = std::min(n, ::luban::int32({bufName}.size())); {fieldName}.reserve(n * 3 / 2);for(int i = 0 ; i < n ; i++) {{ {type.ElementType.Apply(CppSharedptrDeclaringTypeNameVisitor.Ins)} _e; {type.ElementType.Apply(this, bufName, "_e")} {fieldName}.insert(_e);}}}}"; + //} + + //public string Accept(TMap type, string bufName, string fieldName) + //{ + // return $"{{::luban::int32 n; if(!{bufName}.readSize(n)) return false; n = std::min(n, (::luban::int32){bufName}.size()); {fieldName}.reserve(n * 3 / 2);for(int i = 0 ; i < n ; i++) {{ {type.KeyType.Apply(CppSharedptrDeclaringTypeNameVisitor.Ins)} _k; {type.KeyType.Apply(this, bufName, "_k")} {type.ValueType.Apply(CppSharedptrDeclaringTypeNameVisitor.Ins)} _v; {type.ValueType.Apply(this, bufName, "_v")} {fieldName}[_k] = _v;}}}}"; + + //} +} diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppUnderlyingDeclaringTypeNameVisitor.cs b/luban/src/Luban.Cpp/TypeVisitors/CppUnderlyingDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..7d75a423 --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppUnderlyingDeclaringTypeNameVisitor.cs @@ -0,0 +1,86 @@ +using Luban.Cpp.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Cpp.TypeVisitors; + +public class CppUnderlyingDeclaringTypeNameVisitor : ITypeFuncVisitor +{ + public static CppUnderlyingDeclaringTypeNameVisitor Ins { get; } = new(); + + public string Accept(TBool type) + { + return "bool"; + } + + public string Accept(TByte type) + { + return "::luban::byte"; + } + + public string Accept(TShort type) + { + return "::luban::int16"; + } + + public string Accept(TInt type) + { + return "::luban::int32"; + } + + public string Accept(TLong type) + { + return "::luban::int64"; + } + + public string Accept(TFloat type) + { + return "::luban::float32"; + } + + public string Accept(TDouble type) + { + return "::luban::float64"; + } + + public string Accept(TEnum type) + { + return CppTemplateExtension.MakeTypeCppName(type.DefEnum); + } + + public string Accept(TString type) + { + return "::luban::String"; + } + + public virtual string Accept(TBean type) + { + return CppTemplateExtension.MakeTypeCppName(type.DefBean); + } + + public string Accept(TDateTime type) + { + return "::luban::datetime"; + } + + public string Accept(TArray type) + { + return $"::luban::Array<{type.ElementType.Apply(this)}>"; + } + + public string Accept(TList type) + { + return $"::luban::Vector<{type.ElementType.Apply(this)}>"; + } + + public string Accept(TSet type) + { + return $"::luban::HashSet<{type.ElementType.Apply(this)}>"; + } + + public string Accept(TMap type) + { + return $"::luban::HashMap<{type.KeyType.Apply(this)}, {type.ValueType.Apply(this)}>"; + } +} diff --git a/luban/src/Luban.Cpp/TypeVisitors/CppUnderlyingDeserializeVisitorBase.cs b/luban/src/Luban.Cpp/TypeVisitors/CppUnderlyingDeserializeVisitorBase.cs new file mode 100644 index 00000000..0e9622d9 --- /dev/null +++ b/luban/src/Luban.Cpp/TypeVisitors/CppUnderlyingDeserializeVisitorBase.cs @@ -0,0 +1,87 @@ +using Luban.Cpp.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Cpp.TypeVisitors; + +public abstract class CppUnderlyingDeserializeVisitorBase : ITypeFuncVisitor, string> +{ + public string Accept(TBool type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if (!{bufName}.readBool({fieldName})) return false;"; + } + + public string Accept(TByte type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if(!{bufName}.readByte({fieldName})) return false;"; + } + + public string Accept(TShort type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if(!{bufName}.readShort({fieldName})) return false;"; + } + + public string Accept(TInt type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if(!{bufName}.readInt({fieldName})) return false;"; + } + + public string Accept(TLong type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if(!{bufName}.readLong({fieldName})) return false;"; + } + + public string Accept(TFloat type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if(!{bufName}.readFloat({fieldName})) return false;"; + } + + public string Accept(TDouble type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if(!{bufName}.readDouble({fieldName})) return false;"; + } + + public string Accept(TEnum type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"{{int __enum_temp__; if(!{bufName}.readInt(__enum_temp__)) return false; {fieldName} = {CppTemplateExtension.MakeTypeCppName(type.DefEnum)}(__enum_temp__); }}"; + } + + public string Accept(TString type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if(!{bufName}.readString({fieldName})) return false;"; + } + + public string Accept(TBean type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if(!{CppTemplateExtension.MakeTypeCppName(type.DefBean)}::deserialize{type.DefBean.Name}({bufName}, {fieldName})) return false;"; + } + + public string Accept(TDateTime type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + return $"if(!{bufName}.readLong({fieldName})) return false;"; + } + + public string Accept(TArray type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + var suffix = depth == 0 ? "" : $"_{depth}"; + return $"{{::luban::int32 n{suffix}; if(!{bufName}.readSize(n{suffix})) return false; n{suffix} = std::min(n{suffix}, ::luban::int32({bufName}.size())); {fieldName}.reserve(n{suffix});for(int i{suffix} = 0 ; i{suffix} < n{suffix} ; i{suffix}++) {{ {type.ElementType.Apply(typeVisitor)} _e{suffix}; {type.ElementType.Apply(this, bufName, $"_e{suffix}", depth + 1, typeVisitor)} {fieldName}.push_back(_e{suffix});}}}}"; + } + + public string Accept(TList type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + var suffix = depth == 0 ? "" : $"_{depth}"; + return $"{{::luban::int32 n{suffix}; if(!{bufName}.readSize(n{suffix})) return false; n{suffix} = std::min(n{suffix}, ::luban::int32({bufName}.size())); {fieldName}.reserve(n{suffix});for(int i{suffix} = 0 ; i{suffix} < n{suffix} ; i{suffix}++) {{ {type.ElementType.Apply(typeVisitor)} _e{suffix}; {type.ElementType.Apply(this, bufName, $"_e{suffix}", depth + 1, typeVisitor)} {fieldName}.push_back(_e{suffix});}}}}"; + } + + public string Accept(TSet type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + var suffix = depth == 0 ? "" : $"_{depth}"; + return $"{{::luban::int32 n{suffix}; if(!{bufName}.readSize(n{suffix})) return false; n{suffix} = std::min(n{suffix}, ::luban::int32({bufName}.size())); {fieldName}.reserve(n{suffix} * 3 / 2);for(int i{suffix} = 0 ; i{suffix} < n{suffix} ; i{suffix}++) {{ {type.ElementType.Apply(typeVisitor)} _e{suffix}; {type.ElementType.Apply(this, bufName, $"_e{suffix}", depth + 1, typeVisitor)} {fieldName}.insert(_e{suffix});}}}}"; + } + + public string Accept(TMap type, string bufName, string fieldName, int depth, ITypeFuncVisitor typeVisitor) + { + var suffix = depth == 0 ? "" : $"_{depth}"; + return $"{{::luban::int32 n{suffix}; if(!{bufName}.readSize(n{suffix})) return false; n{suffix} = std::min(n{suffix}, (::luban::int32){bufName}.size()); {fieldName}.reserve(n{suffix} * 3 / 2);for(int i{suffix} = 0 ; i{suffix} < n{suffix} ; i{suffix}++) {{ {type.KeyType.Apply(typeVisitor)} _k{suffix}; {type.KeyType.Apply(this, bufName, $"_k{suffix}", depth + 1, typeVisitor)} {type.ValueType.Apply(typeVisitor)} _v{suffix}; {type.ValueType.Apply(this, bufName, $"_v{suffix}",depth + 1, typeVisitor)} {fieldName}[_k{suffix}] = _v{suffix};}}}}"; + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/AssemblyInfo.cs b/luban/src/Luban.DataLoader.Builtin/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.DataLoader.Builtin/DataVisitors/ExcelStreamDataCreator.cs b/luban/src/Luban.DataLoader.Builtin/DataVisitors/ExcelStreamDataCreator.cs new file mode 100644 index 00000000..0bad1725 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/DataVisitors/ExcelStreamDataCreator.cs @@ -0,0 +1,322 @@ +using Luban.DataLoader.Builtin.Excel; +using Luban.DataLoader.Builtin.Utils; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.DataLoader.Builtin.DataVisitors; + +class ExcelStreamDataCreator : ITypeFuncVisitor +{ + public static ExcelStreamDataCreator Ins { get; } = new(); + + private bool CheckNull(bool nullable, object o) + { + return nullable && (o == null || (o is string s && s == "null")); + } + + private static bool CreateBool(object x) + { + if (x is bool b) + { + return b; + } + var s = x.ToString().ToLower().Trim(); + return LoadDataUtil.ParseExcelBool(s); + } + + public DType Accept(TBool type, ExcelStream x) + { + + var d = x.Read(); + if (CheckNull(type.IsNullable, d)) + { + return null; + } + return DBool.ValueOf(CreateBool(d)); + } + + public DType Accept(TByte type, ExcelStream x) + { + var d = x.Read(); + if (CheckNull(type.IsNullable, d)) + { + return null; + } + if (!byte.TryParse(d.ToString(), out byte v)) + { + throw new InvalidExcelDataException($"{d} 不是 byte 类型值"); + } + return DByte.ValueOf(v); + } + + public DType Accept(TShort type, ExcelStream x) + { + var d = x.Read(); + if (CheckNull(type.IsNullable, d)) + { + return null; + } + if (!short.TryParse(d.ToString(), out short v)) + { + throw new InvalidExcelDataException($"{d} 不是 short 类型值"); + } + return DShort.ValueOf(v); + } + + public DType Accept(TInt type, ExcelStream x) + { + var d = x.Read(); + if (CheckNull(type.IsNullable, d)) + { + return null; + } + var ds = d.ToString(); + //if (field?.Remapper is TEnum te) + //{ + // if (te.DefineEnum.TryValueByNameOrAlias(ds, out var c)) + // { + // return DInt.ValueOf(c); + // } + //} + if (!int.TryParse(ds, out var v)) + { + throw new InvalidExcelDataException($"{d} 不是 int 类型值"); + } + return DInt.ValueOf(v); + } + + public DType Accept(TLong type, ExcelStream x) + { + var d = x.Read(); + if (CheckNull(type.IsNullable, d)) + { + return null; + } + var ds = d.ToString(); + //if (field?.Remapper is TEnum te) + //{ + // if (te.DefineEnum.TryValueByNameOrAlias(ds, out var c)) + // { + // return DLong.ValueOf(c); + // } + //} + if (!long.TryParse(ds, out var v)) + { + throw new InvalidExcelDataException($"{d} 不是 long 类型值"); + } + return DLong.ValueOf(v); + } + + public DType Accept(TFloat type, ExcelStream x) + { + var d = x.Read(); + if (CheckNull(type.IsNullable, d)) + { + return null; + } + if (!float.TryParse(d.ToString(), out var v)) + { + throw new InvalidExcelDataException($"{d} 不是 float 类型值"); + } + return DFloat.ValueOf(v); + } + + public DType Accept(TDouble type, ExcelStream x) + { + var d = x.Read(); + if (CheckNull(type.IsNullable, d)) + { + return null; + } + if (!double.TryParse(d.ToString(), out var v)) + { + throw new InvalidExcelDataException($"{d} 不是 double 类型值"); + } + return DDouble.ValueOf(v); + } + + public DType Accept(TEnum type, ExcelStream x) + { + var d = x.Read(); + if (CheckNull(type.IsNullable, d)) + { + return null; + } + if (d == null) + { + throw new InvalidExcelDataException($"枚举值不能为空"); + } + return new DEnum(type, d.ToString().Trim()); + } + + public DType Accept(TString type, ExcelStream x) + { + var d = x.Read(); + var s = SheetDataCreator.ParseString(d, type.IsNullable); + if (s == null) + { + if (type.IsNullable) + { + return null; + } + throw new InvalidExcelDataException("字段不是nullable类型,不能为null"); + } + return DString.ValueOf(type, s); + } + + public DType Accept(TDateTime type, ExcelStream x) + { + var d = x.Read(); + if (CheckNull(type.IsNullable, d)) + { + return null; + } + if (d is System.DateTime datetime) + { + return new DDateTime(datetime); + } + return DataUtil.CreateDateTime(d.ToString()); + } + + private List CreateBeanFields(DefBean bean, ExcelStream stream) + { + var list = new List(); + foreach (DefField f in bean.HierarchyFields) + { + try + { + //string sep = f.Tags.TryGetValue("tag", out var s) ? s : null; + //if (string.IsNullOrWhiteSpace(sep)) + //{ + list.Add(f.CType.Apply(this, stream)); + //} + //else + //{ + // list.Add(f.CType.Apply(this, new ExcelStream(stream.ReadCell(), sep))); + //} + } + catch (DataCreateException dce) + { + dce.Push(bean, f); + throw; + } + catch (Exception e) + { + var dce = new DataCreateException(e, stream.LastReadDataInfo); + dce.Push(bean, f); + throw dce; + } + } + return list; + } + + public DType Accept(TBean type, ExcelStream x) + { + var originBean = type.DefBean; + if (!string.IsNullOrEmpty(originBean.Sep)) + { + x = new ExcelStream(x.ReadCell(), originBean.Sep); + } + else + { + x = TrySep(type, x); + } + + if (originBean.IsAbstractType) + { + string subType = x.Read().ToString(); + if (subType.ToLower().Trim() == FieldNames.BeanNullType) + { + if (!type.IsNullable) + { + throw new InvalidExcelDataException($"type:{originBean.FullName}不是可空类型. 不能为空"); + } + return null; + } + DefBean implType = DataUtil.GetImplTypeByNameOrAlias(originBean, subType); + return new DBean(type, implType, CreateBeanFields(implType, x)); + } + else + { + if (type.IsNullable) + { + if (x.TryPeed(out object subTypeObj)) //ToString().Trim(); + { + string subType = subTypeObj.ToString().Trim(); + + if (subType == FieldNames.BeanNullType) + { + x.Read(); + return null; + } + else if (subType == FieldNames.BeanNotNullType || subType == originBean.Name) + { + x.Read(); + //throw new Exception($"type:'{originBean.FullName}' 可空标识:'{subType}' 不合法(只能为{FieldNames.BeanNotNullType}或{FieldNames.BeanNullType}或{originBean.Name})"); + } + } + } + return new DBean(type, originBean, CreateBeanFields(originBean, x)); + } + } + + private static ExcelStream TrySep(TType type, ExcelStream stream) + { + string sep = type.GetTag("sep"); + + if (!string.IsNullOrEmpty(sep) && !stream.TryReadEOF()) + { + stream = new ExcelStream(stream.ReadCell(), sep); + } + return stream; + } + + // 容器类统统不支持 type.IsNullable + // 因为貌似没意义? + public List ReadList(TType type, TType eleType, ExcelStream stream) + { + var datas = new List(); + stream = TrySep(type, stream); + while (!stream.TryReadEOF()) + { + datas.Add(eleType.Apply(this, stream)); + } + return datas; + } + + public DType Accept(TArray type, ExcelStream x) + { + return new DArray(type, ReadList(type, type.ElementType, x)); + } + + public DType Accept(TList type, ExcelStream x) + { + return new DList(type, ReadList(type, type.ElementType, x)); + } + + public DType Accept(TSet type, ExcelStream x) + { + return new DSet(type, ReadList(type, type.ElementType, x)); + } + + public DType Accept(TMap type, ExcelStream stream) + { + //x = SepIfNeed(type, x); + stream = TrySep(type, stream); + + var datas = new Dictionary(); + while (!stream.TryReadEOF()) + { + var key = type.KeyType.Apply(this, stream); + var value = type.ValueType.Apply(this, stream); + if (!datas.TryAdd(key, value)) + { + throw new InvalidExcelDataException($"map 的 key:{key} 重复"); + } + } + return new DMap(type, datas); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/DataVisitors/InvalidExcelDataException.cs b/luban/src/Luban.DataLoader.Builtin/DataVisitors/InvalidExcelDataException.cs new file mode 100644 index 00000000..d9bad008 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/DataVisitors/InvalidExcelDataException.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; + +namespace Luban.DataLoader.Builtin.DataVisitors; + +class InvalidExcelDataException : Exception +{ + public InvalidExcelDataException() + { + } + + public InvalidExcelDataException(string message) : base(message) + { + } + + public InvalidExcelDataException(string message, Exception innerException) : base(message, innerException) + { + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/DataVisitors/JsonDataCreator.cs b/luban/src/Luban.DataLoader.Builtin/DataVisitors/JsonDataCreator.cs new file mode 100644 index 00000000..644dd038 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/DataVisitors/JsonDataCreator.cs @@ -0,0 +1,193 @@ +using System.Text.Json; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.DataLoader.Builtin.DataVisitors; + +public class JsonDataCreator : ITypeFuncVisitor +{ + public static JsonDataCreator Ins { get; } = new(); + + public DType Accept(TBool type, JsonElement x, DefAssembly ass) + { + return DBool.ValueOf(x.GetBoolean()); + } + + public DType Accept(TByte type, JsonElement x, DefAssembly ass) + { + return DByte.ValueOf(x.GetByte()); + } + + public DType Accept(TShort type, JsonElement x, DefAssembly ass) + { + return DShort.ValueOf(x.GetInt16()); + } + + public DType Accept(TInt type, JsonElement x, DefAssembly ass) + { + return DInt.ValueOf(x.GetInt32()); + } + + public DType Accept(TLong type, JsonElement x, DefAssembly ass) + { + return DLong.ValueOf(x.GetInt64()); + } + + public DType Accept(TFloat type, JsonElement x, DefAssembly ass) + { + return DFloat.ValueOf(x.GetSingle()); + } + + public DType Accept(TDouble type, JsonElement x, DefAssembly ass) + { + return DDouble.ValueOf(x.GetDouble()); + } + + public DType Accept(TEnum type, JsonElement x, DefAssembly ass) + { + return new DEnum(type, x.ToString()); + } + + public DType Accept(TString type, JsonElement x, DefAssembly ass) + { + return DString.ValueOf(type, x.GetString()); + } + + private bool TryGetBeanField(JsonElement x, DefField field, out JsonElement ele) + { + if (!string.IsNullOrEmpty(field.CurrentVariantNameWithFieldName)) + { + if ( x.TryGetProperty(field.CurrentVariantNameWithFieldName, out ele)) + { + return true; + } + } + if (x.TryGetProperty(field.Name, out ele)) + { + return true; + } + if (!string.IsNullOrEmpty(field.Alias) && x.TryGetProperty(field.Alias, out ele)) + { + return true; + } + return false; + } + + public DType Accept(TBean type, JsonElement x, DefAssembly ass) + { + var bean = type.DefBean; + + DefBean implBean; + if (bean.IsAbstractType) + { + if (!x.TryGetProperty(FieldNames.JsonTypeNameKey, out var typeNameProp) && !x.TryGetProperty(FieldNames.FallbackTypeNameKey, out typeNameProp)) + { + throw new Exception($"结构:'{bean.FullName}' 是多态类型,必须用 '{FieldNames.JsonTypeNameKey}' 字段指定 子类名"); + } + string subType = typeNameProp.GetString(); + implBean = DataUtil.GetImplTypeByNameOrAlias(bean, subType); + } + else + { + implBean = bean; + } + + var fields = new List(); + foreach (DefField f in implBean.HierarchyFields) + { + if (TryGetBeanField(x, f, out var ele)) + { + if (ele.ValueKind == JsonValueKind.Null || ele.ValueKind == JsonValueKind.Undefined) + { + if (f.CType.IsNullable) + { + fields.Add(null); + } + else + { + throw new Exception($"结构:'{implBean.FullName}' 字段:'{f.Name}' 不能 null or undefined "); + } + } + else + { + try + { + fields.Add(f.CType.Apply(this, ele, ass)); + } + catch (DataCreateException dce) + { + dce.Push(bean, f); + throw; + } + catch (Exception e) + { + var dce = new DataCreateException(e, ""); + dce.Push(bean, f); + throw dce; + } + } + } + else if (f.CType.IsNullable) + { + fields.Add(null); + } + else + { + throw new Exception($"结构:'{implBean.FullName}' 字段:'{f.CurrentVariantNameWithFieldNameOrOrigin}' 缺失"); + } + } + return new DBean(type, implBean, fields); + } + + private List ReadList(TType type, JsonElement e, DefAssembly ass) + { + var list = new List(); + foreach (var c in e.EnumerateArray()) + { + list.Add(type.Apply(this, c, ass)); + } + return list; + } + + public DType Accept(TArray type, JsonElement x, DefAssembly ass) + { + return new DArray(type, ReadList(type.ElementType, x, ass)); + } + + public DType Accept(TList type, JsonElement x, DefAssembly ass) + { + return new DList(type, ReadList(type.ElementType, x, ass)); + } + + public DType Accept(TSet type, JsonElement x, DefAssembly ass) + { + return new DSet(type, ReadList(type.ElementType, x, ass)); + } + + public DType Accept(TMap type, JsonElement x, DefAssembly ass) + { + var map = new Dictionary(); + foreach (var e in x.EnumerateArray()) + { + if (e.GetArrayLength() != 2) + { + throw new ArgumentException($"json map 类型的 成员数据项:{e} 必须是 [key,value] 形式的列表"); + } + DType key = type.KeyType.Apply(this, e[0], ass); + DType value = type.ValueType.Apply(this, e[1], ass); + if (!map.TryAdd(key, value)) + { + throw new Exception($"map 的 key:{key} 重复"); + } + } + return new DMap(type, map); + } + + public DType Accept(TDateTime type, JsonElement x, DefAssembly ass) + { + return DataUtil.CreateDateTime(x.GetString()); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/DataVisitors/LuaDataCreator.cs b/luban/src/Luban.DataLoader.Builtin/DataVisitors/LuaDataCreator.cs new file mode 100644 index 00000000..18711009 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/DataVisitors/LuaDataCreator.cs @@ -0,0 +1,231 @@ +using System.Numerics; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; +using Neo.IronLua; + +namespace Luban.DataLoader.Builtin.DataVisitors; + +class LuaDataCreator : ITypeFuncVisitor +{ + public static LuaDataCreator Ins { get; } = new(); + + public DType Accept(TBool type, object x, DefAssembly ass) + { + return DBool.ValueOf((bool)x); + } + + public DType Accept(TByte type, object x, DefAssembly ass) + { + return DByte.ValueOf((byte)(int)x); + } + + public DType Accept(TShort type, object x, DefAssembly ass) + { + return DShort.ValueOf((short)(int)x); + } + + public DType Accept(TInt type, object x, DefAssembly ass) + { + return DInt.ValueOf((int)x); + } + + private long ToLong(object x) + { + return x switch + { + int a => a, + long b => b, + double c => (long)c, + float d => (long)d, + _ => throw new Exception($"{x} 不是 long 类型数据"), + }; + } + + private float ToFloat(object x) + { + return x switch + { + int a => a, + long b => b, + double c => (float)c, + float d => d, + _ => throw new Exception($"{x} 不是 float 类型数据"), + }; + } + + private double ToDouble(object x) + { + return x switch + { + int a => a, + long b => b, + double c => c, + float d => d, + _ => throw new Exception($"{x} 不是 double 类型数据"), + }; + } + + public DType Accept(TLong type, object x, DefAssembly ass) + { + return DLong.ValueOf(ToLong(x)); + } + + public DType Accept(TFloat type, object x, DefAssembly ass) + { + return DFloat.ValueOf(ToFloat(x)); + } + + public DType Accept(TDouble type, object x, DefAssembly ass) + { + return DDouble.ValueOf(ToDouble(x)); + } + + public DType Accept(TEnum type, object x, DefAssembly ass) + { + return new DEnum(type, x?.ToString()); + } + + public DType Accept(TString type, object x, DefAssembly ass) + { + if (x is string s) + { + return DString.ValueOf(type, s); + } + else + { + throw new Exception($"{x} 不是 string 类型数据"); + } + } + + private object GetBeanField(LuaTable table, DefField f) + { + object ele; + if (!string.IsNullOrEmpty(f.CurrentVariantNameWithoutFieldName)) + { + ele = table[f.CurrentVariantNameWithFieldName]; + if (ele != null) + { + return ele; + } + } + ele = table[f.Name]; + if (ele == null && !string.IsNullOrEmpty(f.Alias)) + { + ele = table[f.Alias]; + } + return ele; + } + + public DType Accept(TBean type, object x, DefAssembly ass) + { + var table = (LuaTable)x; + var bean = type.DefBean; + + DefBean implBean; + if (bean.IsAbstractType) + { + string subType; + if (table.ContainsKey(FieldNames.LuaTypeNameKey)) + { + subType = (string)(table[FieldNames.LuaTypeNameKey]); + } + else if (table.ContainsKey(FieldNames.FallbackTypeNameKey)) + { + subType = (string)table[FieldNames.FallbackTypeNameKey]; + } + else + { + throw new Exception($"结构:{bean.FullName} 是多态类型,必须用 {FieldNames.LuaTypeNameKey} 字段指定 子类名"); + } + implBean = DataUtil.GetImplTypeByNameOrAlias(bean, subType); + } + else + { + implBean = bean; + } + + var fields = new List(); + foreach (DefField f in implBean.HierarchyFields) + { + var ele = GetBeanField(table, f); + + if (ele != null) + { + try + { + // Console.WriteLine("field:{0} type:{1} value:{2}", field.Name, ele.GetType(), ele); + fields.Add(f.CType.Apply(this, ele, ass)); + } + catch (DataCreateException dce) + { + dce.Push(implBean, f); + throw; + } + catch (Exception e) + { + var dce = new DataCreateException(e, ""); + dce.Push(bean, f); + throw dce; + } + } + else if (f.CType.IsNullable) + { + fields.Add(null); + } + else + { + throw new Exception($"结构:{implBean.FullName} 字段:{f.Name} 缺失"); + } + } + return new DBean(type, implBean, fields); + } + + private List ReadList(TType type, LuaTable e, DefAssembly ass) + { + var list = new List(); + foreach (var c in e.ArrayList) + { + list.Add(type.Apply(this, c, ass)); + } + return list; + } + + public DType Accept(TArray type, object x, DefAssembly ass) + { + return new DArray(type, ReadList(type.ElementType, (LuaTable)x, ass)); + } + + public DType Accept(TList type, object x, DefAssembly ass) + { + return new DList(type, ReadList(type.ElementType, (LuaTable)x, ass)); + } + + public DType Accept(TSet type, object x, DefAssembly ass) + { + return new DSet(type, ReadList(type.ElementType, (LuaTable)x, ass)); + } + + public DType Accept(TMap type, object x, DefAssembly ass) + { + var table = (LuaTable)x; + var map = new Dictionary(); + foreach (var e in table.Values) + { + DType key = type.KeyType.Apply(this, e.Key, ass); + DType value = type.ValueType.Apply(this, e.Value, ass); + if (!map.TryAdd(key, value)) + { + throw new Exception($"map 的 key:{key} 重复"); + } + } + return new DMap(type, map); + } + + public DType Accept(TDateTime type, object x, DefAssembly ass) + { + return DataUtil.CreateDateTime(x.ToString()); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/DataVisitors/SheetDataCreator.cs b/luban/src/Luban.DataLoader.Builtin/DataVisitors/SheetDataCreator.cs new file mode 100644 index 00000000..51e4fdc0 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/DataVisitors/SheetDataCreator.cs @@ -0,0 +1,571 @@ +using Luban.DataLoader.Builtin.Excel; +using Luban.DataLoader.Builtin.Utils; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.DataLoader.Builtin.DataVisitors; + +class SheetDataCreator : ITypeFuncVisitor +{ + public static SheetDataCreator Ins { get; } = new(); + + private bool CheckNull(bool nullable, object o) + { + return nullable && (o == null || (o is string s && s == "null")); + } + + private bool CheckDefault(object o) + { + return o == null || (o is string s && s.Length == 0); + } + + private void ThrowIfNonEmpty(TitleRow row) + { + if (row.SelfTitle.NonEmpty) + { + throw new Exception($"字段不允许为空"); + } + } + + public DType Accept(TBool type, RowColumnSheet sheet, TitleRow row) + { + object x = row.Current; + if (CheckNull(type.IsNullable, x)) + { + return null; + } + if (CheckDefault(x)) + { + ThrowIfNonEmpty(row); + return DBool.ValueOf(false); + } + if (x is bool v) + { + return DBool.ValueOf(v); + } + return DBool.ValueOf(LoadDataUtil.ParseExcelBool(x.ToString())); + } + + public DType Accept(TByte type, RowColumnSheet sheet, TitleRow row) + { + object x = row.Current; + if (CheckNull(type.IsNullable, x)) + { + return null; + } + if (CheckDefault(x)) + { + return DByte.Default; + } + return DByte.ValueOf(byte.Parse(x.ToString())); + } + + public DType Accept(TShort type, RowColumnSheet sheet, TitleRow row) + { + object x = row.Current; + if (CheckNull(type.IsNullable, x)) + { + return null; + } + if (CheckDefault(x)) + { + ThrowIfNonEmpty(row); + return DShort.Default; + } + return DShort.ValueOf(short.Parse(x.ToString())); + } + public DType Accept(TInt type, RowColumnSheet sheet, TitleRow row) + { + object x = row.Current; + if (CheckNull(type.IsNullable, x)) + { + return null; + } + if (CheckDefault(x)) + { + ThrowIfNonEmpty(row); + return DInt.Default; + } + return DInt.ValueOf(int.Parse(x.ToString())); + } + + public DType Accept(TLong type, RowColumnSheet sheet, TitleRow row) + { + object x = row.Current; + if (CheckNull(type.IsNullable, x)) + { + return null; + } + if (CheckDefault(x)) + { + ThrowIfNonEmpty(row); + return DLong.Default; + } + return DLong.ValueOf(long.Parse(x.ToString())); + } + + public DType Accept(TFloat type, RowColumnSheet sheet, TitleRow row) + { + object x = row.Current; + if (CheckNull(type.IsNullable, x)) + { + return null; + } + if (CheckDefault(x)) + { + ThrowIfNonEmpty(row); + return DFloat.Default; + } + return DFloat.ValueOf(float.Parse(x.ToString())); + } + + public DType Accept(TDouble type, RowColumnSheet sheet, TitleRow row) + { + object x = row.Current; + if (CheckNull(type.IsNullable, x)) + { + return null; + } + if (CheckDefault(x)) + { + ThrowIfNonEmpty(row); + return DDouble.Default; + } + return DDouble.ValueOf(double.Parse(x.ToString())); + } + + public DType Accept(TEnum type, RowColumnSheet sheet, TitleRow row) + { + if (row.Row != null) + { + object x = row.Current; + if (CheckNull(type.IsNullable, x)) + { + return null; + } + if (CheckDefault(x)) + { + if (type.DefEnum.IsFlags || type.DefEnum.HasZeroValueItem) + { + return new DEnum(type, "0"); + } + + throw new InvalidExcelDataException($"枚举类:'{type.DefEnum.FullName}' 没有value为0的枚举项, 不支持默认值"); + } + return new DEnum(type, x.ToString()); + } + + if (row.Rows != null) + { + throw new Exception($"{type.DefEnum.FullName} 不支持多行格式"); + } + if (row.Fields != null) + { + //throw new Exception($"array 不支持 子字段. 忘记将字段设为多行模式? {row.SelfTitle.Name} => *{row.SelfTitle.Name}"); + + var items = new List(); + var sortedFields = row.Fields.Values.ToList(); + sortedFields.Sort((a, b) => a.SelfTitle.FromIndex - b.SelfTitle.FromIndex); + foreach (var field in sortedFields) + { + string itemName = field.SelfTitle.Name; + if (!type.DefEnum.TryValueByNameOrAlias(itemName, out _)) + { + throw new Exception($"列名:{itemName} 不是枚举类型'{type.DefEnum.FullName}'的有效枚举项"); + } + if (field.IsBlank) + { + continue; + } + string cur = field.Current.ToString().ToLower(); + if (cur != "0" && cur != "false") + { + items.Add(itemName); + } + } + if (items.Count == 0) + { + if (type.IsNullable) + { + return null; + } + + if (type.DefEnum.IsFlags || type.DefEnum.HasZeroValueItem) + { + return new DEnum(type, "0"); + } + + throw new InvalidExcelDataException($"枚举类:'{type.DefEnum.FullName}' 没有value为0的枚举项, 不支持默认值"); + } + return new DEnum(type, string.Join('|', items)); + } + if (row.Elements != null) + { + throw new Exception($"{type.DefEnum.FullName} 不支持多行子字段格式"); + } + throw new Exception(); + } + + + public static string ParseString(object d, bool nullable) + { + if (d == null) + { + return nullable ? null : string.Empty; + } + + string s = d is string str ? str : d.ToString(); + + if (nullable && string.IsNullOrEmpty(s)) + { + return null; + } + return DataUtil.UnEscapeRawString(s); + } + + public DType Accept(TString type, RowColumnSheet sheet, TitleRow row) + { + object x = row.Current; + if (CheckDefault(x)) + { + ThrowIfNonEmpty(row); + } + var s = ParseString(x, type.IsNullable); + if (s == null) + { + if (type.IsNullable) + { + return null; + } + throw new InvalidExcelDataException("字段不是nullable类型,不能为null"); + } + return DString.ValueOf(type, s); + } + + public DType Accept(TDateTime type, RowColumnSheet sheet, TitleRow row) + { + var d = row.Current; + if (CheckNull(type.IsNullable, d)) + { + return null; + } + if (d is System.DateTime datetime) + { + return new DDateTime(datetime); + } + return DataUtil.CreateDateTime(d.ToString()); + } + + private bool TryGetBeanField(TitleRow row, DefField field, out TitleRow ele) + { + if (!string.IsNullOrEmpty(field.CurrentVariantNameWithFieldName)) + { + ele = row.GetSubTitleNamedRow(field.CurrentVariantNameWithFieldName); + if (ele != null) + { + return true; + } + } + ele = row.GetSubTitleNamedRow(field.Name); + if (ele != null) + { + return true; + } + if (!string.IsNullOrEmpty(field.Alias)) + { + ele = row.GetSubTitleNamedRow(field.Alias); + return ele != null; + } + return false; + } + + private List CreateBeanFields(DefBean bean, RowColumnSheet sheet, TitleRow row) + { + var list = new List(); + foreach (DefField f in bean.HierarchyFields) + + { + string fname = f.Name; + if (!TryGetBeanField(row, f, out var field)) + { + throw new Exception($"bean:'{bean.FullName}' 缺失 列:'{fname}',请检查是否写错或者遗漏"); + } + try + { + list.Add(f.CType.Apply(this, sheet, field)); + } + catch (DataCreateException dce) + { + dce.Push(bean, f); + throw; + } + catch (Exception e) + { + var dce = new DataCreateException(e, $"Sheet:{sheet.SheetName} 字段:{fname} 位置:{field.Location}"); + dce.Push(bean, f); + throw dce; + } + } + return list; + } + + public DType Accept(TBean type, RowColumnSheet sheet, TitleRow row) + { + string sep = row.SelfTitle.Sep;// type.GetBeanAs().Sep; + if (row.Row != null) + { + var s = row.AsStream(sep); + if (type.IsNullable && s.TryReadEOF()) + { + return null; + } + return type.Apply(ExcelStreamDataCreator.Ins, s); + } + + if (row.Rows != null) + { + var s = row.AsMultiRowConcatStream(sep); + if (type.IsNullable && s.TryReadEOF()) + { + return null; + } + return type.Apply(ExcelStreamDataCreator.Ins, s); + } + if (row.Fields != null) + { + sep += type.DefBean.Sep; + var originBean = type.DefBean; + if (originBean.IsAbstractType) + { + TitleRow typeTitle = row.GetSubTitleNamedRow(FieldNames.ExcelTypeNameKey) ?? row.GetSubTitleNamedRow(FieldNames.FallbackTypeNameKey); + if (typeTitle == null) + { + throw new Exception($"type:'{originBean.FullName}' 是多态类型,需要定义'{FieldNames.ExcelTypeNameKey}'列来指定具体子类型"); + } + TitleRow valueTitle = row.GetSubTitleNamedRow(FieldNames.ExcelValueNameKey); + sep += type.GetTag("sep"); + string subType = typeTitle.Current?.ToString()?.Trim(); + if (subType == null || subType == FieldNames.BeanNullType) + { + if (!type.IsNullable) + { + throw new Exception($"type:'{originBean.FullName}' 不是可空类型 '{type.DefBean.FullName}?' , 不能为空"); + } + return null; + } + DefBean implType = DataUtil.GetImplTypeByNameOrAlias(originBean, subType); + if (valueTitle == null) + { + return new DBean(type, implType, CreateBeanFields(implType, sheet, row)); + } + + sep += valueTitle.SelfTitle.Sep; + if (valueTitle.Row != null) + { + var s = valueTitle.AsStream(sep); + if (type.IsNullable && s.TryReadEOF()) + { + return null; + } + return new DBean(type, implType, CreateBeanFields(implType, s)); + } + + if (valueTitle.Rows != null) + { + var s = valueTitle.AsMultiRowConcatStream(sep); + if (type.IsNullable && s.TryReadEOF()) + { + return null; + } + return new DBean(type, implType, CreateBeanFields(implType, s)); + } + throw new Exception(); + } + + if (type.IsNullable) + { + TitleRow typeTitle = row.GetSubTitleNamedRow(FieldNames.ExcelTypeNameKey) ?? row.GetSubTitleNamedRow(FieldNames.FallbackTypeNameKey); + if (typeTitle == null) + { + throw new Exception($"type:'{originBean.FullName}' 是可空类型,需要定义'{FieldNames.ExcelTypeNameKey}'列来指明是否可空"); + } + string subType = typeTitle.Current?.ToString()?.Trim(); + if (subType == null || subType == FieldNames.BeanNullType) + { + return null; + } + + if (subType != FieldNames.BeanNotNullType && subType != originBean.Name) + { + throw new Exception($"type:'{originBean.FullName}' 可空标识:'{subType}' 不合法(只能为'{FieldNames.BeanNullType}'或'{FieldNames.BeanNotNullType}'或'{originBean.Name}')"); + } + } + + return new DBean(type, originBean, CreateBeanFields(originBean, sheet, row)); + } + if (row.Elements != null) + { + var s = row.AsMultiRowConcatElements(sep); + return type.Apply(ExcelStreamDataCreator.Ins, s); + } + throw new Exception(); + } + + private static List ReadList(TType type, IEnumerable streams) + { + var datas = new List(); + foreach (var stream in streams) + { + while (!stream.TryReadEOF()) + { + datas.Add(type.Apply(ExcelStreamDataCreator.Ins, stream)); + } + } + return datas; + } + + private List ReadCollectionDatas(TType type, TType elementType, RowColumnSheet sheet, TitleRow row) + { + if (row.Row != null) + { + var s = row.AsStream(row.SelfTitle.Sep); + return ExcelStreamDataCreator.Ins.ReadList(type, elementType, s); + } + if (row.Rows != null) + { + var s = row.AsMultiRowStream(row.SelfTitle.Sep); + return ReadList(elementType, s); + } + if (row.Fields != null) + { + //throw new Exception($"array 不支持 子字段. 忘记将字段设为多行模式? {row.SelfTitle.Name} => *{row.SelfTitle.Name}"); + + var datas = new List(row.Fields.Count); + var sortedFields = row.Fields.Values.ToList(); + sortedFields.Sort((a, b) => a.SelfTitle.FromIndex - b.SelfTitle.FromIndex); + foreach (var field in sortedFields) + { + if (field.IsBlank) + { + continue; + } + datas.Add(elementType.Apply(this, sheet, field)); + } + return datas; + } + if (row.Elements != null) + { + return row.Elements.Select(e => elementType.Apply(this, sheet, e)).ToList(); + } + throw new Exception(); + } + + public DType Accept(TArray type, RowColumnSheet sheet, TitleRow row) + { + //string sep = DataUtil.GetSep(type); + return new DArray(type, ReadCollectionDatas(type, type.ElementType, sheet, row)); + } + + public DType Accept(TList type, RowColumnSheet sheet, TitleRow row) + { + return new DList(type, ReadCollectionDatas(type, type.ElementType, sheet, row)); + } + + public DType Accept(TSet type, RowColumnSheet sheet, TitleRow row) + { + return new DSet(type, ReadCollectionDatas(type, type.ElementType, sheet, row)); + } + + public DType Accept(TMap type, RowColumnSheet sheet, TitleRow row) + { + string sep = row.SelfTitle.Sep; + + if (row.Row != null) + { + var s = row.AsStream(sep); + return type.Apply(ExcelStreamDataCreator.Ins, s); + } + + if (row.Rows != null) + { + throw new Exception($"map在非多行模式下不支持多行填写,是否忘记将字段设为多行模式? {row.SelfTitle.Name} => *{row.SelfTitle.Name}"); + } + if (row.Fields != null) + { + var datas = new Dictionary(); + foreach (var e in row.Fields) + { + var keyData = type.KeyType.Apply(StringDataCreator.Ins, e.Key); + if (e.Value.Row != null) + { + if (RowColumnSheet.IsBlankRow(e.Value.Row, e.Value.SelfTitle.FromIndex, e.Value.SelfTitle.ToIndex)) + { + continue; + } + var valueData = type.ValueType.Apply(ExcelStreamDataCreator.Ins, e.Value.AsStream("")); + datas.Add(keyData, valueData); + } + else + { + var valueData = type.ValueType.Apply(this, sheet, e.Value); + datas.Add(keyData, valueData); + } + } + return new DMap(type, datas); + } + if (row.Elements != null) + { + var datas = new Dictionary(); + foreach (var e in row.Elements) + { + if (e.SelfTitle.SubTitleList.Count > 0) + { + TitleRow keyTitle = e.GetSubTitleNamedRow(FieldNames.ExcelMapKey); + if (keyTitle == null) + { + throw new Exception($"多行模式下map需要定义'{FieldNames.ExcelMapKey}'列来指明key"); + } + var keyData = type.KeyType.Apply(this, sheet, keyTitle); + var valueData = type.ValueType.Apply(this, sheet, e); + datas.Add(keyData, valueData); + } + else + { + var stream = e.AsStream(sep); + var keyData = type.KeyType.Apply(ExcelStreamDataCreator.Ins, stream); + var valueData = type.ValueType.Apply(ExcelStreamDataCreator.Ins, stream); + datas.Add(keyData, valueData); + } + } + return new DMap(type, datas); + } + throw new Exception(); + } + + private List CreateBeanFields(DefBean bean, ExcelStream stream) + { + var list = new List(); + foreach (DefField f in bean.HierarchyFields) + { + try + { + list.Add(f.CType.Apply(ExcelStreamDataCreator.Ins, stream)); + } + catch (DataCreateException dce) + { + dce.Push(bean, f); + throw; + } + catch (Exception e) + { + var dce = new DataCreateException(e, stream.LastReadDataInfo); + dce.Push(bean, f); + throw dce; + } + } + return list; + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/DataVisitors/StringDataCreator.cs b/luban/src/Luban.DataLoader.Builtin/DataVisitors/StringDataCreator.cs new file mode 100644 index 00000000..a3ef9a64 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/DataVisitors/StringDataCreator.cs @@ -0,0 +1,134 @@ +using Luban.Datas; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.DataLoader.Builtin.DataVisitors; + +class StringDataCreator : ITypeFuncVisitor +{ + public static StringDataCreator Ins { get; } = new(); + + public DType Accept(TBool type, string x) + { + if (bool.TryParse(x, out var b)) + { + return DBool.ValueOf(b); + } + else + { + throw new Exception($"{x} 不是bool类型"); + } + } + + public DType Accept(TByte type, string x) + { + if (byte.TryParse(x, out var b)) + { + return DByte.ValueOf(b); + } + else + { + throw new Exception($"{x} 不是byte类型"); + } + } + + public DType Accept(TShort type, string x) + { + if (short.TryParse(x, out var b)) + { + return DShort.ValueOf(b); + } + else + { + throw new Exception($"{x} 不是short类型"); + } + } + + public DType Accept(TInt type, string x) + { + if (int.TryParse(x, out var b)) + { + return DInt.ValueOf(b); + } + else + { + throw new Exception($"{x} 不是int类型"); + } + } + + public DType Accept(TLong type, string x) + { + if (long.TryParse(x, out var b)) + { + return DLong.ValueOf(b); + } + else + { + throw new Exception($"{x} 不是long类型"); + } + } + + public DType Accept(TFloat type, string x) + { + if (float.TryParse(x, out var b)) + { + return DFloat.ValueOf(b); + } + else + { + throw new Exception($"{x} 不是float类型"); + } + } + + public DType Accept(TDouble type, string x) + { + if (double.TryParse(x, out var b)) + { + return DDouble.ValueOf(b); + } + else + { + throw new Exception($"{x} 不是double类型"); + } + } + + public DType Accept(TEnum type, string x) + { + return new DEnum(type, x); + } + + public DType Accept(TString type, string x) + { + return DString.ValueOf(type, x); + } + + public DType Accept(TBean type, string x) + { + throw new NotSupportedException(); + } + + public DType Accept(TArray type, string x) + { + throw new NotSupportedException(); + } + + public DType Accept(TList type, string x) + { + throw new NotSupportedException(); + } + + public DType Accept(TSet type, string x) + { + throw new NotSupportedException(); + } + + public DType Accept(TMap type, string x) + { + throw new NotSupportedException(); + } + + public DType Accept(TDateTime type, string x) + { + throw new NotSupportedException(); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/DataVisitors/UnityAssetDataCreator.cs b/luban/src/Luban.DataLoader.Builtin/DataVisitors/UnityAssetDataCreator.cs new file mode 100644 index 00000000..f75da067 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/DataVisitors/UnityAssetDataCreator.cs @@ -0,0 +1,6 @@ +namespace Luban.DataLoader.Builtin.DataVisitors; + +class UnityAssetDataCreator : YamlDataCreator +{ + public new static UnityAssetDataCreator Ins = new(); +} diff --git a/luban/src/Luban.DataLoader.Builtin/DataVisitors/XmlDataCreator.cs b/luban/src/Luban.DataLoader.Builtin/DataVisitors/XmlDataCreator.cs new file mode 100644 index 00000000..0c7339df --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/DataVisitors/XmlDataCreator.cs @@ -0,0 +1,183 @@ +using System.Xml.Linq; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.DataLoader.Builtin.DataVisitors; + +class XmlDataCreator : ITypeFuncVisitor +{ + public static XmlDataCreator Ins { get; } = new(); + + public DType Accept(TBool type, XElement x, DefAssembly ass) + { + return DBool.ValueOf(bool.Parse(x.Value.Trim().ToLower())); + } + + public DType Accept(TByte type, XElement x, DefAssembly ass) + { + return DByte.ValueOf(byte.Parse(x.Value.Trim())); + } + + public DType Accept(TShort type, XElement x, DefAssembly ass) + { + return DShort.ValueOf(short.Parse(x.Value.Trim())); + } + + public DType Accept(TInt type, XElement x, DefAssembly ass) + { + return DInt.ValueOf(int.Parse(x.Value.Trim())); + } + + public DType Accept(TLong type, XElement x, DefAssembly ass) + { + return DLong.ValueOf(long.Parse(x.Value.Trim())); + } + + public DType Accept(TFloat type, XElement x, DefAssembly ass) + { + return DFloat.ValueOf(float.Parse(x.Value.Trim())); + } + + public DType Accept(TDouble type, XElement x, DefAssembly ass) + { + return DDouble.ValueOf(double.Parse(x.Value.Trim())); + } + + public DType Accept(TEnum type, XElement x, DefAssembly ass) + { + return new DEnum(type, x.Value.Trim()); + } + + public DType Accept(TString type, XElement x, DefAssembly ass) + { + return DString.ValueOf(type, x.Value); + } + + private XElement GetBeanField(XElement x, DefField f) + { + var eles = x.Elements(f.Name); + var ele = string.IsNullOrEmpty(f.CurrentVariantNameWithoutFieldName) ? eles.FirstOrDefault() : eles.FirstOrDefault(e => + { + var v = e.Attribute("variant"); + return v != null && v.Value == f.CurrentVariantNameWithoutFieldName; + }); + if (ele != null) + { + return ele; + } + if (!string.IsNullOrEmpty(f.Alias)) + { + eles = x.Elements(f.Alias); + return string.IsNullOrEmpty(f.CurrentVariantNameWithoutFieldName) ? eles.FirstOrDefault() : eles.FirstOrDefault(e => + { + var v = e.Attribute("variant"); + return v != null && v.Value == f.CurrentVariantNameWithoutFieldName; + }); + } + return null; + } + + public DType Accept(TBean type, XElement x, DefAssembly ass) + { + var bean = type.DefBean; + + DefBean implBean; + if (bean.IsAbstractType) + { + string subType = x.Attribute(FieldNames.XmlTypeNameKey)?.Value; + if (string.IsNullOrEmpty(subType)) + { + subType = x.Attribute(FieldNames.FallbackTypeNameKey)?.Value; + } + if (string.IsNullOrWhiteSpace(subType)) + { + throw new Exception($"bean:'{bean.FullName}'是多态,需要指定{FieldNames.XmlTypeNameKey}属性.\n xml:{x}"); + } + implBean = DataUtil.GetImplTypeByNameOrAlias(bean, subType); + } + else + { + implBean = bean; + } + + var fields = new List(); + foreach (DefField f in implBean.HierarchyFields) + { + XElement fele = GetBeanField(x, f); + if (fele == null) + { + if (f.CType.IsNullable) + { + fields.Add(null); + continue; + } + throw new Exception($"字段:{f.Name} 缺失"); + } + try + { + fields.Add(f.CType.Apply(this, fele, ass)); + } + catch (DataCreateException dce) + { + dce.Push(implBean, f); + throw; + } + catch (Exception e) + { + var dce = new DataCreateException(e, ""); + dce.Push(bean, f); + throw dce; + } + + } + return new DBean(type, implBean, fields); + } + + private List ReadList(TType type, XElement x, DefAssembly ass) + { + var list = new List(); + foreach (var e in x.Elements()) + { + list.Add(type.Apply(this, e, ass)); + } + return list; + } + + public DType Accept(TArray type, XElement x, DefAssembly ass) + { + return new DArray(type, ReadList(type.ElementType, x, ass)); + } + + public DType Accept(TList type, XElement x, DefAssembly ass) + { + return new DList(type, ReadList(type.ElementType, x, ass)); + } + + public DType Accept(TSet type, XElement x, DefAssembly ass) + { + return new DSet(type, ReadList(type.ElementType, x, ass)); + } + + public DType Accept(TMap type, XElement x, DefAssembly ass) + { + var map = new Dictionary(); + foreach (var e in x.Elements()) + { + DType key = type.KeyType.Apply(this, e.Element("key"), ass); + DType value = type.ValueType.Apply(this, e.Element("value"), ass); + if (!map.TryAdd(key, value)) + { + throw new Exception($"map 的 key:{key} 重复"); + } + } + return new DMap(type, map); + } + + public DType Accept(TDateTime type, XElement x, DefAssembly ass) + { + return DataUtil.CreateDateTime(x.Value); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/DataVisitors/YamlDataCreator.cs b/luban/src/Luban.DataLoader.Builtin/DataVisitors/YamlDataCreator.cs new file mode 100644 index 00000000..d339afaf --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/DataVisitors/YamlDataCreator.cs @@ -0,0 +1,198 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; +using YamlDotNet.RepresentationModel; + +namespace Luban.DataLoader.Builtin.DataVisitors; + +class YamlDataCreator : ITypeFuncVisitor +{ + public static YamlDataCreator Ins { get; } = new(); + + private static string GetLowerTextValue(YamlNode node) + { + return ((string)node).Trim().ToLower(); + } + + private static string GetTextValue(YamlNode node) + { + return node.ToString(); + } + + public DType Accept(TBool type, YamlNode x, DefAssembly y) + { + return DBool.ValueOf(DataUtil.ParseBool(GetLowerTextValue(x))); + } + + public DType Accept(TByte type, YamlNode x, DefAssembly y) + { + return DByte.ValueOf(byte.Parse(GetLowerTextValue(x))); + } + + public DType Accept(TShort type, YamlNode x, DefAssembly y) + { + return DShort.ValueOf(short.Parse(GetLowerTextValue(x))); + } + + public DType Accept(TInt type, YamlNode x, DefAssembly y) + { + return DInt.ValueOf(int.Parse(GetLowerTextValue(x))); + } + + public DType Accept(TLong type, YamlNode x, DefAssembly y) + { + return DLong.ValueOf(long.Parse(GetLowerTextValue(x))); + } + + public DType Accept(TFloat type, YamlNode x, DefAssembly y) + { + return DFloat.ValueOf(float.Parse(GetLowerTextValue(x))); + } + + public DType Accept(TDouble type, YamlNode x, DefAssembly y) + { + return DDouble.ValueOf(double.Parse(GetLowerTextValue(x))); + } + + public DType Accept(TEnum type, YamlNode x, DefAssembly y) + { + return new DEnum(type, GetTextValue(x)); + } + + public DType Accept(TString type, YamlNode x, DefAssembly y) + { + return DString.ValueOf(type, GetTextValue(x)); + } + + private static readonly YamlScalarNode s_typeNodeName = new(FieldNames.JsonTypeNameKey); + private static readonly YamlScalarNode s_typeNodeNameFallback = new(FieldNames.FallbackTypeNameKey); + + private bool TryGetBeanField(YamlMappingNode x, DefField field, out YamlNode ele) + { + if (!string.IsNullOrEmpty(field.CurrentVariantNameWithFieldName)) + { + if (x.Children.TryGetValue(new YamlScalarNode(field.CurrentVariantNameWithFieldName), out ele)) + { + return true; + } + } + if (x.Children.TryGetValue(new YamlScalarNode(field.Name), out ele)) + { + return true; + } + if (!string.IsNullOrEmpty(field.Alias) && x.Children.TryGetValue(new YamlScalarNode(field.Alias), out ele)) + { + return true; + } + return false; + } + + public DType Accept(TBean type, YamlNode x, DefAssembly y) + { + var m = (YamlMappingNode)x; + var bean = type.DefBean; + + DefBean implBean; + if (bean.IsAbstractType) + { + if (!m.Children.TryGetValue(s_typeNodeName, out var typeNode) && !m.Children.TryGetValue(s_typeNodeNameFallback, out typeNode)) + { + throw new Exception($"bean:'{bean.FullName}'是多态,需要指定{FieldNames.JsonTypeNameKey}属性.\n xml:{x}"); + } + string subType = (string)typeNode; + if (string.IsNullOrWhiteSpace(subType)) + { + throw new Exception($"bean:'{bean.FullName}'是多态,需要指定{FieldNames.JsonTypeNameKey}属性.\n xml:{x}"); + } + implBean = DataUtil.GetImplTypeByNameOrAlias(bean, subType); + } + else + { + implBean = bean; + } + + var fields = new List(); + foreach (DefField f in implBean.HierarchyFields) + { + if (!TryGetBeanField(m, f, out var fele)) + { + if (f.CType.IsNullable) + { + fields.Add(null); + continue; + } + throw new Exception($"bean:{implBean.FullName} 字段:{f.Name} 缺失"); + } + try + { + fields.Add(f.CType.Apply(this, fele, y)); + } + catch (DataCreateException dce) + { + dce.Push(implBean, f); + throw; + } + catch (Exception e) + { + var dce = new DataCreateException(e, ""); + dce.Push(bean, f); + throw dce; + } + + } + return new DBean(type, implBean, fields); + } + + private List ReadList(TType type, YamlSequenceNode x, DefAssembly ass) + { + var list = new List(); + foreach (var e in x) + { + list.Add(type.Apply(this, e, ass)); + } + return list; + } + + public DType Accept(TArray type, YamlNode x, DefAssembly y) + { + return new DArray(type, ReadList(type.ElementType, (YamlSequenceNode)x, y)); + } + + public DType Accept(TList type, YamlNode x, DefAssembly y) + { + return new DList(type, ReadList(type.ElementType, (YamlSequenceNode)x, y)); + } + + public DType Accept(TSet type, YamlNode x, DefAssembly y) + { + return new DSet(type, ReadList(type.ElementType, (YamlSequenceNode)x, y)); + } + + public DType Accept(TMap type, YamlNode x, DefAssembly y) + { + var m = (YamlSequenceNode)x; + var map = new Dictionary(); + foreach (var e in m) + { + var kv = (YamlSequenceNode)e; + if (kv.Count() != 2) + { + throw new ArgumentException($"yaml map 类型的 成员数据项:{e} 必须是 [key,value] 形式的列表"); + } + DType key = type.KeyType.Apply(this, kv[0], y); + DType value = type.ValueType.Apply(this, kv[1], y); + if (!map.TryAdd(key, value)) + { + throw new Exception($"map 的 key:{key} 重复"); + } + } + return new DMap(type, map); + } + + public DType Accept(TDateTime type, YamlNode x, DefAssembly y) + { + return DataUtil.CreateDateTime(GetLowerTextValue(x)); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/Cell.cs b/luban/src/Luban.DataLoader.Builtin/Excel/Cell.cs new file mode 100644 index 00000000..e54c8b9f --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/Cell.cs @@ -0,0 +1,29 @@ +namespace Luban.DataLoader.Builtin.Excel; + +public struct Cell +{ + public Cell(int row, int column, object value) + { + this.Row = row; + this.Column = column; + this.Value = value; + } + public int Row { get; } // 从 1 开始 + + public int Column { get; } // 从 0 开始,考虑改了它? + + public object Value { get; } + + + private static string ToAlphaString(int column) + { + int h = column / 26; + int n = column % 26; + return $"{(h > 0 ? ((char)('A' + h - 1)).ToString() : "")}{(char)('A' + n)}"; + } + + public override string ToString() + { + return $"[{ToAlphaString(Column)}:{Row + 1}] {Value}"; + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/ExcelRowColumnDataSource.cs b/luban/src/Luban.DataLoader.Builtin/Excel/ExcelRowColumnDataSource.cs new file mode 100644 index 00000000..06147583 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/ExcelRowColumnDataSource.cs @@ -0,0 +1,97 @@ +using Luban.DataLoader.Builtin.DataVisitors; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; + +namespace Luban.DataLoader.Builtin.Excel; + +[DataLoader("xls")] +[DataLoader("xlsx")] +[DataLoader("xlsm")] +[DataLoader("xlm")] +[DataLoader("csv")] +public class ExcelRowColumnDataSource : DataLoaderBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private readonly List _sheets = new(); + + + public override void Load(string rawUrl, string sheetName, Stream stream) + { + s_logger.Trace("{} {}", rawUrl, sheetName); + RawUrl = rawUrl; + + foreach (RawSheet rawSheet in SheetLoadUtil.LoadRawSheets(rawUrl, sheetName, stream)) + { + var sheet = new RowColumnSheet(rawUrl, sheetName, rawSheet.SheetName); + sheet.Load(rawSheet); + _sheets.Add(sheet); + } + + if (_sheets.Count == 0) + { + if (!string.IsNullOrWhiteSpace(sheetName)) + { + throw new Exception($"excel:‘{rawUrl}’ sheet:‘{sheetName}’ 不存在或者不是有效的单元簿(有效单元薄的A0单元格必须是##)"); + } + else + { + throw new Exception($"excel: ‘{rawUrl}’ 不包含有效的单元薄(有效单元薄的A0单元格必须是##)."); + } + } + } + + public void Load(params RawSheet[] rawSheets) + { + foreach (RawSheet rawSheet in rawSheets) + { + var sheet = new RowColumnSheet("__intern__", rawSheet.TableName, rawSheet.SheetName); + sheet.Load(rawSheet); + _sheets.Add(sheet); + } + } + + public RawSheetTableDefInfo LoadTableDefInfo(string rawUrl, string sheetName, Stream stream) + { + return SheetLoadUtil.LoadSheetTableDefInfo(rawUrl, sheetName, stream); + } + + public override List ReadMulti(TBean type) + { + var datas = new List(); + foreach (var sheet in _sheets) + { + try + { + foreach (var r in sheet.GetRows()) + { + TitleRow row = r.Row; + string tagStr = r.Tag; + if (DataUtil.IsIgnoreTag(tagStr)) + { + continue; + } + var data = (DBean)type.Apply(SheetDataCreator.Ins, sheet, row); + datas.Add(new Record(data, sheet.UrlWithParams, DataUtil.ParseTags(tagStr))); + } + } + catch (DataCreateException dce) + { + dce.OriginDataLocation = sheet.UrlWithParams; + throw; + } + catch (Exception e) + { + throw new Exception($"sheet:{sheet.Name}", e); + } + } + return datas; + } + + public override Record ReadOne(TBean type) + { + throw new Exception($"excel不支持单例读取模式"); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/ExcelStream.cs b/luban/src/Luban.DataLoader.Builtin/Excel/ExcelStream.cs new file mode 100644 index 00000000..d2a9f399 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/ExcelStream.cs @@ -0,0 +1,308 @@ +using System.Text; +using Luban.DataLoader.Builtin.Utils; + +namespace Luban.DataLoader.Builtin.Excel; + +class ExcelStream +{ + + private readonly List _datas; + private readonly int _toIndex; + private int _curIndex; + + private readonly string _overrideDefault; + + public ExcelStream(List datas, int fromIndex, int toIndex, string sep, string overrideDefault) + { + _overrideDefault = overrideDefault; + if (string.IsNullOrWhiteSpace(sep)) + { + if (string.IsNullOrEmpty(overrideDefault)) + { + this._datas = datas; + this._toIndex = toIndex; + this._curIndex = fromIndex; + } + else + { + this._datas = new List(); + for (int i = fromIndex; i <= toIndex; i++) + { + var cell = datas[i]; + object d = cell.Value; + if (!IsSkip(d)) + { + this._datas.Add(cell); + } + else + { + this._datas.Add(new Cell(cell.Row, cell.Column, _overrideDefault)); + } + } + this._curIndex = 0; + this._toIndex = this._datas.Count - 1; + } + + } + else + { + this._datas = new List(); + for (int i = fromIndex; i <= toIndex; i++) + { + var cell = datas[i]; + object d = cell.Value; + if (!IsSkip(d)) + { + if (d is string s) + { + this._datas.AddRange(LoadDataUtil.SplitStringByAnySepChar(s, sep).Select(x => new Cell(cell.Row, cell.Column, x))); + } + else + { + this._datas.Add(cell); + } + } + else if (!string.IsNullOrEmpty(_overrideDefault)) + { + this._datas.Add(new Cell(cell.Row, cell.Column, _overrideDefault)); + } + } + this._curIndex = 0; + this._toIndex = this._datas.Count - 1; + } + } + + public ExcelStream(Cell cell, string sep) + { + if (string.IsNullOrWhiteSpace(sep)) + { + this._datas = new List { cell }; + this._toIndex = 0; + this._curIndex = 0; + } + else + { + this._datas = new List(); + object d = cell.Value; + if (!IsSkip(d)) + { + if (d is string s) + { + this._datas.AddRange(LoadDataUtil.SplitStringByAnySepChar(s, sep).Where(x => !IsSkip(x)).Select(x => new Cell(cell.Row, cell.Column, x))); + } + else + { + this._datas.Add(cell); + } + } + this._curIndex = 0; + this._toIndex = this._datas.Count - 1; + } + } + + public ExcelStream(List> rows, int fromIndex, int toIndex, string sep, string overrideDefault) + { + _overrideDefault = overrideDefault; + this._datas = new List(); + if (string.IsNullOrWhiteSpace(sep)) + { + if (string.IsNullOrEmpty(overrideDefault)) + { + foreach (var row in rows) + { + for (int i = fromIndex; i <= toIndex; i++) + { + this._datas.Add(row[i]); + } + } + } + else + { + throw new NotSupportedException("concated multi rows don't support 'default' "); + } + + } + else + { + foreach (var row in rows) + { + for (int i = fromIndex; i <= toIndex; i++) + { + var cell = row[i]; + object d = cell.Value; + if (!IsSkip(d)) + { + if (d is string s) + { + this._datas.AddRange(LoadDataUtil.SplitStringByAnySepChar(s, sep).Select(x => new Cell(cell.Row, cell.Column, x))); + } + else + { + this._datas.Add(cell); + } + } + else if (!string.IsNullOrEmpty(_overrideDefault)) + { + this._datas.Add(new Cell(cell.Row, cell.Column, _overrideDefault)); + } + } + } + } + this._curIndex = 0; + this._toIndex = this._datas.Count - 1; + } + + public string First => _datas[_curIndex].Value?.ToString(); + + public string LastReadDataInfo => _datas[Math.Min(LastReadIndex, _datas.Count - 1)].ToString(); + + private int LastReadIndex { get; set; } + + public int IncludeNullAndEmptySize => _toIndex - _curIndex + 1; + + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append('['); + for (int i = _curIndex; i <= _toIndex; i++) + { + sb.Append(_datas[i].Value); + sb.Append(','); + } + sb.Append(']'); + + return sb.ToString(); + } + + public bool TryRead(out object data) + { + data = null; + while (_curIndex <= _toIndex) + { + data = _datas[_curIndex++].Value; + if (!IsSkip(data)) + { + LastReadIndex = _curIndex - 1; + return true; + } + } + LastReadIndex = _curIndex - 1; + return false; + } + + public bool TryPeed(out object data) + { + int oldCurIndex = _curIndex; + if (TryRead(out data)) + { + _curIndex = oldCurIndex; + return true; + } + return false; + } + + public object Read(bool notSkip = false) + { + //if (curIndex <= toIndex) + //{ + // return datas[curIndex++].Value; + //} + //else + //{ + // throw new Exception($"cell:{datas[curIndex - 1]} 无法读取到足够多的数据"); + //} + return notSkip ? ReadMayNull() : ReadSkipNull(); + } + + private object ReadMayNull() + { + return _curIndex <= _toIndex ? _datas[LastReadIndex = _curIndex++].Value : null; + } + + //public object Read(bool nullable) + //{ + // return nullable ? Read() : ReadSkipNull(); + //} + + public Cell ReadCell() + { + while (_curIndex <= _toIndex) + { + var data = _datas[_curIndex++]; + if (!IsSkip(data.Value)) + { + LastReadIndex = _curIndex - 1; + return data; + } + } + LastReadIndex = _curIndex - 1; + throw new Exception($"cell:{_datas[_curIndex - 1]} 缺少数据"); + } + + public object ReadSkipNull() + { + while (_curIndex <= _toIndex) + { + var data = _datas[_curIndex++]; + if (!IsSkip(data.Value)) + { + LastReadIndex = _curIndex - 1; + return data.Value; + } + } + LastReadIndex = _curIndex - 1; + throw new Exception($"cell:{_datas[_curIndex - 1]} 缺少数据"); + } + + + public const string END_OF_LIST = "}"; + + + private bool IsSkip(object x) + { + return x == null || (x is string s && string.IsNullOrEmpty(s)); + } + + public bool TryReadEOF() + { + int oldIndex = _curIndex; + while (_curIndex <= _toIndex) + { + var value = _datas[_curIndex++].Value; + if (!IsSkip(value)) + { + if (value is string s && s == END_OF_LIST) + { + LastReadIndex = _curIndex - 1; + return true; + } + else + { + _curIndex = oldIndex; + return false; + } + } + + } + _curIndex = oldIndex; + return true; + } + + internal ExcelStream CreateAutoSepStream(string simpleContainerSep) + { + int startIndex = _curIndex; + while (_curIndex <= _toIndex) + { + var value = _datas[_curIndex++].Value; + if (!IsSkip(value)) + { + if (value is string s && s == END_OF_LIST) + { + break; + } + } + } + LastReadIndex = _curIndex - 1; + return new ExcelStream(_datas, startIndex, LastReadIndex, simpleContainerSep, ""); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/RawSheet.cs b/luban/src/Luban.DataLoader.Builtin/Excel/RawSheet.cs new file mode 100644 index 00000000..eca025b4 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/RawSheet.cs @@ -0,0 +1,12 @@ +namespace Luban.DataLoader.Builtin.Excel; + +public class RawSheet +{ + public Title Title { get; set; } + + public string TableName { get; set; } + + public string SheetName { get; set; } + + public List> Cells { get; set; } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/RawSheetTableDefInfo.cs b/luban/src/Luban.DataLoader.Builtin/Excel/RawSheetTableDefInfo.cs new file mode 100644 index 00000000..e8afe5cd --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/RawSheetTableDefInfo.cs @@ -0,0 +1,18 @@ +namespace Luban.DataLoader.Builtin.Excel; + +public class FieldInfo +{ + public string Name { get; set; } + + public Dictionary Tags { get; set; } + + public string Type { get; set; } + + public string Desc { get; set; } + public string Groups { get; set; } +} + +public class RawSheetTableDefInfo +{ + public Dictionary FieldInfos { get; set; } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/RowColumnSheet.cs b/luban/src/Luban.DataLoader.Builtin/Excel/RowColumnSheet.cs new file mode 100644 index 00000000..bfa6874c --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/RowColumnSheet.cs @@ -0,0 +1,205 @@ +namespace Luban.DataLoader.Builtin.Excel; + +class RowColumnSheet +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public string Name { get; } + + public string UrlWithoutParams { get; } + + public string UrlWithParams => string.IsNullOrEmpty(SheetName) ? UrlWithoutParams : $"{SheetName}@{UrlWithoutParams}"; + + public string SheetName { get; } + + public List<(string Tag, TitleRow Row)> Rows { get; } = new(); + + public RowColumnSheet(string rawUrl, string name, string sheetName) + { + this.UrlWithoutParams = rawUrl; + this.Name = name; + this.SheetName =sheetName; + } + + private string GetRowTag(List row) + { + return row.Count > 0 ? row[0].Value?.ToString() ?? "" : ""; + } + + public void Load(RawSheet rawSheet) + { + var cells = rawSheet.Cells; + Title title = rawSheet.Title; + + if (!title.HierarchyMultiRows) + { + foreach (var row in cells) + { + if (IsBlankRow(row, title)) + { + continue; + } + Rows.Add((GetRowTag(row), ParseOneLineTitleRow(title, row))); + } + } + else + { + foreach (var oneRecordRows in SplitRows(title, cells)) + { + Rows.Add((GetRowTag(oneRecordRows[0]), ParseMultiLineTitleRow(title, oneRecordRows))); + } + } + } + + private TitleRow ParseOneLineTitleRow(Title title, List row) + { + if (title.SubTitleList.Count == 0) + { + return new TitleRow(title, row); + } + + Dictionary fields = new(); + + foreach (var subTitle in title.SubTitleList) + { + fields.Add(subTitle.Name, ParseOneLineTitleRow(subTitle, row)); + } + return new TitleRow(title, fields); + } + + private static bool IsMultiRowsExtendRow(List row, Title title) + { + if (title.HasSubTitle) + { + foreach (var t in title.SubTitleList) + { + if (!t.SelfMultiRows && !IsMultiRowsExtendRow(row, t)) + { + return false; + } + } + //return title.SubTitleList.All(t => t.SelfMultiRows || IsMultiRowsExtendRow(row, t)); + return true; + } + else + { + return IsBlankRow(row, title.FromIndex, title.ToIndex); + } + } + + private IEnumerable>> SplitRows(Title title, List> rows) + { + List> oneRecordRows = null; + foreach (var row in rows) + { + if (IsBlankRow(row, title.FromIndex, title.ToIndex)) + { + continue; + } + if (oneRecordRows == null) + { + oneRecordRows = new List>() { row }; + } + else + { + if (IsMultiRowsExtendRow(row, title)) + { + oneRecordRows.Add(row); + } + else + { + yield return oneRecordRows; + oneRecordRows = new List>() { row }; + } + } + } + if (oneRecordRows != null) + { + yield return oneRecordRows; + } + } + + private TitleRow ParseMultiLineTitleRow(Title title, List> rows) + { + if (title.SubTitleList.Count == 0) + { + if (title.SelfMultiRows) + { + return new TitleRow(title, rows); + } + else + { + return new TitleRow(title, rows[0]); + } + } + else + { + var fields = new Dictionary(); + foreach (var subTitle in title.SubTitleList) + { + if (subTitle.SelfMultiRows) + { + var eles = new List(); + if (subTitle.SubHierarchyMultiRows) + { + foreach (var eleRows in SplitRows(subTitle, rows)) + { + eles.Add(ParseMultiLineTitleRow(subTitle, eleRows)); + } + } + else + { + foreach (var eleRow in rows) + { + if (IsBlankRow(eleRow, subTitle.FromIndex, subTitle.ToIndex)) + { + continue; + } + eles.Add(ParseOneLineTitleRow(subTitle, eleRow)); + } + } + fields.Add(subTitle.Name, new TitleRow(subTitle, eles)); + } + else + { + if (subTitle.SubHierarchyMultiRows) + { + fields.Add(subTitle.Name, ParseMultiLineTitleRow(subTitle, rows)); + } + else + { + fields.Add(subTitle.Name, ParseOneLineTitleRow(subTitle, rows[0])); + } + } + } + return new TitleRow(title, fields); + } + } + + public IEnumerable<(string Tag, TitleRow Row)> GetRows() + { + return Rows; + } + + public static bool IsBlankRow(List row, Title title) + { + if (title.SubTitleList.Count == 0) + { + return IsBlankRow(row, title.FromIndex, title.ToIndex); + } + return title.SubTitleList.All(t => IsBlankRow(row, t)); + } + + public static bool IsBlankRow(List row, int fromIndex, int toIndex) + { + for (int i = Math.Max(1, fromIndex), n = Math.Min(toIndex, row.Count - 1); i <= n; i++) + { + var v = row[i].Value; + if (v != null && !(v is string s && string.IsNullOrEmpty(s))) + { + return false; + } + } + return true; + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/SheetLoadUtil.cs b/luban/src/Luban.DataLoader.Builtin/Excel/SheetLoadUtil.cs new file mode 100644 index 00000000..ba72f620 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/SheetLoadUtil.cs @@ -0,0 +1,647 @@ +using ExcelDataReader; +using Luban.Utils; + +namespace Luban.DataLoader.Builtin.Excel; + +public static class SheetLoadUtil +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public static System.Text.Encoding DetectCsvEncoding(Stream fs) + { + Ude.CharsetDetector cdet = new Ude.CharsetDetector(); + cdet.Feed(fs); + cdet.DataEnd(); + fs.Seek(0, SeekOrigin.Begin); + if (cdet.Charset != null) + { + s_logger.Debug("Charset: {}, confidence: {}", cdet.Charset, cdet.Confidence); + return System.Text.Encoding.GetEncoding(cdet.Charset) ?? System.Text.Encoding.Default; + } + else + { + return System.Text.Encoding.Default; + } + } + + private static readonly AsyncLocal s_curExcel = new(); + + public static IEnumerable LoadRawSheets(string rawUrl, string sheetName, Stream stream) + { + s_logger.Trace("{filename} {sheet}", rawUrl, sheetName); + s_curExcel.Value = rawUrl; + string ext = Path.GetExtension(rawUrl); + using (var reader = ext != ".csv" ? ExcelReaderFactory.CreateReader(stream) : ExcelReaderFactory.CreateCsvReader(stream, new ExcelReaderConfiguration() { FallbackEncoding = DetectCsvEncoding(stream) })) + { + do + { + if (sheetName == null || reader.Name == sheetName) + { + RawSheet sheet; + try + { + sheet = ParseRawSheet(reader); + } + catch (Exception e) + { + throw new Exception($"excel:{rawUrl} sheet:{reader.Name} 读取失败.", e); + } + if (sheet != null) + { + yield return sheet; + } + } + } while (reader.NextResult()); + } + } + + private static RawSheet ParseRawSheet(IExcelDataReader reader) + { + bool orientRow; + + if (!TryParseMeta(reader, out orientRow, out var tableName)) + { + return null; + } + var cells = ParseRawSheetContent(reader, orientRow, false); + ValidateTitles(cells); + var title = ParseTitle(cells, reader.MergeCells, orientRow); + cells.RemoveAll(c => IsNotDataRow(c)); + return new RawSheet() { Title = title, TableName = tableName, SheetName = reader.Name, Cells = cells }; + } + + + private static readonly HashSet s_knownSpecialTags = new() + { + "var", + "+", + "type", + "desc", + "comment", + "column", + "group", + }; + + private const char s_sep = '#'; + + private static void ValidateTitles(List> rows) + { + foreach (var row in rows) + { + if (row.Count == 0) + { + continue; + } + string rowTag = row[0].Value?.ToString()?.ToLower()?.Trim(); + if (string.IsNullOrEmpty(rowTag)) + { + continue; + } + if (!rowTag.StartsWith("##")) + { + break; + } + var tags = rowTag.Substring(2).Split(s_sep).Where(s => !string.IsNullOrEmpty(s)); + foreach (string tag in tags) + { + if (!s_knownSpecialTags.Contains(tag)) + { + s_logger.Error("文件:'{}' 行标签:'{}' 包含未知tag:'{}',是否有拼写错误?", s_curExcel.Value, rowTag, tag); + } + } + } + } + + private static bool IsNotDataRow(List row) + { + if (row.Count == 0) + { + return true; + } + var s = row[0].Value?.ToString()?.Trim(); + return !string.IsNullOrEmpty(s) && s.StartsWith("##"); + } + + public static Title ParseTitle(List> cells, CellRange[] mergeCells, bool orientRow) + { + var rootTitle = new Title() + { + Root = true, + Name = "__root__", + Tags = new Dictionary(), + FromIndex = 0, + ToIndex = cells.Select(r => r.Count).Max() - 1 + }; + + if (!TryFindTopTitle(cells, out var topTitleRowIndex)) + { + throw new Exception($"没有定义任何有效 标题行"); + } + //titleRowNum = GetTitleRowNum(mergeCells, orientRow); + + ParseSubTitles(rootTitle, cells, mergeCells, orientRow, topTitleRowIndex + 1); + + rootTitle.Init(); + + if (rootTitle.SubTitleList.Count == 0) + { + throw new Exception($"没有定义任何有效 列"); + } + return rootTitle; + } + + private static bool TryFindTopTitle(List> cells, out int rowIndex) + { + for (int i = 0; i < cells.Count; i++) + { + var row = cells[i]; + if (row.Count == 0) + { + break; + } + string rowTag = row[0].Value?.ToString()?.ToLower()?.Trim() ?? ""; + if (!rowTag.StartsWith("##")) + { + break; + } + if (rowTag.Substring(2).IndexOf('&') >= 0) + { + throw new Exception($"excel标题头不再使用'&'作为分割符,请改为'{s_sep}'"); + } + var tags = rowTag.Substring(2).Split(s_sep).Select(s => s.Trim()).Where(s => !string.IsNullOrEmpty(s)).ToList(); + if (tags.Contains("field") || tags.Contains("var") || tags.Contains("+")) + { + rowIndex = i; + return true; + } + // 出于历史兼容性,对第一行特殊处理,如果不包含任何tag或者只包含column,则也认为是标题行 + if (i == 0 && (tags.Count == 0 || (tags.Count == 1 && tags[0] == "column"))) + { + rowIndex = i; + return true; + } + } + rowIndex = 0; + return false; + } + + private static bool TryFindNextSubFieldRowIndex(List> cells, int startRowIndex, out int rowIndex) + { + for (int i = startRowIndex; i < cells.Count; i++) + { + var row = cells[i]; + if (row.Count == 0) + { + break; + } + string rowTag = row[0].Value?.ToString()?.ToLower()?.Trim() ?? ""; + if (rowTag == "##field" || rowTag == "##var" || rowTag == "##+") + { + rowIndex = i; + return true; + } + else if (!rowTag.StartsWith("##")) + { + break; + } + } + rowIndex = 0; + return false; + } + + private static bool IsIgnoreTitle(string title) + { + return string.IsNullOrEmpty(title) || title.StartsWith('#'); + } + + public static (string Name, Dictionary Tags) ParseNameAndMetaAttrs(string nameAndAttrs) + { + if (nameAndAttrs.Contains('&')) + { + throw new Exception($"excel标题头不再使用'&'作为分割符,请改为'{s_sep}'"); + } + var attrs = nameAndAttrs.Split(s_sep); + + string titleName = attrs[0]; + var tags = new Dictionary(); + // * 开头的表示是多行 + if (titleName.StartsWith('*')) + { + titleName = titleName.Substring(1); + tags.Add("multi_rows", "1"); + } + //if (titleName.EndsWith("*")) + //{ + // titleName = titleName.Substring(0, titleName.Length - 1); + // tags.Add("multi_rows", "1"); + //} + if (titleName.StartsWith('!')) + { + titleName = titleName.Substring(1); + tags.Add("non_empty", "1"); + } + //if (titleName.EndsWith("!")) + //{ + // titleName = titleName.Substring(0, titleName.Length - 1); + // tags.Add("non_empty", "1"); + //} + foreach (var attrPair in attrs.Skip(1)) + { + var pairs = attrPair.Split('='); + if (pairs.Length != 2) + { + throw new Exception($"invalid title: {nameAndAttrs}"); + } + tags.Add(pairs[0].Trim(), pairs[1].Trim()); + } + return (titleName, tags); + } + + private static void ParseSubTitles(Title title, List> cells, CellRange[] mergeCells, bool orientRow, int excelRowIndex) + { + var rowIndex = excelRowIndex - 1; + var titleRow = cells[rowIndex]; + if (mergeCells != null) + { + foreach (var mergeCell in mergeCells) + { + Title subTitle = null; + if (orientRow) + { + //if (mergeCell.FromRow <= 1 && mergeCell.ToRow >= 1) + if (mergeCell.FromRow == rowIndex && mergeCell.FromColumn >= title.FromIndex && mergeCell.FromColumn <= title.ToIndex) + { + var nameAndAttrs = titleRow[mergeCell.FromColumn].Value?.ToString()?.Trim(); + if (IsIgnoreTitle(nameAndAttrs)) + { + continue; + } + var (titleName, tags) = ParseNameAndMetaAttrs(nameAndAttrs); + subTitle = new Title() { Name = titleName, Tags = tags, FromIndex = mergeCell.FromColumn, ToIndex = mergeCell.ToColumn }; + //s_logger.Info("=== sheet:{sheet} title:{title}", Name, newTitle); + } + } + else + { + if (mergeCell.FromColumn == rowIndex && mergeCell.FromRow >= title.FromIndex && mergeCell.FromRow <= title.ToIndex) + { + // 标题 行 + var nameAndAttrs = titleRow[mergeCell.FromRow].Value?.ToString()?.Trim(); + if (IsIgnoreTitle(nameAndAttrs)) + { + continue; + } + var (titleName, tags) = ParseNameAndMetaAttrs(nameAndAttrs); + subTitle = new Title() { Name = titleName, Tags = tags, FromIndex = mergeCell.FromRow, ToIndex = mergeCell.ToRow }; + } + } + if (subTitle == null) + { + continue; + } + + if (excelRowIndex < cells.Count && TryFindNextSubFieldRowIndex(cells, excelRowIndex, out int nextRowIndex)) + { + ParseSubTitles(subTitle, cells, mergeCells, orientRow, nextRowIndex + 1); + } + title.AddSubTitle(subTitle); + + } + } + + for (int i = title.FromIndex; i <= title.ToIndex; i++) + { + var nameAndAttrs = titleRow[i].Value?.ToString()?.Trim(); + if (IsIgnoreTitle(nameAndAttrs)) + { + continue; + } + var (titleName, tags) = ParseNameAndMetaAttrs(nameAndAttrs); + + Title subTitle; + // [field,,,, field] 形成多列字段 + + + if (titleName.StartsWith('[')) + { + int startIndex = i; + titleName = titleName.Substring(1); + bool findEndPair = false; + for (++i; i <= title.ToIndex; i++) + { + var endNamePair = titleRow[i].Value?.ToString()?.Trim(); + if (string.IsNullOrEmpty(endNamePair)) + { + continue; + } + if (!endNamePair.EndsWith(']') || endNamePair[0..^1] != titleName) + { + throw new Exception($"列:'[{titleName}' 后第一个有效列必须为匹配 '{titleName}]',却发现:'{endNamePair}'"); + } + findEndPair = true; + break; + } + if (!findEndPair) + { + throw new Exception($"列:'[{titleName}' 未找到结束匹配列 '{titleName}]'"); + } + subTitle = new Title() { Name = titleName, Tags = tags, FromIndex = startIndex, ToIndex = i }; + } + else + { + if (title.SubTitles.TryGetValue(titleName, out subTitle)) + { + if (subTitle.FromIndex != i) + { + throw new Exception($"列:{titleName} 重复"); + } + else + { + continue; + } + } + subTitle = new Title() { Name = titleName, Tags = tags, FromIndex = i, ToIndex = i }; + } + if (excelRowIndex < cells.Count && TryFindNextSubFieldRowIndex(cells, excelRowIndex, out int nextRowIndex)) + { + ParseSubTitles(subTitle, cells, mergeCells, orientRow, nextRowIndex + 1); + } + title.AddSubTitle(subTitle); + } + } + + public static bool TryParseMeta(string metaStr, out bool orientRow, out string tableName) + { + orientRow = true; + tableName = ""; + + // meta 行 必须以 ##为第一个单元格内容,紧接着 key:value 形式 表达meta属性 + if (string.IsNullOrEmpty(metaStr) || !metaStr.StartsWith("##")) + { + return false; + } + if (metaStr.Substring(2).Contains('&')) + { + throw new Exception($"excel标题头不再使用'&'作为分割符,请改为'{s_sep}'"); + } + foreach (var attr in metaStr.Substring(2).Split(s_sep)) + { + if (string.IsNullOrWhiteSpace(attr)) + { + continue; + } + + var sepIndex = attr.IndexOf('='); + string key = sepIndex >= 0 ? attr.Substring(0, sepIndex) : attr; + string value = sepIndex >= 0 ? attr.Substring(sepIndex + 1) : ""; + switch (key) + { + case "field": + case "+": + case "var": + case "comment": + case "desc": + case "type": + { + break; + } + case "row": + { + orientRow = true; + break; + } + case "column": + { + orientRow = false; + break; + } + case "table": + { + tableName = value; + break; + } + default: + { + throw new Exception($"非法单元薄 meta 属性定义 {attr}, 合法属性有: +,var,row,column,table="); + } + } + } + return true; + } + + public static bool TryParseMeta(IExcelDataReader reader, out bool orientRow, out string tableName) + { + if (!reader.Read() || reader.FieldCount == 0) + { + orientRow = true; + tableName = ""; + return false; + } + string metaStr = reader.GetString(0)?.Trim(); + return TryParseMeta(metaStr, out orientRow, out tableName); + } + + private static bool IsTypeRow(List row) + { + return IsRowTagEqual(row, "##type"); + } + private static bool IsGroupRow(List row) + { + return IsRowTagEqual(row, "##group"); + } + + private static bool IsHeaderRow(List row) + { + if (row.Count == 0) + { + return false; + } + var s = row[0].Value?.ToString()?.Trim(); + return !string.IsNullOrEmpty(s) && s.StartsWith("##"); + } + + private static bool IsRowTagEqual(List row, string tag) + { + if (row.Count == 0) + { + return false; + } + var s = row[0].Value?.ToString()?.Trim()?.ToLower(); + return s == tag; + } + + private static bool IsEmptyRow(List row) + { + return row.All(c => string.IsNullOrWhiteSpace(c.Value?.ToString())); + } + + const int maxEmptyRowCount = 300; + + private static List> ParseRawSheetContent(IExcelDataReader reader, bool orientRow, bool headerOnly) + { + // TODO 优化性能 + // 几个思路 + // 1. 没有 title 的列不加载 + // 2. 空行优先跳过 + // 3. 跳过null或者empty的单元格 + var originRows = new List>(); + int rowIndex = 0; + int emptyRowCount = 0; + do + { + var row = new List(); + for (int i = 0, n = reader.FieldCount; i < n; i++) + { + row.Add(new Cell(rowIndex, i, reader.GetValue(i))); + } + ++rowIndex; + if (IsEmptyRow(row)) + { + ++emptyRowCount; + if (emptyRowCount == maxEmptyRowCount) + { + s_logger.Warn("excel:{filename} sheet:{sheet} 连续空行超过{}行,删除这些空行可以提升导出性能", s_curExcel.Value, reader.Name, maxEmptyRowCount); + } + } + else + { + emptyRowCount = 0; + } + originRows.Add(row); + if (orientRow && headerOnly && !IsHeaderRow(row)) + { + break; + } + } while (reader.Read()); + + List> finalRows; + + if (orientRow) + { + finalRows = originRows; + } + else + { + // 转置这个行列 + int maxColumn = originRows.Select(r => r.Count).Max(); + finalRows = new List>(); + for (int i = 0; i < maxColumn; i++) + { + var row = new List(); + for (int j = 0; j < originRows.Count; j++) + { + row.Add(i < originRows[j].Count ? originRows[j][i] : new Cell(j + 1, i, null)); + } + finalRows.Add(row); + } + } + return finalRows; + } + + public static RawSheetTableDefInfo LoadSheetTableDefInfo(string rawUrl, string sheetName, Stream stream) + { + s_logger.Trace("{filename} {sheet}", rawUrl, sheetName); + string ext = Path.GetExtension(rawUrl); + using (var reader = ext != ".csv" ? ExcelReaderFactory.CreateReader(stream) : ExcelReaderFactory.CreateCsvReader(stream, new ExcelReaderConfiguration() { FallbackEncoding = DetectCsvEncoding(stream) })) + { + do + { + if (sheetName == null || reader.Name == sheetName) + { + try + { + var tableDefInfo = ParseSheetTableDefInfo(rawUrl, reader); + if (tableDefInfo != null) + { + return tableDefInfo; + } + } + catch (Exception e) + { + throw new Exception($"excel:{rawUrl} sheet:{reader.Name} 读取失败.", e); + } + + } + } while (reader.NextResult()); + } + throw new Exception($"{rawUrl} 没有找到有效的表定义"); + } + + private static RawSheetTableDefInfo ParseSheetTableDefInfo(string rawUrl, IExcelDataReader reader) + { + bool orientRow; + + if (!TryParseMeta(reader, out orientRow, out var _)) + { + return null; + } + var cells = ParseRawSheetContent(reader, orientRow, true); + var title = ParseTitle(cells, reader.MergeCells, orientRow); + + int typeRowIndex = cells.FindIndex(row => IsTypeRow(row)); + + if (typeRowIndex < 0) + { + throw new Exception($"缺失type行。请用'##type'标识type行"); + } + List typeRow = cells[typeRowIndex]; + + // 先找 ##desc 行,再找##comment行,最后找 ##type的下一行 + List descRow = cells.Find(row => IsRowTagEqual(row, "##desc")); + if (descRow == null) + { + descRow = cells.Find(row => IsRowTagEqual(row, "##comment")); + } + if (descRow == null) + { + descRow = cells.Count > 1 ? cells.Skip(1).FirstOrDefault(row => IsRowTagEqual(row, "##")) : null; + } + List groupRow = cells.Find(row => IsGroupRow(row)); + var fields = new Dictionary(); + foreach (var subTitle in title.SubTitleList) + { + if (!DefUtil.IsNormalFieldName(subTitle.Name)) + { + continue; + } + string desc = ""; + if (descRow != null) + { + // 如果有子字段,并且子字段个数>=2时,如果对应注释行有效注释个数为1,表示这是给当前字段的注释, + // 否则是给子字段的注释,取注释为空,而不是第一个注释 + if (subTitle.SubTitles.Count >= 2) + { + int notEmptyCellCount = 0; + for (int i = subTitle.FromIndex; i <= subTitle.ToIndex; i++) + { + var cellValue = descRow?[i].Value?.ToString(); + if (!string.IsNullOrWhiteSpace(cellValue)) + { + ++notEmptyCellCount; + desc = cellValue; + } + } + if (notEmptyCellCount > 1) + { + desc = ""; + } + } + else + { + desc = descRow?[subTitle.FromIndex].Value?.ToString() ?? ""; + } + } + fields.Add(subTitle.Name, new FieldInfo() + { + Name = subTitle.Name, + Tags = subTitle.Tags, + Type = typeRow[subTitle.FromIndex].Value?.ToString() ?? "", + Groups = groupRow?[subTitle.FromIndex].Value?.ToString() ?? "", + Desc = desc, + }); + } + + return new RawSheetTableDefInfo() { FieldInfos = fields }; + } + +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/StreamSheet.cs b/luban/src/Luban.DataLoader.Builtin/Excel/StreamSheet.cs new file mode 100644 index 00000000..68c15c44 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/StreamSheet.cs @@ -0,0 +1,24 @@ +namespace Luban.DataLoader.Builtin.Excel; + +class StreamSheet +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public string Name { get; } + + public string RawUrl { get; } + + public ExcelStream Stream { get; private set; } + + public StreamSheet(string rawUrl, string name) + { + this.RawUrl = rawUrl; + this.Name = name; + } + + public void Load(RawSheet rawSheet) + { + Title title = rawSheet.Title; + Stream = new ExcelStream(rawSheet.Cells, 1, title.ToIndex, "", ""); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/Title.cs b/luban/src/Luban.DataLoader.Builtin/Excel/Title.cs new file mode 100644 index 00000000..9cac406a --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/Title.cs @@ -0,0 +1,114 @@ +using Luban.Utils; + +namespace Luban.DataLoader.Builtin.Excel; + +public class Title +{ + public bool Root { get; set; } + + public int FromIndex { get; set; } + + public int ToIndex { get; set; } + + public string Name { get; set; } + + public Dictionary Tags { get; set; } + + public Dictionary SubTitles { get; set; } = new(); + + public List SubTitleList { get; set; } = new(); + + public bool HasSubTitle => SubTitleList.Count > 0; + + public string Sep { get; private set; } + + public string SepOr(string sep) + { + return string.IsNullOrEmpty(sep) ? Sep : sep; + } + + public bool NonEmpty { get; private set; } + + public string Default { get; private set; } + + public bool SelfMultiRows { get; private set; } + + public bool HierarchyMultiRows { get; private set; } + + public bool SubHierarchyMultiRows { get; private set; } + + public void AddSubTitle(Title title) + { + if (!SubTitles.TryAdd(title.Name, title)) + { + throw new Exception($"列:{title.Name} 重复"); + } + SubTitleList.Add(title); + } + + // 由于先处理merge再处理只占一列的标题头. + // sub titles 未必是有序的。对于大多数数据并无影响 + // 但对于 list类型的多级标题头,有可能导致element 数据次序乱了 + private void SortSubTitles() + { + SubTitleList.Sort((t1, t2) => t1.FromIndex - t2.FromIndex); + foreach (var t in SubTitleList) + { + t.SortSubTitles(); + } + } + + private static HashSet<string> s_validTags = new() + { + "sep", + "non_empty", + "multi_rows", + "default", + }; + + public void Init() + { + SortSubTitles(); + Sep = Tags.TryGetValue("sep", out var sep) ? sep : ""; + //if (Tags.ContainsKey("sep")) + //{ + // throw new Exception($"字段名现在不支持sep,请移到##type行,例如'int&sep=;'"); + //} + NonEmpty = Tags.TryGetValue("non_empty", out var ne) && ne == "1"; + SelfMultiRows = Tags.TryGetValue("multi_rows", out var v2) && (v2 == "1" || v2 == "true"); + Default = Tags.TryGetValue("default", out var v3) ? v3 : null; + + foreach (var (key, value) in Tags) + { + if (!s_validTags.Contains(key)) + { + throw new Exception($"excel标题列:'{Name}' 不支持tag:'{key}',请移到##type行"); + } + } + + if (SubTitleList.Count > 0) + { + if (Root) + { + var firstField = SubTitleList.FirstOrDefault(f => DefUtil.IsNormalFieldName(f.Name)); + if (firstField != null) + { + // 第一个字段一般为key,为了避免失误将空单元格当作key=0的数据,默认非空 + firstField.Tags.TryAdd("non_empty", "1"); + } + } + foreach (var sub in SubTitleList) + { + sub.Init(); + } + } + SubHierarchyMultiRows = SubTitleList.Any(t => t.HierarchyMultiRows); + ; + HierarchyMultiRows = SelfMultiRows || SubHierarchyMultiRows; + } + + public override string ToString() + { + return $"name:{Name} [{FromIndex}, {ToIndex}] sub titles:[{string.Join(",\\n", SubTitleList)}]"; + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Excel/TitleRow.cs b/luban/src/Luban.DataLoader.Builtin/Excel/TitleRow.cs new file mode 100644 index 00000000..a99cdee8 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Excel/TitleRow.cs @@ -0,0 +1,166 @@ +namespace Luban.DataLoader.Builtin.Excel; + +class TitleRow +{ + public List<string> Tags { get; } + + public Title SelfTitle { get; } + + public object Current + { + get + { + if (Row != null) + { + var v = Row[SelfTitle.FromIndex].Value; + if (v == null || (v is string s && string.IsNullOrEmpty(s) && !string.IsNullOrEmpty(SelfTitle.Default))) + { + return SelfTitle.Default; + } + else + { + return v; + } + } + else + { + throw new Exception($"简单数据类型字段 不支持子列名或者多行"); + } + } + } + + public List<Cell> Row { get; } + + public int CellCount => SelfTitle.ToIndex - SelfTitle.FromIndex + 1; + + public List<List<Cell>> Rows { get; } + + public Dictionary<string, TitleRow> Fields { get; } + + public List<TitleRow> Elements { get; } + + public string Location + { + get + { + if (Row != null) + { + return Row[SelfTitle.FromIndex].ToString(); + } + if (Rows != null) + { + return Rows[0][SelfTitle.FromIndex].ToString(); + } + if (Fields != null) + { + return Fields[SelfTitle.SubTitleList[0].Name].Location; + } + if (Elements != null) + { + return Elements.Count > 0 ? Elements[0].Location : "无法定位"; + } + return "无法定位"; + } + } + + public bool IsBlank + { + get + { + if (Row != null) + { + return RowColumnSheet.IsBlankRow(Row, SelfTitle.FromIndex, SelfTitle.ToIndex); + } + if (Rows != null) + { + return RowColumnSheet.IsBlankRow(Rows[0], SelfTitle.FromIndex, SelfTitle.ToIndex); + } + if (Fields != null) + { + return Fields.Values.All(f => f.IsBlank); + } + if (Elements != null) + { + return Elements.All(e => e.IsBlank); + } + throw new Exception(); + } + } + + public ExcelStream AsStream(string sep) + { + if (string.IsNullOrEmpty(sep)) + { + return new ExcelStream(Row, SelfTitle.FromIndex, SelfTitle.ToIndex, "", SelfTitle.Default); + } + else + { + return new ExcelStream(Row, SelfTitle.FromIndex, SelfTitle.ToIndex, sep, SelfTitle.Default); + } + } + + public bool HasSubFields => Fields != null || Elements != null; + + public TitleRow(Title selfTitle, List<Cell> row) + { + SelfTitle = selfTitle; + Row = row; + } + + public TitleRow(Title selfTitle, List<List<Cell>> rows) + { + SelfTitle = selfTitle; + Rows = rows; + } + + public TitleRow(Title selfTitle, Dictionary<string, TitleRow> fields) + { + SelfTitle = selfTitle; + Fields = fields; + } + + public TitleRow(Title selfTitle, List<TitleRow> elements) + { + SelfTitle = selfTitle; + Elements = elements; + } + + public int RowCount => Rows.Count; + + public Title GetTitle(string name) + { + return SelfTitle.SubTitles.TryGetValue(name, out var title) ? title : null; + } + + + public TitleRow GetSubTitleNamedRow(string name) + { + //Title title = Titles[name]; + //return new TitleRow(title, this.Rows); + return Fields.TryGetValue(name, out var r) ? r : null; + } + + public IEnumerable<ExcelStream> GetColumnOfMultiRows(string name, string sep) + { + foreach (var ele in GetSubTitleNamedRow(name).Elements) + { + yield return ele.AsStream(sep); + } + } + + + public IEnumerable<ExcelStream> AsMultiRowStream(string sep) + { + throw new NotSupportedException(); + } + + public ExcelStream AsMultiRowConcatStream(string sep) + { + return new ExcelStream(Rows, SelfTitle.FromIndex, SelfTitle.ToIndex, sep, SelfTitle.Default); + } + + public ExcelStream AsMultiRowConcatElements(string sep) + { + return new ExcelStream(Elements.Select(e => e.Row).ToList(), SelfTitle.FromIndex, SelfTitle.ToIndex, sep, SelfTitle.Default); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Json/JsonDataSource.cs b/luban/src/Luban.DataLoader.Builtin/Json/JsonDataSource.cs new file mode 100644 index 00000000..e5b0a92a --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Json/JsonDataSource.cs @@ -0,0 +1,79 @@ +using System.Text.Json; +using Luban.DataLoader.Builtin.DataVisitors; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; + +namespace Luban.DataLoader.Builtin.Json; + +[DataLoader("json")] +public class JsonDataSource : DataLoaderBase +{ + private JsonElement _data; + + public override void Load(string rawUrl, string sheetOrFieldName, Stream stream) + { + RawUrl = rawUrl; + this._data = JsonDocument.Parse(stream, new JsonDocumentOptions() + { + AllowTrailingCommas = true, + CommentHandling = JsonCommentHandling.Skip, + }).RootElement; + + if (!string.IsNullOrEmpty(sheetOrFieldName)) + { + if (sheetOrFieldName.StartsWith("*")) + { + sheetOrFieldName = sheetOrFieldName.Substring(1); + } + if (!string.IsNullOrEmpty(sheetOrFieldName)) + { + foreach (var subField in sheetOrFieldName.Split('.')) + { + _data = _data.GetProperty(subField); + } + } + } + } + + public override List<Record> ReadMulti(TBean type) + { + var records = new List<Record>(); + foreach (var ele in _data.EnumerateArray()) + { + Record rec = ReadRecord(ele, type); + if (rec != null) + { + records.Add(rec); + } + } + return records; + } + + private Record ReadRecord(JsonElement ele, TBean type) + { + List<string> tags; + if (ele.TryGetProperty(FieldNames.TagKey, out var tagEle)) + { + var tagName = tagEle.GetString(); + if (DataUtil.IsIgnoreTag(tagName)) + { + return null; + } + tags = DataUtil.ParseTags(tagName); + } + else + { + tags = null; + } + + var data = (DBean)type.Apply(JsonDataCreator.Ins, ele, type.DefBean.Assembly); + return new Record(data, RawUrl, tags); + } + + public override Record ReadOne(TBean type) + { + return ReadRecord(_data, type); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Lua/LuaDataSource.cs b/luban/src/Luban.DataLoader.Builtin/Lua/LuaDataSource.cs new file mode 100644 index 00000000..70984a46 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Lua/LuaDataSource.cs @@ -0,0 +1,73 @@ +using System.Text; +using Luban.DataLoader.Builtin.DataVisitors; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Neo.IronLua; + +namespace Luban.DataLoader.Builtin.Lua; + +[DataLoader("lua")] +public class LuaDataSource : DataLoaderBase +{ + private static Neo.IronLua.Lua LuaManager { get; } = new(); + + private LuaGlobal _env; + private LuaTable _dataTable; + + public override void Load(string rawUrl, string sheetName, Stream stream) + { + RawUrl = rawUrl; + _env = LuaManager.CreateEnvironment(); + _dataTable = (LuaTable)_env.DoChunk(new StreamReader(stream, Encoding.UTF8), rawUrl)[0]; + + if (!string.IsNullOrEmpty(sheetName)) + { + if (sheetName.StartsWith("*")) + { + sheetName = sheetName.Substring(1); + } + if (!string.IsNullOrEmpty(sheetName)) + { + foreach (var subField in sheetName.Split('.')) + { + _dataTable = (LuaTable)_dataTable[subField]; + } + } + } + } + + public override List<Record> ReadMulti(TBean type) + { + var records = new List<Record>(); + + foreach (LuaTable t in _dataTable.Values.Values) + { + Record r = ReadRecord(t, type); + if (r != null) + { + records.Add(r); + } + } + + return records; + } + + public override Record ReadOne(TBean type) + { + return ReadRecord(_dataTable, type); + } + + private Record ReadRecord(LuaTable table, TBean type) + { + string tagName = table.GetValue(FieldNames.TagKey)?.ToString(); + if (DataUtil.IsIgnoreTag(tagName)) + { + return null; + } + var data = (DBean)type.Apply(LuaDataCreator.Ins, table, type.DefBean.Assembly); + var tags = DataUtil.ParseTags(tagName); + return new Record(data, RawUrl, tags); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Luban.DataLoader.Builtin.csproj b/luban/src/Luban.DataLoader.Builtin/Luban.DataLoader.Builtin.csproj new file mode 100644 index 00000000..b199e4be --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Luban.DataLoader.Builtin.csproj @@ -0,0 +1,44 @@ +<!-- + - MIT License + - + - Copyright (c) 2023 Code Philosophy Technology Ltd. + - + - Permission is hereby granted, free of charge, to any person obtaining a copy + - of this software and associated documentation files (the "Software"), to deal + - in the Software without restriction, including without limitation the rights + - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + - copies of the Software, and to permit persons to whom the Software is + - furnished to do so, subject to the following conditions: + - + - The above copyright notice and this permission notice shall be included in all + - copies or substantial portions of the Software. + - + - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + - SOFTWARE. + --> + +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="ExcelDataReader" Version="3.7.0" /> + <PackageReference Include="NeoLua" Version="1.3.14" /> + <PackageReference Include="Ude.NetStandard" Version="1.2.0" /> + <PackageReference Include="YamlDotNet.NetCore" Version="1.0.0" /> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.DataLoader.Builtin/UnityAsset/UnityAssetDataSource.cs b/luban/src/Luban.DataLoader.Builtin/UnityAsset/UnityAssetDataSource.cs new file mode 100644 index 00000000..75197fcb --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/UnityAsset/UnityAssetDataSource.cs @@ -0,0 +1,85 @@ +using Luban.DataLoader.Builtin.DataVisitors; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using YamlDotNet.RepresentationModel; + +namespace Luban.DataLoader.Builtin.UnityAsset; + +[DataLoader("asset")] +public class UnityAssetDataSource : DataLoaderBase +{ + private YamlNode _root; + public override void Load(string rawUrl, string sheetOrFieldName, Stream stream) + { + var ys = new YamlStream(); + ys.Load(new StreamReader(stream)); + var rootNode = (YamlMappingNode)ys.Documents[0].RootNode; + + // unity asset 格式为 包含一个doc的 yaml文件 + // doc顶层为map,只包含一个字段,字段key为类型名。 + if (rootNode.Children.Count != 1) + { + throw new Exception($"asset doc 应该只包含一个顶层字段"); + } + + this._root = rootNode.First().Value; + + if (!string.IsNullOrEmpty(sheetOrFieldName)) + { + if (sheetOrFieldName.StartsWith("*")) + { + sheetOrFieldName = sheetOrFieldName[1..]; + } + if (!string.IsNullOrEmpty(sheetOrFieldName)) + { + foreach (var subField in sheetOrFieldName.Split('.')) + { + this._root = _root[new YamlScalarNode(subField)]; + } + } + } + } + + public override List<Record> ReadMulti(TBean type) + { + var records = new List<Record>(); + foreach (var ele in (YamlSequenceNode)_root) + { + var rec = ReadRecord(ele, type); + if (rec != null) + { + records.Add(rec); + } + } + return records; + } + + private static readonly YamlScalarNode s_tagNameNode = new(FieldNames.TagKey); + + public override Record ReadOne(TBean type) + { + return ReadRecord(_root, type); + } + + private Record ReadRecord(YamlNode yamlNode, TBean type) + { + string tagName; + if (((YamlMappingNode)yamlNode).Children.TryGetValue(s_tagNameNode, out var tagNode)) + { + tagName = (string)tagNode; + } + else + { + tagName = null; + } + if (DataUtil.IsIgnoreTag(tagName)) + { + return null; + } + var data = (DBean)type.Apply(UnityAssetDataCreator.Ins, yamlNode, type.DefBean.Assembly); + var tags = DataUtil.ParseTags(tagName); + return new Record(data, RawUrl, tags); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Utils/LoadDataUtil.cs b/luban/src/Luban.DataLoader.Builtin/Utils/LoadDataUtil.cs new file mode 100644 index 00000000..617dceb0 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Utils/LoadDataUtil.cs @@ -0,0 +1,282 @@ +using System.Text; +using Luban.DataLoader.Builtin.DataVisitors; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; + +namespace Luban.DataLoader.Builtin.Utils; + +static class LoadDataUtil +{ + public static string[] SplitVectorString(string x) + { + return x.Split(',', '_', ';'); + } + + public static string[] SplitStringByAnySepChar(string x, string sep) + { + return x.Split(sep.ToCharArray()); + } + + // public static DType CreateVector(TVector2 type, string x) + // { + // var values = SplitVectorString(x); + // if (values.Length != 2) + // { + // throw new Exception($"'{x}' 不是合法vector2类型数据"); + // } + // return new DVector2(new System.Numerics.Vector2(float.Parse(values[0]), float.Parse(values[1]))); + // + // } + // + // public static DType CreateVector(TVector3 type, string x) + // { + // var values = SplitVectorString(x); + // if (values.Length != 3) + // { + // throw new Exception($"'{x}' 不是合法vector3类型数据"); + // } + // return new DVector3(new System.Numerics.Vector3(float.Parse(values[0]), float.Parse(values[1]), float.Parse(values[2]))); + // + // } + // + // public static DType CreateVector(TVector4 type, string x) + // { + // var values = SplitVectorString(x); + // if (values.Length != 4) + // { + // throw new Exception($"'{x}' 不是合法vector4类型数据"); + // } + // return new DVector4(new System.Numerics.Vector4(float.Parse(values[0]), float.Parse(values[1]), float.Parse(values[2]), float.Parse(values[3]))); + // } + + //public static DDateTime CreateDateTime(string x, TimeZoneInfo timeZoneInfo) + //{ + + // DateTime dateTime = DateTime.ParseExact(x, + // new string[] { + // "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM-dd HH", "yyyy-MM-dd", + // //"yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM/dd HH", "yyyy/MM/dd", + // }, + // System.Globalization.CultureInfo.InvariantCulture); + // return new DDateTime(TimeZoneInfo.ConvertTimeToUtc(dateTime, timeZoneInfo)); + //} + private static readonly string[] dateTimeFormats = new string[] { + "yyyy-M-d HH:mm:ss", "yyyy-M-d HH:mm", "yyyy-M-d HH", "yyyy-M-d", + //"yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM/dd HH", "yyyy/MM/dd", + }; + public static DDateTime CreateDateTime(string x) + { + DateTime dateTime = DateTime.ParseExact(x, dateTimeFormats, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None); + //return new DDateTime(TimeZoneInfo.ConvertTime(dateTime, TimeZoneUtil.DefaultTimeZone, TimeZoneInfo.Utc)); + return new DDateTime(dateTime); + } + + public static string FormatDateTime(DateTime datetime) + { + return datetime.ToString("yyyy-M-d HH:mm:ss"); + } + + public static byte[] StreamToBytes(Stream stream) + { + byte[] bytes = new byte[stream.Length]; + stream.Seek(0, SeekOrigin.Begin); + stream.Read(bytes, 0, bytes.Length); + return bytes; + } + + public static string UnEscapeRawString(string s) + { + switch (s) + { + case "null": + return null; + case "\"\"": + return string.Empty; + default: + return s; + } + } + + public static string EscapeString(string s) + { + return s.Replace("\\", "\\\\").Replace("\"", "\\\""); + } + public static string UnEscapeString(string s) + { + return s.Replace("\\\"", "\"").Replace("\\\"", "\""); + } + + public static string EscapeLuaStringWithQuote(string s) + { + if (!s.Contains('\"') && !s.Contains('\\') && !s.Contains('\n')) + { + return "\"" + s + "\""; + } + + var multiEqaulChars = new StringBuilder(); + var result = new StringBuilder(); + var startIndex = s.EndsWith(']') ? 1 : 0; + for (int i = startIndex; i < 100; i++) + { + if (i > 0) + { + multiEqaulChars.Append('='); + } + var multiEqualStr = multiEqaulChars.ToString(); + if (i == 0 || s.Contains(multiEqualStr)) + { + if (s.Contains("[" + multiEqualStr + "[") || s.Contains("]" + multiEqualStr + "]")) + { + continue; + } + } + result.Clear(); + result.Append('[').Append(multiEqualStr).Append('['); + result.Append(s); + result.Append(']').Append(multiEqualStr).Append(']'); + return result.ToString(); + } + throw new Exception($"too complex string:'{s}'"); + } + + //public static string EscapeStringWithQuote(string s) + //{ + // return "\"" + s.Replace("\\", "\\\\") + "\""; + //} + + public static (string Key, string Text) ExtractText(string rawKeyAndText) + { + string[] keyAndText = rawKeyAndText.Split('|'); + if (keyAndText.Length != 2) + { + throw new Exception("text data should like <key>|<text>"); + } + return (keyAndText[0], keyAndText[1]); + } + + public static void ValidateText(string key, string text) + { + if (key == null || text == null) + { + throw new Exception("text的key或text属性不能为null"); + } + if (key == "" && text != "") + { + throw new Exception($"text key为空, 但text:'{text}'不为空"); + } + } + + + public static bool IsIgnoreTag(string tagName) + { + return tagName == "##"; + } + + public static List<string> ParseTags(string rawTagStr) + { + if (string.IsNullOrWhiteSpace(rawTagStr)) + { + return null; + } + var tags = new List<string>(rawTagStr.Split(',').Select(t => t.Trim().ToLower()).Where(t => !string.IsNullOrEmpty(t))); + return tags.Count > 0 ? tags : null; + } + + + private const string TAG_UNCHECKED = "unchecked"; + + public static bool IsUnchecked(Record rec) + { + return rec.Tags != null && rec.Tags.Count > 0 && rec.Tags.Contains(TAG_UNCHECKED); + } + + //public const string SimpleContainerSep = ",;|"; + + public static string GetBeanSep(TBean type) + { + if (type.Tags != null && type.Tags.TryGetValue("sep", out var s) && !string.IsNullOrWhiteSpace(s)) + { + return s; + } + return ((DefBean)type.DefBean).Sep; + } + + public static bool IsCollectionEqual(List<DType> a, List<DType> b) + { + if (a.Count == b.Count) + { + for (int i = 0, n = a.Count; i < n; i++) + { + if (!object.Equals(a[i], b[i])) + { + return false; + } + } + return true; + } + return false; + } + + public static string GetImplTypeName(DBean bean) + { + return GetImplTypeName(bean.ImplType, bean.Type); + } + + public static string GetImplTypeName(DefBean implType, DefBean baseType) + { + if (implType.Namespace == baseType.Namespace) + { + return implType.Name; + } + else + { + return implType.FullName; + } + } + + public static DefBean GetImplTypeByNameOrAlias(DefBean bean, string subType) + { + if (string.IsNullOrEmpty(subType)) + { + throw new Exception($"module:'{bean.Namespace}' 多态数据type不能为空"); + } + DefBean defType = bean.GetHierarchyChildren().Cast<DefBean>().Where(c => c.Alias == subType || c.Name == subType || c.FullName == subType).FirstOrDefault(); + if (defType == null) + { + throw new Exception($"module:'{bean.Namespace}' type:'{subType}' 不是合法类型"); + } + if (defType.IsAbstractType) + { + throw new Exception($"module:'{bean.Namespace}' type:'{subType}' 是抽象类. 不能创建实例"); + } + return defType; + } + + public static bool ParseExcelBool(string s) + { + s = s.ToLower().Trim(); + switch (s) + { + case "true": + case "1": + case "y": + case "yes": + return true; + case "false": + case "0": + case "n": + case "no": + return false; + default: + throw new InvalidExcelDataException($"{s} 不是 bool 类型的值 (true|1|y|yes 或 false|0|n|no)"); + } + } + + //public static string Data2String(DType data) + //{ + // var s = new StringBuilder(); + // data.Apply(VisitorToString.Ins, s); + // return s.ToString(); + //} +} diff --git a/luban/src/Luban.DataLoader.Builtin/Xml/XmlDataSource.cs b/luban/src/Luban.DataLoader.Builtin/Xml/XmlDataSource.cs new file mode 100644 index 00000000..26e70e72 --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Xml/XmlDataSource.cs @@ -0,0 +1,37 @@ +using System.Xml.Linq; +using Luban.DataLoader.Builtin.DataVisitors; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; + +namespace Luban.DataLoader.Builtin.Xml; + +[DataLoader("xml")] +public class XmlDataSource : DataLoaderBase +{ + private XElement _doc; + + public override void Load(string rawUrl, string sheetName, Stream stream) + { + RawUrl = rawUrl; + _doc = XElement.Load(stream); + } + + public override List<Record> ReadMulti(TBean type) + { + throw new NotSupportedException(); + } + + public override Record ReadOne(TBean type) + { + string tagName = _doc.Element(FieldNames.TagKey)?.Value; + if (DataUtil.IsIgnoreTag(tagName)) + { + return null; + } + var data = (DBean)type.Apply(XmlDataCreator.Ins, _doc, type.DefBean.Assembly); + var tags = DataUtil.ParseTags(tagName); + return new Record(data, RawUrl, tags); + } +} diff --git a/luban/src/Luban.DataLoader.Builtin/Yaml/YamlDataLoader.cs b/luban/src/Luban.DataLoader.Builtin/Yaml/YamlDataLoader.cs new file mode 100644 index 00000000..69cd648e --- /dev/null +++ b/luban/src/Luban.DataLoader.Builtin/Yaml/YamlDataLoader.cs @@ -0,0 +1,79 @@ +using Luban.DataLoader.Builtin.DataVisitors; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using YamlDotNet.RepresentationModel; + +namespace Luban.DataLoader.Builtin.Yaml; + +[DataLoader("yml")] +public class YamlDataLoader : DataLoaderBase +{ + private YamlNode _root; + public override void Load(string rawUrl, string sheetOrFieldName, Stream stream) + { + RawUrl = rawUrl; + var ys = new YamlStream(); + ys.Load(new StreamReader(stream)); + var rootNode = ys.Documents[0].RootNode; + + this._root = rootNode; + + if (!string.IsNullOrEmpty(sheetOrFieldName)) + { + if (sheetOrFieldName.StartsWith("*")) + { + sheetOrFieldName = sheetOrFieldName.Substring(1); + } + if (!string.IsNullOrEmpty(sheetOrFieldName)) + { + foreach (var subField in sheetOrFieldName.Split('.')) + { + this._root = _root[new YamlScalarNode(subField)]; + } + } + } + } + + public override List<Record> ReadMulti(TBean type) + { + var records = new List<Record>(); + foreach (var ele in (YamlSequenceNode)_root) + { + var rec = ReadRecord(ele, type); + if (rec != null) + { + records.Add(rec); + } + } + return records; + } + + private static readonly YamlScalarNode s_tagNameNode = new(FieldNames.TagKey); + + public override Record ReadOne(TBean type) + { + return ReadRecord(_root, type); + } + + private Record ReadRecord(YamlNode yamlNode, TBean type) + { + string tagName; + if (((YamlMappingNode)yamlNode).Children.TryGetValue(s_tagNameNode, out var tagNode)) + { + tagName = (string)tagNode; + } + else + { + tagName = null; + } + if (DataUtil.IsIgnoreTag(tagName)) + { + return null; + } + var data = (DBean)type.Apply(YamlDataCreator.Ins, yamlNode, type.DefBean.Assembly); + var tags = DataUtil.ParseTags(tagName); + return new Record(data, RawUrl, tags); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/AssemblyInfo.cs b/luban/src/Luban.DataTarget.Builtin/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.DataTarget.Builtin/Binary/BinaryDataTarget.cs b/luban/src/Luban.DataTarget.Builtin/Binary/BinaryDataTarget.cs new file mode 100644 index 00000000..e00e22f8 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Binary/BinaryDataTarget.cs @@ -0,0 +1,27 @@ +using Luban.DataTarget; +using Luban.Defs; +using Luban.Serialization; + +namespace Luban.DataExporter.Builtin.Binary; + +[DataTarget("bin")] +public class BinaryDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "bytes"; + + private void WriteList(DefTable table, List<Record> datas, ByteBuf x) + { + x.WriteSize(datas.Count); + foreach (var d in datas) + { + d.Data.Apply(BinaryDataVisitor.Ins, x); + } + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var bytes = new ByteBuf(); + WriteList(table, records, bytes); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", bytes.CopyData()); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Binary/BinaryDataVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Binary/BinaryDataVisitor.cs new file mode 100644 index 00000000..234408ca --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Binary/BinaryDataVisitor.cs @@ -0,0 +1,133 @@ +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Serialization; +using Luban.Utils; + +namespace Luban.DataExporter.Builtin.Binary; + +public class BinaryDataVisitor : IDataActionVisitor<ByteBuf> +{ + public static BinaryDataVisitor Ins { get; } = new(); + + public void Accept(DBool type, ByteBuf x) + { + x.WriteBool(type.Value); + } + + public void Accept(DByte type, ByteBuf x) + { + x.WriteByte(type.Value); + } + + public void Accept(DShort type, ByteBuf x) + { + x.WriteShort(type.Value); + } + + public void Accept(DInt type, ByteBuf x) + { + x.WriteInt(type.Value); + } + + public void Accept(DLong type, ByteBuf x) + { + x.WriteLong(type.Value); + } + + public void Accept(DFloat type, ByteBuf x) + { + x.WriteFloat(type.Value); + } + + public void Accept(DDouble type, ByteBuf x) + { + x.WriteDouble(type.Value); + } + + public void Accept(DEnum type, ByteBuf x) + { + x.WriteInt(type.Value); + } + + public void Accept(DString type, ByteBuf x) + { + x.WriteString(type.Value); + } + + public void Accept(DDateTime type, ByteBuf x) + { + x.WriteLong(type.UnixTimeOfCurrentContext()); + } + + public void Accept(DBean type, ByteBuf x) + { + var bean = type.Type; + if (bean.IsAbstractType) + { + x.WriteInt(type.ImplType.Id); + } + + var defFields = type.ImplType.HierarchyFields; + int index = 0; + foreach (var field in type.Fields) + { + var defField = (DefField)defFields[index++]; + if (!defField.NeedExport()) + { + continue; + } + if (defField.CType.IsNullable) + { + if (field != null) + { + x.WriteBool(true); + field.Apply(this, x); + } + else + { + x.WriteBool(false); + } + } + else + { + field.Apply(this, x); + } + } + } + + public void WriteList(List<DType> datas, ByteBuf x) + { + x.WriteSize(datas.Count); + foreach (var d in datas) + { + d.Apply(this, x); + } + } + + public void Accept(DArray type, ByteBuf x) + { + WriteList(type.Datas, x); + } + + public void Accept(DList type, ByteBuf x) + { + WriteList(type.Datas, x); + } + + public void Accept(DSet type, ByteBuf x) + { + WriteList(type.Datas, x); + } + + public void Accept(DMap type, ByteBuf x) + { + Dictionary<DType, DType> datas = type.Datas; + x.WriteSize(datas.Count); + foreach (var e in datas) + { + e.Key.Apply(this, x); + e.Value.Apply(this, x); + } + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Binary/BinaryIndexExportor.cs b/luban/src/Luban.DataTarget.Builtin/Binary/BinaryIndexExportor.cs new file mode 100644 index 00000000..ff1e99cc --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Binary/BinaryIndexExportor.cs @@ -0,0 +1,34 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Serialization; + +namespace Luban.DataExporter.Builtin.Binary; + +class BinaryIndexExportor +{ + public static BinaryIndexExportor Ins { get; } = new(); + + public void WriteList(DefTable table, List<Record> datas, ByteBuf x) + { + x.WriteSize(datas.Count); + var tableDataBuf = new ByteBuf(10 * 1024); + tableDataBuf.WriteSize(datas.Count); + + foreach (var d in datas) + { + int offset = tableDataBuf.Size; + d.Data.Apply(BinaryDataVisitor.Ins, tableDataBuf); + + string keyStr = ""; + foreach (IndexInfo index in table.IndexList) + { + DType key = d.Data.Fields[index.IndexFieldIdIndex]; + key.Apply(BinaryDataVisitor.Ins, x); + keyStr += key.ToString() + ","; + } + x.WriteSize(offset); + Console.WriteLine($"table:{table.Name} key:{keyStr} offset:{offset}"); + } + + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Binary/BinaryRecordOffsetDataTarget.cs b/luban/src/Luban.DataTarget.Builtin/Binary/BinaryRecordOffsetDataTarget.cs new file mode 100644 index 00000000..1ddcee35 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Binary/BinaryRecordOffsetDataTarget.cs @@ -0,0 +1,36 @@ +using Luban.Datas; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Serialization; + +namespace Luban.DataExporter.Builtin.Binary; + +[DataTarget("bin-offset")] +public class BinaryRecordOffsetDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "bytes"; + + private void WriteList(DefTable table, List<Record> datas, ByteBuf x) + { + ByteBuf buf = new ByteBuf(); + buf.WriteSize(datas.Count); + x.WriteSize(datas.Count); + foreach (var d in datas) + { + foreach (var indexInfo in table.IndexList) + { + DType keyData = d.Data.Fields[indexInfo.IndexFieldIdIndex]; + keyData.Apply(BinaryDataVisitor.Ins, x); + } + x.WriteSize(buf.Size); + d.Data.Apply(BinaryDataVisitor.Ins, buf); + } + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var bytes = new ByteBuf(); + WriteList(table, records, bytes); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", bytes.CopyData()); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/DefaultDataExporter.cs b/luban/src/Luban.DataTarget.Builtin/DefaultDataExporter.cs new file mode 100644 index 00000000..eb1ca708 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/DefaultDataExporter.cs @@ -0,0 +1,9 @@ +using Luban.DataTarget; + +namespace Luban.DataExporter.Builtin; + +[DataExporter("default")] +public class DefaultDataExporter : DataExporterBase +{ + +} diff --git a/luban/src/Luban.DataTarget.Builtin/Json/Json2DataTarget.cs b/luban/src/Luban.DataTarget.Builtin/Json/Json2DataTarget.cs new file mode 100644 index 00000000..cd70ef3c --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Json/Json2DataTarget.cs @@ -0,0 +1,64 @@ +using System.Text; +using System.Text.Json; +using Luban.DataExporter.Builtin.Binary; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.DataExporter.Builtin.Json; + +[DataTarget("json2")] +public class Json2DataTarget : JsonDataTarget +{ + protected override string DefaultOutputFileExt => "json"; + + private void WriteAsObject(DefTable table, List<Record> datas, Utf8JsonWriter x) + { + switch (table.Mode) + { + case TableMode.ONE: + { + datas[0].Data.Apply(Json2DataVisitor.Ins, x); + break; + } + case TableMode.MAP: + { + + x.WriteStartObject(); + string indexName = table.IndexField.Name; + foreach (var rec in datas) + { + var indexFieldData = rec.Data.GetField(indexName); + x.WritePropertyName(indexFieldData.Apply(ToJsonPropertyNameVisitor.Ins)); + rec.Data.Apply(Json2DataVisitor.Ins, x); + } + + x.WriteEndObject(); + break; + } + case TableMode.LIST: + { + WriteAsArray(datas, x, Json2DataVisitor.Ins); + break; + } + default: + { + throw new NotSupportedException($"not support table mode:{table.Mode}"); + } + } + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var ss = new MemoryStream(); + var jsonWriter = new Utf8JsonWriter(ss, new JsonWriterOptions() + { + Indented = !UseCompactJson, + SkipValidation = false, + Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + }); + WriteAsObject(table, records, jsonWriter); + jsonWriter.Flush(); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", Encoding.UTF8.GetString(DataUtil.StreamToBytes(ss))); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Json/Json2DataVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Json/Json2DataVisitor.cs new file mode 100644 index 00000000..72f41a2c --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Json/Json2DataVisitor.cs @@ -0,0 +1,20 @@ +using System.Text.Json; +using Luban.Datas; + +namespace Luban.DataExporter.Builtin.Json; + +class Json2DataVisitor : JsonDataVisitor +{ + public static new Json2DataVisitor Ins { get; } = new(); + + public override void Accept(DMap type, Utf8JsonWriter x) + { + x.WriteStartObject(); + foreach (var d in type.Datas) + { + x.WritePropertyName(d.Key.Apply(ToJsonPropertyNameVisitor.Ins)); + d.Value.Apply(this, x); + } + x.WriteEndObject(); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Json/JsonConvertTarget.cs b/luban/src/Luban.DataTarget.Builtin/Json/JsonConvertTarget.cs new file mode 100644 index 00000000..d7e6ab4c --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Json/JsonConvertTarget.cs @@ -0,0 +1,50 @@ +using System.Text; +using System.Text.Json; +using Luban.DataTarget; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.DataExporter.Builtin.Json; + +[DataTarget("json-convert")] +public class JsonConvertTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "json"; + + public static bool UseCompactJson => EnvManager.Current.GetBoolOptionOrDefault("json", "compact", true, false); + + protected virtual JsonDataVisitor ImplJsonDataVisitor => JsonConvertor.Ins; + + public void WriteAsArray(List<Record> datas, Utf8JsonWriter x, JsonDataVisitor jsonDataVisitor) + { + x.WriteStartArray(); + foreach (var d in datas) + { + d.Data.Apply(jsonDataVisitor, x); + } + x.WriteEndArray(); + } + + public override OutputFile ExportRecord(DefTable table, Record record) + { + var ss = new MemoryStream(); + var jsonWriter = new Utf8JsonWriter(ss, new JsonWriterOptions() + { + Indented = !UseCompactJson, + SkipValidation = false, + Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + }); + record.Data.Apply(JsonConvertor.Ins, jsonWriter); + jsonWriter.Flush(); + var fileName = table.IsMapTable ? + record.Data.GetField(table.IndexField.Name).Apply(ToStringVisitor2.Ins).Replace("\"", "").Replace("'", "") + : record.AutoIndex.ToString(); + return CreateOutputFile($"{table.FullName}/{fileName}.{OutputFileExt}", Encoding.UTF8.GetString(DataUtil.StreamToBytes(ss))); + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + throw new NotSupportedException(); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Json/JsonConvertor.cs b/luban/src/Luban.DataTarget.Builtin/Json/JsonConvertor.cs new file mode 100644 index 00000000..c881dc7f --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Json/JsonConvertor.cs @@ -0,0 +1,54 @@ +using System.Text.Json; +using Luban.DataLoader; +using Luban.DataLoader.Builtin; +using Luban.Datas; +using Luban.Defs; + +namespace Luban.DataExporter.Builtin.Json; + +public class JsonConvertor : JsonDataVisitor +{ + public static new JsonConvertor Ins { get; } = new(); + + public override void Accept(DEnum type, Utf8JsonWriter x) + { + x.WriteStringValue(type.StrValue); + } + + public override void Accept(DBean type, Utf8JsonWriter x) + { + x.WriteStartObject(); + + if (type.Type.IsAbstractType) + { + x.WritePropertyName(FieldNames.JsonTypeNameKey); + x.WriteStringValue(type.ImplType.Name); + } + + var defFields = type.ImplType.HierarchyFields; + int index = 0; + foreach (var d in type.Fields) + { + var defField = (DefField)defFields[index++]; + + // 特殊处理 bean 多态类型 + // 另外,不生成 xxx:null 这样 + if (d == null) + { + //x.WriteNullValue(); + } + else + { + x.WritePropertyName(defField.Name); + d.Apply(this, x); + } + } + x.WriteEndObject(); + } + + + public override void Accept(DDateTime type, Utf8JsonWriter x) + { + x.WriteStringValue(type.ToFormatString()); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Json/JsonDataTarget.cs b/luban/src/Luban.DataTarget.Builtin/Json/JsonDataTarget.cs new file mode 100644 index 00000000..ade09fbc --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Json/JsonDataTarget.cs @@ -0,0 +1,42 @@ +using System.Text; +using System.Text.Json; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.DataExporter.Builtin.Json; + +[DataTarget("json")] +public class JsonDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "json"; + + public static bool UseCompactJson => EnvManager.Current.GetBoolOptionOrDefault("json", "compact", true, false); + + protected virtual JsonDataVisitor ImplJsonDataVisitor => JsonDataVisitor.Ins; + + + public void WriteAsArray(List<Record> datas, Utf8JsonWriter x, JsonDataVisitor jsonDataVisitor) + { + x.WriteStartArray(); + foreach (var d in datas) + { + d.Data.Apply(jsonDataVisitor, x); + } + x.WriteEndArray(); + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var ss = new MemoryStream(); + var jsonWriter = new Utf8JsonWriter(ss, new JsonWriterOptions() + { + Indented = !UseCompactJson, + SkipValidation = false, + Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + }); + WriteAsArray(records, jsonWriter, ImplJsonDataVisitor); + jsonWriter.Flush(); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", Encoding.UTF8.GetString(DataUtil.StreamToBytes(ss))); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Json/JsonDataVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Json/JsonDataVisitor.cs new file mode 100644 index 00000000..cf035ac9 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Json/JsonDataVisitor.cs @@ -0,0 +1,133 @@ +using System.Text.Json; +using Luban.DataLoader; +using Luban.DataLoader.Builtin; +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.DataExporter.Builtin.Json; + +public class JsonDataVisitor : IDataActionVisitor<Utf8JsonWriter> +{ + public static JsonDataVisitor Ins { get; } = new(); + + public void Accept(DBool type, Utf8JsonWriter x) + { + x.WriteBooleanValue(type.Value); + } + + public void Accept(DByte type, Utf8JsonWriter x) + { + x.WriteNumberValue(type.Value); + } + + public void Accept(DShort type, Utf8JsonWriter x) + { + x.WriteNumberValue(type.Value); + } + + public void Accept(DInt type, Utf8JsonWriter x) + { + x.WriteNumberValue(type.Value); + } + + public void Accept(DLong type, Utf8JsonWriter x) + { + x.WriteNumberValue(type.Value); + } + + public void Accept(DFloat type, Utf8JsonWriter x) + { + x.WriteNumberValue(type.Value); + } + + public void Accept(DDouble type, Utf8JsonWriter x) + { + x.WriteNumberValue(type.Value); + } + + public virtual void Accept(DEnum type, Utf8JsonWriter x) + { + x.WriteNumberValue(type.Value); + } + + public void Accept(DString type, Utf8JsonWriter x) + { + x.WriteStringValue(type.Value); + } + + public virtual void Accept(DDateTime type, Utf8JsonWriter x) + { + x.WriteNumberValue(type.UnixTimeOfCurrentContext()); + } + + public virtual void Accept(DBean type, Utf8JsonWriter x) + { + x.WriteStartObject(); + + if (type.Type.IsAbstractType) + { + x.WritePropertyName(FieldNames.JsonTypeNameKey); + x.WriteStringValue(DataUtil.GetImplTypeName(type)); + } + + var defFields = type.ImplType.HierarchyFields; + int index = 0; + foreach (var d in type.Fields) + { + var defField = (DefField)defFields[index++]; + + // 特殊处理 bean 多态类型 + // 另外,不生成 xxx:null 这样 + if (d == null || !defField.NeedExport()) + { + //x.WriteNullValue(); + } + else + { + x.WritePropertyName(defField.Name); + d.Apply(this, x); + } + } + x.WriteEndObject(); + } + + public void WriteList(List<DType> datas, Utf8JsonWriter x) + { + x.WriteStartArray(); + foreach (var d in datas) + { + d.Apply(this, x); + } + x.WriteEndArray(); + } + + public void Accept(DArray type, Utf8JsonWriter x) + { + WriteList(type.Datas, x); + } + + public void Accept(DList type, Utf8JsonWriter x) + { + WriteList(type.Datas, x); + } + + public void Accept(DSet type, Utf8JsonWriter x) + { + WriteList(type.Datas, x); + } + + public virtual void Accept(DMap type, Utf8JsonWriter x) + { + x.WriteStartArray(); + foreach (var d in type.Datas) + { + x.WriteStartArray(); + d.Key.Apply(this, x); + d.Value.Apply(this, x); + x.WriteEndArray(); + } + x.WriteEndArray(); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Json/SimpleJsonTypeVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Json/SimpleJsonTypeVisitor.cs new file mode 100644 index 00000000..f1b58eb7 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Json/SimpleJsonTypeVisitor.cs @@ -0,0 +1,40 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.DataExporter.Builtin.Json; + +public class SimpleJsonTypeVisitor : AllTrueVisitor +{ + public static SimpleJsonTypeVisitor Ins { get; } = new(); + + public override bool Accept(TEnum type) + { + return false; + } + + public override bool Accept(TBean type) + { + //return type.Bean.IsNotAbstractType && type.Bean.HierarchyFields.All(f => f.CType.Apply(this)); + return false; + } + + public override bool Accept(TArray type) + { + return type.ElementType.Apply(this); + } + + public override bool Accept(TList type) + { + return type.ElementType.Apply(this); + } + + public override bool Accept(TSet type) + { + return type.ElementType.Apply(this); + } + + public override bool Accept(TMap type) + { + return false; + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Json/ToJsonLiteralVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Json/ToJsonLiteralVisitor.cs new file mode 100644 index 00000000..7dd0d73b --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Json/ToJsonLiteralVisitor.cs @@ -0,0 +1,105 @@ +using System.Text; +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.DataExporter.Builtin.Json; + +public class ToJsonLiteralVisitor : ToLiteralVisitorBase +{ + public static ToJsonLiteralVisitor Ins { get; } = new(); + + public override string Accept(DBean type) + { + var x = new StringBuilder(); + bool prevProperty = false; + if (type.Type.IsAbstractType) + { + x.Append($"{{ \"_name\":\"{type.ImplType.Name}\""); + prevProperty = true; + } + else + { + x.Append('{'); + } + + int index = 0; + foreach (var f in type.Fields) + { + var defField = (DefField)type.ImplType.HierarchyFields[index++]; + if (f == null || !defField.NeedExport()) + { + continue; + } + if (prevProperty) + { + x.Append(','); + } + else + { + prevProperty = true; + } + x.Append('\"').Append(defField.Name).Append('\"').Append(':'); + x.Append(f.Apply(this)); + } + x.Append('}'); + return x.ToString(); + } + + + protected virtual void Append(List<DType> datas, StringBuilder x) + { + x.Append('['); + int index = 0; + foreach (var e in datas) + { + if (index++ > 0) + { + x.Append(','); + } + x.Append(e.Apply(this)); + } + x.Append(']'); + } + + public override string Accept(DArray type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DList type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DSet type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DMap type) + { + var x = new StringBuilder(); + x.Append('{'); + int index = 0; + foreach (var e in type.Datas) + { + if (index++ > 0) + { + x.Append(','); + } + x.Append('"').Append(e.Key.Apply(ToJsonPropertyNameVisitor.Ins)).Append('"'); + x.Append(':'); + x.Append(e.Value.Apply(this)); + } + x.Append('}'); + return x.ToString(); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Json/ToJsonPropertyNameVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Json/ToJsonPropertyNameVisitor.cs new file mode 100644 index 00000000..0d261bc5 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Json/ToJsonPropertyNameVisitor.cs @@ -0,0 +1,84 @@ +using Luban.Datas; +using Luban.DataVisitors; + +namespace Luban.DataExporter.Builtin.Json; + +public class ToJsonPropertyNameVisitor : IDataFuncVisitor<string> +{ + public static ToJsonPropertyNameVisitor Ins { get; } = new(); + + public string Accept(DBool type) + { + throw new NotSupportedException(); + } + + public string Accept(DByte type) + { + return type.Value.ToString(); + } + + public string Accept(DShort type) + { + return type.Value.ToString(); + } + + public string Accept(DInt type) + { + return type.Value.ToString(); + } + + public string Accept(DLong type) + { + return type.Value.ToString(); + } + + public string Accept(DFloat type) + { + throw new NotSupportedException(); + } + + public string Accept(DDouble type) + { + throw new NotSupportedException(); + } + + public string Accept(DEnum type) + { + return type.Value.ToString(); + } + + public string Accept(DString type) + { + return type.Value; + } + + public string Accept(DDateTime type) + { + throw new NotSupportedException(); + } + + public string Accept(DBean type) + { + throw new NotSupportedException(); + } + + public string Accept(DArray type) + { + throw new NotSupportedException(); + } + + public string Accept(DList type) + { + throw new NotSupportedException(); + } + + public string Accept(DSet type) + { + throw new NotSupportedException(); + } + + public string Accept(DMap type) + { + throw new NotSupportedException(); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Luban.DataTarget.Builtin.csproj b/luban/src/Luban.DataTarget.Builtin/Luban.DataTarget.Builtin.csproj new file mode 100644 index 00000000..82c965d9 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Luban.DataTarget.Builtin.csproj @@ -0,0 +1,39 @@ +<!-- + - MIT License + - + - Copyright (c) 2023 Code Philosophy Technology Ltd. + - + - Permission is hereby granted, free of charge, to any person obtaining a copy + - of this software and associated documentation files (the "Software"), to deal + - in the Software without restriction, including without limitation the rights + - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + - copies of the Software, and to permit persons to whom the Software is + - furnished to do so, subject to the following conditions: + - + - The above copyright notice and this permission notice shall be included in all + - copies or substantial portions of the Software. + - + - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + - SOFTWARE. + --> + +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + <RootNamespace>Luban.DataExporter.Builtin</RootNamespace> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + <ProjectReference Include="..\Luban.DataLoader.Builtin\Luban.DataLoader.Builtin.csproj" /> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.DataTarget.Builtin/NullDataExporter.cs b/luban/src/Luban.DataTarget.Builtin/NullDataExporter.cs new file mode 100644 index 00000000..05cf7938 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/NullDataExporter.cs @@ -0,0 +1,12 @@ +using Luban.DataTarget; + +namespace Luban.DataExporter.Builtin; + +[DataExporter("null")] +public class NullDataExporter : DataExporterBase +{ + public override void Handle(GenerationContext ctx, IDataTarget dataTarget, OutputFileManifest manifest) + { + + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Res/ResDataVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Res/ResDataVisitor.cs new file mode 100644 index 00000000..86cc0aa8 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Res/ResDataVisitor.cs @@ -0,0 +1,121 @@ +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Types; + +namespace Luban.DataExporter.Builtin.Res; + +public class ResDataVisitor : IDataActionVisitor<TType, List<ResourceInfo>> +{ + public const string ResTagName = "res"; + + public static ResDataVisitor Ins { get; } = new(); + + public void Accept(DBool type, TType x, List<ResourceInfo> y) + { + + } + + public void Accept(DByte type, TType x, List<ResourceInfo> y) + { + + } + + public void Accept(DShort type, TType x, List<ResourceInfo> y) + { + + } + + public void Accept(DInt type, TType x, List<ResourceInfo> y) + { + + } + + public void Accept(DLong type, TType x, List<ResourceInfo> y) + { + + } + + public void Accept(DFloat type, TType x, List<ResourceInfo> y) + { + + } + + public void Accept(DDouble type, TType x, List<ResourceInfo> y) + { + + } + + public void Accept(DEnum type, TType x, List<ResourceInfo> y) + { + + } + + public void Accept(DString type, TType x, List<ResourceInfo> y) + { + if (!string.IsNullOrEmpty(type.Value) && x.HasTag(ResTagName)) + { + y.Add(new ResourceInfo() { Resource = type.Value, Tag = x.GetTag(ResTagName) }); + } + } + + public void Accept(DDateTime type, TType x, List<ResourceInfo> y) + { + + } + + public void Accept(DBean type, TType x, List<ResourceInfo> y) + { + var def = type.ImplType; + if (def == null) + { + return; + } + int index = 0; + foreach (DType fieldData in type.Fields) + { + if (fieldData == null) + { + continue; + } + var fieldDef = ((DefField)def.HierarchyFields[index++]).CType; + fieldData.Apply(this, fieldDef, y); + } + } + + private void Accept(List<DType> datas, TType elementType, List<ResourceInfo> ress) + { + foreach (var e in datas) + { + if (e != null) + { + e.Apply(this, elementType, ress); + } + } + } + + public void Accept(DArray type, TType x, List<ResourceInfo> y) + { + Accept(type.Datas, type.Type.ElementType, y); + } + + public void Accept(DList type, TType x, List<ResourceInfo> y) + { + Accept(type.Datas, type.Type.ElementType, y); + } + + public void Accept(DSet type, TType x, List<ResourceInfo> y) + { + Accept(type.Datas, type.Type.ElementType, y); + } + + public void Accept(DMap type, TType x, List<ResourceInfo> y) + { + TMap mtype = (TMap)x; + foreach (var (k, v) in type.Datas) + { + k.Apply(this, mtype.KeyType, y); + v.Apply(this, mtype.ValueType, y); + } + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Res/ResourceInfo.cs b/luban/src/Luban.DataTarget.Builtin/Res/ResourceInfo.cs new file mode 100644 index 00000000..a7961fe5 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Res/ResourceInfo.cs @@ -0,0 +1,8 @@ +namespace Luban.DataExporter.Builtin.Res; + +public class ResourceInfo +{ + public string Resource { get; set; } + + public string Tag { get; set; } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Xml/ToXmlLiteralVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Xml/ToXmlLiteralVisitor.cs new file mode 100644 index 00000000..7033a5f5 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Xml/ToXmlLiteralVisitor.cs @@ -0,0 +1,36 @@ +using System.Text; +using Luban.DataExporter.Builtin.Json; +using Luban.Datas; +using Luban.DataVisitors; + +namespace Luban.DataExporter.Builtin.Xml; + +public class ToXmlLiteralVisitor : ToLiteralVisitorBase +{ + public static ToXmlLiteralVisitor Ins { get; } = new(); + + public override string Accept(DBean type) + { + throw new NotSupportedException(); + } + + public override string Accept(DArray type) + { + throw new NotImplementedException(); + } + + public override string Accept(DList type) + { + throw new NotSupportedException(); + } + + public override string Accept(DSet type) + { + throw new NotSupportedException(); + } + + public override string Accept(DMap type) + { + throw new NotSupportedException(); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Xml/XmlDataTarget.cs b/luban/src/Luban.DataTarget.Builtin/Xml/XmlDataTarget.cs new file mode 100644 index 00000000..11cbe177 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Xml/XmlDataTarget.cs @@ -0,0 +1,41 @@ +using System.Text; +using System.Xml; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.DataExporter.Builtin.Xml; + +[DataTarget("xml")] +public class XmlDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "xml"; + + public void WriteAsArray(List<Record> datas, XmlWriter w) + { + w.WriteStartDocument(); + w.WriteStartElement("table"); + foreach (var d in datas) + { + w.WriteStartElement("record"); + d.Data.Apply(XmlDataVisitor.Ins, w); + w.WriteEndElement(); + } + w.WriteEndElement(); + w.WriteEndDocument(); + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var xwSetting = new XmlWriterSettings() + { + Indent = true, + Encoding = Encoding.UTF8, + }; + var ms = new MemoryStream(); + using var xmlWriter = XmlWriter.Create(ms, xwSetting); + WriteAsArray(records, xmlWriter); + xmlWriter.Flush(); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", Encoding.UTF8.GetString(DataUtil.StreamToBytes(ms))); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Xml/XmlDataVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Xml/XmlDataVisitor.cs new file mode 100644 index 00000000..d44b9c2a --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Xml/XmlDataVisitor.cs @@ -0,0 +1,133 @@ +using System.Numerics; +using System.Xml; +using Luban.DataLoader; +using Luban.DataLoader.Builtin; +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.DataExporter.Builtin.Xml; + +public class XmlDataVisitor : IDataActionVisitor<XmlWriter> +{ + public static XmlDataVisitor Ins { get; } = new(); + + public void Accept(DBool type, XmlWriter w) + { + w.WriteValue(type.Value); + } + + public void Accept(DByte type, XmlWriter w) + { + w.WriteValue(type.Value); + } + + public void Accept(DShort type, XmlWriter w) + { + w.WriteValue(type.Value); + } + + public void Accept(DInt type, XmlWriter w) + { + w.WriteValue(type.Value); + } + + public void Accept(DLong type, XmlWriter w) + { + w.WriteValue(type.Value); + } + + public void Accept(DFloat type, XmlWriter w) + { + w.WriteValue(type.Value); + } + + public void Accept(DDouble type, XmlWriter w) + { + w.WriteValue(type.Value); + } + + public void Accept(DEnum type, XmlWriter w) + { + w.WriteValue(type.Value); + } + + public void Accept(DString type, XmlWriter w) + { + w.WriteValue(type.Value); + } + + public void Accept(DDateTime type, XmlWriter w) + { + w.WriteValue(type.UnixTimeOfCurrentContext()); + } + + public void Accept(DBean type, XmlWriter w) + { + if (type.Type.IsAbstractType) + { + w.WriteAttributeString(FieldNames.XmlTypeNameKey, DataUtil.GetImplTypeName(type)); + } + + var defFields = type.ImplType.HierarchyFields; + int index = 0; + foreach (var d in type.Fields) + { + var defField = (DefField)defFields[index++]; + + // 特殊处理 bean 多态类型 + // 另外,不生成 xxx:null 这样 + if (d == null || !defField.NeedExport()) + { + //x.WriteNullValue(); + } + else + { + w.WriteStartElement(defField.Name); + d.Apply(this, w); + w.WriteEndElement(); + } + } + } + + private void WriteList(List<DType> datas, XmlWriter w) + { + foreach (var d in datas) + { + w.WriteStartElement("ele"); + d.Apply(this, w); + w.WriteEndElement(); + } + } + + public void Accept(DArray type, XmlWriter w) + { + WriteList(type.Datas, w); + } + + public void Accept(DList type, XmlWriter w) + { + WriteList(type.Datas, w); + } + + public void Accept(DSet type, XmlWriter w) + { + WriteList(type.Datas, w); + } + + public void Accept(DMap type, XmlWriter w) + { + foreach (var (k, v) in type.Datas) + { + w.WriteStartElement("ele"); + w.WriteStartElement("key"); + k.Apply(this, w); + w.WriteEndElement(); + w.WriteStartElement("value"); + v.Apply(this, w); + w.WriteEndElement(); + w.WriteEndElement(); + } + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Yaml/YamlDataTarget.cs b/luban/src/Luban.DataTarget.Builtin/Yaml/YamlDataTarget.cs new file mode 100644 index 00000000..332739ad --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Yaml/YamlDataTarget.cs @@ -0,0 +1,35 @@ +using Luban.DataTarget; +using Luban.Defs; +using Luban.Utils; +using System.Text; +using YamlDotNet.RepresentationModel; + +namespace Luban.DataExporter.Builtin.Yaml; + +[DataTarget("yaml")] +public class YamlDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "yml"; + + public YamlNode WriteAsArray(List<Record> datas) + { + + var seqNode = new YamlSequenceNode(); + foreach (var d in datas) + { + seqNode.Add(d.Data.Apply(YamlDataVisitor.Ins)); + } + return seqNode; + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var node = WriteAsArray(records); + var ys = new YamlStream(new YamlDocument(node)); + var ms = new MemoryStream(); + var tw = new StreamWriter(ms); + ys.Save(tw, false); + tw.Flush(); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", Encoding.UTF8.GetString(DataUtil.StreamToBytes(ms))); + } +} diff --git a/luban/src/Luban.DataTarget.Builtin/Yaml/YamlDataVisitor.cs b/luban/src/Luban.DataTarget.Builtin/Yaml/YamlDataVisitor.cs new file mode 100644 index 00000000..7e926725 --- /dev/null +++ b/luban/src/Luban.DataTarget.Builtin/Yaml/YamlDataVisitor.cs @@ -0,0 +1,142 @@ +using Luban.DataLoader; +using Luban.DataLoader.Builtin; +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Utils; +using YamlDotNet.Core; +using YamlDotNet.RepresentationModel; + +namespace Luban.DataExporter.Builtin.Yaml; + +public class YamlDataVisitor : IDataFuncVisitor<YamlNode> +{ + public static YamlDataVisitor Ins { get; } = new(); + + private static YamlScalarNode ToPlainNode(string x) + { + return new YamlScalarNode(x) { Style = ScalarStyle.Plain }; + } + + private static YamlScalarNode ToText(string x) + { + return new YamlScalarNode(x) { Style = ScalarStyle.SingleQuoted }; + } + + public YamlNode Accept(DBool type) + { + return ToPlainNode(type.Value ? "true" : "false"); + } + + public YamlNode Accept(DByte type) + { + return ToPlainNode(type.Value.ToString()); + } + + public YamlNode Accept(DShort type) + { + return ToPlainNode(type.Value.ToString()); + } + + public YamlNode Accept(DInt type) + { + return ToPlainNode(type.Value.ToString()); + } + + public YamlNode Accept(DLong type) + { + return ToPlainNode(type.Value.ToString()); + } + + public YamlNode Accept(DFloat type) + { + return ToPlainNode(type.Value.ToString()); + } + + public YamlNode Accept(DDouble type) + { + return ToPlainNode(type.Value.ToString()); + } + + public YamlNode Accept(DEnum type) + { + return ToPlainNode(type.Value.ToString()); + } + + public YamlNode Accept(DString type) + { + return ToText(type.Value); + } + + public YamlNode Accept(DDateTime type) + { + return ToPlainNode(type.UnixTimeOfCurrentContext().ToString()); + } + + public YamlNode Accept(DBean type) + { + var m = new YamlMappingNode(); + + if (type.Type.IsAbstractType) + { + m.Add(FieldNames.JsonTypeNameKey, ToText(DataUtil.GetImplTypeName(type))); + } + var defFields = type.ImplType.HierarchyFields; + int index = 0; + foreach (var d in type.Fields) + { + var defField = (DefField)defFields[index++]; + + // 特殊处理 bean 多态类型 + // 另外,不生成 xxx:null 这样 + if (d == null || !defField.NeedExport()) + { + //x.WriteNullValue(); + } + else + { + m.Add(defField.Name, d.Apply(this)); + } + } + + return m; + } + + public YamlSequenceNode ToSeqNode(List<DType> datas) + { + var seqNode = new YamlSequenceNode(); + foreach (var d in datas) + { + seqNode.Add(d.Apply(this)); + } + return seqNode; + } + + public YamlNode Accept(DArray type) + { + return ToSeqNode(type.Datas); + } + + public YamlNode Accept(DList type) + { + return ToSeqNode(type.Datas); + } + + public YamlNode Accept(DSet type) + { + return ToSeqNode(type.Datas); + } + + public YamlNode Accept(DMap type) + { + var seqNode = new YamlSequenceNode(); + foreach (var d in type.Datas) + { + var e = new YamlSequenceNode(); + e.Add(d.Key.Apply(this)); + e.Add(d.Value.Apply(this)); + seqNode.Add(e); + } + return seqNode; + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/AssemblyInfo.cs b/luban/src/Luban.DataValidator.Builtin/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.DataValidator.Builtin/Collection/IndexValidator.cs b/luban/src/Luban.DataValidator.Builtin/Collection/IndexValidator.cs new file mode 100644 index 00000000..cee90af7 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Collection/IndexValidator.cs @@ -0,0 +1,73 @@ +using Luban.Datas; +using Luban.DataValidator.Builtin.Range; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Luban.Validator; + +namespace Luban.DataValidator.Builtin.Collection; + +[Validator("index")] +public class IndexValidator : DataValidatorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private int _fieldIndex; + + public IndexValidator() + { + + } + + public override void Compile(DefField field, TType type) + { + TType elementType = type.ElementType; + if (elementType == null || type is TMap) + { + throw new Exception($" field:{field} index:{Args} validator not support type:{type}"); + } + if (elementType is not TBean bean) + { + throw new Exception($"field:{field} index:{Args} type:{elementType} validator only support bean type"); + } + + if (!bean.DefBean.TryGetField(Args, out var indexField, out _fieldIndex)) + { + throw new Exception($"field:{field} index:{Args} not exist in bean:{bean.DefBean.FullName}"); + } + + if (!indexField.NeedExport()) + { + throw new Exception($"field:{field} index:{Args} in bean:{bean.DefBean.FullName} is not export"); + } + } + + private IEnumerable<DType> GetElements(DType data) + { + switch (data) + { + case DArray array: + return array.Datas; + case DList list: + return list.Datas; + case DSet dset: + return dset.Datas; + default: + throw new Exception("not possible"); + } + } + + public override void Validate(DataValidatorContext ctx, TType type, DType data) + { + var values = new HashSet<DType>(); + foreach (var ele in GetElements(data)) + { + DType fieldData = ((DBean)ele).Fields[_fieldIndex]; + if (fieldData != null && !values.Add(fieldData)) + { + s_logger.Error("记录 {}:{} (来自文件:{}) index:{} value:{} 重复", DataValidatorContext.CurrentRecordPath, data, Source, Args, fieldData); + GenerationContext.Current.LogValidatorFail(this); + } + } + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Collection/SizeValidator.cs b/luban/src/Luban.DataValidator.Builtin/Collection/SizeValidator.cs new file mode 100644 index 00000000..da502dc7 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Collection/SizeValidator.cs @@ -0,0 +1,45 @@ +using Luban.Datas; +using Luban.DataValidator.Builtin.Range; +using Luban.Defs; +using Luban.Types; +using Luban.Validator; + +namespace Luban.DataValidator.Builtin.Collection; + +[Validator("size")] +public class SizeValidator : DataValidatorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private LongRange _range; + + private Func<DType, long> _sizeGetter; + + public SizeValidator() + { + + } + + public override void Compile(DefField field, TType type) + { + _range = new LongRange(Args); + _sizeGetter = type switch + { + TList => d => ((DList)d).Datas.Count, + TSet => d => ((DSet)d).Datas.Count, + TMap => d => ((DMap)d).Datas.Count, + TArray => d => ((DArray)d).Datas.Count, + _ => throw new Exception($"type:{type} field:{field} not support size validator"), + }; + } + + public override void Validate(DataValidatorContext ctx, TType type, DType data) + { + long size = _sizeGetter(data); + if (!_range.CheckInRange(size)) + { + s_logger.Error("记录 {}:{} (来自文件:{}) size:{},但要求为 {} ", DataValidatorContext.CurrentRecordPath, data, Source, size, _range.RawStr); + GenerationContext.Current.LogValidatorFail(this); + } + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Luban.DataValidator.Builtin.csproj b/luban/src/Luban.DataValidator.Builtin/Luban.DataValidator.Builtin.csproj new file mode 100644 index 00000000..12c0b887 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Luban.DataValidator.Builtin.csproj @@ -0,0 +1,13 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.DataValidator.Builtin/Misc/NotDefaultValueValidator.cs b/luban/src/Luban.DataValidator.Builtin/Misc/NotDefaultValueValidator.cs new file mode 100644 index 00000000..3129fe66 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Misc/NotDefaultValueValidator.cs @@ -0,0 +1,27 @@ +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Types; +using Luban.Validator; + +namespace Luban.DataValidator.Builtin.Misc; + +[Validator("not-default")] +public class NotDefaultValueValidator : DataValidatorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public override void Compile(DefField field, TType type) + { + + } + + public override void Validate(DataValidatorContext ctx, TType type, DType data) + { + if (data.Apply(IsDefaultValueVisitor.Ins)) + { + s_logger.Error("记录 {}:{} (来自文件:{}) 是一个默认值", DataValidatorContext.CurrentRecordPath, data, Source); + GenerationContext.Current.LogValidatorFail(this); + } + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Path/IPathPattern.cs b/luban/src/Luban.DataValidator.Builtin/Path/IPathPattern.cs new file mode 100644 index 00000000..2f00c36d --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Path/IPathPattern.cs @@ -0,0 +1,8 @@ +namespace Luban.DataValidator.Builtin.Path; + +interface IPathPattern +{ + bool ExistPath(string rootDir, string subFile); + + bool EmptyAble { get; set; } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Path/PathValidator.cs b/luban/src/Luban.DataValidator.Builtin/Path/PathValidator.cs new file mode 100644 index 00000000..3ac6b4e4 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Path/PathValidator.cs @@ -0,0 +1,124 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Luban.Validator; + +namespace Luban.DataValidator.Builtin.Path; + +[Validator("path")] +public class PathValidator : DataValidatorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private readonly string _rootDir; + + private string _rawPattern; + + private IPathPattern _pathPattern; + + public PathValidator() + { + if (!EnvManager.Current.TryGetOption(BuiltinOptionNames.PathValidatorFamily, BuiltinOptionNames.PathValidatorRootDir, false, out _rootDir)) + { + string key = $"{BuiltinOptionNames.PathValidatorFamily}.{BuiltinOptionNames.PathValidatorRootDir}"; + if (GenerationContext.Current.GetOrAddUniqueObject(key, () => this) == this) + { + s_logger.Warn("option '-x {0}=<rootValidationDir>' not found, path validation is disabled", key); + } + } + } + + public override void Compile(DefField field, TType type) + { + this._rawPattern = DefUtil.TrimBracePairs(Args); + + if (type is not TString) + { + ThrowCompileError(field, "只支持string类型"); + } + + string[] ss = _rawPattern.Split(';'); + if (ss.Length < 1) + { + ThrowCompileError(field, ""); + } + + string patType = ss[0]; + bool emptyAble = false; + if (patType.EndsWith('?')) + { + patType = patType[0..^1]; + emptyAble = true; + } + + switch (patType) + { + case "normal": + { + if (ss.Length != 2) + { + ThrowCompileError(field, ""); + } + string pat = ss[1]; + int indexOfStar = pat.IndexOf('*'); + if (indexOfStar < 0) + { + ThrowCompileError(field, "必须包含 * "); + } + _pathPattern = new SimpleReplacePattern(pat.Substring(0, indexOfStar), pat.Substring(indexOfStar + 1)); + break; + } + case "unity": + { + if (ss.Length != 1) + { + ThrowCompileError(field, ""); + } + _pathPattern = new UnityAddressablePattern(); + break; + } + case "ue": + { + if (ss.Length != 1) + { + ThrowCompileError(field, ""); + } + _pathPattern = new Ue4ResourcePattern(); + break; + } + default: + { + ThrowCompileError(field, $"不支持的path模式类型:{patType}"); + break; + } + } + + _pathPattern.EmptyAble = emptyAble; + } + + public override void Validate(DataValidatorContext ctx, TType type, DType data) + { + if (string.IsNullOrEmpty(_rootDir)) + { + return; + } + + string value = ((DString)data).Value; + if (value == "" && _pathPattern.EmptyAble) + { + return; + } + + if (!_pathPattern.ExistPath(_rootDir, value)) + { + s_logger.Error("{}:{} (来自文件:{}) 找不到对应文件", RecordPath, value, Source); + GenerationContext.Current.LogValidatorFail(this); + } + } + + private void ThrowCompileError(DefField def, string err) + { + throw new System.ArgumentException($"field:{def} {_rawPattern} 定义不合法. {err}"); + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Path/RegexPattern.cs b/luban/src/Luban.DataValidator.Builtin/Path/RegexPattern.cs new file mode 100644 index 00000000..5009b031 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Path/RegexPattern.cs @@ -0,0 +1,31 @@ +using System.Text.RegularExpressions; + +namespace Luban.DataValidator.Builtin.Path; + +class RegexPattern : IPathPattern +{ + private readonly string _replacePattern; + + private readonly Regex _re; + + public bool EmptyAble { get; set; } + + public string Mode => "regex"; + + public RegexPattern(string matchPattern, string replacePattern) + { + _re = new Regex(matchPattern); + _replacePattern = replacePattern; + } + + public bool ExistPath(string rootDir, string subFile) + { + if (!_re.IsMatch(subFile)) + { + return false; + } + var replacePath = _re.Replace(subFile, _replacePattern); + string finalPath = System.IO.Path.Combine(rootDir, replacePath); + return File.Exists(finalPath); + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Path/SimpleReplacePattern.cs b/luban/src/Luban.DataValidator.Builtin/Path/SimpleReplacePattern.cs new file mode 100644 index 00000000..2edf391d --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Path/SimpleReplacePattern.cs @@ -0,0 +1,23 @@ +namespace Luban.DataValidator.Builtin.Path; + +class SimpleReplacePattern : IPathPattern +{ + private readonly string _prefix; + private readonly string _suffix; + + public bool EmptyAble { get; set; } + + public string Mode => "normal"; + + public SimpleReplacePattern(string prefix, string suffix) + { + _prefix = prefix; + _suffix = suffix; + } + + public bool ExistPath(string rootDir, string subFile) + { + string finalPath = System.IO.Path.Combine(rootDir, _prefix + subFile + _suffix); + return File.Exists(finalPath); + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Path/Ue4ResourcePattern.cs b/luban/src/Luban.DataValidator.Builtin/Path/Ue4ResourcePattern.cs new file mode 100644 index 00000000..0c28b1e6 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Path/Ue4ResourcePattern.cs @@ -0,0 +1,59 @@ +using System.Text.RegularExpressions; + +namespace Luban.DataValidator.Builtin.Path; + +class Ue4ResourcePattern : IPathPattern +{ + private readonly Regex _pat1; + private readonly Regex _pat2; + + public bool EmptyAble { get; set; } + + public Ue4ResourcePattern() + { + _pat1 = new Regex(@"^/Game/(.+?)(\..+)?$"); + _pat2 = new Regex(@"^\w+'/Game/(.+?)(\..+)?'$"); + } + + private bool CheckMatch(Match match) + { + var groups = match.Groups; + if (!groups[1].Success) + { + return false; + } + if (groups[2].Success) + { + // 如果是 /Game/../xxx.yyy 的情形 + // 要求 yyy == xxx 或者 yyy == xxx_C + string path = groups[1].Value; + string suffix = groups[2].Value.Substring(1); + if (suffix.EndsWith("_C")) + { + suffix = suffix[0..^2]; + } + return path.EndsWith(suffix); + } + return true; + } + + private bool AlternativePaths(string rawPath) + { + return File.Exists($"{rawPath}.uasset") || File.Exists($"{rawPath}.umap"); + } + + public bool ExistPath(string rootDir, string subFile) + { + var match1 = _pat1.Match(subFile); + if (match1.Success) + { + return CheckMatch(match1) && AlternativePaths(System.IO.Path.Combine(rootDir, match1.Groups[1].Value)); + } + var match2 = _pat2.Match(subFile); + if (match2.Success) + { + return CheckMatch(match2) && AlternativePaths(System.IO.Path.Combine(rootDir, match2.Groups[1].Value)); + } + return false; + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Path/UnityAddressablePattern.cs b/luban/src/Luban.DataValidator.Builtin/Path/UnityAddressablePattern.cs new file mode 100644 index 00000000..40ec2511 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Path/UnityAddressablePattern.cs @@ -0,0 +1,15 @@ +namespace Luban.DataValidator.Builtin.Path; + +class UnityAddressablePattern : IPathPattern +{ + public bool EmptyAble { get; set; } + + public UnityAddressablePattern() + { + } + + public bool ExistPath(string rootDir, string subFile) + { + return File.Exists(System.IO.Path.Combine(rootDir, subFile)); + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Range/DoubleRange.cs b/luban/src/Luban.DataValidator.Builtin/Range/DoubleRange.cs new file mode 100644 index 00000000..43ba9114 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Range/DoubleRange.cs @@ -0,0 +1,105 @@ +namespace Luban.DataValidator.Builtin.Range; + +public class DoubleRange +{ + private readonly string _str; + + private readonly double? _min; + private readonly double? _max; + + private readonly bool _includeMinBound; + private readonly bool _includeMaxBound; + + public DoubleRange(string strRange) + { + _str = strRange.Trim(); + + if (double.TryParse(_str, out var value)) + { + _min = _max = value; + _includeMinBound = _includeMaxBound = true; + return; + } + + if (_str.Length <= 2) + { + throw new Exception($"range定义不合法"); + } + switch (_str[0]) + { + case '[': + _includeMinBound = true; + break; + case '(': + _includeMinBound = false; + break; + default: + throw new Exception($"range定义不合法"); + } + switch (_str[^1]) + { + case ']': + _includeMaxBound = true; + break; + case ')': + _includeMaxBound = false; + break; + default: + throw new Exception($"range定义不合法"); + } + + var pars = _str[1..^1].Split(','); + if (pars.Length != 2) + { + throw new Exception($"range定义不合法"); + } + + bool p1 = TryParse(pars[0], ref _min); + bool p2 = TryParse(pars[1], ref _max); + + if (!p1 || !p2) + { + throw new Exception($"range定义不合法"); + } + if (_min != (int)_min) + { + _min -= 1e-6; + } + if (_max != (int)_max) + { + _max += 1e-6; + } + } + + public string RawStr => _str; + + private bool TryParse(string s, ref double? x) + { + s = s.Trim(); + if (string.IsNullOrEmpty(s)) + { + x = null; + return true; + } + if (double.TryParse(s, out var v)) + { + x = v; + return true; + } + return false; + } + + + public bool CheckInRange(double x) + { + if (_min is { } m && (_includeMinBound ? m > x : m >= x)) + { + return false; + } + if (_max is { } n && (_includeMaxBound ? n < x : n <= x)) + { + return false; + } + return true; + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Range/LongRange.cs b/luban/src/Luban.DataValidator.Builtin/Range/LongRange.cs new file mode 100644 index 00000000..57bbd308 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Range/LongRange.cs @@ -0,0 +1,97 @@ +namespace Luban.DataValidator.Builtin.Range; + +public class LongRange +{ + private readonly string _str; + + private readonly long? _min; + private readonly long? _max; + + private readonly bool _includeMinBound; + private readonly bool _includeMaxBound; + + public LongRange(string strRange) + { + _str = strRange.Trim(); + + if (long.TryParse(_str, out long value)) + { + _min = _max = value; + _includeMinBound = _includeMaxBound = true; + return; + } + + if (_str.Length <= 2) + { + throw new Exception($"range定义不合法"); + } + switch (_str[0]) + { + case '[': + _includeMinBound = true; + break; + case '(': + _includeMinBound = false; + break; + default: + throw new Exception($"range定义不合法"); + } + switch (_str[^1]) + { + case ']': + _includeMaxBound = true; + break; + case ')': + _includeMaxBound = false; + break; + default: + throw new Exception($"range定义不合法"); + } + + var pars = _str[1..^1].Split(','); + if (pars.Length != 2) + { + throw new Exception($"range定义不合法"); + } + + bool p1 = TryParse(pars[0], ref _min); + bool p2 = TryParse(pars[1], ref _max); + + if (!p1 || !p2) + { + throw new Exception($"range定义不合法"); + } + } + + public string RawStr => _str; + + private bool TryParse(string s, ref long? x) + { + s = s.Trim(); + if (string.IsNullOrEmpty(s)) + { + x = null; + return true; + } + if (long.TryParse(s, out var v)) + { + x = v; + return true; + } + return false; + } + + + public bool CheckInRange(long x) + { + if (_min is { } m && (_includeMinBound ? m > x : m >= x)) + { + return false; + } + if (_max is { } n && (_includeMaxBound ? n < x : n <= x)) + { + return false; + } + return true; + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Range/RangeValidator.cs b/luban/src/Luban.DataValidator.Builtin/Range/RangeValidator.cs new file mode 100644 index 00000000..e7f3e50b --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Range/RangeValidator.cs @@ -0,0 +1,76 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Validator; + +namespace Luban.DataValidator.Builtin.Range; + +[Validator("range")] +public class RangeValidator : DataValidatorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private LongRange _longRange; + private DoubleRange _doubleRange; + + private Func<DType, long> _longGetter; + private Func<DType, double> _doubleGetter; + + public RangeValidator() + { + } + + public override void Compile(DefField field, TType type) + { + switch (type) + { + case TByte: + { + _longRange = new LongRange(Args); + _longGetter = d => ((DByte)d).Value; + break; + } + case TShort: + { + _longRange = new LongRange(Args); + _longGetter = d => ((DShort)d).Value; + break; + } + case TInt: + { + _longRange = new LongRange(Args); + _longGetter = d => ((DInt)d).Value; + break; + } + case TLong: + { + _longRange = new LongRange(Args); + _longGetter = d => ((DLong)d).Value; + break; + } + case TFloat: + { + _doubleRange = new DoubleRange(Args); + _doubleGetter = d => ((DFloat)d).Value; + break; + } + case TDouble: + { + _doubleRange = new DoubleRange(Args); + _doubleGetter = d => ((DDouble)d).Value; + break; + } + default: + throw new Exception($"range not support type:{type} field:{field}"); + } + } + + public override void Validate(DataValidatorContext ctx, TType type, DType data) + { + if ((_longRange != null && !_longRange.CheckInRange(_longGetter(data))) || (_doubleRange != null && !_doubleRange.CheckInRange(_doubleGetter(data)))) + { + s_logger.Error("记录 {}:{} (来自文件:{}) 不在范围:{}内", DataValidatorContext.CurrentRecordPath, data, Source, Args); + GenerationContext.Current.LogValidatorFail(this); + } + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Ref/RefValidator.cs b/luban/src/Luban.DataValidator.Builtin/Ref/RefValidator.cs new file mode 100644 index 00000000..3a3efbd0 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Ref/RefValidator.cs @@ -0,0 +1,215 @@ +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Luban.Validator; + +namespace Luban.DataValidator.Builtin.Ref; + +[Validator("ref")] +public class RefValidator : DataValidatorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private List<string> _tables; + + private readonly List<(DefTable Table, string Index, bool IgnoreDefault)> _compiledTables = new(); + + public RefValidator() + { + + } + + public override void Compile(DefField field, TType type) + { + this._tables = DefUtil.TrimBracePairs(Args).Split(',').Select(s => s.Trim()).ToList(); + if (_tables.Count == 0) + { + throw new Exception($"field:{field} ref 不能为空"); + } + + var assembly = field.Assembly; + foreach (var table in _tables) + { + var (actualTable, indexName, ignoreDefault) = ParseRefString(table); + DefTable ct; + DefRefGroup refGroup; + if ((ct = assembly.GetCfgTable(actualTable)) != null) + { + CompileTable(field, type, ct, indexName, ignoreDefault); + } + else if ((refGroup = assembly.GetRefGroup(actualTable)) != null) + { + if (!string.IsNullOrWhiteSpace(indexName)) + { + throw new Exception($"refgroup:'{actualTable}' index:'{indexName}' 必须为空"); + } + foreach (var rawRefTableName in refGroup.Refs) + { + var (actualRefTableName, refIndex, refIgnoreDefault) = ParseRefString(rawRefTableName); + DefTable subTable = assembly.GetCfgTable(actualRefTableName); + if (subTable == null) + { + throw new Exception($"field:{field} refgroup:'{actualTable}' ref:'{actualRefTableName}' 不存在"); + } + CompileTable(field, type, subTable, refIndex, ignoreDefault || refIgnoreDefault); + } + } + else + { + throw new Exception($"field:{field} ref:'{actualTable}' 不存在"); + } + } + } + + public override void Validate(DataValidatorContext ctx, TType type, DType key) + { + var genCtx = GenerationContext.Current; + var excludeTags = genCtx.ExcludeTags; + + foreach (var tableInfo in _compiledTables) + { + var (defTable, field, zeroAble) = tableInfo; + if (zeroAble && key.Apply(IsDefaultValueVisitor.Ins)) + { + return; + } + + switch (defTable.Mode) + { + case TableMode.ONE: + { + throw new NotSupportedException($"{defTable.FullName} 是singleton表,不支持ref"); + } + case TableMode.MAP: + { + var recordMap = genCtx.GetTableDataInfo(defTable).FinalRecordMap; + if (recordMap.TryGetValue(key, out Record rec)) + { + /* + if (!rec.IsNotFiltered(excludeTags)) + { + s_logger.Error("记录 {} = {} (来自文件:{}) 在引用表:{} 中存在,但导出时被过滤了", + RecordPath, key, Source, defTable.FullName); + } + */ + return; + } + break; + } + case TableMode.LIST: + { + var recordMap = genCtx.GetTableDataInfo(defTable).FinalRecordMapByIndexs[field]; + if (recordMap.TryGetValue(key, out Record rec)) + { + /* + if (!rec.IsNotFiltered(excludeTags)) + { + s_logger.Error("记录 {} = {} (来自文件:{}) 在引用表:{} 中存在,但导出时被过滤了", + RecordPath, key, Source, defTable.FullName); + } + */ + return; + } + break; + } + default: + throw new NotSupportedException(); + } + } + + foreach (var table in _compiledTables) + { + s_logger.Error("记录 {} = {} (来自文件:{}) 在引用表:{} 中不存在", RecordPath, key, Source, table.Table.FullName); + } + GenerationContext.Current.LogValidatorFail(this); + } + + private static (string TableName, string FieldName, bool IgnoreDefault) ParseRefString(string refStr) + { + bool ignoreDefault = false; + + if (refStr.EndsWith("?")) + { + refStr = refStr.Substring(0, refStr.Length - 1); + ignoreDefault = true; + } + + string tableName; + string fieldName; + int sepIndex = refStr.IndexOf('@'); + if (sepIndex >= 0) + { + tableName = refStr.Substring(sepIndex + 1); + fieldName = refStr.Substring(0, sepIndex); + } + else + { + tableName = refStr; + fieldName = ""; + } + return (tableName, fieldName, ignoreDefault); + } + + private void CompileTable(DefField field, TType type, DefTable table, string indexName, bool ignoreDefault) + { + _compiledTables.Add((table, indexName, ignoreDefault)); + + string actualTable = table.FullName; + string fieldTypeName = type.TypeName; + string valueTypeName = table.ValueTType.DefBean.FullName; + if (!table.NeedExport() && field.NeedExport() && field.HostType.Assembly.ExportTables.Any(t => t.ValueTType.DefBean.IsAssignableFrom(field.HostType))) + { + throw new Exception($"field:'{field}' ref 引用的表:'{actualTable}' 没有导出"); + } + if (table.IsSingletonTable) + { + if (string.IsNullOrEmpty(indexName)) + { + throw new Exception($"field:'{field}' ref:{actualTable} 是singleton表,索引字段不能为空"); + } + if (!table.ValueTType.DefBean.TryGetField(indexName, out var indexField, out _)) + { + throw new Exception($"field:'{field}' ref:{actualTable} value_type:{valueTypeName} 未包含索引字段:{indexName}"); + } + if (!(indexField.CType is TMap tmap)) + { + throw new Exception($"field:'{field}' ref:{actualTable} value_type:{valueTypeName} 索引字段:{indexName} type:{indexField.CType.TypeName} 不是map类型"); + } + if (tmap.KeyType.TypeName != fieldTypeName) + { + throw new Exception($"field:'{field}' 类型:'{type.TypeName}' 与被引用的表:{actualTable} value_type:{valueTypeName} 索引字段:{indexName} key_type:{tmap.KeyType.TypeName} 不一致"); + } + + } + else if (table.IsMapTable) + { + if (!string.IsNullOrEmpty(indexName)) + { + throw new Exception($"field:'{field}' ref:{actualTable} 是map表,不能索引子字段"); + } + var keyType = table.KeyTType; + if (keyType.TypeName != fieldTypeName) + { + throw new Exception($"field:'{field}' 类型:'{fieldTypeName}' 与 被引用的map表:'{actualTable}' key类型:'{keyType.TypeName}' 不一致"); + } + } + else + { + if (string.IsNullOrEmpty(indexName)) + { + throw new Exception($"field:'{field}' ref:{actualTable} 是list表,必须显式指定索引字段"); + } + var indexField = table.IndexList.Find(k => k.IndexField.Name == indexName); + if (indexField.Type == null) + { + throw new Exception($"field:'{field}' 索引字段:{indexName} 不是被引用的list表:{actualTable} 的索引字段,合法值为'{table.Index}'之一"); + } + if (indexField.Type.TypeName != fieldTypeName) + { + throw new Exception($"field:'{field}' 类型:'{fieldTypeName}' 与 被引用的list表:'{actualTable}' key:{indexName} 类型:'{indexField.Type.TypeName}' 不一致"); + } + } + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Set/LongDataSet.cs b/luban/src/Luban.DataValidator.Builtin/Set/LongDataSet.cs new file mode 100644 index 00000000..668ea8d1 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Set/LongDataSet.cs @@ -0,0 +1,21 @@ +namespace Luban.DataValidator.Builtin.Set; + +public class LongDataSet +{ + private readonly HashSet<long> _values; + + public LongDataSet(string args) + { + _values = args.Split(',').Select(long.Parse).ToHashSet(); + } + + public LongDataSet(IEnumerable<long> args) + { + _values = args.ToHashSet(); + } + + public bool Contains(long value) + { + return _values.Contains(value); + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Set/SetValidator.cs b/luban/src/Luban.DataValidator.Builtin/Set/SetValidator.cs new file mode 100644 index 00000000..5939e43e --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Set/SetValidator.cs @@ -0,0 +1,83 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Luban.Validator; + +namespace Luban.DataValidator.Builtin.Set; + +[Validator("set")] +public class SetValidator : DataValidatorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private LongDataSet _longSet; + private StringDataSet _stringSet; + + private Func<DType, long> _longGetter; + private Func<DType, string> _stringGetter; + + private string _valueSetStr; + + public SetValidator() + { + } + + public override void Compile(DefField field, TType type) + { + _valueSetStr = Args; + switch (type) + { + case TByte: + { + _longSet = new LongDataSet(Args); + _longGetter = d => ((DByte)d).Value; + break; + } + case TShort: + { + _longSet = new LongDataSet(Args); + _longGetter = d => ((DShort)d).Value; + break; + } + case TInt: + { + _longSet = new LongDataSet(Args); + _longGetter = d => ((DInt)d).Value; + break; + } + case TLong: + { + _longSet = new LongDataSet(Args); + _longGetter = d => ((DLong)d).Value; + break; + } + case TEnum etype: + { + DefEnum enumType = etype.DefEnum; + _longSet = new LongDataSet(Args.Split(',').Select(s => (long)enumType.GetValueByNameOrAlias(s))); + _longGetter = d => ((DEnum)d).Value; + break; + } + case TString: + { + _stringSet = new StringDataSet(Args); + _stringGetter = d => ((DString)d).Value; + break; + } + default: + { + throw new Exception($"set not support type:{type} field:{field}"); + } + } + } + + public override void Validate(DataValidatorContext ctx, TType type, DType data) + { + if ((_longSet != null && !_longSet.Contains(_longGetter(data))) || (_stringSet != null && !_stringSet.Contains(_stringGetter(data)))) + { + s_logger.Error("记录 {}:{} (来自文件:{}) 值不在set:{}中", RecordPath, data, Source, _valueSetStr); + GenerationContext.Current.LogValidatorFail(this); + } + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Set/StringDataSet.cs b/luban/src/Luban.DataValidator.Builtin/Set/StringDataSet.cs new file mode 100644 index 00000000..65ac3c34 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Set/StringDataSet.cs @@ -0,0 +1,15 @@ +namespace Luban.DataValidator.Builtin.Set; + +public class StringDataSet +{ + private readonly HashSet<string> _values; + public StringDataSet(string args) + { + _values = args.Split(',').ToHashSet(); + } + + public bool Contains(string value) + { + return _values.Contains(value); + } +} diff --git a/luban/src/Luban.DataValidator.Builtin/Str/RegexValidator.cs b/luban/src/Luban.DataValidator.Builtin/Str/RegexValidator.cs new file mode 100644 index 00000000..9e618eb0 --- /dev/null +++ b/luban/src/Luban.DataValidator.Builtin/Str/RegexValidator.cs @@ -0,0 +1,54 @@ +using System.Text.RegularExpressions; +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Luban.Validator; + +namespace Luban.DataValidator.Builtin.Str; + +[Validator("regex")] +public class RegexValidator : DataValidatorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private Regex _regex; + + private Func<DType, string> _stringGetter; + + public RegexValidator() + { + } + + public override void Compile(DefField field, TType type) + { + _regex = new Regex(Args, RegexOptions.Compiled); + switch (type) + { + case TString: + { + _stringGetter = d => ((DString)d).Value; + break; + } + default: + { + throw new Exception($"type:{field.CType} field:{field} not support regex validator"); + } + } + } + + + public override void Validate(DataValidatorContext ctx, TType type, DType data) + { + Validate(ctx, type.IsNullable, data); + } + + private void Validate(DataValidatorContext ctx, bool nullable, DType data) + { + if (!_regex.IsMatch(_stringGetter(data))) + { + s_logger.Error($"记录 {RecordPath}:{data} (来自文件:{Source}) 不符合正则表达式:'{_regex}'"); + GenerationContext.Current.LogValidatorFail(this); + } + } +} diff --git a/luban/src/Luban.FlatBuffers/AssemblyInfo.cs b/luban/src/Luban.FlatBuffers/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.FlatBuffers/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.FlatBuffers/CodeTarget/FlatBuffersSchemaTarget.cs b/luban/src/Luban.FlatBuffers/CodeTarget/FlatBuffersSchemaTarget.cs new file mode 100644 index 00000000..6e932175 --- /dev/null +++ b/luban/src/Luban.FlatBuffers/CodeTarget/FlatBuffersSchemaTarget.cs @@ -0,0 +1,53 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.Defs; +using Luban.FlatBuffers.TemplateExtensions; +using Luban.FlatBuffers.TypeVisitors; +using Luban.Tmpl; +using Scriban; +using Scriban.Runtime; + +namespace Luban.FlatBuffers.CodeTarget; + +[CodeTarget("flatbuffers")] +public class FlatBuffersSchemaTarget : AllInOneTemplateCodeTargetBase +{ + public override string FileHeader => ""; + + protected override string FileSuffixName => "fbs"; + + protected override ICodeStyle CodeStyle => CodeFormatManager.Ins.NoneCodeStyle; + + protected override string DefaultOutputFileName => "schema.fbs"; + + private static readonly HashSet<string> s_preservedKeyWords = new() + { + // flatbuffers schema preserved key words + "namespace", "enum", "struct", "union", "table", "root_table", "rpc_service", "file_extension", "attribute", "deprecated", "force_align", "include" + }; + + protected override IReadOnlySet<string> PreservedKeyWords => s_preservedKeyWords; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new FlatBuffersTemplateExtension()); + + var maps = CollectKeyValueEntry(GenerationContext.Current.ExportBeans).KeyValueEntries.Values; + ctx.PushGlobal(new ScriptObject() + { + {"__maps", maps}, + }); + } + + private MapKeyValueEntryCollection CollectKeyValueEntry(List<DefBean> beans) + { + var c = new MapKeyValueEntryCollection(); + + foreach (DefBean bean in beans) + { + CollectMapKeyValueEntriesVisitor.Ins.Accept(bean, c); + } + + return c; + } +} diff --git a/luban/src/Luban.FlatBuffers/DataTarget/FlatBuffersDataTarget.cs b/luban/src/Luban.FlatBuffers/DataTarget/FlatBuffersDataTarget.cs new file mode 100644 index 00000000..cd84c41b --- /dev/null +++ b/luban/src/Luban.FlatBuffers/DataTarget/FlatBuffersDataTarget.cs @@ -0,0 +1,42 @@ +using System.Text.Json; +using Luban.DataExporter.Builtin.Json; +using Luban.DataTarget; +using Luban.Defs; +using Luban.FlatBuffers.DataVisitors; +using Luban.Utils; + +namespace Luban.FlatBuffers.DataTarget; + +[DataTarget("flatbuffers-json")] +public class FlatBuffersDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "json"; + + private void WriteAsTable(List<Record> datas, Utf8JsonWriter x) + { + x.WriteStartObject(); + // 如果修改了这个名字,请同时修改table.tpl + x.WritePropertyName("data_list"); + x.WriteStartArray(); + foreach (var d in datas) + { + d.Data.Apply(FlatBuffersJsonDataVisitor.Ins, x); + } + x.WriteEndArray(); + x.WriteEndObject(); + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var ss = new MemoryStream(); + var jsonWriter = new Utf8JsonWriter(ss, new JsonWriterOptions() + { + Indented = !JsonDataTarget.UseCompactJson, + SkipValidation = false, + Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + }); + WriteAsTable(records, jsonWriter); + jsonWriter.Flush(); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", DataUtil.StreamToBytes(ss)); + } +} diff --git a/luban/src/Luban.FlatBuffers/DataVisitors/FlatBuffersJsonDataVisitor.cs b/luban/src/Luban.FlatBuffers/DataVisitors/FlatBuffersJsonDataVisitor.cs new file mode 100644 index 00000000..c86b4168 --- /dev/null +++ b/luban/src/Luban.FlatBuffers/DataVisitors/FlatBuffersJsonDataVisitor.cs @@ -0,0 +1,69 @@ +using System.Text.Json; +using Luban.DataExporter.Builtin.Json; +using Luban.Datas; +using Luban.Defs; +using Luban.FlatBuffers.TypeVisitors; +using Luban.Types; +using Luban.Utils; + +namespace Luban.FlatBuffers.DataVisitors; + +public class FlatBuffersJsonDataVisitor : JsonDataVisitor +{ + public static new FlatBuffersJsonDataVisitor Ins { get; } = new(); + + public override void Accept(DBean type, Utf8JsonWriter x) + { + x.WriteStartObject(); + + // flatc 不允许有多余字段 + //if (type.Type.IsAbstractType) + //{ + // x.WritePropertyName(FieldNames.TYPE_NAME_KEY); + // x.WriteStringValue(type.ImplType.Name); + //} + + var defFields = type.ImplType.HierarchyFields; + int index = 0; + foreach (var d in type.Fields) + { + var defField = (DefField)defFields[index++]; + + // 特殊处理 bean 多态类型 + // 另外,不生成 xxx:null 这样 + if (d == null || !defField.NeedExport()) + { + //x.WriteNullValue(); + } + else + { + // flatbuffers的union类型的json格式,会额外产生一个 xx_type字段。 + // 另外,json格式不支持union出现在容器类型上。 + if (d is DBean beanField && beanField.Type.IsAbstractType) + { + x.WritePropertyName($"{defField.Name}_type"); + x.WriteStringValue(TBean.Create(defField.CType.IsNullable, beanField.ImplType, null).Apply(FlatBuffersTypeNameVisitor.Ins)); + } + + x.WritePropertyName(defField.Name); + d.Apply(this, x); + } + } + x.WriteEndObject(); + } + + public override void Accept(DMap type, Utf8JsonWriter x) + { + x.WriteStartArray(); + foreach (var d in type.Datas) + { + x.WriteStartObject(); + x.WritePropertyName("key"); + d.Key.Apply(this, x); + x.WritePropertyName("value"); + d.Value.Apply(this, x); + x.WriteEndObject(); + } + x.WriteEndArray(); + } +} diff --git a/luban/src/Luban.FlatBuffers/Luban.FlatBuffers.csproj b/luban/src/Luban.FlatBuffers/Luban.FlatBuffers.csproj new file mode 100644 index 00000000..557d9207 --- /dev/null +++ b/luban/src/Luban.FlatBuffers/Luban.FlatBuffers.csproj @@ -0,0 +1,26 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + <ProjectReference Include="..\Luban.DataTarget.Builtin\Luban.DataTarget.Builtin.csproj" /> + </ItemGroup> + + <ItemGroup> + <None Update="Templates\pb\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\fbs\schema.sbn"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Update="Templates\flatbuffers\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.FlatBuffers/TemplateExtensions/FlatBuffersTemplateExtension.cs b/luban/src/Luban.FlatBuffers/TemplateExtensions/FlatBuffersTemplateExtension.cs new file mode 100644 index 00000000..5af6dcdf --- /dev/null +++ b/luban/src/Luban.FlatBuffers/TemplateExtensions/FlatBuffersTemplateExtension.cs @@ -0,0 +1,25 @@ +using Luban.Defs; +using Luban.FlatBuffers.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.FlatBuffers.TemplateExtensions; + +public class FlatBuffersTemplateExtension : ScriptObject +{ + public static string FullName(DefTypeBase type) + { + return TypeUtil.MakeFlatBuffersFullName(type.Namespace, type.Name); + } + + public static string DeclaringTypeName(TType type) + { + return type.Apply(FlatBuffersTypeNameVisitor.Ins); + } + + public static string TypeMetadata(TType type) + { + return type.IsNullable || type.Apply(IsFlatBuffersScalarTypeVisitor.Ins) ? "" : "(required)"; + } +} diff --git a/luban/src/Luban.FlatBuffers/Templates/flatbuffers/schema.sbn b/luban/src/Luban.FlatBuffers/Templates/flatbuffers/schema.sbn new file mode 100644 index 00000000..ca8099c1 --- /dev/null +++ b/luban/src/Luban.FlatBuffers/Templates/flatbuffers/schema.sbn @@ -0,0 +1,51 @@ +namespace {{__namespace}}; + +{{~for enum in __enums + typeName = full_name enum + ~}} +enum {{typeName}}:int { + {{~if !enum.has_zero_value_item~}} + __GENERATE_DEFAULT_VALUE = 0, + {{~end~}} + {{~for item in enum.items ~}} + {{typeName}}_{{item.name}} = {{item.int_value}}, + {{~end~}} +} +{{~end~}} + +{{~for bean in __beans~}} +{{~if bean.is_abstract_type ~}} +union {{full_name bean}} { + {{~for c in bean.hierarchy_not_abstract_children~}} + {{full_name c}}, + {{~end~}} +} +{{~end~}} +{{~end~}} + +{{~for bean in __beans~}} +{{~if !bean.is_abstract_type ~}} +table {{full_name bean}} { + {{~for f in bean.hierarchy_export_fields ~}} + {{f.name}}:{{declaring_type_name f.ctype}}{{type_metadata f.ctype}}; + {{~end~}} +} +{{~end~}} +{{~end~}} + +{{~for map in __maps~}} +table KeyValue_{{declaring_type_name map.key_type}}_{{declaring_type_name map.value_type}} { + key: {{declaring_type_name map.key_type}}{{type_metadata map.key_type}}; + value: {{declaring_type_name map.value_type}}{{type_metadata map.value_type}}; +} +{{~end~}} + +{{~for table in __tables~}} +table {{full_name table}} { + // WARN! The name 'data_list' is used by FlatBuffersJsonExporter. don't modify it! + data_list:[{{declaring_type_name table.value_ttype}}](required); +} + +root_type {{full_name table}}; +{{~end~}} + diff --git a/luban/src/Luban.FlatBuffers/TypeVisitors/CollectMapKeyValueEntriesVisitor.cs b/luban/src/Luban.FlatBuffers/TypeVisitors/CollectMapKeyValueEntriesVisitor.cs new file mode 100644 index 00000000..dcc35ee7 --- /dev/null +++ b/luban/src/Luban.FlatBuffers/TypeVisitors/CollectMapKeyValueEntriesVisitor.cs @@ -0,0 +1,80 @@ +using Luban.Defs; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.FlatBuffers.TypeVisitors; + +public class MapKeyValueEntryCollection +{ + public Dictionary<string, TMap> KeyValueEntries { get; } = new(); + + public HashSet<string> VisitedTypes { get; } = new(); +} + +public class CollectMapKeyValueEntriesVisitor : DecoratorActionVisitor<MapKeyValueEntryCollection> +{ + public static CollectMapKeyValueEntriesVisitor Ins { get; } = new(); + + + public override void DoAccept(TType type, MapKeyValueEntryCollection x) + { + + } + + public void Accept(DefBean bean, MapKeyValueEntryCollection x) + { + if (!x.VisitedTypes.Add(bean.FullName)) + { + return; + } + if (bean.IsAbstractType) + { + foreach (var c in bean.HierarchyNotAbstractChildren) + { + Accept(c, x); + } + } + else + { + foreach (var field in bean.HierarchyFields) + { + field.CType.Apply(this, x); + } + } + } + + private static string MakeKeyValueType(TMap type) + { + return $"{type.KeyType.Apply(FlatBuffersTypeNameVisitor.Ins)}_{type.ValueType.Apply(FlatBuffersTypeNameVisitor.Ins)}"; + } + + public override void Accept(TBean type, MapKeyValueEntryCollection x) + { + Accept(type.DefBean, x); + } + + public override void Accept(TArray type, MapKeyValueEntryCollection x) + { + if (type.ElementType is TBean tbean) + { + tbean.Apply(this, x); + } + } + + public override void Accept(TList type, MapKeyValueEntryCollection x) + { + if (type.ElementType is TBean tbean) + { + tbean.Apply(this, x); + } + } + + public override void Accept(TMap type, MapKeyValueEntryCollection x) + { + x.KeyValueEntries[MakeKeyValueType(type)] = type; + if (type.ValueType is TBean tbean) + { + tbean.Apply(this, x); + } + } +} diff --git a/luban/src/Luban.FlatBuffers/TypeVisitors/FlatBuffersTypeNameVisitor.cs b/luban/src/Luban.FlatBuffers/TypeVisitors/FlatBuffersTypeNameVisitor.cs new file mode 100644 index 00000000..27b4a63e --- /dev/null +++ b/luban/src/Luban.FlatBuffers/TypeVisitors/FlatBuffersTypeNameVisitor.cs @@ -0,0 +1,85 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.FlatBuffers.TypeVisitors; + +public class FlatBuffersTypeNameVisitor : ITypeFuncVisitor<string> +{ + public static FlatBuffersTypeNameVisitor Ins { get; } = new(); + + public string Accept(TBool type) + { + return "bool"; + } + + public string Accept(TByte type) + { + return "ubyte"; + } + + public string Accept(TShort type) + { + return "int16"; + } + + public string Accept(TInt type) + { + return "int32"; + } + + public string Accept(TLong type) + { + return "int64"; + } + + public string Accept(TFloat type) + { + return "float32"; + } + + public string Accept(TDouble type) + { + return "float64"; + } + + public string Accept(TEnum type) + { + return TypeUtil.MakeFlatBuffersFullName(type.DefEnum.Namespace, type.DefEnum.Name); + } + + public string Accept(TString type) + { + return "string"; + } + + public string Accept(TDateTime type) + { + return "int64"; + } + + public string Accept(TBean type) + { + return TypeUtil.MakeFlatBuffersFullName(type.DefBean.Namespace, type.DefBean.Name); + } + + public string Accept(TArray type) + { + return $"[{type.ElementType.Apply(this)}]"; + } + + public string Accept(TList type) + { + return $"[{type.ElementType.Apply(this)}]"; + } + + public string Accept(TSet type) + { + return $"[{type.ElementType.Apply(this)}]"; + } + + public string Accept(TMap type) + { + return $"[KeyValue_{type.KeyType.Apply(this)}_{type.ValueType.Apply(this)}]"; + } +} diff --git a/luban/src/Luban.FlatBuffers/TypeVisitors/IsFlatBuffersScalarTypeVisitor.cs b/luban/src/Luban.FlatBuffers/TypeVisitors/IsFlatBuffersScalarTypeVisitor.cs new file mode 100644 index 00000000..43a282ad --- /dev/null +++ b/luban/src/Luban.FlatBuffers/TypeVisitors/IsFlatBuffersScalarTypeVisitor.cs @@ -0,0 +1,34 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.FlatBuffers.TypeVisitors; + +public class IsFlatBuffersScalarTypeVisitor : AllTrueVisitor +{ + public static IsFlatBuffersScalarTypeVisitor Ins { get; } = new(); + + public override bool Accept(TBean type) + { + return false; + } + + public override bool Accept(TArray type) + { + return false; + } + + public override bool Accept(TList type) + { + return false; + } + + public override bool Accept(TSet type) + { + return false; + } + + public override bool Accept(TMap type) + { + return false; + } +} diff --git a/luban/src/Luban.Gdscript/AssemblyInfo.cs b/luban/src/Luban.Gdscript/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Gdscript/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Gdscript/CodeTarget/GdscriptCodeTargetBase.cs b/luban/src/Luban.Gdscript/CodeTarget/GdscriptCodeTargetBase.cs new file mode 100644 index 00000000..f9ba0374 --- /dev/null +++ b/luban/src/Luban.Gdscript/CodeTarget/GdscriptCodeTargetBase.cs @@ -0,0 +1,31 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.Gdscript.TemplateExtensions; +using Scriban; + +namespace Luban.Gdscript.CodeTarget; + +public abstract class GdscriptCodeTargetBase : AllInOneTemplateCodeTargetBase +{ + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_GDSCRIPT; + + protected override ICodeStyle DefaultCodeStyle => CodeFormatManager.Ins.PythonDefaultCodeStyle; + + protected override string FileSuffixName => "gd"; + + protected override string DefaultOutputFileName => "schema.gd"; + + + private static readonly HashSet<string> s_preservedKeyWords = new() + { + // gdscript preserved key words + "and", "as", "assert", "break", "class", "const", "continue", "elif", "else", "enum", "extends", "for", "if", "in", "is", "pass", "return", "self", "static", "while" + }; + + protected override IReadOnlySet<string> PreservedKeyWords => s_preservedKeyWords; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new GdscriptCommonTemplateExtension()); + } +} diff --git a/luban/src/Luban.Gdscript/CodeTarget/GdscriptJsonCodeTarget.cs b/luban/src/Luban.Gdscript/CodeTarget/GdscriptJsonCodeTarget.cs new file mode 100644 index 00000000..75d1ce64 --- /dev/null +++ b/luban/src/Luban.Gdscript/CodeTarget/GdscriptJsonCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Gdscript.TemplateExtensions; +using Scriban; + +namespace Luban.Gdscript.CodeTarget; + +[CodeTarget("gdscript-json")] +public class GdscriptJsonCodeTarget : GdscriptCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new GdscriptJsonTemplateExtension()); + } +} diff --git a/luban/src/Luban.Gdscript/Luban.Gdscript.csproj b/luban/src/Luban.Gdscript/Luban.Gdscript.csproj new file mode 100644 index 00000000..da716534 --- /dev/null +++ b/luban/src/Luban.Gdscript/Luban.Gdscript.csproj @@ -0,0 +1,23 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + + <ItemGroup> + <None Update="Templates\python-json\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\gdscript-json\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + <ProjectReference Include="..\Luban.DataTarget.Builtin\Luban.DataTarget.Builtin.csproj" /> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.Gdscript/TemplateExtensions/GdscriptCommonTemplateExtension.cs b/luban/src/Luban.Gdscript/TemplateExtensions/GdscriptCommonTemplateExtension.cs new file mode 100644 index 00000000..482a5df7 --- /dev/null +++ b/luban/src/Luban.Gdscript/TemplateExtensions/GdscriptCommonTemplateExtension.cs @@ -0,0 +1,26 @@ +using Luban.Defs; +using Luban.Gdscript.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Gdscript.TemplateExtensions; + +public class GdscriptCommonTemplateExtension : ScriptObject +{ + + public static string DeclaringTypeName(TType type) + { + return type.Apply(DeclaringTypeNameVisitor.Ins); + } + + public static string FullName(DefTypeBase type) + { + return TypeUtil.MakeGDScriptFullName(type.Namespace, type.Name); + } + + public static string StrFullName(string fullName) + { + return TypeUtil.ToPascalCase(fullName.Replace(".", "_")); + } +} diff --git a/luban/src/Luban.Gdscript/TemplateExtensions/GdscriptJsonTemplateExtension.cs b/luban/src/Luban.Gdscript/TemplateExtensions/GdscriptJsonTemplateExtension.cs new file mode 100644 index 00000000..62beae35 --- /dev/null +++ b/luban/src/Luban.Gdscript/TemplateExtensions/GdscriptJsonTemplateExtension.cs @@ -0,0 +1,34 @@ +using Luban.Defs; +using Luban.Gdscript.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Gdscript.TemplateExtensions; + +public class GdscriptJsonTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string jsonVarName, TType type) + { + if (type.IsNullable) + { + return $"if {jsonVarName} != null: {type.Apply(UnderlyingDeserializeVisitor.Ins, jsonVarName, fieldName)}"; + } + else + { + return type.Apply(UnderlyingDeserializeVisitor.Ins, jsonVarName, fieldName); + } + } + + public static string DeserializeField(string fieldName, string jsonVarName, string jsonFieldName, TType type) + { + if (type.IsNullable) + { + return $"if {jsonVarName}.get('{jsonFieldName}') != null: {type.Apply(UnderlyingDeserializeVisitor.Ins, $"{jsonVarName}[\"{jsonFieldName}\"]", fieldName)}"; + } + else + { + return type.Apply(UnderlyingDeserializeVisitor.Ins, $"{jsonVarName}[\"{jsonFieldName}\"]", fieldName); + } + } +} diff --git a/luban/src/Luban.Gdscript/Templates/gdscript-json/schema.sbn b/luban/src/Luban.Gdscript/Templates/gdscript-json/schema.sbn new file mode 100644 index 00000000..dca95335 --- /dev/null +++ b/luban/src/Luban.Gdscript/Templates/gdscript-json/schema.sbn @@ -0,0 +1,167 @@ +@tool +class_name Schema +extends RefCounted + + +{{~for enum in __enums~}} +{{~if enum.comment != '' ~}} +## {{enum.comment | html.escape}} +{{~end~}} +enum {{full_name enum}} +{ + {{~ for item in enum.items ~}} + {{~if item.comment_or_alias != '' ~}} + ## {{item.comment_or_alias | html.escape}} + {{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} +} + + +{{~end~}} +{{~for bean in __beans + name = (full_name bean) +~}} +{{~if bean.comment != '' ~}} +## {{bean.comment | html.escape}} +{{~end~}} +class {{name}}{{if bean.parent_def_type}} extends {{full_name bean.parent_def_type}}{{end}}: +{{~ for field in bean.export_fields ~}} + {{~if field.comment != '' ~}} + ## {{field.comment | html.escape}} + {{~end~}} + var {{format_field_name __code_style field.name}}: {{declaring_type_name field.ctype}} +{{~end~}} + +{{~if bean.is_abstract_type~}} + static func fromJson(_json_): + var type = _json_['$type'] + match type: + {{~ for child in bean.hierarchy_not_abstract_children~}} + "{{impl_data_type child bean}}": return {{full_name child}}.new(_json_) + {{~end~}} + _: assert(false) + +{{~end~}} + func _init(_json_) -> void: +{{~if bean.parent_def_type~}} + super(_json_) +{{~end~}} + {{~ for field in bean.export_fields ~}} + {{deserialize_field ('self.' + (format_field_name __code_style field.name)) '_json_' field.name field.ctype}} + {{~end~}} + {{~if bean.export_fields.empty?~}} + pass + {{~end~}} + + +{{~end~}} +{{~for table in __tables + value_type = table.value_ttype + value_type_name = (declaring_type_name value_type) +~}} +{{~if table.comment != '' ~}} +## {{table.comment | html.escape}} +{{~end~}} +class {{full_name table}}: + {{~if table.is_map_table ~}} + var _data_list: Array[{{value_type_name}}] + var _data_map: Dictionary + + func _init(_json_) -> void: + for _json2_ in _json_: + var _v: {{value_type_name}} + {{deserialize '_v' '_json2_' value_type}} + self._data_list.append(_v) + self._data_map[_v.{{format_field_name __code_style table.index_field.name}}] = _v + + func get_data_list() -> Array[{{value_type_name}}]: + return self._data_list + + func get_data_map() -> Dictionary: + return self._data_map + + func get_item(key) -> {{value_type_name}}: + return self._data_map.get(key) + + {{~else if table.multi_key ~}} + var _data_list: Array[{{value_type_name}}] + {{~ for INDEX in table.index_list ~}} + var _{{INDEX.index_field.name}}_data_map: Dictionary + {{~ end ~}} + + func _init(_json_) -> void: + {{~ for INDEX in table.index_list ~}} + self._{{INDEX.index_field.name}}_data_map = {} + {{~ end ~}} + + for _json2_ in _json_: + var _v: {{value_type_name}} + {{deserialize '_v' '_json2_' value_type}} + self._data_list.append(_v) + {{~ for INDEX in table.index_list ~}} + self._{{INDEX.index_field.name}}_data_map[_v.{{INDEX.index_field.name}}] = _v + {{~ end ~}} + + func get_data_list() -> Array[{{value_type_name}}]: + return self._data_list + + {{~ for INDEX in table.index_list ~}} + func get_{{INDEX.index_field.name}}_data_map() -> Dictionary: + return self._{{INDEX.index_field.name}}_data_map + {{~ end ~}} + +{{~ for INDEX in table.index_list ~}} + func get_item_by_{{INDEX.index_field.name}}({{INDEX.index_field.name}}) -> {{value_type_name}}: + return self._{{INDEX.index_field.name}}_data_map.get({{INDEX.index_field.name}}) + +{{~ end ~}} + {{~else if table.is_list_table ~}} + var _data_list: Array[{{value_type_name}}] + + func _init(_json_) -> void: + for _json2_ in _json_: + var _v: {{value_type_name}} + {{deserialize '_v' '_json2_' value_type}} + self._data_list.append(_v) + + func get_data_list() -> Array[{{value_type_name}}]: + return self._data_list + + func get_item(index) -> {{value_type_name}}: + return self._data_list[index] + {{~else~}} + var _data:{{value_type_name}} + + func _init(_json_) -> void: + assert(len(_json_) == 1, "table mode = one, but size != 1") + {{deserialize 'self._data' '_json_[0]' value_type}} + + func get_data() -> {{value_type_name}}: + return self._data + + {{~ for field in value_type.def_bean.hierarchy_export_fields + name = format_field_name __code_style field.name + ~}} +{{~if field.comment != '' ~}} + ## {{escape_comment field.comment}} +{{~end~}} + var {{name}}: {{declaring_type_name field.ctype}}: + get: return self._data.{{name}} + + {{~end~}} + {{~end~}} + +{{~end~}} +class {{str_full_name __full_name}}: + {{~for table in __tables ~}} + {{~if table.comment != ''~}} + ## {{table.comment | html.escape}} + {{~end~}} + var {{format_method_name __code_style table.name}}: {{full_name table}} + {{~end~}} + + func _init(loader: Callable) -> void: + {{~for table in __tables ~}} + self.{{format_method_name __code_style table.name}} = {{full_name table}}.new(loader.call('{{table.output_data_file}}')) + {{~end~}} \ No newline at end of file diff --git a/luban/src/Luban.Gdscript/TypeVisitors/DeclaringTypeNameVisitor.cs b/luban/src/Luban.Gdscript/TypeVisitors/DeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..690d8f0d --- /dev/null +++ b/luban/src/Luban.Gdscript/TypeVisitors/DeclaringTypeNameVisitor.cs @@ -0,0 +1,86 @@ +using Luban.Gdscript.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Gdscript.TypeVisitors; + +public class DeclaringTypeNameVisitor : ITypeFuncVisitor<string> +{ + public static DeclaringTypeNameVisitor Ins { get; } = new(); + + public string Accept(TBool type) + { + return "bool"; + } + + public string Accept(TByte type) + { + return "int"; + } + + public string Accept(TShort type) + { + return "int"; + } + + public string Accept(TInt type) + { + return "int"; + } + + public string Accept(TLong type) + { + return "int"; + } + + public string Accept(TFloat type) + { + return "float"; + } + + public string Accept(TDouble type) + { + return "float"; + } + + public virtual string Accept(TEnum type) + { + // return GdscriptCommonTemplateExtension.FullName(type.DefEnum); + return "int"; + } + + public string Accept(TString type) + { + return "String"; + } + + public virtual string Accept(TDateTime type) + { + return "int"; + } + + public string Accept(TBean type) + { + return GdscriptCommonTemplateExtension.FullName(type.DefBean); + } + + public string Accept(TArray type) + { + return $"Array[{type.ElementType.Apply((this))}]"; + } + + public string Accept(TList type) + { + return $"Array[{type.ElementType.Apply((this))}]"; + } + + public string Accept(TSet type) + { + return $"Array[{type.ElementType.Apply((this))}]"; + } + + public string Accept(TMap type) + { + return "Dictionary"; + } +} diff --git a/luban/src/Luban.Gdscript/TypeVisitors/UnderlyingDeserializeVisitor.cs b/luban/src/Luban.Gdscript/TypeVisitors/UnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..47cb6c5e --- /dev/null +++ b/luban/src/Luban.Gdscript/TypeVisitors/UnderlyingDeserializeVisitor.cs @@ -0,0 +1,94 @@ +using Luban.DataExporter.Builtin.Json; +using Luban.Gdscript.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Gdscript.TypeVisitors; + +public class UnderlyingDeserializeVisitor : ITypeFuncVisitor<string, string, string> +{ + public static UnderlyingDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TByte type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TShort type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TInt type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TLong type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TFloat type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TDouble type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TEnum type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TString type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TBean type, string jsonVarName, string fieldName) + { + if (type.DefBean.IsAbstractType) + { + return $"{fieldName} = {GdscriptCommonTemplateExtension.FullName(type.DefBean)}.fromJson({jsonVarName})"; + } + else + { + return $"{fieldName} = {GdscriptCommonTemplateExtension.FullName(type.DefBean)}.new({jsonVarName})"; + } + } + + public string Accept(TArray type, string jsonVarName, string fieldName) + { + return $"{fieldName} = []\nfor _ele in {jsonVarName}: var _e: {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}; {type.ElementType.Apply(this, "_ele", "_e")}; {fieldName}.append(_e)"; + } + + public string Accept(TList type, string jsonVarName, string fieldName) + { + return $"{fieldName} = []\nfor _ele in {jsonVarName}: var _e: {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}; {type.ElementType.Apply(this, "_ele", "_e")}; {fieldName}.append(_e)"; + } + + public string Accept(TSet type, string jsonVarName, string fieldName) + { + return $"{fieldName} = []\nfor _ele in {jsonVarName}: var _e: {type.ElementType.Apply(DeclaringTypeNameVisitor.Ins)}; {type.ElementType.Apply(this, "_ele", "_e")}; {fieldName}.append(_e)"; + } + + public string Accept(TMap type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {{}}\nfor _e in {jsonVarName}: var _k: {type.KeyType.Apply(DeclaringTypeNameVisitor.Ins)}; {type.KeyType.Apply(this, "_e[0]", "_k")}; var _v: {type.ValueType.Apply(DeclaringTypeNameVisitor.Ins)}; {type.ValueType.Apply(this, "_e[1]", "_v")}; {fieldName}[_k] = _v"; + } + + public string Accept(TDateTime type, string jsonVarName, string fieldName) + { + return $"{fieldName} = {jsonVarName}"; + } + +} diff --git a/luban/src/Luban.Golang/AssemblyInfo.cs b/luban/src/Luban.Golang/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Golang/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Golang/CodeTarget/GoBinCodeTarget.cs b/luban/src/Luban.Golang/CodeTarget/GoBinCodeTarget.cs new file mode 100644 index 00000000..3ef2150b --- /dev/null +++ b/luban/src/Luban.Golang/CodeTarget/GoBinCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Golang.TemplateExtensions; +using Scriban; + +namespace Luban.Golang.CodeTarget; + +[CodeTarget("go-bin")] +public class GoBinCodeTarget : GoCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new GoBinTemplateExtension()); + } +} diff --git a/luban/src/Luban.Golang/CodeTarget/GoCodeTargetBase.cs b/luban/src/Luban.Golang/CodeTarget/GoCodeTargetBase.cs new file mode 100644 index 00000000..e311f2a3 --- /dev/null +++ b/luban/src/Luban.Golang/CodeTarget/GoCodeTargetBase.cs @@ -0,0 +1,34 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.Golang.TemplateExtensions; +using Luban.Utils; +using Scriban; +using Scriban.Runtime; + +namespace Luban.Golang.CodeTarget; + +public abstract class GoCodeTargetBase : TemplateCodeTargetBase +{ + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_C_LIKE; + + protected override string FileSuffixName => "go"; + + protected override ICodeStyle DefaultCodeStyle => CodeFormatManager.Ins.GoDefaultCodeStyle; + + private static readonly HashSet<string> s_preservedKeyWords = new() + { + // go preserved key words + //"break", "default", "func", "interface", "select", "case", "defer", "go", "map", "struct", "chan", "else", "goto", "package", "switch", "const", "fallthrough", "if", "range", "continue", "for", "import", "return", "var" + }; + + protected override IReadOnlySet<string> PreservedKeyWords => s_preservedKeyWords; + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new GoCommonTemplateExtension()); + string lubanModuleName = EnvManager.Current.GetOption(Name, "lubanGoModule", true); + ctx.PushGlobal(new ScriptObject() + { + {"__luban_module_name", lubanModuleName}, + }); + } +} diff --git a/luban/src/Luban.Golang/CodeTarget/GoJsonCodeTarget.cs b/luban/src/Luban.Golang/CodeTarget/GoJsonCodeTarget.cs new file mode 100644 index 00000000..51efc10b --- /dev/null +++ b/luban/src/Luban.Golang/CodeTarget/GoJsonCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Golang.TemplateExtensions; +using Scriban; + +namespace Luban.Golang.CodeTarget; + +[CodeTarget("go-json")] +public class GoJsonCodeTarget : GoCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new GoJsonTemplateExtension()); + } +} diff --git a/luban/src/Luban.Golang/Luban.Golang.csproj b/luban/src/Luban.Golang/Luban.Golang.csproj new file mode 100644 index 00000000..e21bc8c6 --- /dev/null +++ b/luban/src/Luban.Golang/Luban.Golang.csproj @@ -0,0 +1,58 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + + <ItemGroup> + <None Update="Templates\java-json\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-json\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-json\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-bin\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-bin\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-bin\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\common\java\enum.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\go-bin\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\go-bin\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\go-bin\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\common\go\enum.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\go-json\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\go-json\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\go-json\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.Golang/TemplateExtensions/GoBinTemplateExtension.cs b/luban/src/Luban.Golang/TemplateExtensions/GoBinTemplateExtension.cs new file mode 100644 index 00000000..e662c8de --- /dev/null +++ b/luban/src/Luban.Golang/TemplateExtensions/GoBinTemplateExtension.cs @@ -0,0 +1,29 @@ +using Luban.Defs; +using Luban.Golang.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.Golang.TemplateExtensions; + +public class GoBinTemplateExtension : ScriptObject +{ + // public static string Deserialize(string bufName, string fieldName, TType type) + // { + // return type.Apply(GoDeserializeBinVisitor.Ins, bufName, fieldName); + // } + + public static string DeserializeField(TType type, string name, string bufName, string err) + { + return type.Apply(DeserializeBinVisitor.Ins, name, bufName, err, 0); + } + + public static string CollectImport(DefBean bean) + { + var imports = new HashSet<string>(); + if (bean.IsAbstractType || bean.HierarchyExportFields.Count > 0) + { + imports.Add("errors"); + } + return string.Join('\n', imports.Select(im => $"import \"{im}\"")); + } +} diff --git a/luban/src/Luban.Golang/TemplateExtensions/GoCommonTemplateExtension.cs b/luban/src/Luban.Golang/TemplateExtensions/GoCommonTemplateExtension.cs new file mode 100644 index 00000000..626887d6 --- /dev/null +++ b/luban/src/Luban.Golang/TemplateExtensions/GoCommonTemplateExtension.cs @@ -0,0 +1,25 @@ +using Luban.Defs; +using Luban.Golang.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Golang.TemplateExtensions; + +public class GoCommonTemplateExtension : ScriptObject +{ + public static string FullName(DefTypeBase bean) + { + return TypeUtil.MakeGoFullName(bean.Namespace, bean.Name); + } + public static string FullNameLowerCase(DefTypeBase bean) + { + return TypeUtil.MakeGoFullName(bean.Namespace, bean.Name).ToLowerInvariant(); + } + + public static string DeclaringTypeName(TType type) + { + return type.Apply(DeclaringTypeNameVisitor.Ins); + } + +} diff --git a/luban/src/Luban.Golang/TemplateExtensions/GoJsonTemplateExtension.cs b/luban/src/Luban.Golang/TemplateExtensions/GoJsonTemplateExtension.cs new file mode 100644 index 00000000..6a2ba8d4 --- /dev/null +++ b/luban/src/Luban.Golang/TemplateExtensions/GoJsonTemplateExtension.cs @@ -0,0 +1,34 @@ +using Luban.Defs; +using Luban.Golang.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.Golang.TemplateExtensions; + +public class GoJsonTemplateExtension : ScriptObject +{ + // public static string Deserialize(string fieldName, string jsonVar, TType type) + // { + // return type.Apply(JavaJsonUnderlyingDeserializeVisitor.Ins, jsonVar, fieldName, 0); + // } + + public static string DeserializeField(TType type, string varName, string fieldName, string bufName) + { + return type.Apply(DeserializeJsonFieldVisitor.Ins, varName, fieldName, bufName); + } + + public static string CollectImport(DefBean bean) + { + var imports = new HashSet<string>(); + if (bean.IsAbstractType || bean.HierarchyExportFields.Count > 0) + { + imports.Add("errors"); + } + + foreach (var f in bean.HierarchyExportFields) + { + f.CType.Apply(TypeVisitors.JsonImport.Ins, imports); + } + return string.Join('\n', imports.Select(im => $"import \"{im}\"")); + } +} diff --git a/luban/src/Luban.Golang/Templates/common/go/enum.sbn b/luban/src/Luban.Golang/Templates/common/go/enum.sbn new file mode 100644 index 00000000..7dd70a6b --- /dev/null +++ b/luban/src/Luban.Golang/Templates/common/go/enum.sbn @@ -0,0 +1,19 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +const ( + {{~ for item in __this.items ~}} +{{~if item.comment_or_alias != '' ~}} + /** + * {{escape_comment item.comment_or_alias}} + */ +{{~end~}} + {{full_name __this}}_{{item.name}} = {{item.int_value}}; + {{~end~}} +) diff --git a/luban/src/Luban.Golang/Templates/go-bin/bean.sbn b/luban/src/Luban.Golang/Templates/go-bin/bean.sbn new file mode 100644 index 00000000..0ff01a03 --- /dev/null +++ b/luban/src/Luban.Golang/Templates/go-bin/bean.sbn @@ -0,0 +1,54 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~ + go_full_name = full_name __this + parent_def_type = __this.parent_def_type + is_abstract_type = __this.is_abstract_type + hierarchy_fields = __this.hierarchy_export_fields + hierarchy_not_abstract_children = __this.hierarchy_not_abstract_children +~}} + +import ( + "{{__luban_module_name}}" +) + +{{collect_import __this}} + +type {{go_full_name}} struct { + {{~for field in hierarchy_fields ~}} + {{format_field_name __code_style field.name}} {{declaring_type_name field.ctype}} + {{~end~}} +} + +const TypeId_{{go_full_name}} = {{__this.id}} + +func (*{{go_full_name}}) GetTypeId() int32 { + return {{__this.id}} +} + +{{~if is_abstract_type~}} +func New{{go_full_name}}(_buf *luban.ByteBuf) (interface{}, error) { + var id int32 + var err error + if id, err = _buf.ReadInt() ; err != nil { + return nil, err + } + switch id { + {{~for child in hierarchy_not_abstract_children~}} + case {{child.id}}: _v, err := New{{full_name child}}(_buf); if err != nil { return nil, errors.New("{{child.full_name|string.downcase}}") } else { return _v, nil } + {{~end~}} + default: return nil, errors.New("unknown type id") + } +} + +{{~else~}} +func New{{go_full_name}}(_buf *luban.ByteBuf) (_v *{{go_full_name}}, err error) { + _v = &{{go_full_name}}{} + {{~for field in hierarchy_fields ~}} + {{deserialize_field field.ctype ("_v." + (format_field_name __code_style field.name)) '_buf' 'err'}} + {{~end~}} + return +} +{{~end~}} diff --git a/luban/src/Luban.Golang/Templates/go-bin/table.sbn b/luban/src/Luban.Golang/Templates/go-bin/table.sbn new file mode 100644 index 00000000..e511405b --- /dev/null +++ b/luban/src/Luban.Golang/Templates/go-bin/table.sbn @@ -0,0 +1,116 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~ + go_full_name = full_name __this + key_type = __this.key_ttype + value_type = __this.value_ttype + index_field = __this.index_field +~}} + +import "{{__luban_module_name}}" + +{{~if __this.is_map_table~}} +type {{go_full_name}} struct { + _dataMap map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}} + _dataList []{{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf *luban.ByteBuf) (*{{go_full_name}}, error) { + if size, err := _buf.ReadSize() ; err != nil { + return nil, err + } else { + _dataList := make([]{{declaring_type_name value_type}}, 0, size) + dataMap := make(map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}}) + + for i := 0 ; i < size ; i++ { + if _v, err2 := New{{full_name value_type.def_bean}}(_buf); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) +{{~if value_type.is_dynamic ~}} + {{~for child in value_type.def_bean.hierarchy_not_abstract_children~}} + if __v, __is := _v.(*{{full_name child}}) ; __is { + dataMap[__v.{{format_field_name __code_style index_field.name}}] = _v + continue + } + {{~end~}} +{{~else~}} + dataMap[_v.{{format_field_name __code_style index_field.name}}] = _v +{{~end~}} + } + } + return &{{go_full_name}}{_dataList:_dataList, _dataMap:dataMap}, nil + } +} + +func (table *{{go_full_name}}) GetDataMap() map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}} { + return table._dataMap +} + +func (table *{{go_full_name}}) GetDataList() []{{declaring_type_name value_type}} { + return table._dataList +} + +func (table *{{go_full_name}}) Get(key {{declaring_type_name key_type}}) {{declaring_type_name value_type}} { + return table._dataMap[key] +} + +{{~else if __this.is_list_table~}} +type {{go_full_name}} struct { + _dataList []{{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf *luban.ByteBuf) (*{{go_full_name}}, error) { + if size, err := _buf.ReadSize() ; err != nil { + return nil, err + } else { + _dataList := make([]{{declaring_type_name value_type}}, 0, size) + + for i := 0 ; i < size ; i++ { + if _v, err2 := New{{full_name value_type.def_bean}}(_buf); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + } + } + return &{{go_full_name}}{_dataList:_dataList}, nil + } +} + +func (table *{{go_full_name}}) GetDataList() []{{declaring_type_name value_type}} { + return table._dataList +} + +func (table *{{go_full_name}}) Get(index int) {{declaring_type_name value_type}} { + return table._dataList[index] +} + +{{~else~}} + +import "errors" + +type {{go_full_name}} struct { + _data {{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf *luban.ByteBuf) (*{{go_full_name}}, error) { + if size, err := _buf.ReadSize() ; err != nil { + return nil, err + } else if size != 1 { + return nil, errors.New(" size != 1 ") + } else { + if _v, err2 := New{{full_name value_type.def_bean}}(_buf); err2 != nil { + return nil, err2 + } else { + return &{{go_full_name}}{_data:_v}, nil + } + } +} + +func (table *{{go_full_name}}) Get() {{declaring_type_name value_type}} { + return table._data +} + +{{~end~}} diff --git a/luban/src/Luban.Golang/Templates/go-bin/tables.sbn b/luban/src/Luban.Golang/Templates/go-bin/tables.sbn new file mode 100644 index 00000000..4b0e7d12 --- /dev/null +++ b/luban/src/Luban.Golang/Templates/go-bin/tables.sbn @@ -0,0 +1,33 @@ +{{~if __namespace != ''~}} +package {{__namespace}}; +{{~end~}} + +import ( + "{{__luban_module_name}}" + "errors" +) + +type ByteBufLoader func(string) (*luban.ByteBuf, error) + +type {{__name}} struct { + {{~for table in __tables ~}} + {{table.name}} *{{full_name table}} + {{~end~}} +} + +func NewTables(loader ByteBufLoader) (*{{__name}}, error) { + var err error + var buf *luban.ByteBuf + + tables := &{{__name}}{} + {{~for table in __tables ~}} + if buf, err = loader("{{table.output_data_file}}") ; err != nil { + return nil, err + } + if tables.{{table.name}}, err = New{{full_name table}}(buf) ; err != nil { + return nil, errors.Join(errors.New("failed to load {{table.name}}"), err) + } + {{~end~}} + return tables, nil +} + diff --git a/luban/src/Luban.Golang/Templates/go-json/bean.sbn b/luban/src/Luban.Golang/Templates/go-json/bean.sbn new file mode 100644 index 00000000..1da3b0e4 --- /dev/null +++ b/luban/src/Luban.Golang/Templates/go-json/bean.sbn @@ -0,0 +1,50 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~ + go_full_name = full_name __this + parent_def_type = __this.parent_def_type + is_abstract_type = __this.is_abstract_type + hierarchy_fields = __this.hierarchy_export_fields + hierarchy_not_abstract_children = __this.hierarchy_not_abstract_children +~}} + +{{collect_import __this}} + +type {{go_full_name}} struct { + {{~for field in hierarchy_fields ~}} + {{format_field_name __code_style field.name}} {{declaring_type_name field.ctype}} + {{~end~}} +} + +const TypeId_{{go_full_name}} = {{__this.id}} + +func (*{{go_full_name}}) GetTypeId() int32 { + return {{__this.id}} +} + +{{~if is_abstract_type~}} +func New{{go_full_name}}(_buf map[string]interface{}) (interface{}, error) { + var id string + var _ok_ bool + if id, _ok_ = _buf["$type"].(string) ; !_ok_ { + return nil, errors.New("type id missing") + } + switch id { + {{~for child in hierarchy_not_abstract_children~}} + case "{{impl_data_type child __this}}": _v, err := New{{full_name child}}(_buf); if err != nil { return nil, errors.New("{{full_name child|string.downcase}}") } else { return _v, nil } + {{~end~}} + default: return nil, errors.New("unknown type id") + } +} + +{{~else~}} +func New{{go_full_name}}(_buf map[string]interface{}) (_v *{{go_full_name}}, err error) { + _v = &{{go_full_name}}{} + {{~for field in hierarchy_fields ~}} + {{deserialize_field field.ctype ("_v." + (format_field_name __code_style field.name)) field.name '_buf'}} + {{~end~}} + return +} +{{~end~}} diff --git a/luban/src/Luban.Golang/Templates/go-json/table.sbn b/luban/src/Luban.Golang/Templates/go-json/table.sbn new file mode 100644 index 00000000..3fd5f9e4 --- /dev/null +++ b/luban/src/Luban.Golang/Templates/go-json/table.sbn @@ -0,0 +1,103 @@ +{{~if ___top_module != ''~}} +package {{__top_module}}; +{{~end~}} + +{{~ + go_full_name = full_name __this + key_type = __this.key_ttype + value_type = __this.value_ttype + index_field = __this.index_field +~}} + +{{~if __this.is_map_table~}} +type {{go_full_name}} struct { + _dataMap map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}} + _dataList []{{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf []map[string]interface{}) (*{{go_full_name}}, error) { + _dataList := make([]{{declaring_type_name value_type}}, 0, len(_buf)) + dataMap := make(map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}}) + + for _, _ele_ := range _buf { + if _v, err2 := New{{full_name value_type.def_bean}}(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) +{{~if value_type.is_dynamic ~}} + {{~for child in value_type.def_bean.hierarchy_not_abstract_children~}} + if __v, __is := _v.(*{{full_name child}}) ; __is { + dataMap[__v.{{format_field_name __code_style index_field.name}}] = _v + continue + } + {{~end~}} +{{~else~}} + dataMap[_v.{{format_field_name __code_style index_field.name}}] = _v +{{~end~}} + } + } + return &{{go_full_name}}{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *{{go_full_name}}) GetDataMap() map[{{declaring_type_name key_type}}]{{declaring_type_name value_type}} { + return table._dataMap +} + +func (table *{{go_full_name}}) GetDataList() []{{declaring_type_name value_type}} { + return table._dataList +} + +func (table *{{go_full_name}}) Get(key {{declaring_type_name key_type}}) {{declaring_type_name value_type}} { + return table._dataMap[key] +} + +{{~else if __this.is_list_table~}} +type {{go_full_name}} struct { + _dataList []{{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf []map[string]interface{}) (*{{go_full_name}}, error) { + _dataList := make([]{{declaring_type_name value_type}}, 0, len(_buf)) + for _, _ele_ := range _buf { + if _v, err2 := New{{full_name value_type.def_bean}}(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + } + } + return &{{go_full_name}}{_dataList:_dataList}, nil +} + +func (table *{{go_full_name}}) GetDataList() []{{declaring_type_name value_type}} { + return table._dataList +} + +func (table *{{go_full_name}}) Get(index int) {{declaring_type_name value_type}} { + return table._dataList[index] +} + +{{~else~}} + +import "errors" + +type {{go_full_name}} struct { + _data {{declaring_type_name value_type}} +} + +func New{{go_full_name}}(_buf []map[string]interface{}) (*{{go_full_name}}, error) { + if len(_buf) != 1 { + return nil, errors.New(" size != 1 ") + } else { + if _v, err2 := New{{full_name value_type.def_bean}}(_buf[0]); err2 != nil { + return nil, err2 + } else { + return &{{go_full_name}}{_data:_v}, nil + } + } +} + +func (table *{{go_full_name}}) Get() {{declaring_type_name value_type}} { + return table._data +} + +{{~end~}} diff --git a/luban/src/Luban.Golang/Templates/go-json/tables.sbn b/luban/src/Luban.Golang/Templates/go-json/tables.sbn new file mode 100644 index 00000000..6f174821 --- /dev/null +++ b/luban/src/Luban.Golang/Templates/go-json/tables.sbn @@ -0,0 +1,28 @@ +{{~if __namespace != ''~}} +package {{__namespace}}; +{{~end~}} + +type JsonLoader func(string) ([]map[string]interface{}, error) + +type {{__name}} struct { + {{~for table in __tables ~}} + {{table.name}} *{{full_name table}} + {{~end~}} +} + +func NewTables(loader JsonLoader) (*{{__name}}, error) { + var err error + var buf []map[string]interface{} + + tables := &{{__name}}{} + {{~for table in __tables ~}} + if buf, err = loader("{{table.output_data_file}}") ; err != nil { + return nil, err + } + if tables.{{table.name}}, err = New{{full_name table}}(buf) ; err != nil { + return nil, err + } + {{~end~}} + return tables, nil +} + diff --git a/luban/src/Luban.Golang/TypeVisitors/BinImport.cs b/luban/src/Luban.Golang/TypeVisitors/BinImport.cs new file mode 100644 index 00000000..ec5ed7e7 --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/BinImport.cs @@ -0,0 +1,35 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Golang.TypeVisitors; + +public class BinImport : DecoratorActionVisitor<HashSet<string>> +{ + public static BinImport Ins { get; } = new(); + + public override void DoAccept(TType type, HashSet<string> x) + { + + } + + public override void Accept(TArray type, HashSet<string> x) + { + type.ElementType.Apply(this, x); + } + + public override void Accept(TList type, HashSet<string> x) + { + type.ElementType.Apply(this, x); + } + + public override void Accept(TSet type, HashSet<string> x) + { + + } + + public override void Accept(TMap type, HashSet<string> x) + { + type.KeyType.Apply(this, x); + type.ValueType.Apply(this, x); + } +} diff --git a/luban/src/Luban.Golang/TypeVisitors/BinUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Golang/TypeVisitors/BinUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..f1733b4e --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/BinUnderlyingDeserializeVisitor.cs @@ -0,0 +1,90 @@ +using Luban.Golang.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Golang.TypeVisitors; + +public class BinUnderlyingDeserializeVisitor : ITypeFuncVisitor<string, string, string, int, string> +{ + public static BinUnderlyingDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadBool(); {err} != nil {{ {err} = errors.New(\"error\"); {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TByte type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadByte(); {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TShort type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadShort(); {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TInt type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadInt(); {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TLong type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadLong(); {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TFloat type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadFloat(); {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TDouble type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadDouble(); {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TEnum type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadInt(); {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TString type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadString(); {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TDateTime type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {bufName}.ReadLong(); {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + public string Accept(TBean type, string fieldName, string bufName, string err, int depth) + { + return $"{{ if {fieldName}, {err} = {($"New{GoCommonTemplateExtension.FullName(type.DefBean)}({bufName})")}; {err} != nil {{ {err} = errors.New(\"error\"); return }} }}"; + } + + private string GenList(TType elementType, string fieldName, string bufName, string err, int depth) + { + return $@"{{{fieldName} = make([]{elementType.Apply(DeclaringTypeNameVisitor.Ins)}, 0); var _n{depth}_ int; if _n{depth}_, {err} = {bufName}.ReadSize(); {err} != nil {{ {err} = errors.New(""error""); return}}; for i{depth} := 0 ; i{depth} < _n{depth}_ ; i{depth}++ {{ var _e{depth}_ {elementType.Apply(DeclaringTypeNameVisitor.Ins)}; {elementType.Apply(DeserializeBinVisitor.Ins, $@"_e{depth}_", bufName, err, depth +1)}; {fieldName} = append({fieldName}, _e{depth}_) }} }}"; + } + + public string Accept(TArray type, string fieldName, string bufName, string err, int depth) + { + return GenList(type.ElementType, fieldName, bufName, err, depth); + } + + public string Accept(TList type, string fieldName, string bufName, string err, int depth) + { + return GenList(type.ElementType, fieldName, bufName, err, depth); + } + + public string Accept(TSet type, string fieldName, string bufName, string err, int depth) + { + return GenList(type.ElementType, fieldName, bufName, err, depth); + } + + public string Accept(TMap type, string fieldName, string bufName, string err, int depth) + { + return $@"{{ {fieldName} = make({type.Apply(DeclaringTypeNameVisitor.Ins)}); var _n{depth}_ int; if _n{depth}_, {err} = {bufName}.ReadSize(); {err} != nil {{ {err} = errors.New(""error""); return}}; for i{depth} := 0 ; i{depth} < _n{depth}_ ; i{depth}++ {{ var _key{depth}_ {type.KeyType.Apply(DeclaringTypeNameVisitor.Ins)}; {type.KeyType.Apply(DeserializeBinVisitor.Ins, $@"_key{depth}_", bufName, err, depth + 1)}; var _value{depth}_ {type.ValueType.Apply(DeclaringTypeNameVisitor.Ins)}; {type.ValueType.Apply(DeserializeBinVisitor.Ins, $@"_value{depth}_", bufName, err, depth + 1)}; {fieldName}[_key{depth}_] = _value{depth}_}} }}"; + } +} diff --git a/luban/src/Luban.Golang/TypeVisitors/DeclaringTypeNameVisitor.cs b/luban/src/Luban.Golang/TypeVisitors/DeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..166491f8 --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/DeclaringTypeNameVisitor.cs @@ -0,0 +1,15 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Golang.TypeVisitors; + +public class DeclaringTypeNameVisitor : DecoratorFuncVisitor<string> +{ + public static DeclaringTypeNameVisitor Ins { get; } = new DeclaringTypeNameVisitor(); + + public override string DoAccept(TType type) + { + var s = type.Apply(UnderlyingDeclaringTypeNameVisitor.Ins); + return type.Apply(IsPointerTypeVisitor.Ins) ? "*" + s : s; + } +} diff --git a/luban/src/Luban.Golang/TypeVisitors/DeserializeBinVisitor.cs b/luban/src/Luban.Golang/TypeVisitors/DeserializeBinVisitor.cs new file mode 100644 index 00000000..9a4095c2 --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/DeserializeBinVisitor.cs @@ -0,0 +1,21 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Golang.TypeVisitors; + +public class DeserializeBinVisitor : DecoratorFuncVisitor<string, string, string, int, string> +{ + public static DeserializeBinVisitor Ins { get; } = new DeserializeBinVisitor(); + + public override string DoAccept(TType type, string fieldName, string bufName, string err, int depth) + { + if (type.IsNullable) + { + return $"{{ var __exists__ bool; if __exists__, {err} = {bufName}.ReadBool(); {err} != nil {{ return }}; if __exists__ {{ var __x__ {type.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}; {type.Apply(BinUnderlyingDeserializeVisitor.Ins, "__x__", bufName, err, depth + 1)}; {fieldName} = {(type.Apply(IsPointerTypeVisitor.Ins) ? "&" : "")}__x__ }}}}"; + } + else + { + return type.Apply(BinUnderlyingDeserializeVisitor.Ins, fieldName, bufName, err, depth); + } + } +} diff --git a/luban/src/Luban.Golang/TypeVisitors/DeserializeJsonFieldVisitor.cs b/luban/src/Luban.Golang/TypeVisitors/DeserializeJsonFieldVisitor.cs new file mode 100644 index 00000000..391782c5 --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/DeserializeJsonFieldVisitor.cs @@ -0,0 +1,24 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Golang.TypeVisitors; + +public class DeserializeJsonFieldVisitor : DecoratorFuncVisitor<string, string, string, string> +{ + public static DeserializeJsonFieldVisitor Ins { get; } = new DeserializeJsonFieldVisitor(); + + public override string DoAccept(TType type, string varName, string fieldName, string bufName) + { + var jsonObjName = $"__json_{fieldName}__"; + if (type.IsNullable) + { + return $"{{ var _ok_ bool; var {jsonObjName} interface{{}}; if {jsonObjName}, _ok_ = {bufName}[\"{fieldName}\"]; !_ok_ || {jsonObjName} == nil {{ {varName} = nil }} else {{ var __x__ {type.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}; {type.Apply(DeserializeJsonUnderingVisitor.Ins, "__x__", jsonObjName, 0)}; {varName} = {(type.Apply(IsPointerTypeVisitor.Ins) ? "&" : "")}__x__ }}}}"; + } + else + { + + return $"{{ var _ok_ bool; var {jsonObjName} interface{{}}; if {jsonObjName}, _ok_ = {bufName}[\"{fieldName}\"]; !_ok_ || {jsonObjName} == nil {{ err = errors.New(\"{fieldName} error\"); return }} else {{ var __x__ {type.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}; {type.Apply(DeserializeJsonUnderingVisitor.Ins, "__x__", jsonObjName, 0)}; {varName} = {(type.Apply(IsPointerTypeVisitor.Ins) ? "&" : "")}__x__ }}}}"; + //return type.Apply(DeserializeJsonUnderingVisitor.Ins, varName, fieldName, bufName, 0); + } + } +} diff --git a/luban/src/Luban.Golang/TypeVisitors/DeserializeJsonUnderingVisitor.cs b/luban/src/Luban.Golang/TypeVisitors/DeserializeJsonUnderingVisitor.cs new file mode 100644 index 00000000..7e532eb4 --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/DeserializeJsonUnderingVisitor.cs @@ -0,0 +1,132 @@ +using Luban.DataLoader; +using Luban.Datas; +using Luban.Golang.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Golang.TypeVisitors; + +class DeserializeJsonUnderingVisitor : ITypeFuncVisitor<string, string, int, string> +{ + public static DeserializeJsonUnderingVisitor Ins { get; } = new(); + + public string Accept(TBool type, string varName, string bufName, int depth) + { + return $"{{ var _ok_ bool; if {varName}, _ok_ = {bufName}.(bool); !_ok_ {{ err = errors.New(\"{varName} error\"); return }} }}"; + } + + private string DeserializeNumber(TType type, string varName, string bufName, int depth) + { + return $"{{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = {bufName}.(float64); !_ok_ {{ err = errors.New(\"{varName} error\"); return }}; {varName} = {type.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}(_x_) }}"; + } + + public string Accept(TByte type, string varName, string bufName, int depth) + { + return DeserializeNumber(type, varName, bufName, depth); + } + + public string Accept(TShort type, string varName, string bufName, int depth) + { + return DeserializeNumber(type, varName, bufName, depth); + } + + public string Accept(TInt type, string varName, string bufName, int depth) + { + return DeserializeNumber(type, varName, bufName, depth); + } + + public string Accept(TLong type, string varName, string bufName, int depth) + { + return DeserializeNumber(type, varName, bufName, depth); + } + + public string Accept(TFloat type, string varName, string bufName, int depth) + { + return DeserializeNumber(type, varName, bufName, depth); + } + + public string Accept(TDouble type, string varName, string bufName, int depth) + { + return DeserializeNumber(type, varName, bufName, depth); + } + + public string Accept(TEnum type, string varName, string bufName, int depth) + { + return DeserializeNumber(type, varName, bufName, depth); + } + + + private string DeserializeString(TType type, string varName, string bufName, int depth) + { + return $"{{ if {varName}, _ok_ = {bufName}.(string); !_ok_ {{ err = errors.New(\"{varName} error\"); return }} }}"; + } + + public string Accept(TString type, string varName, string bufName, int depth) + { + return DeserializeString(type, varName, bufName, depth); + } + + public string Accept(TDateTime type, string varName, string bufName, int depth) + { + return DeserializeNumber(type, varName, bufName, depth); + } + + public string Accept(TBean type, string varName, string bufName, int depth) + { + return $"{{ var _ok_ bool; var _x_ map[string]interface{{}}; if _x_, _ok_ = {bufName}.(map[string]interface{{}}); !_ok_ {{ err = errors.New(\"{varName} error\"); return }}; if {varName}, err = {($"New{GoCommonTemplateExtension.FullName(type.DefBean)}(_x_)")}; err != nil {{ return }} }}"; + } + + private string GenList(TType elementType, string varName, string bufName, int depth) + { + return $@"{{ + var _arr{depth}_ []interface{{}} + var _ok{depth}_ bool + if _arr{depth}_, _ok{depth}_ = ({bufName}).([]interface{{}}); !_ok{depth}_ {{ err = errors.New(""{varName} error""); return }} + + {varName} = make([]{elementType.Apply(DeclaringTypeNameVisitor.Ins)}, 0, len(_arr{depth}_)) + + for _, _e{depth}_ := range _arr{depth}_ {{ + var _list_v{depth}_ {elementType.Apply(DeclaringTypeNameVisitor.Ins)} + {elementType.Apply(DeserializeJsonVisitor.Ins, $"_list_v{depth}_", $"_e{depth}_", depth + 1)} + {varName} = append({varName}, _list_v{depth}_) + }} + }} +"; + } + + public string Accept(TArray type, string varName, string bufName, int depth) + { + return GenList(type.ElementType, varName, bufName, depth); + } + + public string Accept(TList type, string varName, string bufName, int depth) + { + return GenList(type.ElementType, varName, bufName, depth); + } + + public string Accept(TSet type, string varName, string bufName, int depth) + { + return GenList(type.ElementType, varName, bufName, depth); + } + + public string Accept(TMap type, string varName, string bufName, int depth) + { + return $@"{{ + var _arr{depth}_ []interface{{}} + var _ok{depth}_ bool + if _arr{depth}_, _ok_ = ({bufName}).([]interface{{}}); !_ok_ {{ err = errors.New(""{varName} error""); return }} + + {varName} = make({type.Apply(DeclaringTypeNameVisitor.Ins)}) + + for _, _e{depth}_ := range _arr{depth}_ {{ + var _kv{depth}_ []interface{{}} + if _kv{depth}_, _ok{depth}_ = _e{depth}_.([]interface{{}}); !_ok{depth}_ || len(_kv{depth}_) != 2 {{ err = errors.New(""{varName} error""); return }} + var _key{depth}_ {type.KeyType.Apply(DeclaringTypeNameVisitor.Ins)} + {type.KeyType.Apply(DeserializeJsonVisitor.Ins, $"_key{depth}_", $"_kv{depth}_[0]", depth + 1)} + var _value{depth}_ {type.ValueType.Apply(DeclaringTypeNameVisitor.Ins)} + {type.ValueType.Apply(DeserializeJsonVisitor.Ins, $"_value{depth}_", $"_kv{depth}_[1]", depth + 1)} + {varName}[_key{depth}_] = _value{depth}_ + }} + }}"; + } +} diff --git a/luban/src/Luban.Golang/TypeVisitors/DeserializeJsonVisitor.cs b/luban/src/Luban.Golang/TypeVisitors/DeserializeJsonVisitor.cs new file mode 100644 index 00000000..cb66be87 --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/DeserializeJsonVisitor.cs @@ -0,0 +1,21 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Golang.TypeVisitors; + +public class DeserializeJsonVisitor : DecoratorFuncVisitor<string, string, int, string> +{ + public static DeserializeJsonVisitor Ins { get; } = new(); + + public override string DoAccept(TType type, string varName, string bufName, int depth) + { + if (type.IsNullable) + { + return $"{{ if {bufName} == nil {{ return }} else {{ var __x{depth}__ {type.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}; {type.Apply(DeserializeJsonUnderingVisitor.Ins, $"__x{depth}__", bufName, depth)}; {varName} = {(type.Apply(IsPointerTypeVisitor.Ins) ? "&" : "")}__x{depth}__ }}}}"; + } + else + { + return type.Apply(DeserializeJsonUnderingVisitor.Ins, varName, bufName, depth); + } + } +} diff --git a/luban/src/Luban.Golang/TypeVisitors/IsPointerTypeVisitor.cs b/luban/src/Luban.Golang/TypeVisitors/IsPointerTypeVisitor.cs new file mode 100644 index 00000000..989b7d8d --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/IsPointerTypeVisitor.cs @@ -0,0 +1,39 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Golang.TypeVisitors; + +public class IsPointerTypeVisitor : DecoratorFuncVisitor<bool> +{ + public static IsPointerTypeVisitor Ins { get; } = new(); + + public override bool DoAccept(TType type) + { + return type.IsNullable; + } + + public override bool Accept(TBean type) + { + return false; + } + + public override bool Accept(TArray type) + { + return false; + } + + public override bool Accept(TList type) + { + return false; + } + + public override bool Accept(TSet type) + { + return false; + } + + public override bool Accept(TMap type) + { + return false; + } +} diff --git a/luban/src/Luban.Golang/TypeVisitors/JsonImport.cs b/luban/src/Luban.Golang/TypeVisitors/JsonImport.cs new file mode 100644 index 00000000..0bc68a7a --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/JsonImport.cs @@ -0,0 +1,36 @@ +using Luban.Defs; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Golang.TypeVisitors; + +class JsonImport : DecoratorActionVisitor<HashSet<string>> +{ + public static JsonImport Ins { get; } = new(); + + public override void DoAccept(TType type, HashSet<string> x) + { + x.Add("errors"); + } + + public override void Accept(TArray type, HashSet<string> x) + { + type.ElementType.Apply(this, x); + } + + public override void Accept(TList type, HashSet<string> x) + { + type.ElementType.Apply(this, x); + } + + public override void Accept(TSet type, HashSet<string> x) + { + type.ElementType.Apply(this, x); + } + + public override void Accept(TMap type, HashSet<string> x) + { + type.KeyType.Apply(this, x); + type.ValueType.Apply(this, x); + } +} diff --git a/luban/src/Luban.Golang/TypeVisitors/UnderlyingDeclaringTypeNameVisitor.cs b/luban/src/Luban.Golang/TypeVisitors/UnderlyingDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..a46a34f0 --- /dev/null +++ b/luban/src/Luban.Golang/TypeVisitors/UnderlyingDeclaringTypeNameVisitor.cs @@ -0,0 +1,86 @@ +using Luban.Golang.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Golang.TypeVisitors; + +public class UnderlyingDeclaringTypeNameVisitor : ITypeFuncVisitor<string> +{ + public static UnderlyingDeclaringTypeNameVisitor Ins { get; } = new UnderlyingDeclaringTypeNameVisitor(); + + public string Accept(TBool type) + { + return "bool"; + } + + public string Accept(TByte type) + { + return "byte"; + } + + public string Accept(TShort type) + { + return "int16"; + } + + public string Accept(TInt type) + { + return "int32"; + } + + public string Accept(TLong type) + { + return "int64"; + } + + public string Accept(TFloat type) + { + return "float32"; + } + + public string Accept(TDouble type) + { + return "float64"; + } + + public string Accept(TEnum type) + { + return "int32"; + } + + public string Accept(TString type) + { + return "string"; + } + + public string Accept(TBean type) + { + return type.DefBean.IsAbstractType ? $"interface{{}}" : $"*{GoCommonTemplateExtension.FullName(type.DefBean)}"; + } + + public string Accept(TArray type) + { + return $"[]{type.ElementType.Apply(this)}"; + } + + public string Accept(TList type) + { + return $"[]{type.ElementType.Apply(this)}"; + } + + public string Accept(TSet type) + { + return $"[]{type.ElementType.Apply(this)}"; + } + + public string Accept(TMap type) + { + return $"map[{type.KeyType.Apply(this)}]{type.ValueType.Apply(this)}"; + } + + public string Accept(TDateTime type) + { + return "int64"; + } +} diff --git a/luban/src/Luban.Java/AssemblyInfo.cs b/luban/src/Luban.Java/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Java/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Java/CodeTarget/JavaBinCodeTarget.cs b/luban/src/Luban.Java/CodeTarget/JavaBinCodeTarget.cs new file mode 100644 index 00000000..c830f4b4 --- /dev/null +++ b/luban/src/Luban.Java/CodeTarget/JavaBinCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Java.TemplateExtensions; +using Scriban; + +namespace Luban.Java.CodeTarget; + +[CodeTarget("java-bin")] +public class JavaBinCodeTarget : JavaCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new JavaBinTemplateExtension()); + } +} diff --git a/luban/src/Luban.Java/CodeTarget/JavaCodeTargetBase.cs b/luban/src/Luban.Java/CodeTarget/JavaCodeTargetBase.cs new file mode 100644 index 00000000..e7e0dff8 --- /dev/null +++ b/luban/src/Luban.Java/CodeTarget/JavaCodeTargetBase.cs @@ -0,0 +1,38 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.Java.TemplateExtensions; +using Luban.Utils; +using Scriban; + +namespace Luban.Java.CodeTarget; + +public abstract class JavaCodeTargetBase : TemplateCodeTargetBase +{ + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_C_LIKE; + + protected override string FileSuffixName => "java"; + + protected override ICodeStyle DefaultCodeStyle => CodeFormatManager.Ins.JavaDefaultCodeStyle; + + private static readonly HashSet<string> s_preservedKeyWords = new() + { + // java preserved key words + "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "default", + "do", "double", "else", "enum", "extends", "final", "finally", "float", "for", "if", "goto", "implements", "import", + "instanceof", "int", "interface", "long", "native", "new", "package", "private", "protected", "public", "return", + "short", "static", "strictfp", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", + "void", "volatile", "while" + }; + + protected override IReadOnlySet<string> PreservedKeyWords => s_preservedKeyWords; + + protected override string GetFileNameWithoutExtByTypeName(string name) + { + return name.Replace('.', '/'); + } + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new JavaCommonTemplateExtension()); + } +} diff --git a/luban/src/Luban.Java/CodeTarget/JavaJsonCodeTarget.cs b/luban/src/Luban.Java/CodeTarget/JavaJsonCodeTarget.cs new file mode 100644 index 00000000..11930a52 --- /dev/null +++ b/luban/src/Luban.Java/CodeTarget/JavaJsonCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Java.TemplateExtensions; +using Scriban; + +namespace Luban.Java.CodeTarget; + +[CodeTarget("java-json")] +public class JavaJsonCodeTarget : JavaCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new JavaJsonTemplateExtension()); + } +} diff --git a/luban/src/Luban.Java/Luban.Java.csproj b/luban/src/Luban.Java/Luban.Java.csproj new file mode 100644 index 00000000..8593cb83 --- /dev/null +++ b/luban/src/Luban.Java/Luban.Java.csproj @@ -0,0 +1,47 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + </ItemGroup> + + <ItemGroup> + <Folder Include="Templates\common\java\" /> + </ItemGroup> + + <ItemGroup> + <None Update="Templates\lua-lua\schema.sbn"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Update="Templates\lua-bin\schema.sbn"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Update="Templates\common\java\enum.sbn"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Update="Templates\java-bin\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-bin\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-bin\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-json\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-json\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\java-json\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.Java/TemplateExtensions/JavaBinTemplateExtension.cs b/luban/src/Luban.Java/TemplateExtensions/JavaBinTemplateExtension.cs new file mode 100644 index 00000000..6455e691 --- /dev/null +++ b/luban/src/Luban.Java/TemplateExtensions/JavaBinTemplateExtension.cs @@ -0,0 +1,13 @@ +using Luban.Java.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.Java.TemplateExtensions; + +public class JavaBinTemplateExtension : ScriptObject +{ + public static string Deserialize(string bufName, string fieldName, TType type) + { + return type.Apply(JavaBinDeserializeVisitor.Ins, bufName, fieldName); + } +} diff --git a/luban/src/Luban.Java/TemplateExtensions/JavaCommonTemplateExtension.cs b/luban/src/Luban.Java/TemplateExtensions/JavaCommonTemplateExtension.cs new file mode 100644 index 00000000..1f0b1cdb --- /dev/null +++ b/luban/src/Luban.Java/TemplateExtensions/JavaCommonTemplateExtension.cs @@ -0,0 +1,30 @@ +using Luban.Defs; +using Luban.Java.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Java.TemplateExtensions; + +public class JavaCommonTemplateExtension : ScriptObject +{ + public static string DeclaringTypeName(TType type) + { + return type.Apply(JavaDeclaringTypeNameVisitor.Ins); + } + + public static string DeclaringBoxTypeName(TType type) + { + return type.Apply(JavaDeclaringBoxTypeNameVisitor.Ins); + } + + public static string ClassModifier(DefBean type) + { + return type.IsAbstractType ? "abstract" : "final"; + } + + public static string GetterName(string name) + { + return TypeUtil.ToJavaGetterName(name); + } +} diff --git a/luban/src/Luban.Java/TemplateExtensions/JavaJsonTemplateExtension.cs b/luban/src/Luban.Java/TemplateExtensions/JavaJsonTemplateExtension.cs new file mode 100644 index 00000000..bfa9dc5e --- /dev/null +++ b/luban/src/Luban.Java/TemplateExtensions/JavaJsonTemplateExtension.cs @@ -0,0 +1,25 @@ +using Luban.Java.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.Java.TemplateExtensions; + +public class JavaJsonTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string jsonVar, TType type) + { + return type.Apply(JavaJsonUnderlyingDeserializeVisitor.Ins, jsonVar, fieldName, 0); + } + + public static string DeserializeField(string fieldName, string jsonName, string jsonFieldName, TType type) + { + if (type.IsNullable) + { + return $"{{ if ({jsonName}.has(\"{jsonFieldName}\") && !{jsonName}.get(\"{jsonFieldName}\").isJsonNull()) {{ {type.Apply(JavaJsonUnderlyingDeserializeVisitor.Ins, $"{jsonName}.get(\"{jsonFieldName}\")", fieldName, 0)} }} else {{ {fieldName} = null; }} }}"; + } + else + { + return type.Apply(TypeVisitors.JavaJsonUnderlyingDeserializeVisitor.Ins, $"{jsonName}.get(\"{jsonFieldName}\")", fieldName, 0); + } + } +} diff --git a/luban/src/Luban.Java/Templates/common/java/enum.sbn b/luban/src/Luban.Java/Templates/common/java/enum.sbn new file mode 100644 index 00000000..142d8a13 --- /dev/null +++ b/luban/src/Luban.Java/Templates/common/java/enum.sbn @@ -0,0 +1,19 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public final class {{__name}} { + {{~ for item in __this.items ~}} +{{~if item.comment_or_alias != '' ~}} + /** + * {{escape_comment item.comment_or_alias}} + */ +{{~end~}} + public static final int {{item.name}} = {{item.int_value}}; + {{~end~}} +} diff --git a/luban/src/Luban.Java/Templates/java-bin/bean.sbn b/luban/src/Luban.Java/Templates/java-bin/bean.sbn new file mode 100644 index 00000000..39f90f0a --- /dev/null +++ b/luban/src/Luban.Java/Templates/java-bin/bean.sbn @@ -0,0 +1,65 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +import luban.*; + +{{~ + parent_def_type = __this.parent_def_type + export_fields = __this.export_fields + hierarchy_export_fields = __this.hierarchy_export_fields +~}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public {{class_modifier __this}} class {{__name}} extends {{if parent_def_type}}{{__this.parent_def_type.full_name_with_top_module}}{{else}}AbstractBean{{end}} { + public {{__name}}(ByteBuf _buf) { + {{~if parent_def_type~}} + super(_buf); + {{~end~}} + {{~ for field in export_fields ~}} + {{deserialize '_buf' (format_field_name __code_style field.name) field.ctype}} + {{~end~}} + } + + public static {{__name}} deserialize(ByteBuf _buf) { + {{~if __this.is_abstract_type~}} + switch (_buf.readInt()) { + {{~for child in __this.hierarchy_not_abstract_children~}} + case {{child.full_name_with_top_module}}.__ID__: return new {{child.full_name_with_top_module}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__this.full_name_with_top_module}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public final {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + {{~end~}} + +{{~if !__this.is_abstract_type~}} + public static final int __ID__ = {{__this.id}}; + + @Override + public int getTypeId() { return __ID__; } +{{~end~}} + + @Override + public String toString() { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{format_field_name __code_style field.name}} + "," + {{~end~}} + + "}"; + } +} diff --git a/luban/src/Luban.Java/Templates/java-bin/table.sbn b/luban/src/Luban.Java/Templates/java-bin/table.sbn new file mode 100644 index 00000000..8f3c2225 --- /dev/null +++ b/luban/src/Luban.Java/Templates/java-bin/table.sbn @@ -0,0 +1,81 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +import luban.*; + + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public final class {{__name}} { + {{~if __this.is_map_table + key_type = __this.key_ttype + ~}} + private final java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}> _dataMap; + private final java.util.ArrayList<{{declaring_box_type_name __value_type}}> _dataList; + + public {{__name}}(ByteBuf _buf) { + _dataMap = new java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}>(); + _dataList = new java.util.ArrayList<{{declaring_box_type_name __value_type}}>(); + + for(int n = _buf.readSize() ; n > 0 ; --n) { + {{declaring_box_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.add(_v); + _dataMap.put(_v.{{format_field_name __code_style __this.index_field.name}}, _v); + } + } + + public java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}> getDataMap() { return _dataMap; } + public java.util.ArrayList<{{declaring_box_type_name __value_type}}> getDataList() { return _dataList; } + +{{~if __value_type.is_dynamic~}} + @SuppressWarnings("unchecked") + public <T extends {{declaring_box_type_name __value_type}}> T getAs({{declaring_type_name key_type}} key) { return (T)_dataMap.get(key); } +{{~end~}} + public {{declaring_box_type_name __value_type}} get({{declaring_type_name key_type}} key) { return _dataMap.get(key); } + + {{~else if __this.is_list_table ~}} + private final java.util.ArrayList<{{declaring_box_type_name __value_type}}> _dataList; + + public {{__name}}(ByteBuf _buf) { + _dataList = new java.util.ArrayList<{{declaring_box_type_name __value_type}}>(); + + for(int n = _buf.readSize() ; n > 0 ; --n) { + {{declaring_box_type_name __value_type}} _v; + {{deserialize '_buf' '_v' __value_type}} + _dataList.add(_v); + } + } + + public java.util.ArrayList<{{declaring_box_type_name __value_type}}> getDataList() { return _dataList; } + + public {{declaring_box_type_name __value_type}} get(int index) { return _dataList.get(index); } + + + {{~else~}} + private final {{declaring_type_name __value_type}} _data; + + public final {{declaring_type_name __value_type}} data() { return _data; } + + public {{__name}}(ByteBuf _buf) { + int n = _buf.readSize(); + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_buf' '_data' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public {{declaring_type_name field.ctype}} {{getter_name field.name}}() { return _data.{{format_field_name __code_style field.name}}; } + {{~end~}} + + {{~end~}} +} \ No newline at end of file diff --git a/luban/src/Luban.Java/Templates/java-bin/tables.sbn b/luban/src/Luban.Java/Templates/java-bin/tables.sbn new file mode 100644 index 00000000..7ab77d85 --- /dev/null +++ b/luban/src/Luban.Java/Templates/java-bin/tables.sbn @@ -0,0 +1,37 @@ +{{~if __namespace != ''~}} +package {{__namespace}}; +{{~end~}} + +import luban.*; +{{~ +func get_table_inner_name + ret '_' + ($0 | string.downcase) +end +~}} + +public final class {{__name}} +{ + public static interface IByteBufLoader { + ByteBuf load(String file) throws java.io.IOException; + } + + {{~for table in __tables + inner_name = get_table_inner_name table.name + ~}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + private final {{table.full_name_with_top_module}} {{inner_name}}; + public {{table.full_name_with_top_module}} get{{table.name}}() { return {{inner_name}}; } + {{~end~}} + + public {{__name}}(IByteBufLoader loader) throws java.io.IOException { + {{~for table in __tables + inner_name = get_table_inner_name table.name + ~}} + {{inner_name}} = new {{table.full_name_with_top_module}}(loader.load("{{table.output_data_file}}")); + {{~end~}} + } +} diff --git a/luban/src/Luban.Java/Templates/java-json/bean.sbn b/luban/src/Luban.Java/Templates/java-json/bean.sbn new file mode 100644 index 00000000..34fe4158 --- /dev/null +++ b/luban/src/Luban.Java/Templates/java-json/bean.sbn @@ -0,0 +1,67 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +import luban.*; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +{{~ + parent_def_type = __this.parent_def_type + export_fields = __this.export_fields + hierarchy_export_fields = __this.hierarchy_export_fields +~}} + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public {{class_modifier __this}} class {{__name}} extends {{if parent_def_type}}{{__this.parent_def_type.full_name_with_top_module}}{{else}}AbstractBean{{end}} { + public {{__name}}(JsonObject _buf) { + {{~if parent_def_type~}} + super(_buf); + {{~end~}} + {{~ for field in export_fields ~}} + {{deserialize_field (format_field_name __code_style field.name) '_buf' field.name field.ctype}} + {{~end~}} + } + + public static {{__name}} deserialize(JsonObject _buf) { + {{~if __this.is_abstract_type~}} + switch (_buf.get("$type").getAsString()) { + {{~for child in __this.hierarchy_not_abstract_children~}} + case "{{impl_data_type child __this}}": return new {{child.full_name_with_top_module}}(_buf); + {{~end~}} + default: throw new SerializationException(); + } + {{~else~}} + return new {{__this.full_name_with_top_module}}(_buf); + {{~end~}} + } + + {{~ for field in export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public final {{declaring_type_name field.ctype}} {{format_field_name __code_style field.name}}; + {{~end~}} + +{{~if !__this.is_abstract_type~}} + public static final int __ID__ = {{__this.id}}; + + @Override + public int getTypeId() { return __ID__; } +{{~end~}} + + @Override + public String toString() { + return "{{full_name}}{ " + {{~for field in hierarchy_export_fields ~}} + + "{{format_field_name __code_style field.name}}:" + {{format_field_name __code_style field.name}} + "," + {{~end~}} + + "}"; + } +} diff --git a/luban/src/Luban.Java/Templates/java-json/table.sbn b/luban/src/Luban.Java/Templates/java-json/table.sbn new file mode 100644 index 00000000..d4a5ebd6 --- /dev/null +++ b/luban/src/Luban.Java/Templates/java-json/table.sbn @@ -0,0 +1,82 @@ +{{~if __namespace_with_top_module != ''~}} +package {{__namespace_with_top_module}}; +{{~end~}} + +import luban.*; +import com.google.gson.JsonElement; + + +{{~if __this.comment != '' ~}} +/** + * {{escape_comment __this.comment}} + */ +{{~end~}} +public final class {{__name}} { + {{~if __this.is_map_table + key_type = __this.key_ttype + ~}} + private final java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}> _dataMap; + private final java.util.ArrayList<{{declaring_box_type_name __value_type}}> _dataList; + + public {{__name}}(JsonElement _buf) { + _dataMap = new java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}>(); + _dataList = new java.util.ArrayList<{{declaring_box_type_name __value_type}}>(); + + for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { + {{declaring_box_type_name __value_type}} _v; + {{deserialize '_v' '_e_' __value_type}} + _dataList.add(_v); + _dataMap.put(_v.{{format_field_name __code_style __this.index_field.name}}, _v); + } + } + + public java.util.HashMap<{{declaring_box_type_name key_type}}, {{declaring_box_type_name __value_type}}> getDataMap() { return _dataMap; } + public java.util.ArrayList<{{declaring_box_type_name __value_type}}> getDataList() { return _dataList; } + +{{~if __value_type.is_dynamic~}} + @SuppressWarnings("unchecked") + public <T extends {{declaring_box_type_name __value_type}}> T getAs({{declaring_type_name key_type}} key) { return (T)_dataMap.get(key); } +{{~end~}} + public {{declaring_box_type_name __value_type}} get({{declaring_type_name key_type}} key) { return _dataMap.get(key); } + + {{~else if __this.is_list_table ~}} + private final java.util.ArrayList<{{declaring_box_type_name __value_type}}> _dataList; + + public {{__name}}(JsonElement _buf) { + _dataList = new java.util.ArrayList<{{declaring_box_type_name __value_type}}>(); + + for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { + {{declaring_box_type_name __value_type}} _v; + {{deserialize '_v' '_e_' __value_type}} + _dataList.add(_v); + } + } + + public java.util.ArrayList<{{declaring_box_type_name __value_type}}> getDataList() { return _dataList; } + + public {{declaring_box_type_name __value_type}} get(int index) { return _dataList.get(index); } + + + {{~else~}} + private final {{declaring_type_name __value_type}} _data; + + public final {{declaring_type_name __value_type}} data() { return _data; } + + public {{__name}}(JsonElement _buf) { + int n = _buf.getAsJsonArray().size(); + if (n != 1) throw new SerializationException("table mode=one, but size != 1"); + {{deserialize '_data' '_buf.getAsJsonArray().get(0).getAsJsonObject()' __value_type}} + } + + + {{~ for field in __value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public {{declaring_type_name field.ctype}} {{getter_name field.name}}() { return _data.{{format_field_name __code_style field.name}}; } + {{~end~}} + + {{~end~}} +} \ No newline at end of file diff --git a/luban/src/Luban.Java/Templates/java-json/tables.sbn b/luban/src/Luban.Java/Templates/java-json/tables.sbn new file mode 100644 index 00000000..dbb624b0 --- /dev/null +++ b/luban/src/Luban.Java/Templates/java-json/tables.sbn @@ -0,0 +1,39 @@ +{{~if __namespace != ''~}} +package {{__namespace}}; +{{~end~}} + +import luban.*; +import com.google.gson.JsonElement; +{{~ +func get_table_inner_name + ret '_' + ($0 | string.downcase) +end +~}} + +public final class {{__name}} +{ + + public interface IJsonLoader { + JsonElement load(String file) throws java.io.IOException; + } + + {{~for table in __tables + inner_name = get_table_inner_name table.name + ~}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + private final {{table.full_name_with_top_module}} {{inner_name}}; + public {{table.full_name_with_top_module}} get{{table.name}}() { return {{inner_name}}; } + {{~end~}} + + public {{__name}}(IJsonLoader loader) throws java.io.IOException { + {{~for table in __tables + inner_name = get_table_inner_name table.name + ~}} + {{inner_name}} = new {{table.full_name_with_top_module}}(loader.load("{{table.output_data_file}}")); + {{~end~}} + } +} diff --git a/luban/src/Luban.Java/TypeVisitors/JavaBinDeserializeVisitor.cs b/luban/src/Luban.Java/TypeVisitors/JavaBinDeserializeVisitor.cs new file mode 100644 index 00000000..6e5267a8 --- /dev/null +++ b/luban/src/Luban.Java/TypeVisitors/JavaBinDeserializeVisitor.cs @@ -0,0 +1,21 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Java.TypeVisitors; + +public class JavaBinDeserializeVisitor : DecoratorFuncVisitor<string, string, string> +{ + public static JavaBinDeserializeVisitor Ins { get; } = new(); + + public override string DoAccept(TType type, string bufName, string fieldName) + { + if (type.IsNullable) + { + return $"if({bufName}.readBool()){{ {type.Apply(JavaBinUnderlyingDeserializeVisitor.Ins, bufName, fieldName, 0)} }} else {{ {fieldName} = null; }}"; + } + else + { + return type.Apply(JavaBinUnderlyingDeserializeVisitor.Ins, bufName, fieldName, 0); + } + } +} diff --git a/luban/src/Luban.Java/TypeVisitors/JavaBinUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Java/TypeVisitors/JavaBinUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..0179b02e --- /dev/null +++ b/luban/src/Luban.Java/TypeVisitors/JavaBinUnderlyingDeserializeVisitor.cs @@ -0,0 +1,122 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Java.TypeVisitors; + +class JavaBinUnderlyingDeserializeVisitor : ITypeFuncVisitor<string, string, int, string> +{ + public static JavaBinUnderlyingDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.readBool();"; + } + + public string Accept(TByte type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.readByte();"; + } + + public string Accept(TShort type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.readShort();"; + } + + public string Accept(TInt type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.readInt();"; + } + + public string Accept(TLong type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.readLong();"; + } + + public string Accept(TFloat type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.readFloat();"; + } + + public string Accept(TDouble type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.readDouble();"; + } + + public string Accept(TEnum type, string bufName, string fieldName, int depth) + { + string src = $"{bufName}.readInt()"; + string constructor = type.DefEnum.TypeConstructorWithTypeMapper(); + return $"{fieldName} = {(string.IsNullOrEmpty(constructor) ? src : $"{constructor}({src})")};"; + } + + public string Accept(TString type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.readString();"; + } + + public string Accept(TBean type, string bufName, string fieldName, int depth) + { + string src = $"{type.DefBean.FullNameWithTopModule}.deserialize({bufName})"; + string constructor = type.DefBean.TypeConstructorWithTypeMapper(); + return $"{fieldName} = {(string.IsNullOrEmpty(constructor) ? src : $"{constructor}({src})")};"; + } + + public string Accept(TArray type, string bufName, string fieldName, int depth) + { + //return $"{{int n = Math.min({bufName}.readSize(), {bufName}.size());{fieldName} = new {type.ElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)}[n];for(int i = 0 ; i < n ; i++) {{ {type.ElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)} _e;{type.ElementType.Apply(this, bufName, "_e")} {fieldName}[i] = _e;}}}}"; + var __n = $"__n{depth}"; + var __e = $"__e{depth}"; + var __i = $"__i{depth}"; + var typeStr = $"{type.ElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)}[{__n}]"; + if (type.Dimension > 1) + { + if (type.FinalElementType == null) + { + throw new System.Exception("多维数组没有元素类型"); + } + typeStr = $"{type.FinalElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)}[{__n}]"; + for (int i = 0; i < type.Dimension - 1; i++) + { + typeStr += "[]"; + } + } + return $"{{int {__n} = Math.min({bufName}.readSize(), {bufName}.size());{fieldName} = new {typeStr};for(int {__i} = 0 ; {__i} < {__n} ; {__i}++) {{ {type.ElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)} {__e};{type.ElementType.Apply(this, bufName, __e, depth + 1)} {fieldName}[{__i}] = {__e};}}}}"; + } + + public string Accept(TList type, string bufName, string fieldName, int depth) + { + //return $"{{int n = Math.min({bufName}.readSize(), {bufName}.size());{fieldName} = new {type.Apply(JavaDeclaringTypeNameVisitor.Ins)}(n);for(int i = 0 ; i < n ; i++) {{ {type.ElementType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)} _e; {type.ElementType.Apply(this, bufName, "_e")} {fieldName}.add(_e);}}}}"; + + var __n = $"__n{depth}"; + var __e = $"__e{depth}"; + var __i = $"__i{depth}"; + return $"{{int {__n} = Math.min({bufName}.readSize(), {bufName}.size());{fieldName} = new {type.Apply(JavaDeclaringTypeNameVisitor.Ins)}({__n});for(int {__i} = 0 ; {__i} < {__n} ; {__i}++) {{ {type.ElementType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)} {__e}; {type.ElementType.Apply(this, bufName, __e, depth + 1)} {fieldName}.add({__e});}}}}"; + } + + public string Accept(TSet type, string bufName, string fieldName, int depth) + { + //return $"{{int n = Math.min({bufName}.readSize(), {bufName}.size());{fieldName} = new {type.Apply(JavaDeclaringTypeNameVisitor.Ins)}(n * 3 / 2);for(int i = 0 ; i < n ; i++) {{ {type.ElementType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)} _e; {type.ElementType.Apply(this, bufName, "_e")} {fieldName}.add(_e);}}}}"; + + var __n = $"__n{depth}"; + var __e = $"__e{depth}"; + var __i = $"__i{depth}"; + return $"{{int {__n} = Math.min({bufName}.readSize(), {bufName}.size());{fieldName} = new {type.Apply(JavaDeclaringTypeNameVisitor.Ins)}({__n} * 3 / 2);for(int {__i} = 0 ; {__i} < {__n} ; {__i}++) {{ {type.ElementType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)} {__e}; {type.ElementType.Apply(this, bufName, __e, depth + 1)} {fieldName}.add({__e});}}}}"; + } + + public string Accept(TMap type, string bufName, string fieldName, int depth) + { + //return $"{{int n = Math.min({bufName}.readSize(), {bufName}.size());{fieldName} = new {type.Apply(JavaDeclaringTypeNameVisitor.Ins)}(n * 3 / 2);for(int i = 0 ; i < n ; i++) {{ {type.KeyType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)} _k; {type.KeyType.Apply(this, bufName, "_k")} {type.ValueType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)} _v; {type.ValueType.Apply(this, bufName, "_v")} {fieldName}.put(_k, _v);}}}}"; + + var __n = $"__n{depth}"; + var __k = $"__k{depth}"; + var __v = $"__v{depth}"; + var __i = $"__i{depth}"; + return $"{{int {__n} = Math.min({bufName}.readSize(), {bufName}.size());{fieldName} = new {type.Apply(JavaDeclaringTypeNameVisitor.Ins)}({__n} * 3 / 2);for(int {__i} = 0 ; {__i} < {__n} ; {__i}++) {{ {type.KeyType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)} {__k}; {type.KeyType.Apply(this, bufName, __k, depth + 1)} {type.ValueType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)} {__v}; {type.ValueType.Apply(this, bufName, __v, depth + 1)} {fieldName}.put({__k}, {__v});}}}}"; + } + + public string Accept(TDateTime type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.readLong();"; + } +} diff --git a/luban/src/Luban.Java/TypeVisitors/JavaDeclaringBoxTypeNameVisitor.cs b/luban/src/Luban.Java/TypeVisitors/JavaDeclaringBoxTypeNameVisitor.cs new file mode 100644 index 00000000..8487eed2 --- /dev/null +++ b/luban/src/Luban.Java/TypeVisitors/JavaDeclaringBoxTypeNameVisitor.cs @@ -0,0 +1,54 @@ +using Luban.Types; + +namespace Luban.Java.TypeVisitors; + +public class JavaDeclaringBoxTypeNameVisitor : JavaDeclaringTypeNameVisitor +{ + public new static JavaDeclaringBoxTypeNameVisitor Ins { get; } = new(); + + public override string Accept(TBool type) + { + return "Boolean"; + } + + public override string Accept(TByte type) + { + return "Byte"; + } + + public override string Accept(TShort type) + { + return "Short"; + } + + public override string Accept(TInt type) + { + return "Integer"; + } + + public override string Accept(TLong type) + { + return "Long"; + } + + public override string Accept(TFloat type) + { + return "Float"; + } + + public override string Accept(TDouble type) + { + return "Double"; + } + + public override string Accept(TDateTime type) + { + return "Long"; + } + + public override string Accept(TEnum type) + { + //return type.DefineEnum.FullNameWithTopModule; + return "Integer"; + } +} diff --git a/luban/src/Luban.Java/TypeVisitors/JavaDeclaringTypeNameVisitor.cs b/luban/src/Luban.Java/TypeVisitors/JavaDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..e1f39524 --- /dev/null +++ b/luban/src/Luban.Java/TypeVisitors/JavaDeclaringTypeNameVisitor.cs @@ -0,0 +1,86 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Java.TypeVisitors; + +public class JavaDeclaringTypeNameVisitor : ITypeFuncVisitor<string> +{ + public static JavaDeclaringTypeNameVisitor Ins { get; } = new(); + + public virtual string Accept(TBool type) + { + return type.IsNullable ? "Boolean" : "boolean"; + } + + public virtual string Accept(TByte type) + { + return type.IsNullable ? "Byte" : "byte"; + } + + public virtual string Accept(TShort type) + { + return type.IsNullable ? "Short" : "short"; + } + + public virtual string Accept(TInt type) + { + return type.IsNullable ? "Integer" : "int"; + } + + public virtual string Accept(TLong type) + { + return type.IsNullable ? "Long" : "long"; + } + + public virtual string Accept(TFloat type) + { + return type.IsNullable ? "Float" : "float"; + } + + public virtual string Accept(TDouble type) + { + return type.IsNullable ? "Double" : "double"; + } + + public virtual string Accept(TEnum type) + { + string src = type.IsNullable ? "Integer" : "int"; + return type.DefEnum.TypeNameWithTypeMapper() ?? src; + } + + public string Accept(TString type) + { + return "String"; + } + + public virtual string Accept(TDateTime type) + { + return type.IsNullable ? "Long" : "long"; + } + + public string Accept(TBean type) + { + return type.DefBean.TypeNameWithTypeMapper() ?? type.DefBean.FullNameWithTopModule; + } + + public string Accept(TArray type) + { + return $"{type.ElementType.Apply(this)}[]"; + } + + public string Accept(TList type) + { + return $"java.util.ArrayList<{type.ElementType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)}>"; + } + + public string Accept(TSet type) + { + return $"java.util.HashSet<{type.ElementType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)}>"; + } + + public string Accept(TMap type) + { + return $"java.util.HashMap<{type.KeyType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)}, {type.ValueType.Apply(JavaDeclaringBoxTypeNameVisitor.Ins)}>"; + } +} diff --git a/luban/src/Luban.Java/TypeVisitors/JavaJsonUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Java/TypeVisitors/JavaJsonUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..cbb47243 --- /dev/null +++ b/luban/src/Luban.Java/TypeVisitors/JavaJsonUnderlyingDeserializeVisitor.cs @@ -0,0 +1,109 @@ +using Luban.Datas; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Java.TypeVisitors; + +public class JavaJsonUnderlyingDeserializeVisitor : ITypeFuncVisitor<string, string, int, string> +{ + public static JavaJsonUnderlyingDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string json, string x, int depth) + { + return $"{x} = {json}.getAsBoolean();"; + } + + public string Accept(TByte type, string json, string x, int depth) + { + return $"{x} = {json}.getAsByte();"; + } + + public string Accept(TShort type, string json, string x, int depth) + { + return $"{x} = {json}.getAsShort();"; + } + + public string Accept(TInt type, string json, string x, int depth) + { + return $"{x} = {json}.getAsInt();"; + } + + public string Accept(TLong type, string json, string x, int depth) + { + return $"{x} = {json}.getAsLong();"; + } + + public string Accept(TFloat type, string json, string x, int depth) + { + return $"{x} = {json}.getAsFloat();"; + } + + public string Accept(TDouble type, string json, string x, int depth) + { + return $"{x} = {json}.getAsDouble();"; + } + + public string Accept(TEnum type, string json, string x, int depth) + { + return $"{x} = {json}.getAsInt();"; + } + + public string Accept(TString type, string json, string x, int depth) + { + return $"{x} = {json}.getAsString();"; + } + + public string Accept(TDateTime type, string json, string x, int depth) + { + return $"{x} = {json}.getAsLong();"; + } + + public string Accept(TBean type, string json, string x, int depth) + { + return $"{x} = {type.DefBean.FullNameWithTopModule}.deserialize({json}.getAsJsonObject());"; + } + + public string Accept(TArray type, string json, string x, int depth) + { + string __n = $"__n{depth}"; + string __e = $"__e{depth}"; + string __v = $"__v{depth}"; + string __index = $"__index{depth}"; + string typeStr = $"{type.ElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)}[{__n}]"; + if (type.Dimension > 1) + { + if (type.FinalElementType == null) + { + throw new System.Exception("多维数组没有元素类型"); + } + typeStr = $"{type.FinalElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)}[{__n}]"; + for (int i = 0; i < type.Dimension - 1; i++) + { + typeStr += "[]"; + } + } + return $"{{ com.google.gson.JsonArray _json{depth}_ = {json}.getAsJsonArray(); int {__n} = _json{depth}_.size(); {x} = new {typeStr}; int {__index}=0; for(JsonElement {__e} : _json{depth}_) {{ {type.ElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, $"{__e}", $"{__v}", depth + 1)} {x}[{__index}++] = {__v}; }} }}"; + } + + public string Accept(TList type, string json, string x, int depth) + { + string __e = $"_e{depth}"; + string __v = $"_v{depth}"; + return $"{{ com.google.gson.JsonArray _json{depth}_ = {json}.getAsJsonArray(); {x} = new {type.Apply(JavaDeclaringTypeNameVisitor.Ins)}(_json{depth}_.size()); for(JsonElement {__e} : _json{depth}_) {{ {type.ElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, __e, __v, depth + 1)} {x}.add({__v}); }} }}"; + } + + public string Accept(TSet type, string json, string x, int depth) + { + string __e = $"_e{depth}"; + string __v = $"_v{depth}"; + return $"{{ com.google.gson.JsonArray _json{depth}_ = {json}.getAsJsonArray(); {x} = new {type.Apply(JavaDeclaringTypeNameVisitor.Ins)}(_json{depth}_.size()); for(JsonElement {__e} : _json{depth}_) {{ {type.ElementType.Apply(JavaDeclaringTypeNameVisitor.Ins)} {__v}; {type.ElementType.Apply(this, __e, __v, depth + 1)} {x}.add({__v}); }} }}"; + } + + public string Accept(TMap type, string json, string x, int depth) + { + string __e = $"_e{depth}"; + string __k = $"_k{depth}"; + string __v = $"_v{depth}"; + return @$"{{ com.google.gson.JsonArray _json{depth}_ = {json}.getAsJsonArray(); {x} = new {type.Apply(JavaDeclaringTypeNameVisitor.Ins)}(_json{depth}_.size()); for(JsonElement {__e} : _json{depth}_) {{ {type.KeyType.Apply(JavaDeclaringTypeNameVisitor.Ins)} {__k}; {type.KeyType.Apply(this, $"{__e}.getAsJsonArray().get(0)", __k, depth + 1)} {type.ValueType.Apply(JavaDeclaringTypeNameVisitor.Ins)} {__v}; {type.ValueType.Apply(this, $"{__e}.getAsJsonArray().get(1)", __v, depth + 1)} {x}.put({__k}, {__v}); }} }}"; + } +} diff --git a/luban/src/Luban.L10N/AssemblyInfo.cs b/luban/src/Luban.L10N/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.L10N/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.L10N/DataTarget/TextKeyCollection.cs b/luban/src/Luban.L10N/DataTarget/TextKeyCollection.cs new file mode 100644 index 00000000..00a60d83 --- /dev/null +++ b/luban/src/Luban.L10N/DataTarget/TextKeyCollection.cs @@ -0,0 +1,16 @@ +namespace Luban.L10N.DataTarget; + +public class TextKeyCollection +{ + private readonly HashSet<string> _keys = new(); + + public void AddKey(string key) + { + if (!string.IsNullOrWhiteSpace(key)) + { + _keys.Add(key); + } + } + + public IEnumerable<string> Keys => _keys; +} diff --git a/luban/src/Luban.L10N/DataTarget/TextKeyListCollectorVisitor.cs b/luban/src/Luban.L10N/DataTarget/TextKeyListCollectorVisitor.cs new file mode 100644 index 00000000..c2aa0832 --- /dev/null +++ b/luban/src/Luban.L10N/DataTarget/TextKeyListCollectorVisitor.cs @@ -0,0 +1,95 @@ + + +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Types; + +namespace Luban.L10N.DataTarget; + + +/// <summary> +/// 检查 相同key的text,原始值必须相同 +/// </summary> +public class TextKeyListCollectorVisitor : IDataActionVisitor2<TextKeyCollection> +{ + public static TextKeyListCollectorVisitor Ins { get; } = new TextKeyListCollectorVisitor(); + + public void Accept(DBool data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DByte data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DShort data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DInt data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DLong data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DFloat data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DDouble data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DEnum data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DString data, TType type, TextKeyCollection x) + { + if (data != null && type.HasTag("text")) + { + x.AddKey(data.Value); + } + } + + public void Accept(DDateTime data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DBean data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DArray data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DList data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DSet data, TType type, TextKeyCollection x) + { + + } + + public void Accept(DMap data, TType type, TextKeyCollection x) + { + + } +} diff --git a/luban/src/Luban.L10N/DataTarget/TextKeyListDataTarget.cs b/luban/src/Luban.L10N/DataTarget/TextKeyListDataTarget.cs new file mode 100644 index 00000000..70651a48 --- /dev/null +++ b/luban/src/Luban.L10N/DataTarget/TextKeyListDataTarget.cs @@ -0,0 +1,41 @@ +using Luban.DataTarget; +using Luban.DataVisitors; +using Luban.Defs; +using System.Text; + +namespace Luban.L10N.DataTarget; + +[DataTarget("text-list")] +internal class TextKeyListDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "txt"; + + public override bool ExportAllRecords => true; + + public override AggregationType AggregationType => AggregationType.Tables; + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + throw new NotImplementedException(); + } + + public override OutputFile ExportTables(List<DefTable> tables) + { + var textCollection = new TextKeyCollection(); + + var visitor = new DataActionHelpVisitor2<TextKeyCollection>(TextKeyListCollectorVisitor.Ins); + + foreach (var table in tables) + { + TableVisitor.Ins.Visit(table, visitor, textCollection); + } + + var keys = textCollection.Keys.ToList(); + keys.Sort((a, b) => string.Compare(a, b, StringComparison.Ordinal)); + var content = string.Join("\n", keys); + + string outputFile = EnvManager.Current.GetOption(BuiltinOptionNames.L10NFamily, BuiltinOptionNames.L10NTextListFile, false); + + return CreateOutputFile(outputFile, content); + } +} diff --git a/luban/src/Luban.L10N/DefaultTextProvider.cs b/luban/src/Luban.L10N/DefaultTextProvider.cs new file mode 100644 index 00000000..72bccdd2 --- /dev/null +++ b/luban/src/Luban.L10N/DefaultTextProvider.cs @@ -0,0 +1,134 @@ +using Luban.DataLoader; +using Luban.Datas; +using Luban.Defs; +using Luban.RawDefs; +using Luban.Types; +using Luban.Utils; +using System.Linq; + +namespace Luban.L10N; + +[TextProvider("default")] +public class DefaultTextProvider : ITextProvider +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private string _keyFieldName; + private string _ValueFieldName; + + private bool _convertTextKeyToValue; + + private readonly Dictionary<string, string> _texts = new(); + + private readonly HashSet<string> _unknownTextKeys = new(); + + public void Load() + { + EnvManager env = EnvManager.Current; + + _keyFieldName = env.GetOptionOrDefault(BuiltinOptionNames.L10NFamily, BuiltinOptionNames.L10NTextFileKeyFieldName, false, ""); + if (string.IsNullOrWhiteSpace(_keyFieldName)) + { + throw new Exception($"'-x {BuiltinOptionNames.L10NFamily}.{BuiltinOptionNames.L10NTextFileKeyFieldName}=xxx' missing"); + } + + _convertTextKeyToValue = DataUtil.ParseBool(env.GetOptionOrDefault(BuiltinOptionNames.L10NFamily, BuiltinOptionNames.L10NConvertTextKeyToValue, false, "false")); + if (_convertTextKeyToValue) + { + _ValueFieldName = env.GetOptionOrDefault(BuiltinOptionNames.L10NFamily, BuiltinOptionNames.L10NTextFileLanguageFieldName, false, ""); + if (string.IsNullOrWhiteSpace(_ValueFieldName)) + { + throw new Exception($"'-x {BuiltinOptionNames.L10NFamily}.{BuiltinOptionNames.L10NTextFileLanguageFieldName}=xxx' missing"); + } + } + + string textProviderFile = env.GetOption(BuiltinOptionNames.L10NFamily, BuiltinOptionNames.L10NTextFilePath, false); + LoadTextListFromFile(textProviderFile); + } + + public bool ConvertTextKeyToValue => _convertTextKeyToValue; + + public bool IsValidKey(string key) + { + return _texts.ContainsKey(key); + } + + public bool TryGetText(string key, out string text) + { + return _texts.TryGetValue(key, out text); + } + + private void LoadTextListFromFile(string fileName) + { + var ass = new DefAssembly(new RawAssembly() + { + Targets = new List<RawTarget> { new() { Name = "default", Manager = "Tables" } }, + }, "default", new List<string>(), null, null); + + + var rawFields = new List<RawField> { new() { Name = _keyFieldName, Type = "string" }, }; + if (_convertTextKeyToValue) + { + rawFields.Add(new() { Name = _ValueFieldName, Type = "string" }); + } + var defTableRecordType = new DefBean(new RawBean() + { + Namespace = "__intern__", + Name = "__TextInfo__", + Parent = "", + Alias = "", + IsValueType = false, + Sep = "", + Fields = rawFields, + }) + { + Assembly = ass, + }; + + ass.AddType(defTableRecordType); + defTableRecordType.PreCompile(); + defTableRecordType.Compile(); + defTableRecordType.PostCompile(); + var tableRecordType = TBean.Create(false, defTableRecordType, null); + + (var actualFile, var sheetName) = FileUtil.SplitFileAndSheetName(FileUtil.Standardize(fileName)); + var records = DataLoaderManager.Ins.LoadTableFile(tableRecordType, actualFile, sheetName, new Dictionary<string, string>()); + + foreach (var r in records) + { + DBean data = r.Data; + + string key = ((DString)data.GetField(_keyFieldName)).Value; + string value = _convertTextKeyToValue ? ((DString)data.GetField(_ValueFieldName)).Value : key; + if (string.IsNullOrEmpty(key)) + { + s_logger.Error("textFile:{} key:{} is empty. ignore it!", fileName, key); + continue; + } + if (!_texts.TryAdd(key, value)) + { + s_logger.Error("textFile:{} key:{} is duplicated", fileName, key); + } + }; + } + + public void AddUnknownKey(string key) + { + _unknownTextKeys.Add(key); + } + + public void ProcessDatas() + { + if (_convertTextKeyToValue) + { + var trans = new TextKeyToValueTransformer(this); + foreach (var table in GenerationContext.Current.Tables) + { + foreach (var record in GenerationContext.Current.GetTableAllDataList(table)) + { + record.Data = (DBean)record.Data.Apply(trans,table.ValueTType); + } + } + } + } +} diff --git a/luban/src/Luban.L10N/Luban.L10N.csproj b/luban/src/Luban.L10N/Luban.L10N.csproj new file mode 100644 index 00000000..f5bc0507 --- /dev/null +++ b/luban/src/Luban.L10N/Luban.L10N.csproj @@ -0,0 +1,14 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + <ProjectReference Include="..\Luban.DataLoader.Builtin\Luban.DataLoader.Builtin.csproj" /> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.L10N/TextKeyToValueTransformer.cs b/luban/src/Luban.L10N/TextKeyToValueTransformer.cs new file mode 100644 index 00000000..fcbcc7b7 --- /dev/null +++ b/luban/src/Luban.L10N/TextKeyToValueTransformer.cs @@ -0,0 +1,39 @@ +using Luban.Datas; +using Luban.DataTransformer; +using Luban.DataVisitors; +using Luban.Types; +using Luban.Utils; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.L10N; + +public class TextKeyToValueTransformer : DataTransfomerBase, IDataFuncVisitor2<DType> +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private readonly ITextProvider _provider; + + public TextKeyToValueTransformer(ITextProvider provider) + { + _provider = provider; + } + + DType IDataFuncVisitor2<DType>.Accept(DString data, TType type) + { + if(string.IsNullOrEmpty(data.Value) || !type.HasTag("text")) + { + return data; + } + if (_provider.TryGetText(data.Value, out var text)) + { + return DString.ValueOf(type, text); + } + s_logger.Error("can't find target language text of text id:{} ", data.Value); + //_provider.AddUnknownKey(data.Value); + return data; + } +} diff --git a/luban/src/Luban.L10N/TextValidator.cs b/luban/src/Luban.L10N/TextValidator.cs new file mode 100644 index 00000000..1ae02f41 --- /dev/null +++ b/luban/src/Luban.L10N/TextValidator.cs @@ -0,0 +1,41 @@ +using Luban.Datas; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Luban.Validator; + +namespace Luban.L10N; + +[Validator("text")] +public class TextValidator : DataValidatorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public override void Compile(DefField field, TType type) + { + if (type is not TString) + { + throw new Exception($"field:{field} text validator supports string type only"); + } + } + + public override void Validate(DataValidatorContext ctx, TType type, DType data) + { + ITextProvider provider = GenerationContext.Current.TextProvider; + // dont' check when convertTextKeyToValue is true + if (provider == null || provider.ConvertTextKeyToValue) + { + return; + } + string key = ((DString)data).Value; + if (string.IsNullOrEmpty(key)) + { + return; + } + if (!provider.IsValidKey(key)) + { + s_logger.Error("记录 {}:{} (来自文件:{}) 不是一个有效的文本key", DataValidatorContext.CurrentRecordPath, data, Source); + GenerationContext.Current.LogValidatorFail(this); + } + } +} diff --git a/luban/src/Luban.Lua/AssemblyInfo.cs b/luban/src/Luban.Lua/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Lua/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Lua/CodeTarget/LuaBinCodeTarget.cs b/luban/src/Luban.Lua/CodeTarget/LuaBinCodeTarget.cs new file mode 100644 index 00000000..e4c70be5 --- /dev/null +++ b/luban/src/Luban.Lua/CodeTarget/LuaBinCodeTarget.cs @@ -0,0 +1,17 @@ +using Luban.CodeTarget; +using Luban.Lua.TemplateExtensions; +using Luban.Tmpl; +using Scriban; +using Scriban.Runtime; + +namespace Luban.Lua.CodeTarget; + +[CodeTarget("lua-bin")] +public class LuaBinCodeTarget : LuaCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new LuaBinTemplateExtension()); + } +} diff --git a/luban/src/Luban.Lua/CodeTarget/LuaCodeTargetBase.cs b/luban/src/Luban.Lua/CodeTarget/LuaCodeTargetBase.cs new file mode 100644 index 00000000..db400efe --- /dev/null +++ b/luban/src/Luban.Lua/CodeTarget/LuaCodeTargetBase.cs @@ -0,0 +1,30 @@ +using Luban.CodeTarget; +using Luban.Lua.TemplateExtensions; +using Luban.Tmpl; +using Scriban; +using Scriban.Runtime; + +namespace Luban.Lua.CodeTarget; + +public abstract class LuaCodeTargetBase : AllInOneTemplateCodeTargetBase +{ + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_LUA; + + protected override string FileSuffixName => "lua"; + + protected override string DefaultOutputFileName => "schema.lua"; + + + private static readonly HashSet<string> s_preservedKeyWords = new() + { + // lua preserved key words + "and", "break", "do", "else", "elseif", "end", "false", "for", "function", "goto", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while" + }; + + protected override IReadOnlySet<string> PreservedKeyWords => s_preservedKeyWords; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new LuaCommonTemplateExtension()); + } +} diff --git a/luban/src/Luban.Lua/CodeTarget/LuaLuaCodeTarget.cs b/luban/src/Luban.Lua/CodeTarget/LuaLuaCodeTarget.cs new file mode 100644 index 00000000..5ba012cd --- /dev/null +++ b/luban/src/Luban.Lua/CodeTarget/LuaLuaCodeTarget.cs @@ -0,0 +1,11 @@ +using Luban.CodeTarget; +using Luban.Defs; +using Scriban; + +namespace Luban.Lua.CodeTarget; + +[CodeTarget("lua-lua")] +public class LuaLuaCodeTarget : LuaCodeTargetBase +{ + +} diff --git a/luban/src/Luban.Lua/DataTarget/LuaDataTarget.cs b/luban/src/Luban.Lua/DataTarget/LuaDataTarget.cs new file mode 100644 index 00000000..099f9283 --- /dev/null +++ b/luban/src/Luban.Lua/DataTarget/LuaDataTarget.cs @@ -0,0 +1,72 @@ +using System.Text; +using Luban.Datas; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Lua.DataVisitors; + +namespace Luban.Lua.DataTarget; + +[DataTarget("lua")] +public class LuaDataTarget : DataTargetBase +{ + public void ExportTableSingleton(DefTable t, Record record, StringBuilder result) + { + result.Append("return ").AppendLine(); + result.Append(record.Data.Apply(ToLuaLiteralVisitor.Ins)); + } + + public void ExportTableMap(DefTable t, List<Record> records, StringBuilder s) + { + s.Append("return").AppendLine(); + s.Append('{').AppendLine(); + foreach (Record r in records) + { + DBean d = r.Data; + string keyStr = d.GetField(t.Index).Apply(ToLuaLiteralVisitor.Ins); + if (!keyStr.StartsWith("[", StringComparison.Ordinal)) + { + s.Append($"[{keyStr}] = "); + } + else + { + s.Append($"[ {keyStr} ] = "); + } + s.Append(d.Apply(ToLuaLiteralVisitor.Ins)); + s.Append(',').AppendLine(); + } + s.Append('}'); + } + + public void ExportTableList(DefTable t, List<Record> records, StringBuilder s) + { + s.Append("return").AppendLine(); + s.Append('{').AppendLine(); + foreach (Record r in records) + { + DBean d = r.Data; + s.Append(d.Apply(ToLuaLiteralVisitor.Ins)); + s.Append(',').AppendLine(); + } + s.Append('}'); + } + + protected override string DefaultOutputFileExt => "lua"; + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var ss = new StringBuilder(); + if (table.IsMapTable) + { + ExportTableMap(table, records, ss); + } + else if (table.IsSingletonTable) + { + ExportTableSingleton(table, records[0], ss); + } + else + { + ExportTableList(table, records, ss); + } + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", ss.ToString()); + } +} diff --git a/luban/src/Luban.Lua/DataVisitors/ToLuaLiteralVisitor.cs b/luban/src/Luban.Lua/DataVisitors/ToLuaLiteralVisitor.cs new file mode 100644 index 00000000..f6d6e89b --- /dev/null +++ b/luban/src/Luban.Lua/DataVisitors/ToLuaLiteralVisitor.cs @@ -0,0 +1,96 @@ +using System.Text; +using Luban.DataLoader; +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.Lua.DataVisitors; + +public class ToLuaLiteralVisitor : ToLiteralVisitorBase +{ + public static ToLuaLiteralVisitor Ins { get; } = new(); + + public override string Accept(DString type) + { + return DataUtil.EscapeLuaStringWithQuote(type.Value); + } + + public override string Accept(DBean type) + { + var x = new StringBuilder(); + if (type.Type.IsAbstractType) + { + x.Append($"{{ {FieldNames.LuaTypeNameKey}='{DataUtil.GetImplTypeName(type)}',"); + } + else + { + x.Append('{'); + } + + int index = 0; + foreach (var f in type.Fields) + { + var defField = (DefField)type.ImplType.HierarchyFields[index++]; + if (f == null || !defField.NeedExport()) + { + continue; + } + x.Append(defField.Name).Append('='); + x.Append(f.Apply(this)); + x.Append(','); + } + x.Append('}'); + return x.ToString(); + } + + + private void Append(List<DType> datas, StringBuilder x) + { + x.Append('{'); + foreach (var e in datas) + { + x.Append(e.Apply(this)); + x.Append(','); + } + x.Append('}'); + } + + public override string Accept(DArray type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DList type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DSet type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DMap type) + { + var x = new StringBuilder(); + x.Append('{'); + foreach (var e in type.Datas) + { + x.Append('['); + x.Append(e.Key.Apply(this)); + x.Append(']'); + x.Append('='); + x.Append(e.Value.Apply(this)); + x.Append(','); + } + x.Append('}'); + return x.ToString(); + } +} diff --git a/luban/src/Luban.Lua/Luban.Lua.csproj b/luban/src/Luban.Lua/Luban.Lua.csproj new file mode 100644 index 00000000..6a195a64 --- /dev/null +++ b/luban/src/Luban.Lua/Luban.Lua.csproj @@ -0,0 +1,29 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + </ItemGroup> + + <ItemGroup> + <Folder Include="CodeTarget\" /> + </ItemGroup> + + <ItemGroup> + <None Update="Templates\pb\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\lua-bin\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\lua-lua\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.Lua/TemplateExtensions/LuaBinTemplateExtension.cs b/luban/src/Luban.Lua/TemplateExtensions/LuaBinTemplateExtension.cs new file mode 100644 index 00000000..046d1dac --- /dev/null +++ b/luban/src/Luban.Lua/TemplateExtensions/LuaBinTemplateExtension.cs @@ -0,0 +1,15 @@ +using Luban.Defs; +using Luban.Lua.TypVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Lua.TemplateExtensions; + +public class LuaBinTemplateExtension : ScriptObject +{ + public static string Deserialize(string bufName, TType type) + { + return type.Apply(LuaUnderlyingDeserializeVisitor.Ins, bufName); + } +} diff --git a/luban/src/Luban.Lua/TemplateExtensions/LuaCommonTemplateExtension.cs b/luban/src/Luban.Lua/TemplateExtensions/LuaCommonTemplateExtension.cs new file mode 100644 index 00000000..e0b2a748 --- /dev/null +++ b/luban/src/Luban.Lua/TemplateExtensions/LuaCommonTemplateExtension.cs @@ -0,0 +1,15 @@ +using Luban.Defs; +using Luban.Lua.TypVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Lua.TemplateExtensions; + +public class LuaCommonTemplateExtension : ScriptObject +{ + public static string CommentType(TType type) + { + return type.Apply(LuaCommentTypeVisitor.Ins); + } +} diff --git a/luban/src/Luban.Lua/Templates/lua-bin/schema.sbn b/luban/src/Luban.Lua/Templates/lua-bin/schema.sbn new file mode 100644 index 00000000..5a492a7f --- /dev/null +++ b/luban/src/Luban.Lua/Templates/lua-bin/schema.sbn @@ -0,0 +1,158 @@ +local setmetatable = setmetatable +local pairs = pairs +local ipairs = ipairs +local tinsert = table.insert + +local function SimpleClass() + local class = {} + class.__index = class + class.New = function(...) + local ctor = class.ctor + local o = ctor and ctor(...) or {} + setmetatable(o, class) + return o + end + return class +end + + +local function get_map_size(m) + local n = 0 + for _ in pairs(m) do + n = n + 1 + end + return n +end + +local enums = +{ + {{~ for c in __enums ~}} + ---@class {{c.full_name}} {{-if c.comment != ''}} @{{escape_comment c.comment}}{{end}} + {{~ for item in c.items ~}} + ---@field public {{item.name}} integer {{-if item.comment != ''}} @{{escape_comment item.comment}}{{end}} + {{~end~}} + ['{{c.full_name}}'] = { {{ for item in c.items }} {{item.name}}={{item.int_value}}, {{end}} }; + {{~end~}} +} + +local tables = +{ +{{~for table in __tables ~}} + {{~if table.is_map_table ~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='map', index='{{table.index}}', value_type='{{table.value_ttype.def_bean.full_name}}' }, + {{~else if table.is_list_table ~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='list', index='{{table.index}}', value_type='{{table.value_ttype.def_bean.full_name}}' }, + {{~else~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='one', value_type='{{table.value_ttype.def_bean.full_name}}'}, + {{~end~}} +{{~end~}} +} + +local function InitTypes(methods) + local readBool = methods.readBool + local readByte = methods.readByte + local readShort = methods.readShort + local readFshort = methods.readFshort + local readInt = methods.readInt + local readFint = methods.readFint + local readLong = methods.readLong + local readFlong = methods.readFlong + local readFloat = methods.readFloat + local readDouble = methods.readDouble + local readSize = methods.readSize + + local readString = methods.readString + + local function readList(bs, keyFun) + local list = {} + local v + for i = 1, readSize(bs) do + tinsert(list, keyFun(bs)) + end + return list + end + + local readArray = readList + + local function readSet(bs, keyFun) + local set = {} + local v + for i = 1, readSize(bs) do + tinsert(set, keyFun(bs)) + end + return set + end + + local function readMap(bs, keyFun, valueFun) + local map = {} + for i = 1, readSize(bs) do + local k = keyFun(bs) + local v = valueFun(bs) + map[k] = v + end + return map + end + + local function readNullableBool(bs) + if readBool(bs) then + return readBool(bs) + end + end + + local beans = {} + {{~ for bean in __beans ~}} + do + ---@class {{bean.full_name}} {{if bean.parent_def_type}}:{{bean.parent}} {{end}} {{-if bean.comment != ''}} @{{escape_comment bean.comment}}{{end}} + {{~ for field in bean.export_fields~}} + ---@field public {{field.name}} {{comment_type field.ctype}} {{-if field.comment != ''}} @{{escape_comment field.comment}}{{end}} + {{~end~}} + local class = { + {{~ for field in bean.export_fields~}} + { name='{{field.name}}', type='{{comment_type field.ctype}}'}, + {{~end~}} + } + beans['{{bean.full_name}}'] = class + end + {{~end~}} + + local beans = {} +{{~ for bean in __beans ~}} + do + ---@class {{bean.full_name}} {{if bean.parent_def_type}}:{{bean.parent}} {{end}} + {{~ for field in bean.export_fields~}} + ---@field public {{field.name}} {{comment_type field.ctype}} + {{~end~}} + local class = SimpleClass() + class._id = {{bean.id}} + class._type_ = '{{bean.full_name}}' + local id2name = { {{for c in bean.hierarchy_not_abstract_children}} [{{c.id}}] = '{{c.full_name}}', {{end}} } +{{~if bean.is_abstract_type~}} + class._deserialize = function(bs) + local id = readInt(bs) + return beans[id2name[id]]._deserialize(bs) + end +{{~else~}} + class._deserialize = function(bs) + local o = { + {{~ for field in bean.hierarchy_export_fields ~}} + {{~if !(need_marshal_bool_prefix field.ctype)~}} + {{field.name}} = {{deserialize 'bs' field.ctype}}, + {{~else~}} + {{field.name}} = {{if !field.ctype.is_bool}}readBool(bs) and {{deserialize 'bs' field.ctype}} or nil {{-else-}} readNullableBool(bs) {{-end-}}, + {{~end~}} + {{~end~}} + } + setmetatable(o, class) + return o + end +{{~end~}} + beans[class._type_] = class + end +{{~end~}} + + + return { enums = enums, beans = beans, tables = tables } + end + +return { InitTypes = InitTypes } + diff --git a/luban/src/Luban.Lua/Templates/lua-lua/schema.sbn b/luban/src/Luban.Lua/Templates/lua-lua/schema.sbn new file mode 100644 index 00000000..3a75e1a3 --- /dev/null +++ b/luban/src/Luban.Lua/Templates/lua-lua/schema.sbn @@ -0,0 +1,42 @@ + +local enums = +{ + {{~ for c in __enums ~}} + ---@class {{c.full_name}} {{-if c.comment != ''}} @{{escape_comment c.comment}}{{end}} + {{~ for item in c.items ~}} + ---@field public {{item.name}} integer {{-if item.comment != ''}} @{{escape_comment item.comment}}{{end}} + {{~end~}} + ['{{c.full_name}}'] = { {{ for item in c.items }} {{item.name}}={{item.int_value}}, {{end}} }; + {{~end~}} +} + +local beans = {} +{{~ for bean in __beans ~}} + do + ---@class {{bean.full_name}} {{if bean.parent_def_type}}:{{bean.parent}} {{end}} {{-if bean.comment != ''}} @{{escape_comment bean.comment}}{{end}} + {{~ for field in bean.export_fields~}} + ---@field public {{field.name}} {{comment_type field.ctype}} {{-if field.comment != ''}} @{{escape_comment field.comment}}{{end}} + {{~end~}} + local class = { + {{~ for field in bean.export_fields~}} + { name='{{field.name}}', type='{{comment_type field.ctype}}'}, + {{~end~}} + } + beans['{{bean.full_name}}'] = class + end +{{~end~}} + +local tables = +{ +{{~for table in __tables ~}} + {{~if table.is_map_table ~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='map', index='{{table.index}}', value_type='{{table.value_ttype.def_bean.full_name}}' }, + {{~else if table.is_list_table ~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='list', index='{{table.index}}', value_type='{{table.value_ttype.def_bean.full_name}}' }, + {{~else~}} + { name='{{table.name}}', file='{{table.output_data_file}}', mode='one', value_type='{{table.value_ttype.def_bean.full_name}}'}, + {{~end~}} +{{~end~}} +} + +return { enums = enums, beans = beans, tables = tables } diff --git a/luban/src/Luban.Lua/TypVisitors/LuaCommentTypeVisitor.cs b/luban/src/Luban.Lua/TypVisitors/LuaCommentTypeVisitor.cs new file mode 100644 index 00000000..a3b2a90f --- /dev/null +++ b/luban/src/Luban.Lua/TypVisitors/LuaCommentTypeVisitor.cs @@ -0,0 +1,84 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Lua.TypVisitors; + +public class LuaCommentTypeVisitor : ITypeFuncVisitor<string> +{ + public static LuaCommentTypeVisitor Ins { get; } = new(); + + public string Accept(TBool type) + { + return "boolean"; + } + + public string Accept(TByte type) + { + return "integer"; + } + + public string Accept(TShort type) + { + return "integer"; + } + + public string Accept(TInt type) + { + return "integer"; + } + + public string Accept(TLong type) + { + return "integer"; + } + + public string Accept(TFloat type) + { + return "number"; + } + + public string Accept(TDouble type) + { + return "number"; + } + + public string Accept(TEnum type) + { + return "integer"; + } + + public string Accept(TString type) + { + return "string"; + } + + public string Accept(TBean type) + { + return type.DefBean.FullName; + } + + public string Accept(TArray type) + { + return $"{type.ElementType.Apply(this)}[]"; + } + + public string Accept(TList type) + { + return $"{type.ElementType.Apply(this)}[]"; + } + + public string Accept(TSet type) + { + return $"{type.ElementType.Apply(this)}[]"; + } + + public string Accept(TMap type) + { + return $"table<{type.KeyType.Apply(this)},{type.ValueType.Apply(this)}>"; + } + + public string Accept(TDateTime type) + { + return "integer"; + } +} diff --git a/luban/src/Luban.Lua/TypVisitors/LuaDeserializeMethodNameVisitor.cs b/luban/src/Luban.Lua/TypVisitors/LuaDeserializeMethodNameVisitor.cs new file mode 100644 index 00000000..6835ec35 --- /dev/null +++ b/luban/src/Luban.Lua/TypVisitors/LuaDeserializeMethodNameVisitor.cs @@ -0,0 +1,84 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Lua.TypVisitors; + +public class LuaDeserializeMethodNameVisitor : ITypeFuncVisitor<string> +{ + public static LuaDeserializeMethodNameVisitor Ins { get; } = new(); + + public string Accept(TBool type) + { + return "readBool"; + } + + public string Accept(TByte type) + { + return "readByte"; + } + + public string Accept(TShort type) + { + return "readShort"; + } + + public string Accept(TInt type) + { + return "readInt"; + } + + public string Accept(TLong type) + { + return "readLong"; + } + + public string Accept(TFloat type) + { + return "readFloat"; + } + + public string Accept(TDouble type) + { + return "readDouble"; + } + + public string Accept(TEnum type) + { + return "readInt"; + } + + public string Accept(TString type) + { + return "readString"; + } + + public string Accept(TBean type) + { + return $"beans['{type.DefBean.FullName}']._deserialize"; + } + + public string Accept(TArray type) + { + return "readList"; + } + + public string Accept(TList type) + { + return "readList"; + } + + public string Accept(TSet type) + { + return "readSet"; + } + + public string Accept(TMap type) + { + return "readMap"; + } + + public string Accept(TDateTime type) + { + return "readLong"; + } +} diff --git a/luban/src/Luban.Lua/TypVisitors/LuaUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Lua/TypVisitors/LuaUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..ed52faf5 --- /dev/null +++ b/luban/src/Luban.Lua/TypVisitors/LuaUnderlyingDeserializeVisitor.cs @@ -0,0 +1,34 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Lua.TypVisitors; + +public class LuaUnderlyingDeserializeVisitor : DecoratorFuncVisitor<string, string> +{ + public static LuaUnderlyingDeserializeVisitor Ins { get; } = new(); + + public override string DoAccept(TType type, string x) + { + return $"{type.Apply(LuaDeserializeMethodNameVisitor.Ins)}({x})"; + } + + public override string Accept(TArray type, string x) + { + return $"readArray({x}, {type.ElementType.Apply(LuaDeserializeMethodNameVisitor.Ins)})"; + } + + public override string Accept(TList type, string x) + { + return $"readList({x}, {type.ElementType.Apply(LuaDeserializeMethodNameVisitor.Ins)})"; + } + + public override string Accept(TSet type, string x) + { + return $"readSet({x}, {type.ElementType.Apply(LuaDeserializeMethodNameVisitor.Ins)})"; + } + + public override string Accept(TMap type, string x) + { + return $"readMap({x}, {type.KeyType.Apply(LuaDeserializeMethodNameVisitor.Ins)}, {type.ValueType.Apply(LuaDeserializeMethodNameVisitor.Ins)})"; + } +} diff --git a/luban/src/Luban.Lua/TypVisitors/LuaValueOrDefaultVisitor.cs b/luban/src/Luban.Lua/TypVisitors/LuaValueOrDefaultVisitor.cs new file mode 100644 index 00000000..f61139f3 --- /dev/null +++ b/luban/src/Luban.Lua/TypVisitors/LuaValueOrDefaultVisitor.cs @@ -0,0 +1,84 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Lua.TypVisitors; + +public class LuaValueOrDefaultVisitor : ITypeFuncVisitor<string, string> +{ + public static LuaValueOrDefaultVisitor Ins { get; } = new(); + + public string Accept(TBool type, string x) + { + return $"{x} == true"; + } + + public string Accept(TByte type, string x) + { + return $"{x} or 0"; + } + + public string Accept(TShort type, string x) + { + return $"{x} or 0"; + } + + public string Accept(TInt type, string x) + { + return $"{x} or 0"; + } + + public string Accept(TLong type, string x) + { + return $"{x} or 0"; + } + + public string Accept(TFloat type, string x) + { + return $"{x} or 0"; + } + + public string Accept(TDouble type, string x) + { + return $"{x} or 0"; + } + + public string Accept(TEnum type, string x) + { + return $"{x} or 0"; + } + + public string Accept(TString type, string x) + { + return $"{x} or \"\""; + } + + public string Accept(TBean type, string x) + { + return $"{x} or {{}}"; + } + + public string Accept(TArray type, string x) + { + return $"{x} or {{}}"; + } + + public string Accept(TList type, string x) + { + return $"{x} or {{}}"; + } + + public string Accept(TSet type, string x) + { + return $"{x} or {{}}"; + } + + public string Accept(TMap type, string x) + { + return $"{x} or {{}}"; + } + + public string Accept(TDateTime type, string x) + { + return $"{x} or 0"; + } +} diff --git a/luban/src/Luban.MsgPack/AssemblyInfo.cs b/luban/src/Luban.MsgPack/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.MsgPack/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.MsgPack/Luban.MsgPack.csproj b/luban/src/Luban.MsgPack/Luban.MsgPack.csproj new file mode 100644 index 00000000..a2159422 --- /dev/null +++ b/luban/src/Luban.MsgPack/Luban.MsgPack.csproj @@ -0,0 +1,17 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="MessagePack" Version="2.5.192" /> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.MsgPack/MsgPackDataTarget.cs b/luban/src/Luban.MsgPack/MsgPackDataTarget.cs new file mode 100644 index 00000000..c599001e --- /dev/null +++ b/luban/src/Luban.MsgPack/MsgPackDataTarget.cs @@ -0,0 +1,32 @@ +using System.Text; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Utils; +using MessagePack; + +namespace Luban.MsgPack; + +[DataTarget("msgpack")] +public class MsgPackDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "bytes"; + + + public void WriteList(DefTable table, List<Record> records, ref MessagePackWriter writer) + { + writer.WriteArrayHeader(records.Count); + foreach (var record in records) + { + MsgPackDataVisitor.Ins.Accept(record.Data, ref writer); + } + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var ms = new System.Buffers.ArrayBufferWriter<byte>(); + var writer = new MessagePackWriter(ms); + WriteList(table, records, ref writer); + writer.Flush(); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", ms.WrittenSpan.ToArray()); + } +} diff --git a/luban/src/Luban.MsgPack/MsgPackDataVisitor.cs b/luban/src/Luban.MsgPack/MsgPackDataVisitor.cs new file mode 100644 index 00000000..fae4b20e --- /dev/null +++ b/luban/src/Luban.MsgPack/MsgPackDataVisitor.cs @@ -0,0 +1,195 @@ +using Luban.DataLoader; +using Luban.Datas; +using Luban.Defs; +using Luban.Utils; +using MessagePack; + +namespace Luban.MsgPack; + +class MsgPackDataVisitor +{ + public static MsgPackDataVisitor Ins { get; } = new(); + + public void Apply(DType type, ref MessagePackWriter writer) + { + switch (type) + { + case DInt x: + Accept(x, ref writer); + break; + case DString x: + Accept(x, ref writer); + break; + case DFloat x: + Accept(x, ref writer); + break; + case DBean x: + Accept(x, ref writer); + break; + case DBool x: + Accept(x, ref writer); + break; + case DEnum x: + Accept(x, ref writer); + break; + case DList x: + Accept(x, ref writer); + break; + case DArray x: + Accept(x, ref writer); + break; + case DLong x: + Accept(x, ref writer); + break; + case DDateTime x: + Accept(x, ref writer); + break; + case DMap x: + Accept(x, ref writer); + break; + case DByte x: + Accept(x, ref writer); + break; + case DDouble x: + Accept(x, ref writer); + break; + case DSet x: + Accept(x, ref writer); + break; + case DShort x: + Accept(x, ref writer); + break; + default: + throw new NotSupportedException($"DType:{type.GetType().FullName} not support"); + } + } + + public void Accept(DBool type, ref MessagePackWriter writer) + { + writer.Write(type.Value); + } + + public void Accept(DByte type, ref MessagePackWriter writer) + { + writer.Write(type.Value); + } + + public void Accept(DShort type, ref MessagePackWriter writer) + { + writer.Write(type.Value); + } + + public void Accept(DInt type, ref MessagePackWriter writer) + { + writer.Write(type.Value); + } + + public void Accept(DLong type, ref MessagePackWriter writer) + { + writer.Write(type.Value); + } + + public void Accept(DFloat type, ref MessagePackWriter writer) + { + writer.Write(type.Value); + } + + public void Accept(DDouble type, ref MessagePackWriter writer) + { + writer.Write(type.Value); + } + + public void Accept(DEnum type, ref MessagePackWriter writer) + { + writer.Write(type.Value); + } + + public void Accept(DString type, ref MessagePackWriter writer) + { + writer.Write(type.Value); + } + + public void Accept(DDateTime type, ref MessagePackWriter writer) + { + writer.Write(type.UnixTimeOfCurrentContext()); + } + + public void Accept(DBean type, ref MessagePackWriter writer) + { + var implType = type.ImplType; + var hierarchyFields = implType.HierarchyFields; + int exportCount = 0; + { + if (type.Type.IsAbstractType) + { + exportCount++; + } + int idx = 0; + foreach (var field in type.Fields) + { + var defField = (DefField)hierarchyFields[idx++]; + if (field == null || !defField.NeedExport()) + { + continue; + } + ++exportCount; + } + } + + writer.WriteMapHeader(exportCount); + if (type.Type.IsAbstractType) + { + writer.Write(FieldNames.JsonTypeNameKey); + writer.Write(DataUtil.GetImplTypeName(type)); + } + + int index = 0; + foreach (var field in type.Fields) + { + var defField = (DefField)hierarchyFields[index++]; + if (field == null || !defField.NeedExport()) + { + continue; + } + writer.Write(defField.Name); + Apply(field, ref writer); + } + } + + public void Accept(DArray type, ref MessagePackWriter writer) + { + writer.WriteArrayHeader(type.Datas.Count); + foreach (var d in type.Datas) + { + Apply(d, ref writer); + } + } + + public void Accept(DList type, ref MessagePackWriter writer) + { + writer.WriteArrayHeader(type.Datas.Count); + foreach (var d in type.Datas) + { + Apply(d, ref writer); + } + } + + public void Accept(DSet type, ref MessagePackWriter writer) + { + writer.WriteArrayHeader(type.Datas.Count); + foreach (var d in type.Datas) + { + Apply(d, ref writer); + } + } + + public void Accept(DMap type, ref MessagePackWriter writer) + { + writer.WriteMapHeader(type.Datas.Count); + foreach (var d in type.Datas) + { + Apply(d.Key, ref writer); + Apply(d.Value, ref writer); + } + } +} diff --git a/luban/src/Luban.PHP/AssemblyInfo.cs b/luban/src/Luban.PHP/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.PHP/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.PHP/CodeTarget/PHPCodeTargetBase.cs b/luban/src/Luban.PHP/CodeTarget/PHPCodeTargetBase.cs new file mode 100644 index 00000000..8a5c8cc4 --- /dev/null +++ b/luban/src/Luban.PHP/CodeTarget/PHPCodeTargetBase.cs @@ -0,0 +1,35 @@ +using Luban.CodeFormat; +using Luban.CodeFormat.CodeStyles; +using Luban.CodeTarget; +using Luban.PHP.TemplateExtensions; +using Scriban; + +namespace Luban.PHP.CodeTarget; + +public abstract class PHPCodeTargetBase : AllInOneTemplateCodeTargetBase +{ + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_PHP; + + protected override string FileSuffixName => "php"; + + private readonly static ICodeStyle s_codeStyle = new ConfigurableCodeStyle("pascal", "pascal", "camel", "camel", "camel", "none"); + + protected override ICodeStyle DefaultCodeStyle => s_codeStyle; + + protected override string DefaultOutputFileName => "schema.php"; + + private static readonly HashSet<string> s_preservedKeyWords = new() + { + // PHP preserved key words + "__halt_compiler","abstract","and","array","as","break","callable","case","catch","class","clone","const","continue","declare", + "default","die","do","echo","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","eval", + "exit","extends","final","finally","for","foreach","function","global","goto","if","implements","include","include_once","instanceof","insteadof","interface" + }; + + protected override IReadOnlySet<string> PreservedKeyWords => s_preservedKeyWords; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new PHPCommonTemplateExtension()); + } +} diff --git a/luban/src/Luban.PHP/CodeTarget/PHPJsonCodeTarget.cs b/luban/src/Luban.PHP/CodeTarget/PHPJsonCodeTarget.cs new file mode 100644 index 00000000..8a987ed1 --- /dev/null +++ b/luban/src/Luban.PHP/CodeTarget/PHPJsonCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.PHP.TemplateExtensions; +using Scriban; + +namespace Luban.PHP.CodeTarget; + +[CodeTarget("php-json")] +public class PHPJsonCodeTarget : PHPCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new PHPJsonTemplateExtension()); + } +} diff --git a/luban/src/Luban.PHP/Luban.PHP.csproj b/luban/src/Luban.PHP/Luban.PHP.csproj new file mode 100644 index 00000000..5671bdc3 --- /dev/null +++ b/luban/src/Luban.PHP/Luban.PHP.csproj @@ -0,0 +1,60 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + <ProjectReference Include="..\Luban.DataTarget.Builtin\Luban.DataTarget.Builtin.csproj" /> + </ItemGroup> + + <ItemGroup> + <None Update="Templates\cs-bin\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-bin\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-bin\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-dotnet-json\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-dotnet-json\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-dotnet-json\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\common\cs\enum.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\common\php\enum.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\ts-json\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\ts-json\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\ts-json\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\ts-json\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\php-json\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + + <ItemGroup> + <Folder Include="TypeVisitors\" /> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.PHP/TemplateExtensions/PHPCommonTemplateExtension.cs b/luban/src/Luban.PHP/TemplateExtensions/PHPCommonTemplateExtension.cs new file mode 100644 index 00000000..243a13dc --- /dev/null +++ b/luban/src/Luban.PHP/TemplateExtensions/PHPCommonTemplateExtension.cs @@ -0,0 +1,38 @@ +using Luban.CodeFormat; +using Luban.Defs; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.PHP.TemplateExtensions; + +public class PHPCommonTemplateExtension : ScriptObject +{ + public static string FullName(DefTypeBase type) + { + return TypeUtil.MakePyFullName(type.Namespace, type.Name); + } + + public static string ClassModifier(DefBean bean) + { + return bean.IsAbstractType ? "abstract" : ""; + } + + public static string NamespaceWithGraceBegin(string ns) + { + if (string.IsNullOrEmpty(ns)) + { + return ""; + } + return string.Join("", ns.Split('.').Select(n => $"namespace {n} {{")); + } + + public static string NamespaceWithGraceEnd(string ns) + { + if (string.IsNullOrEmpty(ns)) + { + return ""; + } + return string.Join("", ns.Split('.').Select(n => $"}}")); + } +} diff --git a/luban/src/Luban.PHP/TemplateExtensions/PHPJsonTemplateExtension.cs b/luban/src/Luban.PHP/TemplateExtensions/PHPJsonTemplateExtension.cs new file mode 100644 index 00000000..e465a359 --- /dev/null +++ b/luban/src/Luban.PHP/TemplateExtensions/PHPJsonTemplateExtension.cs @@ -0,0 +1,13 @@ +using Luban.PHP.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.PHP.TemplateExtensions; + +public class PHPJsonTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string jsonVar, TType type) + { + return type.Apply(JsonDeserializeVisitor.Ins, jsonVar, fieldName, 0); + } +} diff --git a/luban/src/Luban.PHP/Templates/common/php/enum.sbn b/luban/src/Luban.PHP/Templates/common/php/enum.sbn new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/luban/src/Luban.PHP/Templates/common/php/enum.sbn @@ -0,0 +1,2 @@ + + diff --git a/luban/src/Luban.PHP/Templates/php-json/schema.sbn b/luban/src/Luban.PHP/Templates/php-json/schema.sbn new file mode 100644 index 00000000..478c850f --- /dev/null +++ b/luban/src/Luban.PHP/Templates/php-json/schema.sbn @@ -0,0 +1,155 @@ +{{~namespace_with_grace_begin __namespace~}} + +{{~for enum in __enums~}} +{{~if enum.comment != '' ~}} +/** + * {{enum.comment | html.escape}} + */ +{{~end~}} +class {{full_name enum}} { + {{~for item in enum.items ~}} +{{~if item.comment != '' ~}} + /** + * {{escape_comment item.comment}} + */ +{{~end~}} + public const {{item.name}} = {{item.value}}; + {{~end~}} +} + +{{~end~}} + + +{{~for bean in __beans~}} +{{name = (full_name bean)}} +{{~if bean.comment != '' ~}} +/** + * {{escape_comment bean.comment}} + */ +{{~end~}} +{{class_modifier bean}} class {{name}}{{if bean.parent_def_type}} extends {{full_name bean.parent_def_type}}{{end}} { +{{~if bean.is_abstract_type~}} + public static function constructFrom($_json_) { + $type = $_json_['$type']; + switch ($type) { + {{~ for child in bean.hierarchy_not_abstract_children~}} + case '{{impl_data_type child bean}}': return new {{full_name child}}($_json_); + {{~end~}} + default: throw new \Exception("unknown type:$type"); + } + } +{{~end~}} + + public function __construct($_json_) { + {{~if bean.parent_def_type~}} + parent::__construct($_json_); + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{~if !field.ctype.is_nullable~}} + if (!array_key_exists('{{field.name}}', $_json_)) { throw new \Exception("field:'{{field.name}}' missing"); } + {{~end~}} + {{deserialize ('$this->' + format_field_name __code_style field.name) ( '$_json_[\'' + field.name + '\']') field.ctype}}; + {{~end~}} + } + + {{~ for field in bean.export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public ${{format_field_name __code_style field.name}}; + {{~end~}} +} + + +{{~end~}} + +{{~for table in __tables + key_type = table.key_ttype + value_type = table.value_ttype + name = (full_name table) +~}} + +{{~if table.comment != '' ~}} +/** + * {{escape_comment table.comment}} + */ +{{~end~}} +class {{name}} { + {{~if table.is_map_table ~}} + private $_dataMap; + private $_dataList; + public function __construct($_json_) { + $this->_dataMap = []; + $this->_dataList = []; + foreach ($_json_ as $_json2_) { + {{deserialize '$_v' '$_json2_' value_type}}; + array_push($this->_dataList, $_v); + $this->_dataMap[$_v->{{format_field_name __code_style table.index_field.name}}] = $_v; + } + } + + public function getDataMap() { return $this->_dataMap; } + public function getDataList() { return $this->_dataList; } + + public function get($key) { return $this->_dataMap[$key]; } + + {{~else if table.is_list_table ~}} + private $_dataList; + + public function __construct($_json_) { + $this->_dataList = []; + foreach ($_json_ as $_json2_) { + {{deserialize '$_v' '$_json2_' value_type}}; + array_push($this->_dataList, $_v); + } + } + + public function getDataList() { return $this->_dataList; } + + public function get($index) { return $this->_dataList[$index]; } + + {{~else~}} + + private $_data; + public function __construct($_json_) { + if (count($_json_) != 1) throw new \Exception('table:{{table.name}} mode=one, but size != 1'); + {{deserialize '$this->_data' '$_json_[0]' value_type}}; + } + + public function getData() { return $this->_data; } + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + public function get{{format_field_name __code_style field.name}}() { return $this->_data->{{format_field_name __code_style field.name}}; } + {{~end~}} + + {{end}} +} + +{{~end~}} + +class {{__name}} { + {{~ for table in __tables ~}} + private $_{{table.name}}; +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + public function get{{table.name}}() { return $this->_{{table.name}}; } + {{~end~}} + + public function __construct($loader) { + {{~for table in __tables ~}} + $this->_{{table.name}} = new {{full_name table}}($loader('{{table.output_data_file}}')); + {{~end~}} + } +} + +{{~namespace_with_grace_end __namespace~}} diff --git a/luban/src/Luban.PHP/TypeVisitors/JsonDeserializeVisitor.cs b/luban/src/Luban.PHP/TypeVisitors/JsonDeserializeVisitor.cs new file mode 100644 index 00000000..c3fd0b0e --- /dev/null +++ b/luban/src/Luban.PHP/TypeVisitors/JsonDeserializeVisitor.cs @@ -0,0 +1,26 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.PHP.TypeVisitors; + +public class JsonDeserializeVisitor : DecoratorFuncVisitor<string, string, int, string> +{ + public static JsonDeserializeVisitor Ins { get; } = new(); + + public override string DoAccept(TType type, string jsonFieldName, string fieldName, int depth) + { + if (type.IsNullable) + { + return $"if({jsonFieldName} != null) {{ {type.Apply(JsonUnderlyingDeserializeVisitor.Ins, jsonFieldName, fieldName, depth)}; }} else {{ {fieldName} = null; }}"; + } + else + { + return type.Apply(JsonUnderlyingDeserializeVisitor.Ins, jsonFieldName, fieldName, depth); + } + } + + //public override string Accept(TBean type, string bytebufName, string fieldName) + //{ + // return type.Apply(TypescriptJsonUnderingConstructorVisitor.Ins, bytebufName, fieldName); + //} +} diff --git a/luban/src/Luban.PHP/TypeVisitors/JsonUnderlyingDeserializeVisitor.cs b/luban/src/Luban.PHP/TypeVisitors/JsonUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..9eb7fe0b --- /dev/null +++ b/luban/src/Luban.PHP/TypeVisitors/JsonUnderlyingDeserializeVisitor.cs @@ -0,0 +1,103 @@ +using Luban.DataExporter.Builtin.Json; +using Luban.Datas; +using Luban.PHP.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.PHP.TypeVisitors; + +public class JsonUnderlyingDeserializeVisitor : ITypeFuncVisitor<string, string, int, string> +{ + public static JsonUnderlyingDeserializeVisitor Ins { get; } = new JsonUnderlyingDeserializeVisitor(); + + public string Accept(TBool type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TByte type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TShort type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TInt type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TLong type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TFloat type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TDouble type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TEnum type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TString type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TDateTime type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TBean type, string jsonVarName, string fieldName, int depth) + { + string fullName = PHPCommonTemplateExtension.FullName(type.DefBean); + if (type.DefBean.IsAbstractType) + { + return $"{fieldName} = {fullName}::constructFrom({jsonVarName})"; + } + else + { + return $"{fieldName} = new {fullName}({jsonVarName})"; + } + } + + public string Accept(TArray type, string jsonVarName, string fieldName, int depth) + { + return $"{{ {fieldName} = []; foreach ({jsonVarName} as $_ele{depth}) {{ {type.ElementType.Apply(this, $"$_ele{depth}", $"$_e{depth}", depth + 1)}; array_push({fieldName}, $_e{depth});}} }}"; + } + + public string Accept(TList type, string jsonVarName, string fieldName, int depth) + { + return $"{{ {fieldName} = []; foreach ({jsonVarName} as $_ele{depth}) {{ {type.ElementType.Apply(this, $"$_ele{depth}", $"$_e{depth}", depth + 1)}; array_push({fieldName}, $_e{depth});}} }}"; + } + + public string Accept(TSet type, string jsonVarName, string fieldName, int depth) + { + if (type.ElementType.Apply(SimpleJsonTypeVisitor.Ins)) + { + return $"{fieldName} = {jsonVarName}"; + } + return $"{{ {fieldName} = []; foreach ({jsonVarName} as $_ele{depth}) {{ {type.ElementType.Apply(this, $"$_ele{depth}", $"$_e{depth}", depth + 1)}; array_push({fieldName}, $_e{depth});}} }}"; + } + + public string Accept(TMap type, string jsonVarName, string fieldName, int depth) + { + if (type.KeyType.Apply(SimpleJsonTypeVisitor.Ins) && type.ValueType.Apply(SimpleJsonTypeVisitor.Ins)) + { + return $"{fieldName} = {jsonVarName}"; + } + return $"{{{fieldName} = []; foreach ({jsonVarName} as $e{depth}) {{ {type.KeyType.Apply(this, $"$e{depth}[0]", $"$_k{depth}", depth + 1)}; {type.ValueType.Apply(this, $"$e{depth}[1]", $"$_v{depth}", depth + 1)}; {fieldName}[$_k{depth}] = $_v{depth}; }} }}"; + } +} diff --git a/luban/src/Luban.Protobuf/AssemblyInfo.cs b/luban/src/Luban.Protobuf/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Protobuf/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Protobuf/CodeTarget/CSharpProtobuf3CodeTarget.cs b/luban/src/Luban.Protobuf/CodeTarget/CSharpProtobuf3CodeTarget.cs new file mode 100644 index 00000000..7469a6b6 --- /dev/null +++ b/luban/src/Luban.Protobuf/CodeTarget/CSharpProtobuf3CodeTarget.cs @@ -0,0 +1,44 @@ +using Luban.CodeTarget; +using Luban.Protobuf.TemplateExtensions; +using Luban.Utils; +using Scriban; + +namespace Luban.Protobuf.CodeTarget; + +[CodeTarget("cs-protobuf3")] +public class CSharpProtobuf3CodeTarget : ProtobufSchemaTargetBase +{ + protected override string CommonTemplateSearchPath => "pb"; + protected override string TemplateDir => "cs_pb"; + + protected override string Syntax => "proto3"; + + protected override string FileSuffixName => "cs"; + + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_C_LIKE; + + public override void Handle(GenerationContext ctx, OutputFileManifest manifest) + { + base.Handle(ctx, manifest); + + var tasks = new List<Task<OutputFile>>(); + tasks.Add(Task.Run(() => + { + var writer = new CodeWriter(); + GenerateTables(ctx, ctx.ExportTables, writer); + return CreateOutputFile($"{GetFileNameWithoutExtByTypeName(ctx.Target.Manager)}.{FileSuffixName}", writer.ToResult(FileHeader)); + })); + Task.WaitAll(tasks.ToArray()); + foreach (var task in tasks) + { + manifest.AddFile(task.Result); + } + } + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new Protobuf3TemplateExtension()); + ctx.PushGlobal(new CsharpProtobuf3TemplateExtension()); + } + +} diff --git a/luban/src/Luban.Protobuf/CodeTarget/Protobuf2SchemaTarget.cs b/luban/src/Luban.Protobuf/CodeTarget/Protobuf2SchemaTarget.cs new file mode 100644 index 00000000..c6afbb1a --- /dev/null +++ b/luban/src/Luban.Protobuf/CodeTarget/Protobuf2SchemaTarget.cs @@ -0,0 +1,16 @@ +using Luban.CodeTarget; +using Luban.Protobuf.TemplateExtensions; +using Scriban; + +namespace Luban.Protobuf.CodeTarget; + +[CodeTarget("protobuf2")] +public class Protobuf2SchemaTarget : ProtobufSchemaTargetBase +{ + protected override string Syntax => "proto2"; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new Protobuf2TemplateExtension()); + } +} diff --git a/luban/src/Luban.Protobuf/CodeTarget/Protobuf3SchemaTarget.cs b/luban/src/Luban.Protobuf/CodeTarget/Protobuf3SchemaTarget.cs new file mode 100644 index 00000000..0c4e1bf8 --- /dev/null +++ b/luban/src/Luban.Protobuf/CodeTarget/Protobuf3SchemaTarget.cs @@ -0,0 +1,16 @@ +using Luban.CodeTarget; +using Luban.Protobuf.TemplateExtensions; +using Scriban; + +namespace Luban.Protobuf.CodeTarget; + +[CodeTarget("protobuf3")] +public class Protobuf3SchemaTarget : ProtobufSchemaTargetBase +{ + protected override string Syntax => "proto3"; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new Protobuf3TemplateExtension()); + } +} diff --git a/luban/src/Luban.Protobuf/CodeTarget/ProtobufSchemaTargetBase.cs b/luban/src/Luban.Protobuf/CodeTarget/ProtobufSchemaTargetBase.cs new file mode 100644 index 00000000..7d818bea --- /dev/null +++ b/luban/src/Luban.Protobuf/CodeTarget/ProtobufSchemaTargetBase.cs @@ -0,0 +1,56 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.Protobuf.TemplateExtensions; +using Luban.Tmpl; +using Scriban; +using Scriban.Runtime; + +namespace Luban.Protobuf.CodeTarget; + +public abstract class ProtobufSchemaTargetBase : AllInOneTemplateCodeTargetBase +{ + public override string FileHeader => ""; + + protected override string FileSuffixName => "pb"; + + protected abstract string Syntax { get; } + + protected override string TemplateDir => "pb"; + + protected override ICodeStyle CodeStyle => CodeFormatManager.Ins.NoneCodeStyle; + + protected override string DefaultOutputFileName => "schema.proto"; + + private static readonly HashSet<string> s_preservedKeyWords = new() + { + // protobuf schema preserved key words + "package", "optional", "import", "message", "enum", "service", "rpc", "stream", "returns", "oneof", "map", "reserved", + "to", "true", "false", "syntax", "repeated", "required", "extend", "extensions", "group", "default", "packed", "option", + "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64", "float", "double", "bool", "string", "bytes" + }; + + protected override IReadOnlySet<string> PreservedKeyWords => s_preservedKeyWords; + + protected override string GenerateSchema(GenerationContext ctx) + { + var writer = new CodeWriter(); + var template = GetTemplate($"schema"); + var tplCtx = CreateTemplateContext(template); + tplCtx.PushGlobal(new ProtobufCommonTemplateExtension()); + OnCreateTemplateContext(tplCtx); + var extraEnvs = new ScriptObject + { + { "__ctx", ctx}, + { "__name", ctx.Target.Manager}, + { "__namespace", ctx.Target.TopModule}, + { "__tables", ctx.ExportTables}, + { "__beans", ctx.ExportBeans}, + { "__enums", ctx.ExportEnums}, + { "__code_style", CodeStyle}, + { "__syntax", Syntax}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + return writer.ToResult(FileHeader); + } +} diff --git a/luban/src/Luban.Protobuf/DataTarget/Protobuf2BinDataTarget.cs b/luban/src/Luban.Protobuf/DataTarget/Protobuf2BinDataTarget.cs new file mode 100644 index 00000000..c010ab09 --- /dev/null +++ b/luban/src/Luban.Protobuf/DataTarget/Protobuf2BinDataTarget.cs @@ -0,0 +1,32 @@ +using Google.Protobuf; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Protobuf.DataVisitors; +using Luban.Utils; + +namespace Luban.Protobuf.DataTarget; + +[DataTarget("protobuf2-bin")] +public class Protobuf2BinDataTarget : DataTargetBase +{ + protected override string DefaultOutputFileExt => "bytes"; + + public void WriteList(DefTable table, List<Record> datas, MemoryStream x) + { + var cos = new CodedOutputStream(x); + foreach (var d in datas) + { + cos.WriteTag(1, WireFormat.WireType.LengthDelimited); + d.Data.Apply(ProtobufBinDataVisitor.Ins, cos); + } + cos.Flush(); + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var ss = new MemoryStream(); + WriteList(table, records, ss); + ss.Flush(); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", DataUtil.StreamToBytes(ss)); + } +} diff --git a/luban/src/Luban.Protobuf/DataTarget/Protobuf2JsonDataTarget.cs b/luban/src/Luban.Protobuf/DataTarget/Protobuf2JsonDataTarget.cs new file mode 100644 index 00000000..de2ead23 --- /dev/null +++ b/luban/src/Luban.Protobuf/DataTarget/Protobuf2JsonDataTarget.cs @@ -0,0 +1,45 @@ +using System.Text; +using System.Text.Json; +using Luban.DataExporter.Builtin.Json; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Protobuf.DataVisitors; +using Luban.Utils; + +namespace Luban.Protobuf.DataTarget; + +[DataTarget("protobuf2-json")] +public class Protobuf2JsonDataTarget : JsonDataTarget +{ + protected override string DefaultOutputFileExt => "json"; + + protected override JsonDataVisitor ImplJsonDataVisitor => Protobuf2JsonDataVisitor.Ins; + + public void WriteAsTable(List<Record> datas, Utf8JsonWriter x) + { + x.WriteStartObject(); + // 如果修改了这个名字,请同时修改table.tpl + x.WritePropertyName("data_list"); + x.WriteStartArray(); + foreach (var d in datas) + { + d.Data.Apply(Protobuf2JsonDataVisitor.Ins, x); + } + x.WriteEndArray(); + x.WriteEndObject(); + } + + public override OutputFile ExportTable(DefTable table, List<Record> records) + { + var ss = new MemoryStream(); + var jsonWriter = new Utf8JsonWriter(ss, new JsonWriterOptions() + { + Indented = !UseCompactJson, + SkipValidation = false, + Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + }); + WriteAsTable(records, jsonWriter); + jsonWriter.Flush(); + return CreateOutputFile($"{table.OutputDataFile}.{OutputFileExt}", Encoding.UTF8.GetString(DataUtil.StreamToBytes(ss))); + } +} diff --git a/luban/src/Luban.Protobuf/DataTarget/Protobuf3BinDataTarget.cs b/luban/src/Luban.Protobuf/DataTarget/Protobuf3BinDataTarget.cs new file mode 100644 index 00000000..2d259493 --- /dev/null +++ b/luban/src/Luban.Protobuf/DataTarget/Protobuf3BinDataTarget.cs @@ -0,0 +1,13 @@ +using Google.Protobuf; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Protobuf.DataVisitors; +using Luban.Utils; + +namespace Luban.Protobuf.DataTarget; + +[DataTarget("protobuf3-bin")] +public class Protobuf3BinDataTarget : Protobuf2BinDataTarget +{ + +} diff --git a/luban/src/Luban.Protobuf/DataTarget/Protobuf3JsonDataTarget.cs b/luban/src/Luban.Protobuf/DataTarget/Protobuf3JsonDataTarget.cs new file mode 100644 index 00000000..8122d93c --- /dev/null +++ b/luban/src/Luban.Protobuf/DataTarget/Protobuf3JsonDataTarget.cs @@ -0,0 +1,14 @@ +using System.Text.Json; +using Luban.DataExporter.Builtin.Json; +using Luban.DataTarget; +using Luban.Defs; +using Luban.Protobuf.DataVisitors; +using Luban.Utils; + +namespace Luban.Protobuf.DataTarget; + +[DataTarget("protobuf3-json")] +public class Protobuf3JsonDataTarget : Protobuf2JsonDataTarget +{ + protected override JsonDataVisitor ImplJsonDataVisitor => Protobuf3JsonDataVisitor.Ins; +} diff --git a/luban/src/Luban.Protobuf/DataVisitors/Protobuf2JsonDataVisitor.cs b/luban/src/Luban.Protobuf/DataVisitors/Protobuf2JsonDataVisitor.cs new file mode 100644 index 00000000..462504bd --- /dev/null +++ b/luban/src/Luban.Protobuf/DataVisitors/Protobuf2JsonDataVisitor.cs @@ -0,0 +1,61 @@ +using System.Text.Json; +using Luban.DataExporter.Builtin.Json; +using Luban.Datas; +using Luban.Defs; +using Luban.Protobuf.TypeVisitors; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Protobuf.DataVisitors; + +public class Protobuf2JsonDataVisitor : JsonDataVisitor +{ + public static new Protobuf2JsonDataVisitor Ins { get; } = new(); + + public override void Accept(DBean type, Utf8JsonWriter x) + { + x.WriteStartObject(); + + if (type.Type.IsAbstractType) + { + x.WritePropertyName(type.ImplType.Name); + x.WriteStartObject(); + } + + var defFields = type.ImplType.HierarchyFields; + int index = 0; + foreach (var d in type.Fields) + { + var defField = (DefField)defFields[index++]; + + // 特殊处理 bean 多态类型 + // 另外,不生成 xxx:null 这样 + if (d == null || !defField.NeedExport()) + { + //x.WriteNullValue(); + } + else + { + x.WritePropertyName(defField.Name); + d.Apply(this, x); + } + } + if (type.Type.IsAbstractType) + { + x.WriteEndObject(); + } + x.WriteEndObject(); + } + + + public override void Accept(DMap type, Utf8JsonWriter x) + { + x.WriteStartObject(); + foreach (var d in type.Datas) + { + x.WritePropertyName(d.Key.Apply(ToJsonLiteralVisitor.Ins)); + d.Value.Apply(this, x); + } + x.WriteEndObject(); + } +} diff --git a/luban/src/Luban.Protobuf/DataVisitors/Protobuf3JsonDataVisitor.cs b/luban/src/Luban.Protobuf/DataVisitors/Protobuf3JsonDataVisitor.cs new file mode 100644 index 00000000..6c400117 --- /dev/null +++ b/luban/src/Luban.Protobuf/DataVisitors/Protobuf3JsonDataVisitor.cs @@ -0,0 +1,14 @@ +using System.Text.Json; +using Luban.DataExporter.Builtin.Json; +using Luban.Datas; +using Luban.Defs; +using Luban.Protobuf.TypeVisitors; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Protobuf.DataVisitors; + +public class Protobuf3JsonDataVisitor : Protobuf2JsonDataVisitor +{ + public static new Protobuf3JsonDataVisitor Ins { get; } = new(); +} diff --git a/luban/src/Luban.Protobuf/DataVisitors/ProtobufBinDataVisitor.cs b/luban/src/Luban.Protobuf/DataVisitors/ProtobufBinDataVisitor.cs new file mode 100644 index 00000000..b24e1829 --- /dev/null +++ b/luban/src/Luban.Protobuf/DataVisitors/ProtobufBinDataVisitor.cs @@ -0,0 +1,234 @@ +using Google.Protobuf; +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Protobuf.TypeVisitors; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Protobuf.DataVisitors; + +public class ProtobufBinDataVisitor : IDataActionVisitor<CodedOutputStream> +{ + public static ProtobufBinDataVisitor Ins { get; } = new(); + + public void Accept(DBool type, CodedOutputStream x) + { + x.WriteBool(type.Value); + } + + public void Accept(DByte type, CodedOutputStream x) + { + x.WriteInt32(type.Value); + } + + public void Accept(DShort type, CodedOutputStream x) + { + x.WriteInt32(type.Value); + } + + public void Accept(DInt type, CodedOutputStream x) + { + x.WriteInt32(type.Value); + } + + public void Accept(DLong type, CodedOutputStream x) + { + x.WriteInt64(type.Value); + } + + public void Accept(DFloat type, CodedOutputStream x) + { + x.WriteFloat(type.Value); + } + + public void Accept(DDouble type, CodedOutputStream x) + { + x.WriteDouble(type.Value); + } + + public void Accept(DEnum type, CodedOutputStream x) + { + x.WriteInt32(type.Value); + } + + public void Accept(DDateTime type, CodedOutputStream x) + { + x.WriteInt64(type.UnixTimeOfCurrentContext()); + } + + public void Accept(DString type, CodedOutputStream x) + { + x.WriteString(type.Value); + } + + private MemoryStream AllocMemoryStream() + { + // TODO 优化 + return new MemoryStream(); + } + + private void FreeMemoryStream(MemoryStream cos) + { + cos.Seek(0, SeekOrigin.Begin); + } + + private void WriteRawMessageWithoutLength(DBean type, CodedOutputStream temp) + { + //var ms = AllocMemoryStream(); + //var temp = new CodedOutputStream(ms); + //if (bean.IsAbstractType) + //{ + // temp.WriteTag(type.ImplType.AutoId, WireFormat.WireType.LengthDelimited); + //} + + var defFields = type.ImplType.HierarchyFields; + int index = 0; + foreach (var field in type.Fields) + { + var defField = defFields[index++]; + if (!defField.NeedExport()) + { + continue; + } + var fieldType = defField.CType; + if (field == null) + { + continue; + } + switch (field) + { + case DArray arr: + { + WriteList(fieldType.ElementType, defField.AutoId, arr.Datas, temp); + break; + } + case DList list: + { + WriteList(fieldType.ElementType, defField.AutoId, list.Datas, temp); + break; + } + case DSet set: + { + WriteList(fieldType.ElementType, defField.AutoId, set.Datas, temp); + break; + } + case DMap map: + { + WriteMap(map, defField.AutoId, temp); + break; + } + default: + { + temp.WriteTag(defField.AutoId, defField.CType.Apply(ProtobufWireTypeVisitor.Ins)); + field.Apply(this, temp); + break; + } + } + } + //temp.Flush(); + //ms.Seek(0, SeekOrigin.Begin); + //var bs = ByteString.FromStream(ms); + //x.WriteBytes(bs); + //FreeMemoryStream(ms); + } + + private void EnterScope(CodedOutputStream x, Action<CodedOutputStream> action) + { + var ms = AllocMemoryStream(); + var temp = new CodedOutputStream(ms); + action(temp); + temp.Flush(); + ms.Seek(0, SeekOrigin.Begin); + var bs = ByteString.FromStream(ms); + x.WriteBytes(bs); + FreeMemoryStream(ms); + } + + public void Accept(DBean type, CodedOutputStream x) + { + EnterScope(x, cos => + { + var bean = type.Type; + + if (bean.IsAbstractType) + { + cos.WriteTag(type.ImplType.AutoId, WireFormat.WireType.LengthDelimited); + EnterScope(cos, cos2 => WriteRawMessageWithoutLength(type, cos2)); + } + else + { + WriteRawMessageWithoutLength(type, cos); + } + }); + } + + private void WriteList(TType elementType, int fieldId, List<DType> datas, CodedOutputStream x) + { + if (elementType.Apply(IsProtobufPackedType.Ins)) + { + x.WriteTag(fieldId, WireFormat.WireType.LengthDelimited); + var ms = AllocMemoryStream(); + var temp = new CodedOutputStream(ms); + foreach (var data in datas) + { + data.Apply(this, temp); + } + temp.Flush(); + ms.Seek(0, SeekOrigin.Begin); + x.WriteBytes(ByteString.FromStream(ms)); + FreeMemoryStream(ms); + } + else + { + var eleWireType = elementType.Apply(ProtobufWireTypeVisitor.Ins); + foreach (var data in datas) + { + x.WriteTag(fieldId, eleWireType); + data.Apply(this, x); + } + } + } + + public void Accept(DArray type, CodedOutputStream x) + { + throw new NotImplementedException(); + } + + public void Accept(DList type, CodedOutputStream x) + { + throw new NotImplementedException(); + } + + public void Accept(DSet type, CodedOutputStream x) + { + throw new NotImplementedException(); + } + + private void WriteMap(DMap type, int fieldId, CodedOutputStream x) + { + var keyType = type.Type.KeyType; + var valueType = type.Type.ValueType; + var ms = AllocMemoryStream(); + foreach (var e in type.Datas) + { + x.WriteTag(fieldId, WireFormat.WireType.LengthDelimited); + ms.Seek(0, SeekOrigin.Begin); + var temp = new CodedOutputStream(ms); + temp.WriteTag(1, keyType.Apply(ProtobufWireTypeVisitor.Ins)); + e.Key.Apply(this, temp); + temp.WriteTag(2, valueType.Apply(ProtobufWireTypeVisitor.Ins)); + e.Value.Apply(this, temp); + temp.Flush(); + ms.Seek(0, SeekOrigin.Begin); + x.WriteBytes(ByteString.FromStream(ms)); + + } + FreeMemoryStream(ms); + } + + public void Accept(DMap type, CodedOutputStream x) + { + throw new NotSupportedException(); + } +} diff --git a/luban/src/Luban.Protobuf/DataVisitors/ProtobufWireTypeVisitor.cs b/luban/src/Luban.Protobuf/DataVisitors/ProtobufWireTypeVisitor.cs new file mode 100644 index 00000000..23239e1b --- /dev/null +++ b/luban/src/Luban.Protobuf/DataVisitors/ProtobufWireTypeVisitor.cs @@ -0,0 +1,87 @@ +using Google.Protobuf; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Protobuf.DataVisitors; + +public class ProtobufWireTypeVisitor : ITypeFuncVisitor<WireFormat.WireType> +{ + public static ProtobufWireTypeVisitor Ins { get; } = new(); + + public WireFormat.WireType Accept(TBool type) + { + return WireFormat.WireType.Varint; + } + + public WireFormat.WireType Accept(TByte type) + { + return WireFormat.WireType.Varint; + } + + public WireFormat.WireType Accept(TShort type) + { + return WireFormat.WireType.Varint; + } + + public WireFormat.WireType Accept(TInt type) + { + return WireFormat.WireType.Varint; + } + + public WireFormat.WireType Accept(TLong type) + { + return WireFormat.WireType.Varint; + } + + public WireFormat.WireType Accept(TFloat type) + { + return WireFormat.WireType.Fixed32; + } + + public WireFormat.WireType Accept(TDouble type) + { + return WireFormat.WireType.Fixed64; + } + + public WireFormat.WireType Accept(TEnum type) + { + return WireFormat.WireType.Varint; + } + + public WireFormat.WireType Accept(TString type) + { + return WireFormat.WireType.LengthDelimited; + } + + public WireFormat.WireType Accept(TDateTime type) + { + return WireFormat.WireType.Varint; + } + + public WireFormat.WireType Accept(TBean type) + { + return WireFormat.WireType.LengthDelimited; + } + + public WireFormat.WireType Accept(TArray type) + { + //return WireFormat.WireType.LengthDelimited; + throw new Exception("not support multi-dimension array wire type"); + } + + public WireFormat.WireType Accept(TList type) + { + throw new Exception("not support multi-dimension list wire type"); + } + + public WireFormat.WireType Accept(TSet type) + { + throw new Exception("not support multi-dimension set wire type"); + } + + public WireFormat.WireType Accept(TMap type) + { + //return WireFormat.WireType.LengthDelimited; + throw new Exception("not support multi-dimension map wire type"); + } +} diff --git a/luban/src/Luban.Protobuf/Luban.Protobuf.csproj b/luban/src/Luban.Protobuf/Luban.Protobuf.csproj new file mode 100644 index 00000000..57182fbe --- /dev/null +++ b/luban/src/Luban.Protobuf/Luban.Protobuf.csproj @@ -0,0 +1,27 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + <ProjectReference Include="..\Luban.DataTarget.Builtin\Luban.DataTarget.Builtin.csproj" /> + </ItemGroup> + + <ItemGroup> + <PackageReference Include="Google.Protobuf" Version="3.29.0" /> + </ItemGroup> + + <ItemGroup> + <None Update="Templates\cs_pb\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\pb\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.Protobuf/TemplateExtensions/CsharpProtobuf3TemplateExtension.cs b/luban/src/Luban.Protobuf/TemplateExtensions/CsharpProtobuf3TemplateExtension.cs new file mode 100644 index 00000000..2bb5f5c6 --- /dev/null +++ b/luban/src/Luban.Protobuf/TemplateExtensions/CsharpProtobuf3TemplateExtension.cs @@ -0,0 +1,32 @@ +using Scriban.Runtime; +namespace Luban.Protobuf.TemplateExtensions; + +public class CsharpProtobuf3TemplateExtension : ScriptObject +{ + + public static string NamespaceWithGraceBegin(string ns) + { + if (string.IsNullOrEmpty(ns)) + { + return string.Empty; + } + ns = ns.Substring(0, 1).ToUpper() + ns.Substring(1); + + return $"namespace {ns}\n{{"; + } + + public static string NamespaceWithGraceEnd(string ns) + { + if (string.IsNullOrEmpty(ns)) + { + return string.Empty; + } + return "}"; + } + public static string ProtoFullName(string typeName) + { + var name = string.Join("", typeName.Split('.')); + + return name.Substring(0, 1).ToUpper() + name.Substring(1); + } +} diff --git a/luban/src/Luban.Protobuf/TemplateExtensions/Protobuf2TemplateExtension.cs b/luban/src/Luban.Protobuf/TemplateExtensions/Protobuf2TemplateExtension.cs new file mode 100644 index 00000000..06e541be --- /dev/null +++ b/luban/src/Luban.Protobuf/TemplateExtensions/Protobuf2TemplateExtension.cs @@ -0,0 +1,35 @@ + +using Luban.CodeFormat; +using Luban.Defs; +using Luban.Protobuf.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Protobuf.TemplateExtensions; + +public class Protobuf2TemplateExtension : ScriptObject +{ + public static string PreDecorator(TType type) + { + if (type.IsNullable) + { + return "optional"; + } + else if (type.IsCollection) + { + if (type is TMap) + { + return ""; + } + else + { + return "repeated"; + } + } + else + { + return "required"; + } + } +} diff --git a/luban/src/Luban.Protobuf/TemplateExtensions/Protobuf3TemplateExtension.cs b/luban/src/Luban.Protobuf/TemplateExtensions/Protobuf3TemplateExtension.cs new file mode 100644 index 00000000..11809279 --- /dev/null +++ b/luban/src/Luban.Protobuf/TemplateExtensions/Protobuf3TemplateExtension.cs @@ -0,0 +1,35 @@ + +using Luban.CodeFormat; +using Luban.Defs; +using Luban.Protobuf.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Protobuf.TemplateExtensions; + +public class Protobuf3TemplateExtension : ScriptObject +{ + public static string PreDecorator(TType type) + { + if (type.IsNullable) + { + return "optional"; + } + else if (type.IsCollection) + { + if (type is TMap) + { + return ""; + } + else + { + return "repeated"; + } + } + else + { + return ""; + } + } +} diff --git a/luban/src/Luban.Protobuf/TemplateExtensions/ProtobufCommonTemplateExtension.cs b/luban/src/Luban.Protobuf/TemplateExtensions/ProtobufCommonTemplateExtension.cs new file mode 100644 index 00000000..195ddafe --- /dev/null +++ b/luban/src/Luban.Protobuf/TemplateExtensions/ProtobufCommonTemplateExtension.cs @@ -0,0 +1,36 @@ + +using Luban.CodeFormat; +using Luban.Defs; +using Luban.Protobuf.DataTarget; +using Luban.Protobuf.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Protobuf.TemplateExtensions; + +public class ProtobufCommonTemplateExtension : ScriptObject +{ + + public static string FullName(DefTypeBase type) + { + return TypeUtil.MakePbFullName(type.Namespace, type.Name); + } + + public static string DeclaringTypeName(TType type) + { + return type.Apply(ProtobufTypeNameVisitor.Ins); + } + + public static string SuffixOptions(TType type) + { + if (type.IsCollection && !(type is TMap)) + { + return $"[packed = {(type.ElementType.Apply(IsProtobufPackedType.Ins) ? "true" : "false")}]"; + } + else + { + return ""; + } + } +} diff --git a/luban/src/Luban.Protobuf/Templates/cs_pb/tables.sbn b/luban/src/Luban.Protobuf/Templates/cs_pb/tables.sbn new file mode 100644 index 00000000..837061f5 --- /dev/null +++ b/luban/src/Luban.Protobuf/Templates/cs_pb/tables.sbn @@ -0,0 +1,32 @@ +using Google.Protobuf; +using Google.Protobuf.Collections; +using System.Reflection; + +{{namespace_with_grace_begin __namespace}} +public partial class {{__name}} +{ + {{~for table in __tables ~}} +{{~if table.comment != '' ~}} + /// <summary> + /// {{escape_comment table.comment}} + /// </summary> +{{~end~}} + public {{proto_full_name table.full_name}} {{format_property_name __code_style table.name}} { get; } + + {{~end~}} + + public {{__name}}(System.Func<string, byte[]> loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = {{proto_full_name table.full_name}}.Parser.ParseFrom(loader("{{table.output_data_file}}")); + {{~end~}} + } + public {{__name}}(System.Func<string, string> loader) + { + {{~for table in __tables ~}} + {{format_property_name __code_style table.name}} = {{proto_full_name table.full_name}}.Parser.ParseJson(loader("{{table.output_data_file}}")); + {{~end~}} + } +} + +{{namespace_with_grace_end __namespace}} diff --git a/luban/src/Luban.Protobuf/Templates/pb/schema.sbn b/luban/src/Luban.Protobuf/Templates/pb/schema.sbn new file mode 100644 index 00000000..fce80354 --- /dev/null +++ b/luban/src/Luban.Protobuf/Templates/pb/schema.sbn @@ -0,0 +1,41 @@ +syntax = "{{__syntax}}"; + +package {{__namespace}}; + +{{~for enum in __enums + typeName = full_name enum + ~}} +enum {{typeName}} { + {{~if !enum.has_zero_value_item ~}} + {{typeName}}_EMPTY_PLACEHOLDER = 0; + {{~end~}} + {{~for item in enum.items ~}} + {{typeName}}_{{item.name}} = {{item.int_value}}; + {{~end~}} +} +{{~end~}} + +{{~for bean in __beans + typeName = full_name bean +~}} +message {{typeName}} { +{{~if bean.is_abstract_type ~}} + oneof value { + {{~for c in bean.hierarchy_not_abstract_children~}} + {{full_name c}} {{c.name}} = {{c.auto_id}}; + {{~end~}} + } +{{~else~}} + {{~for f in bean.hierarchy_export_fields ~}} + {{pre_decorator f.ctype}} {{declaring_type_name f.ctype}} {{f.name}} = {{f.auto_id}} {{suffix_options f.ctype}}; + {{~end~}} +{{~end~}} +} +{{~end~}} + +{{~for table in __tables~}} +message {{full_name table}} { + repeated {{declaring_type_name table.value_ttype}} data_list = 1 [packed = false]; +} +{{~end~}} + diff --git a/luban/src/Luban.Protobuf/TypeVisitors/IsProtobufPackedType.cs b/luban/src/Luban.Protobuf/TypeVisitors/IsProtobufPackedType.cs new file mode 100644 index 00000000..44a7a7e5 --- /dev/null +++ b/luban/src/Luban.Protobuf/TypeVisitors/IsProtobufPackedType.cs @@ -0,0 +1,45 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Protobuf.TypeVisitors; + +public class IsProtobufPackedType : AllTrueVisitor +{ + public static IsProtobufPackedType Ins { get; } = new(); + + + public override bool Accept(TString type) + { + return false; + } + + public override bool Accept(TEnum type) + { + return false; + } + + public override bool Accept(TBean type) + { + return false; + } + + public override bool Accept(TArray type) + { + return false; + } + + public override bool Accept(TList type) + { + return false; + } + + public override bool Accept(TSet type) + { + return false; + } + + public override bool Accept(TMap type) + { + return false; + } +} diff --git a/luban/src/Luban.Protobuf/TypeVisitors/ProtobufTypeNameVisitor.cs b/luban/src/Luban.Protobuf/TypeVisitors/ProtobufTypeNameVisitor.cs new file mode 100644 index 00000000..2c485068 --- /dev/null +++ b/luban/src/Luban.Protobuf/TypeVisitors/ProtobufTypeNameVisitor.cs @@ -0,0 +1,102 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Protobuf.TypeVisitors; + +public class ProtobufTypeNameVisitor : ITypeFuncVisitor<string> +{ + public static ProtobufTypeNameVisitor Ins { get; } = new(); + + public string Accept(TBool type) + { + return "bool"; + } + + public string Accept(TByte type) + { + return "int32"; + } + + public string Accept(TShort type) + { + return "int32"; + } + + public string Accept(TInt type) + { + return "int32"; + } + + public string Accept(TLong type) + { + return "int64"; + } + + public string Accept(TFloat type) + { + return "float"; + } + + public string Accept(TDouble type) + { + return "double"; + } + + public string Accept(TEnum type) + { + return TypeUtil.MakePbFullName(type.DefEnum.Namespace, type.DefEnum.Name); + } + + public string Accept(TString type) + { + return "string"; + } + + public string Accept(TDateTime type) + { + return "int64"; + } + + public string Accept(TBean type) + { + return TypeUtil.MakePbFullName(type.DefBean.Namespace, type.DefBean.Name); + } + + public string Accept(TArray type) + { + if (type.ElementType.IsCollection) + { + throw new Exception("not support multi-dimension array type"); + } + return $"{type.ElementType.Apply(this)}"; + } + + public string Accept(TList type) + { + if (type.ElementType.IsCollection) + { + throw new Exception("not support multi-dimension list type"); + } + return $"{type.ElementType.Apply(this)}"; + } + + public string Accept(TSet type) + { + if (type.ElementType.IsCollection) + { + throw new Exception("not support multi-dimension set type"); + } + return $"{type.ElementType.Apply(this)}"; + } + + public string Accept(TMap type) + { + if (type.ElementType.IsCollection) + { + throw new Exception("not support multi-dimension map type"); + } + string key = type.KeyType is TEnum ? "int32" : (type.KeyType.Apply(this)); + return $"map<{key}, {type.ValueType.Apply(this)}>"; + } +} diff --git a/luban/src/Luban.Python/AssemblyInfo.cs b/luban/src/Luban.Python/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Python/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Python/CodeTarget/Python2JsonCodeTarget.cs b/luban/src/Luban.Python/CodeTarget/Python2JsonCodeTarget.cs new file mode 100644 index 00000000..d17f3ae3 --- /dev/null +++ b/luban/src/Luban.Python/CodeTarget/Python2JsonCodeTarget.cs @@ -0,0 +1,11 @@ +using Luban.CodeTarget; +using Luban.Defs; +using Scriban; + +namespace Luban.Python.CodeTarget; + +[CodeTarget("python-json")] +public class Python2JsonCodeTarget : PythonCodeTargetBase +{ + +} diff --git a/luban/src/Luban.Python/CodeTarget/PythonCodeTargetBase.cs b/luban/src/Luban.Python/CodeTarget/PythonCodeTargetBase.cs new file mode 100644 index 00000000..be6c3709 --- /dev/null +++ b/luban/src/Luban.Python/CodeTarget/PythonCodeTargetBase.cs @@ -0,0 +1,33 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.Python.TemplateExtensions; +using Scriban; +using Scriban.Runtime; + +namespace Luban.Python.CodeTarget; + +public abstract class PythonCodeTargetBase : AllInOneTemplateCodeTargetBase +{ + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_PYTHON; + + protected override ICodeStyle DefaultCodeStyle => CodeFormatManager.Ins.PythonDefaultCodeStyle; + + protected override string FileSuffixName => "py"; + + protected override string DefaultOutputFileName => "schema.py"; + + private static readonly HashSet<string> s_preservedKeyWords = new() + { + // python preserved key words + "False", "None", "True", "and", "as", "assert", "async", "await", "break", "class", "continue", + "def", "del", "elif", "else", "except", "finally", "for", "from", "global", "if", "import", "in", + "is", "lambda", "nonlocal", "not", "or", "pass", "raise", "return", "try", "while", "with", "yield" + }; + + protected override IReadOnlySet<string> PreservedKeyWords => s_preservedKeyWords; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new PythonCommonTemplateExtension()); + } +} diff --git a/luban/src/Luban.Python/DataVisitors/ToPythonLiteralVisitor.cs b/luban/src/Luban.Python/DataVisitors/ToPythonLiteralVisitor.cs new file mode 100644 index 00000000..ffc6fdfa --- /dev/null +++ b/luban/src/Luban.Python/DataVisitors/ToPythonLiteralVisitor.cs @@ -0,0 +1,104 @@ +using System.Text; +using Luban.Datas; +using Luban.DataVisitors; +using Luban.Defs; +using Luban.Utils; + +namespace Luban.Python.DataVisitors; + +public class ToPythonLiteralVisitor : ToLiteralVisitorBase +{ + public static ToPythonLiteralVisitor Ins { get; } = new(); + + public override string Accept(DBool type) + { + return type.Value ? "True" : "False"; + } + + public override string Accept(DBean type) + { + var x = new StringBuilder(); + var bean = type.ImplType; + if (bean.IsAbstractType) + { + x.Append($"{{ \"_name\":\"{type.ImplType.Name}\","); + } + else + { + x.Append('{'); + } + + int index = 0; + foreach (var f in type.Fields) + { + var defField = (DefField)type.ImplType.HierarchyFields[index++]; + if (f == null || !defField.NeedExport()) + { + continue; + } + x.Append('\"').Append(defField.Name).Append('\"').Append(':'); + x.Append(f.Apply(this)); + x.Append(','); + } + x.Append('}'); + return x.ToString(); + } + + + protected virtual void Append(List<DType> datas, StringBuilder x) + { + x.Append('['); + int index = 0; + foreach (var e in datas) + { + if (index > 0) + { + x.Append(','); + } + ++index; + x.Append(e.Apply(this)); + } + x.Append(']'); + } + + public override string Accept(DArray type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DList type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DSet type) + { + var x = new StringBuilder(); + Append(type.Datas, x); + return x.ToString(); + } + + public override string Accept(DMap type) + { + var x = new StringBuilder(); + x.Append('{'); + int index = 0; + foreach (var e in type.Datas) + { + if (index > 0) + { + x.Append(','); + } + ++index; + x.Append(e.Key.Apply(this)); + x.Append(':'); + x.Append(e.Value.Apply(this)); + } + x.Append('}'); + return x.ToString(); + } +} diff --git a/luban/src/Luban.Python/Luban.Python.csproj b/luban/src/Luban.Python/Luban.Python.csproj new file mode 100644 index 00000000..b9f5a049 --- /dev/null +++ b/luban/src/Luban.Python/Luban.Python.csproj @@ -0,0 +1,30 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + <ProjectReference Include="..\Luban.DataTarget.Builtin\Luban.DataTarget.Builtin.csproj" /> + </ItemGroup> + + <ItemGroup> + <Folder Include="TypeVisitors\" /> + </ItemGroup> + + <ItemGroup> + <None Update="Templates\lua-bin\schema.sbn"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Update="Templates\python2-json\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\python-json\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.Python/TemplateExtensions/PythonCommonTemplateExtension.cs b/luban/src/Luban.Python/TemplateExtensions/PythonCommonTemplateExtension.cs new file mode 100644 index 00000000..7ef5acb3 --- /dev/null +++ b/luban/src/Luban.Python/TemplateExtensions/PythonCommonTemplateExtension.cs @@ -0,0 +1,45 @@ +using Luban.Defs; +using Luban.Python.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Python.TemplateExtensions; + +public class PythonCommonTemplateExtension : ScriptObject +{ + + public static string FullName(DefTypeBase type) + { + return TypeUtil.MakePyFullName(type.Namespace, type.Name); + } + + public static string StrFullName(string fullName) + { + return fullName.Replace(".", "_"); + } + + public static string Deserialize(string fieldName, string jsonVarName, TType type) + { + if (type.IsNullable) + { + return $"if {jsonVarName} != None: {type.Apply(JsonUnderlyingDeserializeVisitor.Ins, jsonVarName, fieldName, 0)}"; + } + else + { + return type.Apply(JsonUnderlyingDeserializeVisitor.Ins, jsonVarName, fieldName, 0); + } + } + + public static string DeserializeField(string fieldName, string jsonVarName, string jsonFieldName, TType type) + { + if (type.IsNullable) + { + return $"if {jsonVarName}.get('{jsonFieldName}') != None: {type.Apply(JsonUnderlyingDeserializeVisitor.Ins, $"{jsonVarName}['{jsonFieldName}']", fieldName, 0)}"; + } + else + { + return type.Apply(JsonUnderlyingDeserializeVisitor.Ins, $"{jsonVarName}['{jsonFieldName}']", fieldName, 0); + } + } +} diff --git a/luban/src/Luban.Python/Templates/python-json/schema.sbn b/luban/src/Luban.Python/Templates/python-json/schema.sbn new file mode 100644 index 00000000..dfa6e4bb --- /dev/null +++ b/luban/src/Luban.Python/Templates/python-json/schema.sbn @@ -0,0 +1,156 @@ +from enum import Enum +{{ + + func table_key_list + table = $0 + varName = $1 + indexList = table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_name_list + table = $0 + paramList = table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} + +{{~for enum in __enums~}} +{{~if enum.comment != '' ~}} +''' +{{enum.comment | html.escape}} +''' +{{~end~}} +class {{full_name enum}}(Enum): + {{~ for item in enum.items ~}} +{{~if item.comment_or_alias != '' ~}} + ''' + {{item.comment_or_alias | html.escape}} + ''' +{{~end~}} + {{item.name}} = {{item.value}} + {{~end~}} + {{~if enum.items.empty?~}} + pass + {{~end~}} + +{{~end~}} + +{{~for bean in __beans + name = (full_name bean) +~}} +class {{name}} {{if bean.parent_def_type}}({{full_name bean.parent_def_type}}){{end}}: +{{~if bean.is_abstract_type~}} + _childrenTypes = None + @staticmethod + def fromJson(_json_): + childrenTypes = {{name}}._childrenTypes + if not childrenTypes: + childrenTypes = {{name}}._childrenTypes = { + {{~ for child in bean.hierarchy_not_abstract_children~}} + '{{impl_data_type child bean}}': {{name}}, + {{~end~}} + } + type = _json_['$type'] + child = {{name}}._childrenTypes.get(type) + if child != None: + return child(_json_) + else: + raise Exception() +{{~end~}} + def __init__(self, _json_): + {{~if bean.parent_def_type~}} + {{full_name bean.parent_def_type}}.__init__(self, _json_) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{deserialize_field ('self.' + (format_field_name __code_style field.name)) '_json_' field.name field.ctype}} + {{~end~}} + {{~if bean.export_fields.empty?}} + pass + {{~end~}} + +{{~end~}} + +{{~for table in __tables + value_type = table.value_ttype +~}} +class {{full_name table}}: + {{~if table.is_map_table ~}} + + def __init__(self, _json_ ): + self._dataMap = {} + self._dataList = [] + + for _json2_ in _json_: + {{deserialize '_v' '_json2_' value_type}} + self._dataList.append(_v) + self._dataMap[_v.{{format_field_name __code_style table.index_field.name}}] = _v + + def getDataMap(self) : return self._dataMap + def getDataList(self) : return self._dataList + + def get(self, key) : return self._dataMap.get(key) + {{~else if table.is_union_index~}} + + def __init__(self, _json_ ): + self._dataMap = {} + self._dataList = [] + + for _json2_ in _json_: + {{deserialize '_v' '_json2_' value_type}} + self._dataList.append(_v) + self._dataMap[({{table_key_list table '_v'}})] = _v + + def getDataMap(self) : return self._dataMap + def getDataList(self) : return self._dataList + + def get(self, {{table_param_name_list table}}) : return self._dataMap.get(({{table_param_name_list table}})) + + {{~else if table.is_list_table ~}} + + def __init__(self, _json_ ): + self._dataList = [] + {{~for idx in table.index_list~}} + self._dataMap_{{idx.index_field.name}} = {} + {{~end~}} + for _json2_ in _json_: + {{deserialize '_v' '_json2_' value_type}} + self._dataList.append(_v) + {{~for idx in table.index_list~}} + self._dataMap_{{idx.index_field.name}}[_v.{{format_property_name __code_style idx.index_field.name}}] = _v + {{~end~}} + + def getDataList(self) : return self._dataList + + def get(self, index) : return self._dataList[index] + {{~for idx in table.index_list~}} + def get_by_{{format_property_name __code_style idx.index_field.name}}(self, key): return self._dataMap_{{idx.index_field.name}}.get(key) + {{~end~}} + {{~else~}} + + def __init__(self, _json_): + if (len(_json_) != 1): raise Exception('table mode=one, but size != 1') + {{deserialize 'self._data' '_json_[0]' value_type}} + + def getData(self) : return self._data + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' + name = format_field_name __code_style field.name +~}} + ''' + {{escape_comment field.comment}} + ''' +{{~end~}} + def {{name}}(self) : return self._data.{{name}} + {{~end~}} + {{~end~}} + +{{~end~}} + + +class {{str_full_name __full_name}}: + def __init__(self, loader): + {{~for table in __tables ~}} + self.{{format_method_name __code_style table.name}} = {{full_name table}}(loader('{{table.output_data_file}}')); + {{~end~}} diff --git a/luban/src/Luban.Python/TypeVisitors/DeclaringTypeNameVisitor.cs b/luban/src/Luban.Python/TypeVisitors/DeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..19b3c420 --- /dev/null +++ b/luban/src/Luban.Python/TypeVisitors/DeclaringTypeNameVisitor.cs @@ -0,0 +1,25 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Python.TypeVisitors; + +public class DeclaringTypeNameVisitor : DecoratorFuncVisitor<string> +{ + public static DeclaringTypeNameVisitor Ins { get; } = new(); + + public override string DoAccept(TType type) + { + throw new System.NotSupportedException(); + } + + public override string Accept(TEnum type) + { + return type.DefEnum.FullName.Replace('.', '_'); + } + + public override string Accept(TBean type) + { + return type.DefBean.FullName.Replace('.', '_'); + } +} diff --git a/luban/src/Luban.Python/TypeVisitors/JsonUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Python/TypeVisitors/JsonUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..06452f5e --- /dev/null +++ b/luban/src/Luban.Python/TypeVisitors/JsonUnderlyingDeserializeVisitor.cs @@ -0,0 +1,114 @@ +using Luban.DataExporter.Builtin.Json; +using Luban.Datas; +using Luban.Python.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Python.TypeVisitors; + +public class JsonUnderlyingDeserializeVisitor : ITypeFuncVisitor<string, string, int, string> +{ + public static JsonUnderlyingDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string jsonVarName, string fieldName, int depth) + { + return $"{StringUtil.RepeatSpaceAsTab(depth)}{fieldName} = {jsonVarName}"; + } + + public string Accept(TByte type, string jsonVarName, string fieldName, int depth) + { + return $"{StringUtil.RepeatSpaceAsTab(depth)}{fieldName} = {jsonVarName}"; + } + + public string Accept(TShort type, string jsonVarName, string fieldName, int depth) + { + return $"{StringUtil.RepeatSpaceAsTab(depth)}{fieldName} = {jsonVarName}"; + } + + public string Accept(TInt type, string jsonVarName, string fieldName, int depth) + { + return $"{StringUtil.RepeatSpaceAsTab(depth)}{fieldName} = {jsonVarName}"; + } + + public string Accept(TLong type, string jsonVarName, string fieldName, int depth) + { + return $"{StringUtil.RepeatSpaceAsTab(depth)}{fieldName} = {jsonVarName}"; + } + + public string Accept(TFloat type, string jsonVarName, string fieldName, int depth) + { + return $"{StringUtil.RepeatSpaceAsTab(depth)}{fieldName} = {jsonVarName}"; + } + + public string Accept(TDouble type, string jsonVarName, string fieldName, int depth) + { + return $"{StringUtil.RepeatSpaceAsTab(depth)}{fieldName} = {jsonVarName}"; + } + + public string Accept(TEnum type, string jsonVarName, string fieldName, int depth) + { + return $"{StringUtil.RepeatSpaceAsTab(depth)}{fieldName} = {jsonVarName}"; + } + + public string Accept(TString type, string jsonVarName, string fieldName, int depth) + { + return $"{StringUtil.RepeatSpaceAsTab(depth)}{fieldName} = {jsonVarName}"; + } + + public string Accept(TBean type, string jsonVarName, string fieldName, int depth) + { + string padding = StringUtil.RepeatSpaceAsTab(depth); + if (type.DefBean.IsAbstractType) + { + return $"{padding}{fieldName} = {PythonCommonTemplateExtension.FullName(type.DefBean)}.fromJson({jsonVarName})"; + } + else + { + return $"{padding}{fieldName} = {PythonCommonTemplateExtension.FullName(type.DefBean)}({jsonVarName})"; + } + } + + public string Accept(TArray type, string jsonVarName, string fieldName, int depth) + { + string eleName = $"_ele{depth}_"; + string subVarName = $"_e{depth}_"; + string padding = StringUtil.RepeatSpaceAsTab(depth); + string subPadding = StringUtil.RepeatSpaceAsTab(depth + 1); + return $"{padding}{fieldName} = []\n{padding}for {eleName} in {jsonVarName}:\n{type.ElementType.Apply(this, eleName, subVarName, depth + 1)}\n{subPadding}{fieldName}.append({subVarName})"; + } + + public string Accept(TList type, string jsonVarName, string fieldName, int depth) + { + string eleName = $"_ele{depth}_"; + string subVarName = $"_e{depth}_"; + string padding = StringUtil.RepeatSpaceAsTab(depth); + string subPadding = StringUtil.RepeatSpaceAsTab(depth + 1); + return $"{padding}{fieldName} = []\n{padding}for {eleName} in {jsonVarName}:\n{type.ElementType.Apply(this, eleName, subVarName, depth + 1)}\n{subPadding}{fieldName}.append({subVarName})"; + } + + public string Accept(TSet type, string jsonVarName, string fieldName, int depth) + { + string eleName = $"_ele{depth}_"; + string subVarName = $"_e{depth}_"; + string padding = StringUtil.RepeatSpaceAsTab(depth); + string subPadding = StringUtil.RepeatSpaceAsTab(depth + 1); + return $"{padding}{fieldName} = []\n{padding}for {eleName} in {jsonVarName}:\n{type.ElementType.Apply(this, eleName, subVarName, depth + 1)}\n{subPadding}{fieldName}.append({subVarName})"; + } + + public string Accept(TMap type, string jsonVarName, string fieldName, int depth) + { + string keyEleName = $"_elek{depth}_"; + string valueEleName = $"_elev{depth}_"; + string keySubVarName = $"_k{depth}_"; + string valueSubVarName = $"_v{depth}_"; + string padding = StringUtil.RepeatSpaceAsTab(depth); + string subPadding = StringUtil.RepeatSpaceAsTab(depth + 1); + return $"{padding}{fieldName} = {{}};\n{padding}for {keyEleName}, {valueEleName} in {jsonVarName}:\n{type.KeyType.Apply(this, keyEleName, keySubVarName, depth + 1)}\n{type.ValueType.Apply(this, valueEleName, valueSubVarName, depth + 1)}\n{subPadding}{fieldName}[{keySubVarName}] = {valueSubVarName}"; + } + + public string Accept(TDateTime type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } +} diff --git a/luban/src/Luban.Rust/AssemblyInfo.cs b/luban/src/Luban.Rust/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Rust/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Rust/CodeTarget/RustBinCodeTarget.cs b/luban/src/Luban.Rust/CodeTarget/RustBinCodeTarget.cs new file mode 100644 index 00000000..d09d9054 --- /dev/null +++ b/luban/src/Luban.Rust/CodeTarget/RustBinCodeTarget.cs @@ -0,0 +1,16 @@ +using Luban.CodeTarget; +using Luban.CSharp.TemplateExtensions; +using Luban.Rust.CodeTarget; +using Scriban; + +namespace Luban.CSharp.CodeTarget; + +[CodeTarget("rust-bin")] +public class RustBinCodeTarget : RustCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new RustBinTemplateExtension()); + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/CodeTarget/RustCodeTargetBase.cs b/luban/src/Luban.Rust/CodeTarget/RustCodeTargetBase.cs new file mode 100644 index 00000000..a0093b8b --- /dev/null +++ b/luban/src/Luban.Rust/CodeTarget/RustCodeTargetBase.cs @@ -0,0 +1,224 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.Defs; +using Luban.Rust.TemplateExtensions; +using Luban.Tmpl; +using Luban.Utils; + +using Scriban; +using Scriban.Runtime; +using System.Text; +using System.Xml.Linq; + +namespace Luban.Rust.CodeTarget; + +public class RustCodeTargetBase : TemplateCodeTargetBase +{ + protected override IReadOnlySet<string> PreservedKeyWords => _preservedKeyWords; + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_RUST; + protected override string FileSuffixName => "rs"; + + protected override ICodeStyle DefaultCodeStyle => CodeFormatManager.Ins.PythonDefaultCodeStyle; + + private static readonly HashSet<string> _preservedKeyWords = + [ + "as", "async", "await", "break", "const", "continue", "crate", + "dyn", "else", "enum", "extern", "false", "fn", "for", "if", + "impl", "in", "let", "loop", "match", "mod", "move", "mut", + "pub", "ref", "return", "self", "Self", "static", "struct", + "super", "trait", "true", "type", "union", "unsafe", "use", + "where", "while", + // Keywords Reserved for Future Use + "abstract", "become", "box", "do", "final", "macro", "override", + "priv", "try", "typeof", "unsized", "virtual", "yield" + ]; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new RustCommonTemplateExtension()); + } + + + public override void Handle(GenerationContext ctx, OutputFileManifest manifest) + { + var topMod = new Mod(); + var modDic = new Dictionary<string, Mod>(); + var polymorphicBeans = new HashSet<DefBean>(); + foreach (var item in ctx.ExportTables) + { + CollectMod(item, topMod, modDic); + } + + foreach (var item in ctx.ExportBeans) + { + if (item.IsAbstractType) + { + polymorphicBeans.Add(item); + } + if (!string.IsNullOrEmpty(item.Parent)) + { + polymorphicBeans.Add(item); + } + CollectMod(item, topMod, modDic); + } + + foreach (var item in ctx.ExportEnums) + { + CollectMod(item, topMod, modDic); + } + + var tasks = new List<Task<OutputFile>> + { + Task.Run(() => + { + var allns = modDic.Values.Select(x => "crate::" + x.FullPath.Replace("/", "::")).ToList(); + var allmods = modDic.Keys.Select(x => x.Replace(".", "::")); + return CreateOutputFile($"{GenerationContext.Current.TopModule}/src/lib.rs", GenerateLib(ctx, allmods, allns, topMod, polymorphicBeans)); + }), + Task.Run(() => CreateOutputFile($"{GenerationContext.Current.TopModule}/Cargo.toml", GenerateToml(ctx))), + }; + + foreach (var mod in modDic.Values) + { + tasks.Add(Task.Run(() => + { + var path = $"{GenerationContext.Current.TopModule}/src/{mod.FullPath}"; + path += mod.SubMods.Count <= 0 ? ".rs" : "/mod.rs"; + + return CreateOutputFile(path, GenerateMod(ctx, mod)); + })); + } + + GenerateMacros(ctx, manifest); + Task.WaitAll(tasks.ToArray()); + foreach (var task in tasks) + { + manifest.AddFile(task.Result); + } + } + + private static void CollectMod<T>(T item, Mod topMod, Dictionary<string, Mod> modDic) where T : DefTypeBase + { + Mod mod = topMod; + if (!string.IsNullOrEmpty(item.Namespace)) + { + var ns = item.Namespace.Split("."); + var parent = topMod; + foreach (var se in ns) + { + if (!modDic.TryGetValue(se, out mod!)) + { + mod = new Mod + { + Name = se + }; + + mod.FullPath = string.IsNullOrEmpty(parent.FullPath) + ? mod.Name + : $"{parent.FullPath}/{mod.Name}"; + + modDic.Add(se, mod); + } + + parent.SubMods.Add(mod); + parent = mod; + } + } + + switch (item) + { + case DefTable def: + mod.Tables.Add(def); + break; + case DefBean def: + mod.Beans.Add(def); + break; + case DefEnum def: + mod.Enums.Add(def); + break; + } + } + + protected virtual string GenerateToml(GenerationContext ctx) + { + var writer = new CodeWriter(); + var template = GetTemplate($"toml"); + var tplCtx = CreateTemplateContext(template); + var extraEnvs = new ScriptObject + { + {"__name", GenerationContext.Current.TopModule}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + return writer.ToResult(string.Empty); + } + + protected virtual string GenerateLib(GenerationContext ctx, IEnumerable<string> mods, IEnumerable<string> ns, Mod topMod, HashSet<DefBean> polymorphicBeans) + { + var writer = new CodeWriter(); + var template = GetTemplate($"lib"); + var tplCtx = CreateTemplateContext(template); + OnCreateTemplateContext(tplCtx); + + var extraEnvs = new ScriptObject + { + {"__ctx", ctx}, + {"__name", ctx.Target.Manager}, + {"__namespace", ctx.Target.TopModule}, + {"__full_name", TypeUtil.MakeFullName(ctx.Target.TopModule, ctx.Target.Manager)}, + {"__top_mod", topMod}, + {"__mods", mods}, + {"__ns", ns}, + {"__tables", ctx.ExportTables}, + {"__polymorphic_beans", polymorphicBeans}, + {"__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + var result = writer.ToResult(FileHeader); + result = result + GenerateMod(ctx, topMod, false); + return result; + } + + protected virtual string GenerateMod(GenerationContext ctx, Mod mod, bool addHeader = true) + { + var writer = new CodeWriter(); + var template = GetTemplate($"mod"); + var tplCtx = CreateTemplateContext(template); + OnCreateTemplateContext(tplCtx); + + var extraEnvs = new ScriptObject + { + {"__ctx", ctx}, + {"__name", ctx.Target.Manager}, + {"__namespace", ctx.Target.TopModule}, + {"__full_name", TypeUtil.MakeFullName(ctx.Target.TopModule, ctx.Target.Manager)}, + {"__mod", mod}, + {"__code_style", CodeStyle}, + }; + tplCtx.PushGlobal(extraEnvs); + writer.Write(template.Render(tplCtx)); + var result = writer.ToResult(addHeader ? FileHeader : null); + return result; + } + + protected virtual void GenerateMacros(GenerationContext ctx, OutputFileManifest manifest) + { + var template = TemplateManager.Ins.GetTemplateString($"{CommonTemplateSearchPath}/macros/Cargo.toml"); + var path = $"macros/Cargo.toml"; + manifest.AddFile(CreateOutputFile(path, template)); + template = TemplateManager.Ins.GetTemplateString($"{CommonTemplateSearchPath}/macros/src/lib.rs"); + path = $"macros/src/lib.rs"; + manifest.AddFile(CreateOutputFile(path, template)); + } + + protected class Mod + { + public string Name { get; set; } = string.Empty; + public string FullPath { get; set; } = string.Empty; + public HashSet<Mod> SubMods { get; set; } = []; + public List<DefTable> Tables { get; set; } = []; + public List<DefBean> Beans { get; set; } = []; + public List<DefEnum> Enums { get; set; } = []; + } +} diff --git a/luban/src/Luban.Rust/CodeTarget/RustJsonCodeTarget.cs b/luban/src/Luban.Rust/CodeTarget/RustJsonCodeTarget.cs new file mode 100644 index 00000000..38c9d2af --- /dev/null +++ b/luban/src/Luban.Rust/CodeTarget/RustJsonCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Rust.TemplateExtensions; +using Scriban; + +namespace Luban.Rust.CodeTarget; + +[CodeTarget("rust-json")] +public class RustJsonCodeTarget : RustCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new RustJsonTemplateExtension()); + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/ConstantStrings.cs b/luban/src/Luban.Rust/ConstantStrings.cs new file mode 100644 index 00000000..84c48064 --- /dev/null +++ b/luban/src/Luban.Rust/ConstantStrings.cs @@ -0,0 +1,9 @@ +namespace Luban.Rust; + +public static class ConstantStrings +{ + public const string ArrayType = "Vec"; + public const string ListType = "Vec"; + public const string SetType = "std::collections::HashSet"; + public const string MapType = "std::collections::HashMap"; +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/Luban.Rust.csproj b/luban/src/Luban.Rust/Luban.Rust.csproj new file mode 100644 index 00000000..cda29977 --- /dev/null +++ b/luban/src/Luban.Rust/Luban.Rust.csproj @@ -0,0 +1,40 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + </ItemGroup> + + <ItemGroup> + <None Update="Templates\rust-json\toml.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\rust-json\lib.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\rust-json\mod.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\common\rs\macros\Cargo.toml.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\common\rs\macros\src\lib.rs.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\rust-bin\lib.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\rust-bin\mod.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\rust-bin\toml.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + +</Project> \ No newline at end of file diff --git a/luban/src/Luban.Rust/TemplateExtensions/RustBinTemplateExtension.cs b/luban/src/Luban.Rust/TemplateExtensions/RustBinTemplateExtension.cs new file mode 100644 index 00000000..31277f4a --- /dev/null +++ b/luban/src/Luban.Rust/TemplateExtensions/RustBinTemplateExtension.cs @@ -0,0 +1,38 @@ +using Luban.CodeTarget; +using Luban.CSharp.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.CSharp.TemplateExtensions; + +public class RustBinTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string bufName, TType type) + { + if (type.IsNullable) + { + return $"let mut {fieldName} = if {bufName}.read_bool() {{ Some({type.Apply(BinaryUnderlyingDeserializeVisitor.Ins, bufName, fieldName, 0)}) }} else {{ None }};"; + } + else + { + return $"let {fieldName} = {type.Apply(BinaryUnderlyingDeserializeVisitor.Ins, bufName, fieldName, 0)};"; + } + } + + public static string DeserializeRow(string fieldName, string bufName, TType type) + { + if (type.IsNullable) + { + return $"let mut {fieldName} = if {bufName}.read_bool() {{ Some({type.Apply(BinaryUnderlyingDeserializeVisitor.Ins, bufName, fieldName, 0)}) }} else {{ None }};"; + } + else + { + if (type is TBean {IsDynamic: true}) + { + return $"let {fieldName} = {type.Apply(BinaryUnderlyingDeserializeVisitor.Ins, bufName, fieldName, 0)};"; + } + + return $"let {fieldName} = std::sync::Arc::new({type.Apply(BinaryUnderlyingDeserializeVisitor.Ins, bufName, fieldName, 0)});"; + } + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/TemplateExtensions/RustCommonTemplateExtension.cs b/luban/src/Luban.Rust/TemplateExtensions/RustCommonTemplateExtension.cs new file mode 100644 index 00000000..e42a54df --- /dev/null +++ b/luban/src/Luban.Rust/TemplateExtensions/RustCommonTemplateExtension.cs @@ -0,0 +1,34 @@ +using Luban.Defs; +using Luban.Rust.TypeVisitors; +using Luban.Types; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Rust.TemplateExtensions; + +public class RustCommonTemplateExtension : ScriptObject +{ + public static string DeclaringTypeName(TType type) + { + return type?.Apply(RustDeclaringBoxTypeNameVisitor.Ins) ?? string.Empty; + } + + public static string GetterName(string name) + { + return "get_" + name; + } + + public static string FullName(DefTypeBase type) + { + return $"crate::{type.FullName.Replace(".", "::")}"; + } + + public static string BaseTraitName(DefBean bean) + { + if (!bean.IsAbstractType) return string.Empty; + + var name = $"crate::{bean.FullName.Replace(".", "::")}"; + return name.Insert(name.Length - bean.Name.Length, "T"); + + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/TemplateExtensions/RustJsonTemplateExtension.cs b/luban/src/Luban.Rust/TemplateExtensions/RustJsonTemplateExtension.cs new file mode 100644 index 00000000..ae08f86e --- /dev/null +++ b/luban/src/Luban.Rust/TemplateExtensions/RustJsonTemplateExtension.cs @@ -0,0 +1,42 @@ +using Luban.Rust.TypeVisitors; +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.Rust.TemplateExtensions; + +public class RustJsonTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string jsonVarName, TType type) + { + if (type.IsNullable) + { + return $"let mut {fieldName} = serde_json::from_value({jsonVarName}.clone())"; + } + else + { + return $"let {fieldName} = {type.Apply(RustJsonUnderlyingDeserializeVisitor.Ins, $"{jsonVarName}[\"{fieldName}\"]", fieldName, 0)};"; + } + } + + public static string DeserializeRow(string fieldName, string jsonVarName, TType type) + { + if (type is TBean {DefBean: {IsAbstractType: true}}) + { + return $"let {fieldName} = {type.Apply(RustJsonUnderlyingDeserializeVisitor.Ins, $"{jsonVarName}", fieldName, 0)};"; + } + + return $"let {fieldName} = std::sync::Arc::new({type.Apply(RustJsonUnderlyingDeserializeVisitor.Ins, $"{jsonVarName}", fieldName, 0)});"; + } + + public static string DeserializeField(string fieldName, string jsonVarName, TType type) + { + if (type.IsNullable) + { + return $"let mut {fieldName} = None; if let Some(value) = {jsonVarName}.get(\"{fieldName}\") {{ {fieldName} = Some({type.Apply(RustJsonUnderlyingDeserializeVisitor.Ins, $"{jsonVarName}[\"{fieldName}\"]", fieldName, 0)}); }}"; + } + else + { + return $"let {fieldName} = {type.Apply(RustJsonUnderlyingDeserializeVisitor.Ins, $"{jsonVarName}[\"{fieldName}\"]", fieldName, 0)};"; + } + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/Templates/common/rs/macros/Cargo.toml.sbn b/luban/src/Luban.Rust/Templates/common/rs/macros/Cargo.toml.sbn new file mode 100644 index 00000000..ae3a110d --- /dev/null +++ b/luban/src/Luban.Rust/Templates/common/rs/macros/Cargo.toml.sbn @@ -0,0 +1,14 @@ +[package] +name = "macros" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +quote = "1.0.36" +syn = "2.0.60" +proc-macro2 = "1.0.82" + +[lib] +proc-macro = true \ No newline at end of file diff --git a/luban/src/Luban.Rust/Templates/common/rs/macros/src/lib.rs.sbn b/luban/src/Luban.Rust/Templates/common/rs/macros/src/lib.rs.sbn new file mode 100644 index 00000000..7e93f74b --- /dev/null +++ b/luban/src/Luban.Rust/Templates/common/rs/macros/src/lib.rs.sbn @@ -0,0 +1,65 @@ +#[macro_use] +extern crate quote; + +use proc_macro::TokenStream; +use proc_macro2; +use quote::{format_ident, quote, ToTokens}; +use syn::{parse_macro_input, Data, DeriveInput}; + +#[proc_macro_derive(TryIntoBase)] +pub fn base_try_from(item: TokenStream) -> TokenStream { + let derive_input = parse_macro_input!(item as DeriveInput); + let ty_name = &derive_input.ident; + + match derive_input.data { + Data::Struct(_) => {} + _ => panic!("base_try_from can only be used on structs or enums"), + } + + let expanded = quote! { + impl<'a> TryFrom<&'a AbstractBase> for &'a #ty_name { + type Error = String; + + fn try_from(value: &'a AbstractBase) -> Result<Self, Self::Error> { + let r = value.downcast_ref::<#ty_name>(); + if let Some(v) = r { + return Ok(v); + } + + Err(concat!("can not into to ", stringify!(#ty_name)).to_string()) + } + } + }; + + TokenStream::from(expanded) +} + +#[proc_macro_derive(EnumFromNum)] +pub fn enum_from_num(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as DeriveInput); + let ty_name = &input.ident; + + + let tokens = vec![ + format_ident!("i64"), + format_ident!("i16"), + format_ident!("i8"), + format_ident!("isize"), + format_ident!("u64"), + format_ident!("u32"), + format_ident!("u16"), + format_ident!("u8"), + format_ident!("usize"), + format_ident!("f64"), + format_ident!("f32"), + ]; + quote! { + #( + impl From<#tokens> for #ty_name { + fn from(value: #tokens) -> Self { + (value as i32).into() + } + } + )* + }.into() +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/Templates/rust-bin/lib.sbn b/luban/src/Luban.Rust/Templates/rust-bin/lib.sbn new file mode 100644 index 00000000..254110e7 --- /dev/null +++ b/luban/src/Luban.Rust/Templates/rust-bin/lib.sbn @@ -0,0 +1,51 @@ +pub mod prelude{ + pub use crate::*; +{{~ for ns in __ns ~}} + pub use {{ns}}::*; +{{~end~}} +} +{{~ if __polymorphic_beans.count != 0 ~}} + +type AbstractBase = dyn std::any::Any + Sync + Send; + +pub trait GetBase<'a, T> { + fn get_base(&'a self) -> Result<T, LubanError>; +} +{{~end~}} + +#[derive(Debug)] +pub enum LubanError { + Loader(String), + Table(String), + Bean(String), + Polymorphic(String), + Unknown(String), +} + +impl std::fmt::Display for LubanError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(match self { + LubanError::Loader(msg) | + LubanError::Table(msg) | + LubanError::Bean(msg) | + LubanError::Polymorphic(msg) | + LubanError::Unknown(msg) => msg, + }) + } +} + +pub struct Tables{ +{{~ for table in __tables ~}} + pub {{table.name}}: std::sync::Arc<{{full_name table}}>, +{{~end~}} +} + +impl Tables { + pub fn new<T: Fn(&str) -> Result<ByteBuf, LubanError>>(loader: T) -> Result<Tables, LubanError> { + Ok(Tables { +{{~ for table in __tables ~}} + {{table.name}}: {{full_name table}}::new(loader("{{table.output_data_file}}")?)?, +{{~end~}} + }) + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/Templates/rust-bin/mod.sbn b/luban/src/Luban.Rust/Templates/rust-bin/mod.sbn new file mode 100644 index 00000000..a844024b --- /dev/null +++ b/luban/src/Luban.Rust/Templates/rust-bin/mod.sbn @@ -0,0 +1,280 @@ +{{~ for mod in __mod.sub_mods ~}} +pub mod {{mod.name}}; +{{~end~}} + +{{~ if __mod.name != '' ~}} +use super::*; +{{~end~}} +use luban_lib::*; + +{{~ for enum in __mod.enums ~}} +{{~ if enum.comment != '' ~}} +///{{enum.comment | html.escape}} +{{~end~}} +{{~ if enum.is_flags ~}} +bitflags::bitflags!{ + #[derive(Debug, Hash, Eq, PartialEq)] + pub struct {{enum.name}} : u32 { + {{~ for item in enum.items ~}} + {{~if item.comment_or_alias != '' ~}} + ///{{item.comment_or_alias | html.escape}} + {{~end~}} + const {{item.name}} = {{item.int_value}}; + {{~end~}} + } +} +{{~else~}} +#[derive(Debug, Hash, Eq, PartialEq, macros::EnumFromNum)] +pub enum {{enum.name}} { + {{~ for item in enum.items ~}} +{{~if item.comment_or_alias != '' ~}} + ///{{item.comment_or_alias | html.escape}} +{{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} + {{~if enum.items.empty?~}} + None + {{~end~}} +} + +impl From<i32> for {{enum.name}} { + fn from(value: i32) -> Self { + match value { + {{~ for item in enum.items ~}} + {{item.value}} => {{enum.name}}::{{item.name}}, + {{~end~}} + _ => panic!("Invalid value for {{enum.name}}:{}", value), + } + } +} + +{{~end~}} +{{~end~}} +{{~ for bean in __mod.beans + hierarchy_fields = bean.hierarchy_export_fields +~}} +#[derive(Debug)] +{{~if bean.parent != ''~}} +#[derive(macros::TryIntoBase)] +{{~end~}} +pub struct {{bean.name}} { + {{~ for field in hierarchy_fields ~}} +{{~if field.comment != '' ~}} + /// {{escape_comment field.comment}} +{{~end~}} + pub {{field.name}}: {{declaring_type_name field.ctype}}, + {{~end~}} +} +{{~if bean.is_abstract_type~}} + +impl {{bean.name}} { + pub fn new(mut buf: &mut ByteBuf) -> Result<std::sync::Arc<AbstractBase>, LubanError> { + let type_id = buf.read_int(); + match type_id { + {{~for child in bean.hierarchy_not_abstract_children~}} + {{full_name child}}::__ID__ => Ok(std::sync::Arc::new({{full_name child}}::new(buf)?)), + {{~end~}} + _ => Err(LubanError::Bean(format!("Invalid type for {{bean.name}}:{}", type_id))) + } + } +} + +pub trait T{{bean.name}} { + {{~ for field in hierarchy_fields ~}} + fn {{getter_name field.name}}(&self) -> &{{declaring_type_name field.ctype}}; + {{~end~}} +} +{{~for child in bean.hierarchy_not_abstract_children~}} + +impl {{base_trait_name bean}} for {{full_name child}} { + {{~ for field in hierarchy_fields ~}} + fn {{getter_name field.name}}(&self) -> &{{declaring_type_name field.ctype}} { + &self.{{field.name}} + } + {{~end~}} +} +{{~end~}} + +impl<'a> GetBase<'a, &'a dyn {{base_trait_name bean}}> for AbstractBase { + fn get_base(&'a self) -> Result<&'a dyn {{base_trait_name bean}}, LubanError> { + {{~for child in bean.hierarchy_not_abstract_children~}} + let base: Result<&{{full_name child}}, _> = self.try_into(); + if let Ok(r) = base { + return Ok(r); + } + {{~end~}} + + Err(LubanError::Polymorphic(format!("Invalid type for {{bean.name}}"))) + } +} +{{~else~}} + +impl {{bean.name}}{ + pub fn new(mut buf: &mut ByteBuf) -> Result<{{bean.name}}, LubanError> { + {{~ for field in hierarchy_fields ~}} + {{deserialize field.name 'buf' field.ctype}} + {{~end~}} + + Ok({{bean.name}} { {{ for field in hierarchy_fields }}{{field.name}}, {{end}}}) + } + + pub const __ID__: i32 = {{bean.id}}; +} +{{~end~}} + +{{~end~}} +{{~ for table in __mod.tables + key_type = declaring_type_name table.key_ttype + if table.value_ttype.def_bean.is_abstract_type + value_type = declaring_type_name table.value_ttype + else + value_type = "std::sync::Arc<"+declaring_type_name table.value_ttype+">" + end + name = table.name + map_type = "std::collections::HashMap<"+key_type+", "+value_type+">" +~}} +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'std::collections::HashMap<(' + (array.each table.index_list @index_type_name | array.join ', ') + '), ' + value_type + '>' + end + + func table_key_list + varName = $0 + indexList = table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{~ if table.comment != '' ~}} +///{{table.comment | html.escape}} +{{~end~}} +#[derive(Debug)] +pub struct {{table.name}} { + {{~if table.is_map_table ~}} + pub data_list: Vec<{{value_type}}>, + pub data_map: {{map_type}}, + {{~else if table.is_list_table ~}} + pub data_list: Vec<{{value_type}}>, + {{~if table.is_union_index~}} + pub data_map_union: {{table_union_map_type_name}}, + {{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + pub data_map_{{idx.index_field.name}}: std::collections::HashMap<{{declaring_type_name idx.type}}, {{value_type}}>, + {{~end~}} + {{~end~}} + {{~else~}} + pub data: {{declaring_type_name table.value_ttype}}, + {{~end~}} +} +{{~if table.is_map_table ~}} + +impl {{name}} { + pub fn new(mut buf: ByteBuf) -> Result<std::sync::Arc<{{name}}>, LubanError> { + let mut data_map: {{map_type}} = Default::default(); + let mut data_list: Vec<{{value_type}}> = vec![]; + + for x in (0..buf.read_size()).rev() { + {{deserialize_row "row" "buf" table.value_ttype}} + data_list.push(row.clone()); + {{~ if table.value_ttype.def_bean.is_abstract_type ~}} + let key = <AbstractBase as GetBase<&dyn {{base_trait_name table.value_ttype.def_bean}}>>::get_base(std::ops::Deref::deref(&row))?; + data_map.insert(key.{{getter_name table.index_field.name}}().clone(), row.clone()); + {{~else~}} + data_map.insert(row.{{table.index_field.name}}.clone(), row.clone()); + {{~end~}} + } + + Ok(std::sync::Arc::new({{name}} { data_map, data_list })) + } + + pub fn get(&self, key: &{{key_type}}) -> Option<{{value_type}}> { + self.data_map.get(key).map(|x| x.clone()) + } +} + +impl std::ops::Index<{{key_type}}> for {{name}} { + type Output = {{value_type}}; + + fn index(&self, index: {{key_type}}) -> &Self::Output { + &self.data_map.get(&index).unwrap() + } +} +{{~else if table.is_list_table ~}} + +impl {{name}} { + pub fn new(mut buf: ByteBuf) -> Result<std::sync::Arc<{{name}}>, LubanError> { + let mut data_list: Vec<{{value_type}}> = vec![]; + + for x in (0..buf.read_size()).rev() { + {{deserialize_row "row" "buf" table.value_ttype}} + data_list.push(row.clone()); + } + {{~if table.is_union_index~}} + let mut data_map_union: {{table_union_map_type_name}} = Default::default(); + for x in &data_list { + data_map_union.insert(({{table_key_list "x"}}.clone()), x.clone()); + } + {{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + let mut data_map_{{idx.index_field.name}}: std::collections::HashMap<{{declaring_type_name idx.index_field.ctype}}, {{value_type}}> = Default::default(); + {{~end~}} + for x in &data_list { + {{~for idx in table.index_list~}} + data_map_{{idx.index_field.name}}.insert(x.{{format_property_name __code_style idx.index_field.name}}.clone(), x.clone()); + {{~end~}} + } + {{~end~}} + + Ok(std::sync::Arc::new({{table.name}} { + data_list, +{{~if table.is_union_index~}} + data_map_union, +{{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + data_map_{{idx.index_field.name}}, + {{~end~}} +{{~end~}} + })) + } + + {{~if table.is_union_index~}} + pub fn get(&self, key: &({{array.each table.index_list @index_type_name | array.join ', '}})) -> Option<{{value_type}}> { + self.data_map_union.get(key).map(|x| x.clone()) + } + {{~else if !table.index_list.empty? ~}} + {{~for idx in table.index_list + index = format_property_name __code_style idx.index_field.name + ~}} + pub fn get_by_{{index}}(&self, key: &{{declaring_type_name idx.type}}) -> Option<{{value_type}}> { + self.data_map_{{index}}.get(key).map(|x| x.clone()) + } + {{~end~}} + {{~end~}} +} +{{~else~}} + +impl {{name}} { + pub fn new(mut buf: ByteBuf) -> Result<std::sync::Arc<{{name}}>, LubanError> { + let n = buf.read_size(); + if n != 1 { return Err(LubanError::Table(format!("table mode=one, but size != 1"))); } + {{deserialize 'data' 'buf' table.value_ttype}} + Ok(std::sync::Arc::new({{name}} { data })) + } +} +{{~end~}} + +{{~end~}} diff --git a/luban/src/Luban.Rust/Templates/rust-bin/toml.sbn b/luban/src/Luban.Rust/Templates/rust-bin/toml.sbn new file mode 100644 index 00000000..6345181f --- /dev/null +++ b/luban/src/Luban.Rust/Templates/rust-bin/toml.sbn @@ -0,0 +1,11 @@ +[package] +name = "{{__name}}" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +bitflags = { version = "2.5.x" , features = ["serde"] } +macros = { path = "../macros" } +luban_lib = { path = "../../luban_lib" } \ No newline at end of file diff --git a/luban/src/Luban.Rust/Templates/rust-json/lib.sbn b/luban/src/Luban.Rust/Templates/rust-json/lib.sbn new file mode 100644 index 00000000..8f906cc1 --- /dev/null +++ b/luban/src/Luban.Rust/Templates/rust-json/lib.sbn @@ -0,0 +1,51 @@ +pub mod prelude{ + pub use crate::*; +{{~ for ns in __ns ~}} + pub use {{ns}}::*; +{{~end~}} +} +{{~ if __polymorphic_beans.count != 0 ~}} + +type AbstractBase = dyn std::any::Any + Sync + Send; + +pub trait GetBase<'a, T> { + fn get_base(&'a self) -> Result<T, LubanError>; +} +{{~end~}} + +#[derive(Debug)] +pub enum LubanError { + Loader(String), + Table(String), + Bean(String), + Polymorphic(String), + Unknown(String), +} + +impl std::fmt::Display for LubanError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(match self { + LubanError::Loader(msg) | + LubanError::Table(msg) | + LubanError::Bean(msg) | + LubanError::Polymorphic(msg) | + LubanError::Unknown(msg) => msg, + }) + } +} + +pub struct Tables{ +{{~ for table in __tables ~}} + pub {{table.name}}: std::sync::Arc<{{full_name table}}>, +{{~end~}} +} + +impl Tables { + pub fn new<T: Fn(&str) -> Result<serde_json::Value, LubanError>>(loader: T) -> Result<Tables, LubanError> { + Ok(Tables { +{{~ for table in __tables ~}} + {{table.name}}: {{full_name table}}::new(&loader("{{table.output_data_file}}")?)?, +{{~end~}} + }) + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/Templates/rust-json/mod.sbn b/luban/src/Luban.Rust/Templates/rust-json/mod.sbn new file mode 100644 index 00000000..fc2f0be4 --- /dev/null +++ b/luban/src/Luban.Rust/Templates/rust-json/mod.sbn @@ -0,0 +1,287 @@ +{{~ for mod in __mod.sub_mods ~}} +pub mod {{mod.name}}; +{{~end~}} + +{{~ if __mod.name != '' ~}} +use super::*; +{{~end~}} +use serde::Deserialize; + +{{~ for enum in __mod.enums ~}} +{{~ if enum.comment != '' ~}} +///{{enum.comment | html.escape}} +{{~end~}} +{{~ if enum.is_flags ~}} +bitflags::bitflags!{ + #[derive(Debug, Hash, Eq, PartialEq)] + pub struct {{enum.name}} : u32 { + {{~ for item in enum.items ~}} + {{~if item.comment_or_alias != '' ~}} + ///{{item.comment_or_alias | html.escape}} + {{~end~}} + const {{item.name}} = {{item.int_value}}; + {{~end~}} + } +} +{{~else~}} +#[derive(Deserialize, Debug, Hash, Eq, PartialEq, macros::EnumFromNum)] +pub enum {{enum.name}} { + {{~ for item in enum.items ~}} +{{~if item.comment_or_alias != '' ~}} + ///{{item.comment_or_alias | html.escape}} +{{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} + {{~if enum.items.empty?~}} + None + {{~end~}} +} + +impl From<i32> for {{enum.name}} { + fn from(value: i32) -> Self { + match value { + {{~ for item in enum.items ~}} + {{item.value}} => {{enum.name}}::{{item.name}}, + {{~end~}} + _ => panic!("Invalid value for {{enum.name}}:{}", value), + } + } +} + +{{~end~}} +{{~end~}} +{{~ for bean in __mod.beans + hierarchy_fields = bean.hierarchy_export_fields +~}} +#[derive(Debug)] +{{~if bean.parent != ''~}} +#[derive(macros::TryIntoBase)] +{{~end~}} +pub struct {{bean.name}} { + {{~ for field in hierarchy_fields ~}} +{{~if field.comment != '' ~}} + /// {{escape_comment field.comment}} +{{~end~}} + pub {{field.name}}: {{declaring_type_name field.ctype}}, + {{~end~}} +} +{{~if bean.is_abstract_type~}} + +impl {{bean.name}} { + pub fn new(json: &serde_json::Value) -> Result<std::sync::Arc<AbstractBase>, LubanError> { + let type_id = json["$type"].as_str().unwrap(); + match type_id { + {{~for child in bean.hierarchy_not_abstract_children~}} + "{{impl_data_type child bean}}" => Ok(std::sync::Arc::new({{full_name child}}::new(json)?)), + {{~end~}} + _ => Err(LubanError::Bean(format!("Invalid type for {{bean.name}}:{}", type_id))) + } + } +} + +pub trait T{{bean.name}} { + {{~ for field in hierarchy_fields ~}} + fn {{getter_name field.name}}(&self) -> &{{declaring_type_name field.ctype}}; + {{~end~}} +} +{{~for child in bean.hierarchy_not_abstract_children~}} + +impl {{base_trait_name bean}} for {{full_name child}} { + {{~ for field in hierarchy_fields ~}} + fn {{getter_name field.name}}(&self) -> &{{declaring_type_name field.ctype}} { + &self.{{field.name}} + } + {{~end~}} +} +{{~end~}} + +impl<'a> GetBase<'a, &'a dyn {{base_trait_name bean}}> for AbstractBase { + fn get_base(&'a self) -> Result<&'a dyn {{base_trait_name bean}}, LubanError> { + {{~for child in bean.hierarchy_not_abstract_children~}} + let base: Result<&{{full_name child}}, _> = self.try_into(); + if let Ok(r) = base { + return Ok(r); + } + {{~end~}} + + Err(LubanError::Polymorphic(format!("Invalid type for {{bean.name}}"))) + } +} +{{~else~}} + +impl {{bean.name}}{ + pub fn new(json: &serde_json::Value) -> Result<{{bean.name}}, LubanError> { + {{~ for field in hierarchy_fields ~}} + {{deserialize_field field.name 'json' field.ctype}} + {{~end~}} + + Ok({{bean.name}} { {{ for field in hierarchy_fields }}{{field.name}}, {{end}}}) + } +} +{{~end~}} + +{{~end~}} +{{~ for table in __mod.tables + key_type = declaring_type_name table.key_ttype + if table.value_ttype.def_bean.is_abstract_type + value_type = declaring_type_name table.value_ttype + else + value_type = "std::sync::Arc<"+declaring_type_name table.value_ttype+">" + end + name = table.name + map_type = "std::collections::HashMap<"+key_type+", "+value_type+">" +~}} +{{ + + func index_type_name + ret (declaring_type_name $0.type) + end + + func table_union_map_type_name + ret 'std::collections::HashMap<(' + (array.each table.index_list @index_type_name | array.join ', ') + '), ' + value_type + '>' + end + + func table_key_list + varName = $0 + indexList = table.index_list |array.each do; ret varName + '.' + (format_property_name __code_style $0.index_field.name); end; + ret array.join indexList ', ' + end + + func table_param_def_list + paramList = table.index_list |array.each do; ret (declaring_type_name $0.type) + ' ' + $0.index_field.name; end + ret array.join paramList ', ' + end + + func table_param_name_list + paramList = table.index_list |array.each do; ret $0.index_field.name; end + ret array.join paramList ', ' + end +}} +{{~ if table.comment != '' ~}} +///{{table.comment | html.escape}} +{{~end~}} +#[derive(Debug)] +pub struct {{table.name}} { + {{~if table.is_map_table ~}} + pub data_list: Vec<{{value_type}}>, + pub data_map: {{map_type}}, + {{~else if table.is_list_table ~}} + pub data_list: Vec<{{value_type}}>, + {{~if table.is_union_index~}} + pub data_map_union: {{table_union_map_type_name}}, + {{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + pub data_map_{{idx.index_field.name}}: std::collections::HashMap<{{declaring_type_name idx.type}}, {{value_type}}>, + {{~end~}} + {{~end~}} + {{~else~}} + pub data: {{declaring_type_name table.value_ttype}}, + {{~end~}} +} +{{~if table.is_map_table ~}} + +impl {{name}} { + pub fn new(json: &serde_json::Value) -> Result<std::sync::Arc<{{name}}>, LubanError> { + let mut data_map: {{map_type}} = Default::default(); + let mut data_list: Vec<{{value_type}}> = vec![]; + + for x in json.as_array().unwrap() { + {{~ if table.value_ttype.is_bean ~}} + {{deserialize_row "row" "x" table.value_ttype}} + {{~else~}} + let row: {{value_type}} = std::sync::Arc::new(serde_json::from_value(x.clone()).unwrap()); + {{~end~}} + data_list.push(row.clone()); + {{~ if table.value_ttype.def_bean.is_abstract_type ~}} + let key = <AbstractBase as GetBase<&dyn {{base_trait_name table.value_ttype.def_bean}}>>::get_base(std::ops::Deref::deref(&row))?; + data_map.insert(key.{{getter_name table.index_field.name}}().clone(), row.clone()); + {{~else~}} + data_map.insert(row.{{table.index_field.name}}.clone(), row.clone()); + {{~end~}} + } + + Ok(std::sync::Arc::new({{name}} { data_map, data_list })) + } + + pub fn get(&self, key: &{{key_type}}) -> Option<{{value_type}}> { + self.data_map.get(key).map(|x| x.clone()) + } +} + +impl std::ops::Index<{{key_type}}> for {{name}} { + type Output = {{value_type}}; + + fn index(&self, index: {{key_type}}) -> &Self::Output { + &self.data_map.get(&index).unwrap() + } +} +{{~else if table.is_list_table ~}} + +impl {{name}} { + pub fn new(json: &serde_json::Value) -> Result<std::sync::Arc<{{name}}>, LubanError> { + let mut data_list: Vec<{{value_type}}> = vec![]; + + for x in json.as_array().unwrap() { + {{~ if table.value_ttype.is_bean ~}} + {{deserialize_row "row" "x" table.value_ttype}} + {{~else~}} + let row: {{value_type}} = std::sync::Arc::new(serde_json::from_value(x.clone()).unwrap()); + {{~end~}} + data_list.push(row.clone()); + } + {{~if table.is_union_index~}} + let mut data_map_union: {{table_union_map_type_name}} = Default::default(); + for x in &data_list { + data_map_union.insert(({{table_key_list "x"}}.clone()), x.clone()); + } + {{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + let mut data_map_{{idx.index_field.name}}: std::collections::HashMap<{{declaring_type_name idx.index_field.ctype}}, {{value_type}}> = Default::default(); + {{~end~}} + for x in &data_list { + {{~for idx in table.index_list~}} + data_map_{{idx.index_field.name}}.insert(x.{{format_property_name __code_style idx.index_field.name}}.clone(), x.clone()); + {{~end~}} + } + {{~end~}} + + Ok(std::sync::Arc::new({{table.name}} { + data_list, +{{~if table.is_union_index~}} + data_map_union, +{{~else if !table.index_list.empty?~}} + {{~for idx in table.index_list~}} + data_map_{{idx.index_field.name}}, + {{~end~}} +{{~end~}} + })) + } + + {{~if table.is_union_index~}} + pub fn get(&self, key: &({{array.each table.index_list @index_type_name | array.join ', '}})) -> Option<{{value_type}}> { + self.data_map_union.get(key).map(|x| x.clone()) + } + {{~else if !table.index_list.empty? ~}} + {{~for idx in table.index_list + index = format_property_name __code_style idx.index_field.name + ~}} + pub fn get_by_{{index}}(&self, key: &{{declaring_type_name idx.type}}) -> Option<{{value_type}}> { + self.data_map_{{index}}.get(key).map(|x| x.clone()) + } + {{~end~}} + {{~end~}} +} +{{~else~}} + +impl {{name}} { + pub fn new(json: &serde_json::Value) -> Result<std::sync::Arc<{{name}}>, LubanError> { + let json = json.as_array().unwrap(); + let n = json.len(); + if n != 1 { return Err(LubanError::Table(format!("table mode=one, but size != 1"))); } + let data = {{full_name table.value_ttype.def_bean}}::new(&json[0])?; + Ok(std::sync::Arc::new({{name}} { data })) + } +} +{{~end~}} + +{{~end~}} diff --git a/luban/src/Luban.Rust/Templates/rust-json/toml.sbn b/luban/src/Luban.Rust/Templates/rust-json/toml.sbn new file mode 100644 index 00000000..40870c70 --- /dev/null +++ b/luban/src/Luban.Rust/Templates/rust-json/toml.sbn @@ -0,0 +1,12 @@ +[package] +name = "{{__name}}" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde = { version = "1.0.x", features = ["derive"] } +serde_json = "1.0.x" +bitflags = { version = "2.5.x" , features = ["serde"]} +macros = {path = "../macros"} \ No newline at end of file diff --git a/luban/src/Luban.Rust/TypeVisitors/BinaryUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Rust/TypeVisitors/BinaryUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..7ae647eb --- /dev/null +++ b/luban/src/Luban.Rust/TypeVisitors/BinaryUnderlyingDeserializeVisitor.cs @@ -0,0 +1,106 @@ +using Luban.Rust; +using Luban.Rust.TemplateExtensions; +using Luban.Rust.TypeVisitors; +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.CSharp.TypeVisitors; + +public class BinaryUnderlyingDeserializeVisitor : ITypeFuncVisitor<string, string, int, string> +{ + public static BinaryUnderlyingDeserializeVisitor Ins { get; } = new(); + + public string Accept(TBool type, string bufName, string fieldName, int depth) + { + return $"{bufName}.read_bool()"; + } + + public string Accept(TByte type, string bufName, string fieldName, int depth) + { + return $"{bufName}.read_byte()"; + } + + public string Accept(TShort type, string bufName, string fieldName, int depth) + { + return $"{bufName}.read_short()"; + } + + public string Accept(TInt type, string bufName, string fieldName, int depth) + { + return $"{bufName}.read_int()"; + } + + public string Accept(TLong type, string bufName, string fieldName, int depth) + { + return $"{bufName}.read_long()"; + } + + public string Accept(TFloat type, string bufName, string fieldName, int depth) + { + return $"{bufName}.read_float()"; + } + + public string Accept(TDouble type, string bufName, string fieldName, int depth) + { + return $"{bufName}.read_double()"; + } + + public string Accept(TEnum type, string bufName, string fieldName, int depth) + { + return type.DefEnum.IsFlags + ? $"{type.Apply(RustDeclaringTypeNameVisitor.Ins)}::from_bits_truncate({bufName}.read_uint())" + : $"{bufName}.read_int().into()"; + } + + public string Accept(TString type, string bufName, string fieldName, int depth) + { + return $"{bufName}.read_string()"; + } + + public string Accept(TDateTime type, string bufName, string fieldName, int depth) + { + return $"{bufName}.read_ulong()"; + } + + public string Accept(TBean type, string bufName, string fieldName, int depth) + { + return type.DefBean.IsAbstractType + ? $"{RustCommonTemplateExtension.FullName(type.DefBean)}::new(&mut {bufName})?" + : $"{type.Apply(RustDeclaringTypeNameVisitor.Ins)}::new(&mut {bufName})?"; + } + + public string Accept(TArray type, string bufName, string fieldName, int depth) + { + string n = $"n{depth}"; + string e = $"_e{depth}"; + string i = $"i{depth}"; + return $"{{let {n} = std::cmp::min({bufName}.read_size(), {bufName}.size());let mut {e} = vec![]; for {i} in 0..{n} {{ {e}.push({type.ElementType.Apply(this, bufName, $"{e}", depth + 1)}); }} {e} }}"; + } + + public string Accept(TList type, string bufName, string fieldName, int depth) + { + string n = $"n{depth}"; + string e = $"_e{depth}"; + string i = $"i{depth}"; + return $"{{let {n} = std::cmp::min({bufName}.read_size(), {bufName}.size());let mut {e} = vec![]; for {i} in 0..{n} {{ {e}.push({type.ElementType.Apply(this, bufName, $"{e}", depth + 1)}); }} {e} }}"; + } + + public string Accept(TSet type, string bufName, string fieldName, int depth) + { + string n = $"n{depth}"; + string e = $"_e{depth}"; + string i = $"i{depth}"; + return $"{{let {n} = std::cmp::min({bufName}.read_size(), {bufName}.size());let mut {e} = {ConstantStrings.SetType}::default(); for {i} in 0..{n} {{ {e}.insert({type.ElementType.Apply(this, bufName, $"{e}", depth + 1)}); }} {e} }}"; + } + + public string Accept(TMap type, string bufName, string fieldName, int depth) + { + string n = $"n{depth}"; + string e = $"_e{depth}"; + string k = $"_k{depth}"; + string v = $"_v{depth}"; + string i = $"i{depth}"; + return $"{{let {n} = std::cmp::min({bufName}.read_size(), {bufName}.size()); let mut {e} = {ConstantStrings.MapType}::with_capacity({n} * 3 / 2);for {i} in 0..{n} {{ let {k} = {type.KeyType.Apply(this, bufName, k, depth + 1)}; let {v} = {type.ValueType.Apply(this, bufName, v, depth + 1)}; {e}.insert({k}, {v});}} {e} }}"; + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/TypeVisitors/RustDeclaringBoxTypeNameVisitor.cs b/luban/src/Luban.Rust/TypeVisitors/RustDeclaringBoxTypeNameVisitor.cs new file mode 100644 index 00000000..255bd07d --- /dev/null +++ b/luban/src/Luban.Rust/TypeVisitors/RustDeclaringBoxTypeNameVisitor.cs @@ -0,0 +1,15 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Rust.TypeVisitors; + +public class RustDeclaringBoxTypeNameVisitor : DecoratorFuncVisitor<string> +{ + public static readonly RustDeclaringBoxTypeNameVisitor Ins = new(); + + public override string DoAccept(TType type) + { + var origin = type.Apply(RustDeclaringTypeNameVisitor.Ins); + return type.IsNullable ? $"Option<{origin}>" : origin; + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/TypeVisitors/RustDeclaringTypeNameVisitor.cs b/luban/src/Luban.Rust/TypeVisitors/RustDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..90a10a08 --- /dev/null +++ b/luban/src/Luban.Rust/TypeVisitors/RustDeclaringTypeNameVisitor.cs @@ -0,0 +1,87 @@ +using Luban.Types; +using Luban.TypeVisitors; +using Luban.Utils; + +namespace Luban.Rust.TypeVisitors; + +public class RustDeclaringTypeNameVisitor : ITypeFuncVisitor<string> +{ + public static readonly RustDeclaringTypeNameVisitor Ins = new(); + + public string Accept(TBool type) + { + return "bool"; + } + + public string Accept(TByte type) + { + return "u8"; + } + + public string Accept(TShort type) + { + return "i16"; + } + + public string Accept(TInt type) + { + return "i32"; + } + + public string Accept(TLong type) + { + return "i64"; + } + + public string Accept(TFloat type) + { + return "f32"; + } + + public string Accept(TDouble type) + { + return "f64"; + } + + public string Accept(TEnum type) + { + return $"crate::{(type.DefEnum.TypeNameWithTypeMapper() ?? type.DefEnum.FullName).Replace(".", "::")}"; + } + + public string Accept(TString type) + { + return "String"; + } + + public string Accept(TDateTime type) + { + return "u64"; + } + + public string Accept(TBean type) + { + return type.DefBean.IsAbstractType + ? "std::sync::Arc<AbstractBase>" + : $"crate::{(type.DefBean.TypeNameWithTypeMapper() ?? type.DefBean.FullName).Replace(".", "::")}"; + } + + public string Accept(TArray type) + { + return $"Vec<{type.ElementType.Apply(this)}>"; + } + + public string Accept(TList type) + { + return $"Vec<{type.ElementType.Apply(this)}>"; + } + + public string Accept(TSet type) + { + return $"std::collections::HashSet<{type.ElementType.Apply(this)}>"; + } + + public string Accept(TMap type) + { + return $"std::collections::HashMap<{type.KeyType.Apply(this)}, {type.ValueType.Apply(this)}>"; + } +} \ No newline at end of file diff --git a/luban/src/Luban.Rust/TypeVisitors/RustJsonUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Rust/TypeVisitors/RustJsonUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..dc8972e7 --- /dev/null +++ b/luban/src/Luban.Rust/TypeVisitors/RustJsonUnderlyingDeserializeVisitor.cs @@ -0,0 +1,89 @@ +using Luban.Rust.TemplateExtensions; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Rust.TypeVisitors; + +public class RustJsonUnderlyingDeserializeVisitor : ITypeFuncVisitor<string, string, int, string> +{ + public static readonly RustJsonUnderlyingDeserializeVisitor Ins = new(); + + public string Accept(TBool type, string json, string field, int depth) + { + return $"{json}.as_bool().unwrap()"; + } + + public string Accept(TByte type, string json, string field, int depth) + { + return $"({json}.as_u64().unwrap() as u8)"; + } + + public string Accept(TShort type, string json, string field, int depth) + { + return $"({json}.as_i64().unwrap() as i16)"; + } + + public string Accept(TInt type, string json, string field, int depth) + { + return $"({json}.as_i64().unwrap() as i32)"; + } + + public string Accept(TLong type, string json, string field, int depth) + { + return $"{json}.as_i64().unwrap()"; + } + + public string Accept(TFloat type, string json, string field, int depth) + { + return $"({json}.as_f64().unwrap() as f32)"; + } + + public string Accept(TDouble type, string json, string field, int depth) + { + return $"{json}.as_f64().unwrap()"; + } + + public string Accept(TEnum type, string json, string field, int depth) + { + return type.DefEnum.IsFlags + ? $"{type.Apply(RustDeclaringTypeNameVisitor.Ins)}::from_bits_truncate(<u32 as std::str::FromStr>::from_str(&{json}.to_string()).unwrap())" + : $"{json}.as_i64().unwrap().into()"; + } + + public string Accept(TString type, string json, string field, int depth) + { + return $"{json}.as_str().unwrap().to_string()"; + } + + public string Accept(TDateTime type, string json, string field, int depth) + { + return $"({json}.as_i64().unwrap() as u64)"; + } + + public string Accept(TBean type, string json, string field, int depth) + { + return type.DefBean.IsAbstractType + ? $"{RustCommonTemplateExtension.FullName(type.DefBean)}::new(&{json})?" + : $"{type.Apply(RustDeclaringTypeNameVisitor.Ins)}::new(&{json})?"; + } + + public string Accept(TArray type, string json, string field, int depth) + { + return $"{json}.as_array().unwrap().iter().map(|field| {type.ElementType.Apply(this, "field", "_temp", depth + 1)}).collect()".Replace("?", ".unwrap()"); + } + + public string Accept(TList type, string json, string field, int depth) + { + return $"{json}.as_array().unwrap().iter().map(|field| {type.ElementType.Apply(this, "field", "_temp", depth + 1)}).collect()".Replace("?", ".unwrap()"); + } + + public string Accept(TSet type, string json, string field, int depth) + { + return $"{json}.as_array().unwrap().iter().map(|field| {type.ElementType.Apply(this, "field", "_temp", depth + 1)}).collect()".Replace("?", ".unwrap()"); + } + + public string Accept(TMap type, string json, string field, int depth) + { + return $"std::collections::HashMap::from_iter({json}.as_array().unwrap().iter().map(|x| {{let array = x.as_array().unwrap();({type.KeyType.Apply(this, "array[0]", "", depth + 1)}, {type.ElementType.Apply(this, "array[1]", "", depth + 1)})}}).collect::<Vec<({type.KeyType.Apply(RustDeclaringBoxTypeNameVisitor.Ins)}, {type.ElementType.Apply(RustDeclaringBoxTypeNameVisitor.Ins)})>>())".Replace("?", ".unwrap()"); + } +} \ No newline at end of file diff --git a/luban/src/Luban.Schema.Builtin/AssemblyInfo.cs b/luban/src/Luban.Schema.Builtin/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Schema.Builtin/AutoTableImporter.cs b/luban/src/Luban.Schema.Builtin/AutoTableImporter.cs new file mode 100644 index 00000000..2ac89b25 --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/AutoTableImporter.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.Schema.Builtin; + +public class AutoTableImporter +{ +} diff --git a/luban/src/Luban.Schema.Builtin/BeanSchemaFromExcelHeaderLoader.cs b/luban/src/Luban.Schema.Builtin/BeanSchemaFromExcelHeaderLoader.cs new file mode 100644 index 00000000..2dee30ea --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/BeanSchemaFromExcelHeaderLoader.cs @@ -0,0 +1,146 @@ +using Luban.DataLoader.Builtin.Excel; +using Luban.Defs; +using Luban.RawDefs; +using Luban.Utils; + +namespace Luban.Schema.Builtin; + +[BeanSchemaLoader("default")] +public class BeanSchemaFromExcelHeaderLoader : IBeanSchemaLoader +{ + public RawBean Load(string fileName, string beanFullName, RawTable table) + { + return LoadTableValueTypeDefineFromFile(fileName, beanFullName, table); + } + + public static RawBean LoadTableValueTypeDefineFromFile(string fileName, string valueTypeFullName, RawTable table) + { + var valueTypeNamespace = TypeUtil.GetNamespace(valueTypeFullName); + string valueTypeName = TypeUtil.GetName(valueTypeFullName); + var cb = new RawBean() + { + Namespace = valueTypeNamespace, + Name = valueTypeName, + Comment = "", + Parent = "", + Groups = new(), + Fields = new(), + }; + + + (var actualFile, var sheetName) = FileUtil.SplitFileAndSheetName(FileUtil.Standardize(fileName)); + + if (!File.Exists(actualFile)) + { + if (Directory.Exists(fileName)) + { + var files = FileUtil.GetFileOrDirectory(fileName); + var firstExcelFile = files.FirstOrDefault(f => FileUtil.IsExcelFile(f)); + if (firstExcelFile == null) + { + throw new Exception($"table: '{table.Name}' valueType:'{valueTypeFullName}' directory:'{fileName}', 当table的ReadSchemaFromFile为true时,目录下必须有excel文件"); + } + actualFile = firstExcelFile; + } + else + { + throw new Exception($"table '{table.Name}' intput path:'{fileName}' not found"); + } + } + else if (!FileUtil.IsExcelFile(actualFile)) + { + throw new Exception($"table: '{table.Name}' valueType:'{valueTypeFullName}' file:'{fileName}',当table的ReadSchemaFromFile为true时,文件必须是excel文件"); + } + + using var inputStream = new FileStream(actualFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + + var tableDefInfo = SheetLoadUtil.LoadSheetTableDefInfo(actualFile, sheetName, inputStream); + + foreach (var (name, f) in tableDefInfo.FieldInfos) + { + if (name.Contains('@')) + { + var splitName = name.Split('@'); + if (splitName.Length != 2) + { + throw new Exception($"file:{fileName} title:'{name}' is invalid!"); + } + string actualName = splitName[0]; + string variantName = splitName[1]; + RawField rawField = cb.Fields.Find(f => f.Name == actualName); + if (rawField == null) + { + throw new Exception($"file:{fileName} field:{actualName} not found for variant field:'{name}' not found!"); + } + rawField.Variants.Add(variantName); + continue; + } + + var cf = new RawField() + { + Name = name, + Groups = new List<string>(), + Variants = new List<string>(), + }; + + string[] attrs = f.Type.Trim().Split('&').Select(s => s.Trim()).ToArray(); + + if (attrs.Length == 0 || string.IsNullOrWhiteSpace(attrs[0])) + { + throw new Exception($"file:{fileName} title:'{name}' type missing!"); + } + + cf.Comment = f.Desc; + cf.Type = attrs[0]; + for (int i = 1; i < attrs.Length; i++) + { + var pair = attrs[i].Split('=', 2); + if (pair.Length != 2) + { + throw new Exception($"file:{fileName} title:'{name}' attr:'{attrs[i]}' is invalid!"); + } + var attrName = pair[0].Trim(); + var attrValue = pair[1].Trim(); + switch (attrName) + { + case "index": + case "ref": + case "path": + case "range": + case "sep": + case "regex": + { + throw new Exception($"file:{fileName} title:'{name}' attr:'{attrName}' 属于type的属性,必须用#分割,尝试'{cf.Type}#{attrs[i]}'"); + } + case "group": + { + cf.Groups = attrValue.Split(',').Select(s => s.Trim()).Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + break; + } + case "comment": + { + cf.Comment = attrValue; + break; + } + case "tags": + { + cf.Tags = DefUtil.ParseAttrs(attrValue); + break; + } + default: + { + throw new Exception($"file:{fileName} title:'{name}' attr:'{attrs[i]}' is invalid!"); + } + } + } + + if (!string.IsNullOrEmpty(f.Groups)) + { + cf.Groups = f.Groups.Split(',').Select(s => s.Trim()).Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + } + + cb.Fields.Add(cf); + } + return cb; + } +} diff --git a/luban/src/Luban.Schema.Builtin/DefaultSchemaCollector.cs b/luban/src/Luban.Schema.Builtin/DefaultSchemaCollector.cs new file mode 100644 index 00000000..031b5542 --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/DefaultSchemaCollector.cs @@ -0,0 +1,65 @@ +using Luban.RawDefs; +using Luban.Utils; + +namespace Luban.Schema.Builtin; + +[SchemaCollector("default")] +public class DefaultSchemaCollector : SchemaCollectorBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private LubanConfig _config; + + public override void Load(LubanConfig config) + { + _config = config; + + foreach (var importFile in _config.Imports) + { + s_logger.Debug("import schema file:{} type:{}", importFile.FileName, importFile.Type); + var schemaLoader = SchemaManager.Ins.CreateSchemaLoader(FileUtil.GetExtensionWithDot(importFile.FileName), importFile.Type, this); + schemaLoader.Load(importFile.FileName); + } + + LoadTablesFromTableImporter(); + LoadTableValueTypeSchemasFromFile(); + } + + public override RawAssembly CreateRawAssembly() + { + return CreateRawAssembly(_config); + } + + private void LoadTableValueTypeSchemasFromFile() + { + var tasks = new List<Task>(); + string beanSchemaLoaderName = EnvManager.Current.GetOptionOrDefault(BuiltinOptionNames.SchemaCollectorFamily, "beanSchemaLoader", true, "default"); + foreach (var table in Tables.Where(t => t.ReadSchemaFromFile)) + { + tasks.Add(Task.Run(() => + { + string fileName = table.InputFiles[0]; + IBeanSchemaLoader schemaLoader = SchemaManager.Ins.CreateBeanSchemaLoader(beanSchemaLoaderName); + string fullPath = $"{GenerationContext.GetInputDataPath()}/{fileName}"; + RawBean bean = schemaLoader.Load(fullPath, table.ValueType, table); + bean.Groups = new List<string>(table.Groups); + Add(bean); + })); + } + Task.WaitAll(tasks.ToArray()); + } + + private void LoadTablesFromTableImporter() + { + string tableImporterName = EnvManager.Current.GetOptionOrDefault("tableImporter", "name", false, "default"); + if (string.IsNullOrWhiteSpace(tableImporterName) || tableImporterName == "none") + { + return; + } + ITableImporter tableImporter = SchemaManager.Ins.CreateTableImporter(tableImporterName); + foreach (var table in tableImporter.LoadImportTables()) + { + Add(table); + } + } +} diff --git a/luban/src/Luban.Schema.Builtin/DefaultTableImporter.cs b/luban/src/Luban.Schema.Builtin/DefaultTableImporter.cs new file mode 100644 index 00000000..e56652a3 --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/DefaultTableImporter.cs @@ -0,0 +1,79 @@ +using Luban.Defs; +using Luban.RawDefs; +using Luban.Utils; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace Luban.Schema.Builtin; + +[TableImporter("default")] +public class DefaultTableImporter : ITableImporter +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public List<RawTable> LoadImportTables() + { + string dataDir = GenerationContext.GlobalConf.InputDataDir; + + string fileNamePatternStr = EnvManager.Current.GetOptionOrDefault("tableImporter", "filePattern", false, "#(.*)"); + string tableNamespaceFormatStr = EnvManager.Current.GetOptionOrDefault("tableImporter", "tableNamespaceFormat", false, "{0}"); + string tableNameFormatStr = EnvManager.Current.GetOptionOrDefault("tableImporter", "tableNameFormat", false, "Tb{0}"); + string valueTypeNameFormatStr = EnvManager.Current.GetOptionOrDefault("tableImporter", "valueTypeNameFormat", false, "{0}"); + var fileNamePattern = new Regex(fileNamePatternStr); + var excelExts = new HashSet<string> { "xlsx", "xls", "xlsm", "csv" }; + + var tables = new List<RawTable>(); + foreach (string file in Directory.GetFiles(dataDir, "*", SearchOption.AllDirectories)) + { + if (FileUtil.IsIgnoreFile(file)) + { + continue; + } + string fileName = Path.GetFileName(file); + string ext = Path.GetExtension(fileName).TrimStart('.'); + if (!excelExts.Contains(ext)) + { + continue; + } + string fileNameWithoutExt = Path.GetFileNameWithoutExtension(fileName); + var match = fileNamePattern.Match(fileNameWithoutExt); + if (!match.Success || match.Groups.Count <= 1) + { + continue; + } + + string relativePath = file.Substring(dataDir.Length + 1).TrimStart('\\').TrimStart('/'); + string namespaceFromRelativePath = Path.GetDirectoryName(relativePath).Replace('/', '.').Replace('\\', '.'); + + string rawTableFullName = match.Groups[1].Value; + string rawTableNamespace = TypeUtil.GetNamespace(rawTableFullName); + string rawTableName = TypeUtil.GetName(rawTableFullName); + string tableNamespace = TypeUtil.MakeFullName(namespaceFromRelativePath, string.Format(tableNamespaceFormatStr, rawTableNamespace)); + string tableName = string.Format(tableNameFormatStr, rawTableName); + string valueTypeFullName = TypeUtil.MakeFullName(tableNamespace, string.Format(valueTypeNameFormatStr, rawTableName)); + + var table = new RawTable() + { + Namespace = tableNamespace, + Name = tableName, + Index = "", + ValueType = valueTypeFullName, + ReadSchemaFromFile = true, + Mode = TableMode.MAP, + Comment = "", + Groups = new List<string> { }, + InputFiles = new List<string> { relativePath }, + OutputFile = "", + }; + s_logger.Debug("import table file:{@}", table); + tables.Add(table); + } + + + return tables; + } +} diff --git a/luban/src/Luban.Schema.Builtin/ExcelSchemaLoader.cs b/luban/src/Luban.Schema.Builtin/ExcelSchemaLoader.cs new file mode 100644 index 00000000..3ed50599 --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/ExcelSchemaLoader.cs @@ -0,0 +1,318 @@ +using System.Xml.Linq; +using Luban.DataLoader; +using Luban.DataLoader.Builtin.Excel; +using Luban.Datas; +using Luban.Defs; +using Luban.RawDefs; +using Luban.Types; +using Luban.Utils; + +namespace Luban.Schema.Builtin; + +[SchemaLoader("table", "xlsx", "xls", "xlsm", "csv")] +[SchemaLoader("bean", "xlsx", "xls", "xlsm", "csv")] +[SchemaLoader("enum", "xlsx", "xls", "xlsm", "csv")] +public class ExcelSchemaLoader : SchemaLoaderBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + public override void Load(string fileName) + { + switch (Type) + { + case "table": + LoadTableListFromFile(fileName); + break; + case "bean": + LoadBeanListFromFile(fileName); + break; + case "enum": + LoadEnumListFromFile(fileName); + break; + default: + throw new Exception($"unknown type:{Type}"); + } + } + + + private void LoadTableListFromFile(string fileName) + { + var defTableRecordType = new DefBean(new RawBean() + { + Namespace = "__intern__", + Name = "__TableRecord__", + Parent = "", + Alias = "", + IsValueType = false, + Sep = "", + Fields = new List<RawField> + { + new() { Name = "full_name", Type = "string" }, + new() { Name = "value_type", Type = "string" }, + new() { Name = "index", Type = "string" }, + new() { Name = "mode", Type = "string" }, + new() { Name = "group", Type = "string" }, + new() { Name = "comment", Type = "string" }, + new() { Name = "read_schema_from_file", Type = "bool" }, + new() { Name = "input", Type = "string" }, + new() { Name = "output", Type = "string" }, + new() { Name = "tags", Type = "string" }, + } + }) + { + Assembly = new DefAssembly(new RawAssembly() + { + Targets = new List<RawTarget> { new() { Name = "default", Manager = "Tables" } }, + }, "default", new List<string>(), null, null), + }; + defTableRecordType.PreCompile(); + defTableRecordType.Compile(); + defTableRecordType.PostCompile(); + var tableRecordType = TBean.Create(false, defTableRecordType, null); + + (var actualFile, var sheetName) = FileUtil.SplitFileAndSheetName(FileUtil.Standardize(fileName)); + var records = DataLoaderManager.Ins.LoadTableFile(tableRecordType, actualFile, sheetName, new Dictionary<string, string>()); + foreach (var r in records) + { + DBean data = r.Data; + //s_logger.Info("== read text:{}", r.Data); + string fullName = (data.GetField("full_name") as DString).Value.Trim(); + string name = TypeUtil.GetName(fullName); + if (string.IsNullOrWhiteSpace(fullName) || string.IsNullOrWhiteSpace(name)) + { + throw new Exception($"file:{actualFile} 定义了一个空的table类名"); + } + string module = TypeUtil.GetNamespace(fullName); + string valueType = (data.GetField("value_type") as DString).Value.Trim(); + string index = (data.GetField("index") as DString).Value.Trim(); + string mode = (data.GetField("mode") as DString).Value.Trim(); + string group = (data.GetField("group") as DString).Value.Trim(); + string comment = (data.GetField("comment") as DString).Value.Trim(); + bool readSchemaFromFile = (data.GetField("read_schema_from_file") as DBool).Value; + if (readSchemaFromFile && string.IsNullOrEmpty(TypeUtil.GetNamespace(valueType))) + { + valueType = TypeUtil.MakeFullName(module, valueType); + } + string inputFile = (data.GetField("input") as DString).Value.Trim(); + // string patchInput = (data.GetField("patch_input") as DString).Value.Trim(); + string tags = (data.GetField("tags") as DString).Value.Trim(); + string outputFile = (data.GetField("output") as DString).Value.Trim(); + // string options = (data.GetField("options") as DString).Value.Trim(); + var table = SchemaLoaderUtil.CreateTable(fileName, name, module, valueType, index, mode, group, comment, readSchemaFromFile, inputFile, tags, outputFile); + Collector.Add(table); + }; + } + + private void LoadEnumListFromFile(string fileName) + { + var ass = new DefAssembly(new RawAssembly() + { + Targets = new List<RawTarget> { new() { Name = "default", Manager = "Tables" } }, + }, "default", new List<string>(), null, null); + + var enumItemType = new DefBean(new RawBean() + { + Namespace = "__intern__", + Name = "__EnumItem__", + Parent = "", + Alias = "", + IsValueType = false, + Sep = "", + Fields = new List<RawField> + { + new() { Name = "name", Type = "string" }, + new() { Name = "alias", Type = "string" }, + new() { Name = "value", Type = "string" }, + new() { Name = "comment", Type = "string" }, + new() { Name = "tags", Type = "string" }, + } + }) + { + Assembly = ass, + }; + ass.AddType(enumItemType); + enumItemType.PreCompile(); + enumItemType.Compile(); + enumItemType.PostCompile(); + + var defTableRecordType = new DefBean(new RawBean() + { + Namespace = "__intern__", + Name = "__EnumInfo__", + Parent = "", + Alias = "", + IsValueType = false, + Sep = "", + Fields = new List<RawField> + { + new() { Name = "full_name", Type = "string" }, + new() { Name = "comment", Type = "string" }, + new() { Name = "flags", Type = "bool" }, + new() { Name = "group", Type = "string" }, + new() { Name = "tags", Type = "string" }, + new() { Name = "unique", Type = "bool" }, + new() { Name = "items", Type = "list,__EnumItem__" }, + } + }) + { + Assembly = ass, + }; + ass.AddType(defTableRecordType); + defTableRecordType.PreCompile(); + defTableRecordType.Compile(); + defTableRecordType.PostCompile(); + var tableRecordType = TBean.Create(false, defTableRecordType, null); + + (var actualFile, var sheetName) = FileUtil.SplitFileAndSheetName(FileUtil.Standardize(fileName)); + var records = DataLoaderManager.Ins.LoadTableFile(tableRecordType, actualFile, sheetName, new Dictionary<string, string>()); + + foreach (var r in records) + { + DBean data = r.Data; + //s_logger.Info("== read text:{}", r.Data); + string fullName = (data.GetField("full_name") as DString).Value.Trim(); + string name = TypeUtil.GetName(fullName); + if (string.IsNullOrWhiteSpace(fullName) || string.IsNullOrWhiteSpace(name)) + { + throw new Exception($"file:{fileName} 定义了一个空的enum类名"); + } + string module = TypeUtil.GetNamespace(fullName); + + DList items = (data.GetField("items") as DList); + + var curEnum = new RawEnum() + { + Name = name, + Namespace = module, + IsFlags = (data.GetField("flags") as DBool).Value, + Tags = DefUtil.ParseAttrs((data.GetField("tags") as DString).Value), + Comment = (data.GetField("comment") as DString).Value, + IsUniqueItemId = (data.GetField("unique") as DBool).Value, + Groups = SchemaLoaderUtil.CreateGroups((data.GetField("group") as DString).Value.Trim()), + Items = items.Datas.Cast<DBean>().Select(d => new EnumItem() + { + Name = (d.GetField("name") as DString).Value.Trim(), + Alias = (d.GetField("alias") as DString).Value, + Value = (d.GetField("value") as DString).Value, + Comment = (d.GetField("comment") as DString).Value, + Tags = DefUtil.ParseAttrs((d.GetField("tags") as DString).Value), + }).ToList(), + }; + Collector.Add(curEnum); + }; + } + + private void LoadBeanListFromFile(string fileName) + { + var ass = new DefAssembly(new RawAssembly() + { + Targets = new List<RawTarget> { new() { Name = "default", Manager = "Tables" } }, + }, "default", new List<string>(), null, null); + + var defBeanFieldType = new DefBean(new RawBean() + { + Namespace = "__intern__", + Name = "__FieldInfo__", + Parent = "", + Alias = "", + IsValueType = false, + Sep = "", + Fields = new List<RawField> + { + new() { Name = "name", Type = "string" }, + new() { Name = "alias", Type = "string" }, + new() { Name = "type", Type = "string" }, + new() { Name = "group", Type = "string" }, + new() { Name = "comment", Type = "string" }, + new() { Name = "tags", Type = "string" }, + new() { Name = "variants", Type = "string" }, + } + }) + { + Assembly = ass, + }; + + defBeanFieldType.PreCompile(); + defBeanFieldType.Compile(); + defBeanFieldType.PostCompile(); + + ass.AddType(defBeanFieldType); + + var defTableRecordType = new DefBean(new RawBean() + { + Namespace = "__intern__", + Name = "__BeanInfo__", + Parent = "", + Alias = "", + IsValueType = false, + Sep = "", + Fields = new List<RawField> + { + new() { Name = "full_name", Type = "string" }, + new() {Name = "parent", Type = "string" }, + new() { Name = "valueType", Type = "bool" }, + new() { Name = "sep", Type = "string" }, + new() { Name = "alias", Type = "string" }, + new() { Name = "comment", Type = "string" }, + new() { Name = "tags", Type = "string" }, + new() { Name = "group", Type = "string" }, + new() { Name = "fields", Type = "list,__FieldInfo__" }, + } + }) + { + Assembly = ass, + }; + ass.AddType(defTableRecordType); + defTableRecordType.PreCompile(); + defTableRecordType.Compile(); + defTableRecordType.PostCompile(); + var tableRecordType = TBean.Create(false, defTableRecordType, null); + (var actualFile, var sheetName) = FileUtil.SplitFileAndSheetName(FileUtil.Standardize(fileName)); + var records = DataLoaderManager.Ins.LoadTableFile(tableRecordType, actualFile, sheetName, new Dictionary<string, string>()); + + foreach (var r in records) + { + DBean data = r.Data; + //s_logger.Info("== read text:{}", r.Data); + string fullName = (data.GetField("full_name") as DString).Value.Trim(); + string name = TypeUtil.GetName(fullName); + if (string.IsNullOrWhiteSpace(fullName) || string.IsNullOrWhiteSpace(name)) + { + throw new Exception($"file:'{fileName}' 定义了一个空bean类名"); + } + string module = TypeUtil.GetNamespace(fullName); + + string parent = (data.GetField("parent") as DString).Value.Trim(); + string sep = (data.GetField("sep") as DString).Value.Trim(); + string alias = (data.GetField("alias") as DString).Value.Trim(); + string comment = (data.GetField("comment") as DString).Value.Trim(); + string tags = (data.GetField("tags") as DString).Value.Trim(); + string group = (data.GetField("group") as DString).Value.Trim(); + DList fields = data.GetField("fields") as DList; + var curBean = new RawBean() + { + Name = name, + Namespace = module, + IsValueType = ((DBool)data.GetField("valueType")).Value, + Sep = sep, + Alias = alias, + Comment = comment, + Tags = DefUtil.ParseAttrs(tags), + Groups = SchemaLoaderUtil.CreateGroups(group), + Parent = parent, + Fields = fields.Datas.Select(d => (DBean)d).Select(b => SchemaLoaderUtil.CreateField( + fileName, + (b.GetField("name") as DString).Value.Trim(), + (b.GetField("alias") as DString).Value.Trim(), + (b.GetField("type") as DString).Value.Trim(), + (b.GetField("group") as DString).Value, + (b.GetField("comment") as DString).Value.Trim(), + (b.GetField("tags") as DString).Value.Trim(), + (b.GetField("variants") as DString).Value.Trim(), + false + )).ToList(), + }; + Collector.Add(curBean); + }; + } +} diff --git a/luban/src/Luban.Schema.Builtin/Luban.Schema.Builtin.csproj b/luban/src/Luban.Schema.Builtin/Luban.Schema.Builtin.csproj new file mode 100644 index 00000000..668c84d8 --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/Luban.Schema.Builtin.csproj @@ -0,0 +1,43 @@ +<!-- + - MIT License + - + - Copyright (c) 2023 Code Philosophy Technology Ltd. + - + - Permission is hereby granted, free of charge, to any person obtaining a copy + - of this software and associated documentation files (the "Software"), to deal + - in the Software without restriction, including without limitation the rights + - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + - copies of the Software, and to permit persons to whom the Software is + - furnished to do so, subject to the following conditions: + - + - The above copyright notice and this permission notice shall be included in all + - copies or substantial portions of the Software. + - + - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + - SOFTWARE. + --> + +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + <EnableDynamicLoading>true</EnableDynamicLoading> + </PropertyGroup> + + <ItemGroup> + <None Remove="plugin.yml" /> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj"> + </ProjectReference> + <ProjectReference Include="..\Luban.DataLoader.Builtin\Luban.DataLoader.Builtin.csproj" /> + </ItemGroup> +</Project> diff --git a/luban/src/Luban.Schema.Builtin/SchemaLoaderUtil.cs b/luban/src/Luban.Schema.Builtin/SchemaLoaderUtil.cs new file mode 100644 index 00000000..54de5a17 --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/SchemaLoaderUtil.cs @@ -0,0 +1,137 @@ +using Luban.Defs; +using Luban.RawDefs; +using Luban.Utils; + +namespace Luban.Schema.Builtin; + +public static class SchemaLoaderUtil +{ + public static List<string> CreateGroups(string s) + { + return s.Split(',', ';').Select(x => x.Trim()).Where(x => !string.IsNullOrWhiteSpace(x)).ToList(); + } + + public static RawTable CreateTable(string schemaFile, string name, string module, string valueType, string index, string mode, string group, + string comment, bool readSchemaFromFile, string input, string tags, string outputFileName) + { + var p = new RawTable() + { + Name = name, + Namespace = module, + ValueType = valueType, + ReadSchemaFromFile = readSchemaFromFile, + Index = index, + Groups = CreateGroups(group), + Comment = comment, + Mode = ConvertMode(schemaFile, name, mode, index), + Tags = DefUtil.ParseAttrs(tags), + OutputFile = outputFileName, + }; + if (string.IsNullOrWhiteSpace(name)) + { + throw new Exception($"定义文件:{schemaFile} table:'{p.Name}' name:'{p.Name}' 不能为空"); + } + if (string.IsNullOrWhiteSpace(valueType)) + { + throw new Exception($"定义文件:{schemaFile} table:'{p.Name}' value_type:'{valueType}' 不能为空"); + } + p.InputFiles.AddRange(input.Split(',').Select(s => s.Trim()).Where(s => !string.IsNullOrWhiteSpace(s))); + + // if (!string.IsNullOrWhiteSpace(patchInput)) + // { + // foreach (var subPatchStr in patchInput.Split('|').Select(s => s.Trim()).Where(s => !string.IsNullOrWhiteSpace(s))) + // { + // var nameAndDirs = subPatchStr.Split(':'); + // if (nameAndDirs.Length != 2) + // { + // throw new Exception($"定义文件:{schemaFile} table:'{p.Name}' patch_input:'{subPatchStr}' 定义不合法"); + // } + // var patchDirs = nameAndDirs[1].Split(',', ';').ToList(); + // if (!p.PatchInputFiles.TryAdd(nameAndDirs[0], patchDirs)) + // { + // throw new Exception($"定义文件:{schemaFile} table:'{p.Name}' patch_input:'{subPatchStr}' 子patch:'{nameAndDirs[0]}' 重复"); + // } + // } + // } + + return p; + } + + public static TableMode ConvertMode(string schemaFile, string tableName, string modeStr, string indexStr) + { + TableMode mode; + string[] indexs = indexStr.Split(',', '+'); + switch (modeStr) + { + case "one": + case "single": + case "singleton": + { + if (!string.IsNullOrWhiteSpace(indexStr)) + { + throw new Exception($"定义文件:{schemaFile} table:'{tableName}' mode={modeStr} 是单例表,不支持定义index属性"); + } + mode = TableMode.ONE; + break; + } + case "map": + { + if (!string.IsNullOrWhiteSpace(indexStr) && indexs.Length > 1) + { + throw new Exception($"定义文件:'{schemaFile}' table:'{tableName}' 是单主键表,index:'{indexStr}'不能包含多个key"); + } + mode = TableMode.MAP; + break; + } + case "list": + { + mode = TableMode.LIST; + break; + } + case "": + { + if (string.IsNullOrWhiteSpace(indexStr) || indexs.Length == 1) + { + mode = TableMode.MAP; + } + else + { + mode = TableMode.LIST; + } + break; + } + default: + { + throw new ArgumentException($"不支持的 mode:{modeStr}"); + } + } + return mode; + } + + public static RawField CreateField(string schemaFile, string name, string alias, string type, string group, + string comment, string tags, string variants, + bool ignoreNameValidation) + { + var f = new RawField() + { + Name = name, + Alias = alias, + Groups = CreateGroups(group), + Comment = comment, + Tags = DefUtil.ParseAttrs(tags), + Variants = DefUtil.ParseVariant(variants), + NotNameValidation = ignoreNameValidation, + }; + + f.Type = type; + + //FillValueValidator(f, refs, "ref"); + //FillValueValidator(f, path, "path"); // (ue4|unity|normal|regex);xxx;xxx + //FillValueValidator(f, range, "range"); + + //FillValidators(defileFile, "key_validator", keyValidator, f.KeyValidators); + //FillValidators(defileFile, "value_validator", valueValidator, f.ValueValidators); + //FillValidators(defileFile, "validator", validator, f.Validators); + return f; + } +} diff --git a/luban/src/Luban.Schema.Builtin/XmlSchemaLoader.cs b/luban/src/Luban.Schema.Builtin/XmlSchemaLoader.cs new file mode 100644 index 00000000..a28d212f --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/XmlSchemaLoader.cs @@ -0,0 +1,287 @@ +using System.Xml.Linq; +using Luban.Defs; +using Luban.RawDefs; +using Luban.Utils; + +namespace Luban.Schema.Builtin; + +[SchemaLoader("", "xml")] +public class XmlSchemaLoader : SchemaLoaderBase +{ + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private readonly Dictionary<string, Action<XElement>> _tagHandlers = new(); + + private string _fileName; + + private readonly Stack<string> _namespaceStack = new(); + + private string CurNamespace => _namespaceStack.TryPeek(out var ns) ? ns : ""; + + public XmlSchemaLoader() + { + _tagHandlers.Add("module", AddModule); + _tagHandlers.Add("enum", AddEnum); + _tagHandlers.Add("bean", AddBean); + _tagHandlers.Add("table", AddTable); + _tagHandlers.Add("refgroup", AddRefGroup); + } + + public override void Load(string fileName) + { + _fileName = fileName; + XElement doc = XmlUtil.Open(fileName); + AddModule(doc); + } + + private void AddModule(XElement me) + { + var name = XmlUtil.GetOptionalAttribute(me, "name")?.Trim(); + _namespaceStack.Push(_namespaceStack.Count > 0 ? TypeUtil.MakeFullName(_namespaceStack.Peek(), name) : name); + + // 加载所有module定义,允许嵌套 + foreach (XElement e in me.Elements()) + { + var tagName = e.Name.LocalName; + if (_tagHandlers.TryGetValue(tagName, out var handler)) + { + handler(e); + } + else + { + throw new LoadDefException($"定义文件:{_fileName} module:{CurNamespace} 不支持 tag:{tagName}"); + } + } + _namespaceStack.Pop(); + } + + protected void TryGetUpdateParent(XElement e, ref string parent) + { + string selfDefParent = XmlUtil.GetOptionalAttribute(e, "parent"); + if (!string.IsNullOrEmpty(selfDefParent)) + { + if (!string.IsNullOrEmpty(parent)) + { + throw new Exception($"嵌套在'{parent}'中定义的子bean:'{XmlUtil.GetRequiredAttribute(e, "name")}' 不能再定义parent:{selfDefParent} 属性"); + } + parent = selfDefParent; + } + } + + private static readonly List<string> _enumOptionalAttrs = new() { "flags", "comment", "tags", "unique", "group" }; + private static readonly List<string> _enumRequiredAttrs = new() { "name" }; + + private static readonly List<string> _enumItemOptionalAttrs = new() { "value", "alias", "comment", "tags" }; + private static readonly List<string> _enumItemRequiredAttrs = new() { "name" }; + + private void AddEnum(XElement e) + { + XmlSchemaUtil.ValidAttrKeys(_fileName, e, _enumOptionalAttrs, _enumRequiredAttrs); + var en = new RawEnum() + { + Name = XmlUtil.GetRequiredAttribute(e, "name").Trim(), + Namespace = CurNamespace, + Comment = XmlUtil.GetOptionalAttribute(e, "comment"), + IsFlags = XmlUtil.GetOptionBoolAttribute(e, "flags"), + Tags = DefUtil.ParseAttrs(XmlUtil.GetOptionalAttribute(e, "tags")), + IsUniqueItemId = XmlUtil.GetOptionBoolAttribute(e, "unique", true), + Groups = SchemaLoaderUtil.CreateGroups(XmlUtil.GetOptionalAttribute(e, "group")), + Items = new(), + TypeMappers = new(), + }; + + foreach (XElement item in e.Elements()) + { + switch (item.Name.LocalName) + { + case "var": + { + XmlSchemaUtil.ValidAttrKeys(_fileName, item, _enumItemOptionalAttrs, _enumItemRequiredAttrs); + en.Items.Add(new EnumItem() + { + Name = XmlUtil.GetRequiredAttribute(item, "name").Trim(), + Alias = XmlUtil.GetOptionalAttribute(item, "alias"), + Value = XmlUtil.GetOptionalAttribute(item, "value"), + Comment = XmlUtil.GetOptionalAttribute(item, "comment"), + Tags = DefUtil.ParseAttrs(XmlUtil.GetOptionalAttribute(item, "tags")), + }); + break; + } + case "mapper": + { + en.TypeMappers.Add(CreateTypeMapper(item, en.FullName)); + break; + } + default: + { + throw new Exception($"不支持的enum子节点:{item.Name.LocalName}"); + } + } + } + s_logger.Trace("add enum:{@}", en); + Collector.Add(en); + } + + private readonly List<string> _tableOptionalAttrs = new() { "index", "mode", "group", "comment", "readSchemaFromFile", "output", "tags" }; + private readonly List<string> _tableRequireAttrs = new() { "name", "value", "input" }; + + private void AddTable(XElement e) + { + XmlSchemaUtil.ValidAttrKeys(_fileName, e, _tableOptionalAttrs, _tableRequireAttrs); + string name = XmlUtil.GetRequiredAttribute(e, "name"); + string module = CurNamespace; + string valueType = XmlUtil.GetRequiredAttribute(e, "value"); + bool defineFromFile = XmlUtil.GetOptionBoolAttribute(e, "readSchemaFromFile"); + if (string.IsNullOrEmpty(TypeUtil.GetNamespace(valueType))) + { + valueType = TypeUtil.MakeFullName(module, valueType); + } + string index = XmlUtil.GetOptionalAttribute(e, "index"); + string group = XmlUtil.GetOptionalAttribute(e, "group"); + string comment = XmlUtil.GetOptionalAttribute(e, "comment"); + string input = XmlUtil.GetRequiredAttribute(e, "input"); + string mode = XmlUtil.GetOptionalAttribute(e, "mode"); + string tags = XmlUtil.GetOptionalAttribute(e, "tags"); + string output = XmlUtil.GetOptionalAttribute(e, "output"); + Collector.Add(SchemaLoaderUtil.CreateTable(_fileName, name, module, valueType, index, mode, group, comment, defineFromFile, input, tags, output)); + } + + private static readonly List<string> _fieldOptionalAttrs = new() + { + // "ref", + // "path", + "alias", + "group", + "comment", + "tags", + "variants", + }; + + private static readonly List<string> _fieldRequireAttrs = new() { "name", "type" }; + + protected RawField CreateField(XElement e) + { + XmlSchemaUtil.ValidAttrKeys(_fileName, e, _fieldOptionalAttrs, _fieldRequireAttrs); + + string typeStr = XmlUtil.GetRequiredAttribute(e, "type"); + + // string refStr = XmlUtil.GetOptionalAttribute(e, "ref"); + // if (!string.IsNullOrWhiteSpace(refStr)) + // { + // typeStr = typeStr + "#(ref=" + refStr + ")"; + // } + // string pathStr = XmlUtil.GetOptionalAttribute(e, "path"); + // if (!string.IsNullOrWhiteSpace(pathStr)) + // { + // typeStr = typeStr + "#(path=" + pathStr + ")"; + // } + + return SchemaLoaderUtil.CreateField(_fileName, + XmlUtil.GetRequiredAttribute(e, "name"), + XmlUtil.GetOptionalAttribute(e, "alias"), + typeStr, + XmlUtil.GetOptionalAttribute(e, "group"), + XmlUtil.GetOptionalAttribute(e, "comment"), + XmlUtil.GetOptionalAttribute(e, "tags"), + XmlUtil.GetOptionalAttribute(e, "variants"), + false + ); + } + + private static readonly List<string> _beanOptionsAttrs = new() { "parent", "valueType", "alias", "sep", "comment", "tags", "group" }; + private static readonly List<string> _beanRequireAttrs = new() { "name" }; + + private TypeMapper CreateTypeMapper(XElement e, string fullName) + { + var opts = new Dictionary<string, string>(); + foreach (XElement optionEle in e.Elements()) + { + string key = XmlUtil.GetRequiredAttribute(optionEle, "name"); + string value = XmlUtil.GetRequiredAttribute(optionEle, "value"); + if (!opts.TryAdd(key, value)) + { + throw new Exception($"CreateTypeMapper {fullName} option:{key} 重复定义"); + } + } + var mapper = new TypeMapper() + { + Targets = XmlUtil.GetRequiredAttribute(e, "target").Split(',', ';', '|').ToList(), + CodeTargets = XmlUtil.GetRequiredAttribute(e, "codeTarget").Split(',', ';', '|').ToList(), + Options = opts, + }; + return mapper; + } + + + protected void AddBean(XElement e) + { + AddBean(e, ""); + } + + protected void AddBean(XElement e, string parent) + { + XmlSchemaUtil.ValidAttrKeys(_fileName, e, _beanOptionsAttrs, _beanRequireAttrs); + TryGetUpdateParent(e, ref parent); + var b = new RawBean() + { + Name = XmlUtil.GetRequiredAttribute(e, "name"), + Namespace = CurNamespace, + Parent = parent, + IsValueType = XmlUtil.GetOptionBoolAttribute(e, "valueType"), + Alias = XmlUtil.GetOptionalAttribute(e, "alias"), + Sep = XmlUtil.GetOptionalAttribute(e, "sep"), + Comment = XmlUtil.GetOptionalAttribute(e, "comment"), + Tags = DefUtil.ParseAttrs(XmlUtil.GetOptionalAttribute(e, "tags")), + Groups = SchemaLoaderUtil.CreateGroups(XmlUtil.GetOptionalAttribute(e, "group")), + Fields = new(), + TypeMappers = new(), + }; + var childBeans = new List<XElement>(); + + bool defineAnyChildBean = false; + foreach (XElement fe in e.Elements()) + { + switch (fe.Name.LocalName) + { + case "var": + { + if (defineAnyChildBean) + { + throw new LoadDefException($"定义文件:{_fileName} 类型:{b.FullName} 的多态子bean必须在所有成员字段 <var> 之后定义"); + } + b.Fields.Add(CreateField(fe)); + ; + break; + } + case "mapper": + { + b.TypeMappers.Add(CreateTypeMapper(fe, b.FullName)); + break; + } + case "bean": + { + defineAnyChildBean = true; + childBeans.Add(fe); + break; + } + default: + { + throw new LoadDefException($"定义文件:{_fileName} 类型:{b.FullName} 不支持 tag:{fe.Name}"); + } + } + } + s_logger.Trace("add bean:{@bean}", b); + Collector.Add(b); + + var fullname = b.FullName; + foreach (var cb in childBeans) + { + AddBean(cb, fullname); + } + } + + private void AddRefGroup(XElement e) + { + Collector.Add(XmlSchemaUtil.CreateRefGroup(_fileName, e)); + } +} diff --git a/luban/src/Luban.Schema.Builtin/XmlSchemaUtil.cs b/luban/src/Luban.Schema.Builtin/XmlSchemaUtil.cs new file mode 100644 index 00000000..cbf2ede8 --- /dev/null +++ b/luban/src/Luban.Schema.Builtin/XmlSchemaUtil.cs @@ -0,0 +1,41 @@ +using System.Xml.Linq; +using Luban.Defs; +using Luban.RawDefs; +using Luban.Utils; + +namespace Luban.Schema.Builtin; + +public static class XmlSchemaUtil +{ + public static void ValidAttrKeys(string defineFile, XElement e, List<string> optionKeys, List<string> requireKeys) + { + foreach (var k in e.Attributes()) + { + var name = k.Name.LocalName; + if (!requireKeys.Contains(name) && optionKeys != null && !optionKeys.Contains(name)) + { + throw new LoadDefException($"定义文件:{defineFile} 定义:{e} 包含未知属性 attr:{name}"); + } + } + foreach (var k in requireKeys) + { + if (e.Attribute(k) == null) + { + throw new LoadDefException($"定义文件:{defineFile} 定义:{e} 缺失属性 attr:{k}"); + } + } + } + + private static readonly List<string> _refGroupRequireAttrs = new() { "name", "ref" }; + + public static RawRefGroup CreateRefGroup(string fileName, XElement e) + { + ValidAttrKeys(fileName, e, null, _refGroupRequireAttrs); + + return new RawRefGroup() + { + Name = XmlUtil.GetRequiredAttribute(e, "name"), + Refs = XmlUtil.GetRequiredAttribute(e, "ref").Split(',').Select(s => s.Trim()).ToList(), + }; + } +} diff --git a/luban/src/Luban.Typescript/AssemblyInfo.cs b/luban/src/Luban.Typescript/AssemblyInfo.cs new file mode 100644 index 00000000..983f7d1b --- /dev/null +++ b/luban/src/Luban.Typescript/AssemblyInfo.cs @@ -0,0 +1,5 @@ + + +using Luban; + +[assembly: RegisterBehaviour] diff --git a/luban/src/Luban.Typescript/CodeTarget/TypescriptBinCodeTarget.cs b/luban/src/Luban.Typescript/CodeTarget/TypescriptBinCodeTarget.cs new file mode 100644 index 00000000..b4459237 --- /dev/null +++ b/luban/src/Luban.Typescript/CodeTarget/TypescriptBinCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Typescript.TemplateExtensions; +using Scriban; + +namespace Luban.Typescript.CodeTarget; + +[CodeTarget("typescript-bin")] +public class TypescriptBinCodeTarget : TypescriptCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new TypescriptBinTemplateExtension()); + } +} diff --git a/luban/src/Luban.Typescript/CodeTarget/TypescriptCodeTargetBase.cs b/luban/src/Luban.Typescript/CodeTarget/TypescriptCodeTargetBase.cs new file mode 100644 index 00000000..0bd60aeb --- /dev/null +++ b/luban/src/Luban.Typescript/CodeTarget/TypescriptCodeTargetBase.cs @@ -0,0 +1,35 @@ +using Luban.CodeFormat; +using Luban.CodeTarget; +using Luban.Typescript.TemplateExtensions; +using Scriban; + +namespace Luban.Typescript.CodeTarget; + +public abstract class TypescriptCodeTargetBase : AllInOneTemplateCodeTargetBase +{ + public override string FileHeader => CommonFileHeaders.AUTO_GENERATE_C_LIKE; + + protected override string FileSuffixName => "ts"; + + protected override ICodeStyle DefaultCodeStyle => CodeFormatManager.Ins.TypescriptDefaultCodeStyle; + + protected override string DefaultOutputFileName => "schema.ts"; + + private static readonly HashSet<string> s_preservedKeyWords = new() + { + // typescript preserved key words + // remove `type` because it's used frequently + "abstract", "as", "any", "boolean", "break", "case", "catch", "class", "const", "continue", "debugger", "declare", + "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "from", "function", "get", + "if", "implements", "import", "in", "instanceof", "interface", "let", "module", "namespace", "new", "null", "number", + "object", "package", "private", "protected", "public", "require", "return", "set", "static", "string", "super", "switch", + "symbol", "this", "throw", "true", "try", /*"type",*/ "typeof", "undefined", "var", "void", "while", "with", "yield" + }; + + protected override IReadOnlySet<string> PreservedKeyWords => s_preservedKeyWords; + + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + ctx.PushGlobal(new TypescriptCommonTemplateExtension()); + } +} diff --git a/luban/src/Luban.Typescript/CodeTarget/TypescriptJsonCodeTarget.cs b/luban/src/Luban.Typescript/CodeTarget/TypescriptJsonCodeTarget.cs new file mode 100644 index 00000000..ec37960d --- /dev/null +++ b/luban/src/Luban.Typescript/CodeTarget/TypescriptJsonCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Typescript.TemplateExtensions; +using Scriban; + +namespace Luban.Typescript.CodeTarget; + +[CodeTarget("typescript-json")] +public class TypescriptJsonCodeTarget : TypescriptCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new TypescriptJsonTemplateExtension()); + } +} diff --git a/luban/src/Luban.Typescript/CodeTarget/TypescriptProtobufCodeTarget.cs b/luban/src/Luban.Typescript/CodeTarget/TypescriptProtobufCodeTarget.cs new file mode 100644 index 00000000..5a3d3dbe --- /dev/null +++ b/luban/src/Luban.Typescript/CodeTarget/TypescriptProtobufCodeTarget.cs @@ -0,0 +1,15 @@ +using Luban.CodeTarget; +using Luban.Typescript.TemplateExtensions; +using Scriban; + +namespace Luban.Typescript.CodeTarget; + +[CodeTarget("typescript-protobuf")] +public class TypescriptProtobufCodeTarget : TypescriptCodeTargetBase +{ + protected override void OnCreateTemplateContext(TemplateContext ctx) + { + base.OnCreateTemplateContext(ctx); + ctx.PushGlobal(new TypescriptBinTemplateExtension()); + } +} diff --git a/luban/src/Luban.Typescript/Luban.Typescript.csproj b/luban/src/Luban.Typescript/Luban.Typescript.csproj new file mode 100644 index 00000000..5807eb37 --- /dev/null +++ b/luban/src/Luban.Typescript/Luban.Typescript.csproj @@ -0,0 +1,63 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + <ProjectReference Include="..\Luban.CSharp\Luban.CSharp.csproj" /> + <ProjectReference Include="..\Luban.DataTarget.Builtin\Luban.DataTarget.Builtin.csproj" /> + </ItemGroup> + + <ItemGroup> + <None Update="Templates\cs-bin\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-bin\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-bin\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-dotnet-json\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-dotnet-json\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\cs-dotnet-json\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\common\cs\enum.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\common\ts\enum.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\ts-json\bean.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\ts-json\table.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\ts-json\tables.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\ts-json\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\typescript-json\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\typescript-bin\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="Templates\typescript-protobuf\schema.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban.Typescript/TemplateExtensions/TypescriptBinTemplateExtension.cs b/luban/src/Luban.Typescript/TemplateExtensions/TypescriptBinTemplateExtension.cs new file mode 100644 index 00000000..c91c89d5 --- /dev/null +++ b/luban/src/Luban.Typescript/TemplateExtensions/TypescriptBinTemplateExtension.cs @@ -0,0 +1,12 @@ +using Luban.Types; +using Scriban.Runtime; + +namespace Luban.Typescript.TemplateExtensions; + +public class TypescriptBinTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string bufName, TType type) + { + return type.Apply(BinDeserializeVisitor.Ins, bufName, fieldName); + } +} diff --git a/luban/src/Luban.Typescript/TemplateExtensions/TypescriptCommonTemplateExtension.cs b/luban/src/Luban.Typescript/TemplateExtensions/TypescriptCommonTemplateExtension.cs new file mode 100644 index 00000000..98bee3cb --- /dev/null +++ b/luban/src/Luban.Typescript/TemplateExtensions/TypescriptCommonTemplateExtension.cs @@ -0,0 +1,45 @@ +using Luban.CodeFormat; +using Luban.Defs; +using Luban.Types; +using Luban.Typescript.TypeVisitors; +using Luban.Utils; +using Scriban.Runtime; + +namespace Luban.Typescript.TemplateExtensions; + +public class TypescriptCommonTemplateExtension : ScriptObject +{ + public static string DeclaringTypeName(TType type) + { + return type.Apply(DeclaringTypeNameVisitor.Ins); + } + + public static string ClassModifier(DefBean bean) + { + return bean.IsAbstractType ? "abstract" : "sealed"; + } + + public static string MethodModifier(DefBean bean) + { + return bean.ParentDefType != null ? "override" : (bean.IsAbstractType ? "virtual" : ""); + } + + public static string NamespaceWithGraceBegin(string ns) + { + if (string.IsNullOrEmpty(ns)) + { + return ""; + } + return string.Join("", ns.Split('.').Select(n => $"export namespace {n} {{")); + } + + public static string NamespaceWithGraceEnd(string ns) + { + if (string.IsNullOrEmpty(ns)) + { + return ""; + } + return string.Join("", ns.Split('.').Select(n => $"}}")); + } + +} diff --git a/luban/src/Luban.Typescript/TemplateExtensions/TypescriptJsonTemplateExtension.cs b/luban/src/Luban.Typescript/TemplateExtensions/TypescriptJsonTemplateExtension.cs new file mode 100644 index 00000000..86c1e903 --- /dev/null +++ b/luban/src/Luban.Typescript/TemplateExtensions/TypescriptJsonTemplateExtension.cs @@ -0,0 +1,13 @@ +using Luban.Types; +using Luban.Typescript.TypeVisitors; +using Scriban.Runtime; + +namespace Luban.Typescript.TemplateExtensions; + +public class TypescriptJsonTemplateExtension : ScriptObject +{ + public static string Deserialize(string fieldName, string jsonVar, TType type) + { + return type.Apply(JsonDeserializeVisitor.Ins, jsonVar, fieldName, 0); + } +} diff --git a/luban/src/Luban.Typescript/Templates/common/ts/enum.sbn b/luban/src/Luban.Typescript/Templates/common/ts/enum.sbn new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/luban/src/Luban.Typescript/Templates/common/ts/enum.sbn @@ -0,0 +1,2 @@ + + diff --git a/luban/src/Luban.Typescript/Templates/typescript-bin/schema.sbn b/luban/src/Luban.Typescript/Templates/typescript-bin/schema.sbn new file mode 100644 index 00000000..f8f9f967 --- /dev/null +++ b/luban/src/Luban.Typescript/Templates/typescript-bin/schema.sbn @@ -0,0 +1,234 @@ + +import ByteBuf from '../bright/serialization/ByteBuf' + +{{~for enum in __enums~}} +{{namespace_with_grace_begin enum.namespace}} +{{~if enum.comment != '' ~}} +/** + * {{enum.comment | html.escape}} + */ +{{~end~}} +export enum {{enum.name}} { + {{~for item in enum.items ~}} +{{~if item.comment != '' ~}} + /** + * {{escape_comment item.comment}} + */ +{{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} +} + +{{namespace_with_grace_end enum.namespace}} +{{~end~}} + + +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_ref' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = refTable.name + if field.is_nullable + ret 'this.'+(get_ref_name field) + ' = this.' + fieldName + '!= null ? tables.' + tableName + '.get(this.' + fieldName + ') : null' + else + ret 'this.'+(get_ref_name field) + ' = tables.' + tableName + '.get(this.' + fieldName + ')' + end + else + if (is_field_bean_need_resolve_ref field) + ret 'this.'+fieldName + '?.resolve(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'for (let _e of ' + 'this.' + fieldName + ') { _e?.resolve(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'for (let [_, _e] of ' + 'this.' + fieldName + ') { _e?.resolve(tables); }' + else + ret '' + end + end +end +~}} + +{{~for bean in __beans~}} + +{{namespace_with_grace_begin bean.namespace}} +{{~if bean.comment != '' ~}} +/** + * {{escape_comment bean.comment}} + */ +{{~end~}} +export {{if bean.is_abstract_type}}abstract {{end}}class {{bean.name}}{{if bean.parent_def_type}} extends {{bean.parent_def_type.full_name}}{{end}} { +{{~if bean.is_abstract_type~}} + static constructorFrom(_buf_: ByteBuf): {{bean.name}}{ + switch (_buf_.ReadInt()) { + {{~ for child in bean.hierarchy_not_abstract_children~}} + case {{child.id}}: return new {{child.full_name}}(_buf_) + {{~end~}} + default: throw new Error() + } + } +{{~end~}} + + constructor(_buf_: ByteBuf) { + {{~if bean.parent_def_type~}} + super(_buf_) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{deserialize ('this.' + format_field_name __code_style field.name) '_buf_' field.ctype}} + {{~end~}} + } + + {{~ for field in bean.export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + readonly {{format_field_name __code_style field.name}}: {{declaring_type_name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}}: {{declaring_type_name (get_ref_type field)}} | undefined + {{~end~}} + {{~end~}} + + resolve(tables:{{__name}}) { + {{~if bean.parent_def_type~}} + super.resolve(tables) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{generate_resolve_field_ref field}} + {{~end~}} + } +} + +{{namespace_with_grace_end bean.namespace}} + +{{~end~}} + +{{~for table in __tables + key_type = table.key_ttype + value_type = table.value_ttype +~}} + +{{namespace_with_grace_begin table.namespace}} +{{~if table.comment != '' ~}} +/** + * {{escape_comment table.comment}} + */ +{{~end~}} +export class {{table.name}} { + {{~if table.is_map_table ~}} + private _dataMap: Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> + private _dataList: {{declaring_type_name value_type}}[] + constructor(_buf_: ByteBuf) { + this._dataMap = new Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}>() + this._dataList = [] + for(let n = _buf_.ReadInt(); n > 0; n--) { + let _v: {{declaring_type_name value_type}} + {{deserialize '_v' '_buf_' value_type}} + this._dataList.push(_v) + this._dataMap.set(_v.{{format_field_name __code_style table.index_field.name}}, _v) + } + } + + getDataMap(): Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> { return this._dataMap; } + getDataList(): {{declaring_type_name value_type}}[] { return this._dataList; } + + get(key: {{declaring_type_name key_type}}): {{declaring_type_name value_type}} | undefined { + return this._dataMap.get(key); + } + + resolve(tables:{{__name}}) { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + {{~else if table.is_list_table ~}} + private _dataList: {{declaring_type_name value_type}}[] + + constructor(_buf_: ByteBuf) { + this._dataList = [] + for(let n = _buf_.ReadInt(); n > 0; n--) { + let _v: {{declaring_type_name value_type}} + {{deserialize '_v' '_buf_' value_type}} + this._dataList.push(_v) + } + } + + getDataList(): {{declaring_type_name value_type}}[] { return this._dataList } + + get(index: number): {{declaring_type_name value_type}} | undefined { return this._dataList[index] } + + resolve(tables:{{__name}}) { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + {{~else~}} + + private _data: {{declaring_type_name value_type}} + constructor(_buf_: ByteBuf) { + if (_buf_.ReadInt() != 1) throw new Error('table mode=one, but size != 1') + {{deserialize 'this._data' '_buf_' value_type}} + } + + getData(): {{declaring_type_name value_type}} { return this._data; } + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + get {{format_field_name __code_style field.name}}(): {{declaring_type_name field.ctype}} { return this._data.{{format_field_name __code_style field.name}}; } + {{~if can_generate_ref field~}} + get {{format_field_name __code_style field.name}}_ref(): {{declaring_type_name (get_ref_type field)}} | undefined { return this._data.{{format_field_name __code_style field.name}}_ref; } + {{~end~}} + {{~end~}} + + resolve(tables:{{__name}}) { + this._data.resolve(tables) + } + {{end}} +} +{{namespace_with_grace_end table.namespace}} + +{{~end~}} + + +type ByteBufLoader = (file: string) => ByteBuf + +export class {{__name}} { + {{~ for table in __tables ~}} + private _{{table.name}}: {{table.full_name}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + get {{table.name}}(): {{table.full_name}} { return this._{{table.name}};} + {{~end~}} + + static getTableNames(): string[] { + let names: string[] = []; + {{~for table in __tables ~}} + names.push('{{table.output_data_file}}'); + {{~end~}} + return names; + } + + constructor(loader: ByteBufLoader) { + {{~for table in __tables ~}} + this._{{table.name}} = new {{table.full_name}}(loader('{{table.output_data_file}}')) + {{~end~}} + + {{~for table in __tables ~}} + this._{{table.name}}.resolve(this) + {{~end~}} + } +} diff --git a/luban/src/Luban.Typescript/Templates/typescript-json/schema.sbn b/luban/src/Luban.Typescript/Templates/typescript-json/schema.sbn new file mode 100644 index 00000000..ed794223 --- /dev/null +++ b/luban/src/Luban.Typescript/Templates/typescript-json/schema.sbn @@ -0,0 +1,226 @@ + +{{~for enum in __enums~}} +{{namespace_with_grace_begin enum.namespace}} +{{~if enum.comment != '' ~}} +/** + * {{enum.comment | html.escape}} + */ +{{~end~}} +export enum {{enum.name}} { + {{~for item in enum.items ~}} +{{~if item.comment != '' ~}} + /** + * {{escape_comment item.comment}} + */ +{{~end~}} + {{item.name}} = {{item.value}}, + {{~end~}} +} + +{{namespace_with_grace_end enum.namespace}} +{{~end~}} + + +{{~ +func get_ref_name + ret (format_property_name __code_style $0.name) + '_ref' +end + +func generate_resolve_field_ref + field = $0 + fieldName = format_property_name __code_style field.name + refTable = get_ref_table field + if can_generate_ref field + tableName = refTable.name + if field.is_nullable + ret 'this.'+(get_ref_name field) + ' = this.' + fieldName + '!= null ? tables.' + tableName + '.get(this.' + fieldName + ') : null' + else + ret 'this.'+(get_ref_name field) + ' = tables.' + tableName + '.get(this.' + fieldName + ')' + end + else + if (is_field_bean_need_resolve_ref field) + ret 'this.'+fieldName + '?.resolve(tables);' + else if (is_field_array_like_need_resolve_ref field) + ret 'for (let _e of ' + 'this.' + fieldName + ') { _e?.resolve(tables); }' + else if (is_field_map_need_resolve_ref field) + ret 'for (let [_, _e] of ' + 'this.' + fieldName + ') { _e?.resolve(tables); }' + else + ret '' + end + end +end +~}} + +{{~for bean in __beans~}} + +{{namespace_with_grace_begin bean.namespace}} +{{~if bean.comment != '' ~}} +/** + * {{escape_comment bean.comment}} + */ +{{~end~}} +export {{if bean.is_abstract_type}}abstract {{end}}class {{bean.name}}{{if bean.parent_def_type}} extends {{bean.parent_def_type.full_name}}{{end}} { +{{~if bean.is_abstract_type~}} + static constructorFrom(_json_: any): {{bean.name}}{ + switch (_json_["$type"]) { + {{~ for child in bean.hierarchy_not_abstract_children~}} + case '{{impl_data_type child bean}}': return new {{child.full_name}}(_json_) + {{~end~}} + default: throw new Error() + } + } +{{~end~}} + + constructor(_json_: any) { + {{~if bean.parent_def_type~}} + super(_json_) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{~if !field.ctype.is_nullable~}} + if (_json_.{{field.name}} === undefined) { throw new Error() } + {{~end~}} + {{deserialize ('this.' + format_field_name __code_style field.name) ( '_json_.' + field.name) field.ctype}} + {{~end~}} + } + + {{~ for field in bean.export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + readonly {{format_field_name __code_style field.name}}: {{declaring_type_name field.ctype}} + {{~if can_generate_ref field~}} + {{get_ref_name field}}: {{declaring_type_name (get_ref_type field)}} | undefined + {{~end~}} + {{~end~}} + + resolve(tables:{{__name}}) { + {{~if bean.parent_def_type~}} + super.resolve(tables) + {{~end~}} + {{~ for field in bean.export_fields ~}} + {{generate_resolve_field_ref field}} + {{~end~}} + } +} + +{{namespace_with_grace_end bean.namespace}} + +{{~end~}} + +{{~for table in __tables + key_type = table.key_ttype + value_type = table.value_ttype +~}} + +{{namespace_with_grace_begin table.namespace}} +{{~if table.comment != '' ~}} +/** + * {{escape_comment table.comment}} + */ +{{~end~}} +export class {{table.name}} { + {{~if table.is_map_table ~}} + private _dataMap: Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> + private _dataList: {{declaring_type_name value_type}}[] + constructor(_json_: any) { + this._dataMap = new Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}>() + this._dataList = [] + for(var _json2_ of _json_) { + let _v: {{declaring_type_name value_type}} + {{deserialize '_v' '_json2_' value_type}} + this._dataList.push(_v) + this._dataMap.set(_v.{{format_field_name __code_style table.index_field.name}}, _v) + } + } + + getDataMap(): Map<{{declaring_type_name key_type}}, {{declaring_type_name value_type}}> { return this._dataMap; } + getDataList(): {{declaring_type_name value_type}}[] { return this._dataList; } + + get(key: {{declaring_type_name key_type}}): {{declaring_type_name value_type}} | undefined { return this._dataMap.get(key); } + + resolve(tables:{{__name}}) { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + {{~else if table.is_list_table ~}} + private _dataList: {{declaring_type_name value_type}}[] + + constructor(_json_: any) { + this._dataList = [] + for(var _json2_ of _json_) { + let _v: {{declaring_type_name value_type}} + {{deserialize '_v' '_json2_' value_type}} + this._dataList.push(_v) + } + } + + getDataList(): {{declaring_type_name value_type}}[] { return this._dataList } + + get(index: number): {{declaring_type_name value_type}} | undefined { return this._dataList[index] } + + resolve(tables:{{__name}}) { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + {{~else~}} + + private _data: {{declaring_type_name value_type}} + constructor(_json_: any) { + if (_json_.length != 1) throw new Error('table mode=one, but size != 1') + {{deserialize 'this._data' '_json_[0]' value_type}} + } + + getData(): {{declaring_type_name value_type}} { return this._data; } + + {{~ for field in value_type.def_bean.hierarchy_export_fields ~}} +{{~if field.comment != '' ~}} + /** + * {{escape_comment field.comment}} + */ +{{~end~}} + get {{format_field_name __code_style field.name}}(): {{declaring_type_name field.ctype}} { return this._data.{{format_field_name __code_style field.name}}; } + {{~if can_generate_ref field~}} + get {{format_field_name __code_style field.name}}_ref(): {{declaring_type_name (get_ref_type field)}} | undefined { return this._data.{{format_field_name __code_style field.name}}_ref; } + {{~end~}} + {{~end~}} + + resolve(tables:{{__name}}) + { + this._data.resolve(tables) + } + {{end}} +} +{{namespace_with_grace_end table.namespace}} + +{{~end~}} + + +type JsonLoader = (file: string) => any + +export class {{__name}} { + {{~ for table in __tables ~}} + private _{{table.name}}: {{table.full_name}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + get {{table.name}}(): {{table.full_name}} { return this._{{table.name}};} + {{~end~}} + + constructor(loader: JsonLoader) { + {{~for table in __tables ~}} + this._{{table.name}} = new {{table.full_name}}(loader('{{table.output_data_file}}')) + {{~end~}} + + {{~for table in __tables ~}} + this._{{table.name}}.resolve(this) + {{~end~}} + } +} diff --git a/luban/src/Luban.Typescript/Templates/typescript-protobuf/schema.sbn b/luban/src/Luban.Typescript/Templates/typescript-protobuf/schema.sbn new file mode 100644 index 00000000..0538d7b5 --- /dev/null +++ b/luban/src/Luban.Typescript/Templates/typescript-protobuf/schema.sbn @@ -0,0 +1,31 @@ +import pb from 'pb'; + +type BufLoader = (file: string) => Uint8Array; + +export class {{__name}} { + {{~ for table in __tables ~}} + private _{{table.name}}: pb.cfg.{{table.name}} +{{~if table.comment != '' ~}} + /** + * {{escape_comment table.comment}} + */ +{{~end~}} + get {{table.name}}(): pb.cfg.{{table.name}} { return this._{{table.name}};} + {{~end~}} + + static getTableNames(): string[] { + let names: string[] = []; + {{~for table in __tables ~}} + names.push('{{table.output_data_file}}'); + {{~end~}} + return names; + } + + constructor(loader: BufLoader) { + let buffer: Uint8Array; + {{~for table in __tables ~}} + buffer = loader('{{table.output_data_file}}'); + this._{{table.name}} = pb.cfg.{{table.name}}.decode(buffer, buffer.length); + {{~end~}} + } +} diff --git a/luban/src/Luban.Typescript/TypeVisitors/BinDeserializeVisitor.cs b/luban/src/Luban.Typescript/TypeVisitors/BinDeserializeVisitor.cs new file mode 100644 index 00000000..a333332c --- /dev/null +++ b/luban/src/Luban.Typescript/TypeVisitors/BinDeserializeVisitor.cs @@ -0,0 +1,23 @@ +using Luban.Types; +using Luban.Typescript.TypeVisitors; +using Luban.TypeVisitors; + +namespace Luban.Typescript.TemplateExtensions +{ + class BinDeserializeVisitor : DecoratorFuncVisitor<string, string, string> + { + public static BinDeserializeVisitor Ins { get; } = new BinDeserializeVisitor(); + + public override string DoAccept(TType type, string byteBufName, string fieldName) + { + if (type.IsNullable) + { + return $"if({byteBufName}.ReadBool()) {{ {type.Apply(BinUnderingDeserializeVisitor.Ins, byteBufName, fieldName, 0)} }} else {{ {fieldName} = null; }}"; + } + else + { + return type.Apply(BinUnderingDeserializeVisitor.Ins, byteBufName, fieldName, 0); + } + } + } +} diff --git a/luban/src/Luban.Typescript/TypeVisitors/BinUnderingDeserializeVisitor.cs b/luban/src/Luban.Typescript/TypeVisitors/BinUnderingDeserializeVisitor.cs new file mode 100644 index 00000000..fd5729f4 --- /dev/null +++ b/luban/src/Luban.Typescript/TypeVisitors/BinUnderingDeserializeVisitor.cs @@ -0,0 +1,21 @@ +using Luban.Types; + +namespace Luban.Typescript.TypeVisitors +{ + public class BinUnderingDeserializeVisitor : BinUnderingDeserializeVisitorBase + { + public static BinUnderingDeserializeVisitor Ins { get; } = new BinUnderingDeserializeVisitor(); + + public override string Accept(TBean type, string bufVarName, string fieldName, int depth) + { + if (type.DefBean.IsAbstractType) + { + return $"{fieldName} = {type.DefBean.FullName}.constructorFrom({bufVarName})"; + } + else + { + return $"{fieldName} = new {type.DefBean.FullName}({bufVarName})"; + } + } + } +} diff --git a/luban/src/Luban.Typescript/TypeVisitors/BinUnderingDeserializeVisitorBase.cs b/luban/src/Luban.Typescript/TypeVisitors/BinUnderingDeserializeVisitorBase.cs new file mode 100644 index 00000000..772f35f4 --- /dev/null +++ b/luban/src/Luban.Typescript/TypeVisitors/BinUnderingDeserializeVisitorBase.cs @@ -0,0 +1,82 @@ +using Luban.DataExporter.Builtin.Json; +using Luban.Datas; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Typescript.TypeVisitors +{ + public abstract class BinUnderingDeserializeVisitorBase : ITypeFuncVisitor<string, string, int, string> + { + public string Accept(TBool type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadBool()"; + } + + public string Accept(TByte type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadByte()"; + } + + public string Accept(TShort type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadShort()"; + } + + public string Accept(TInt type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadInt()"; + } + + public string Accept(TLong type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.{(type.IsBigInt ? "ReadLong" : "ReadLongAsNumber")}()"; + } + + public string Accept(TFloat type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadFloat()"; + } + + public string Accept(TDouble type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadDouble()"; + } + + public string Accept(TEnum type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadInt()"; + } + + public string Accept(TString type, string bufName, string fieldName, int depth) + { + return $"{fieldName} = {bufName}.ReadString()"; + } + + public abstract string Accept(TBean type, string bufVarName, string fieldName, int depth); + + public string Accept(TArray type, string bufVarName, string fieldName, int depth) + { + return $"{{ let n = Math.min({bufVarName}.ReadSize(), {bufVarName}.Size); {fieldName} = []; for(let i = 0 ; i < n ; i++) {{ let _e{depth} ;{type.ElementType.Apply(this, bufVarName, $"_e{depth}", depth + 1)}; {fieldName}.push(_e{depth});}}}}"; + } + + public virtual string Accept(TList type, string bufVarName, string fieldName, int depth) + { + return $"{{ let n = Math.min({bufVarName}.ReadSize(), {bufVarName}.Size); {fieldName} = []; for(let i = 0 ; i < n ; i++) {{ let _e{depth}; {type.ElementType.Apply(this, bufVarName, $"_e{depth}", depth + 1)}; {fieldName}.push(_e{depth});}}}}"; + } + + public virtual string Accept(TSet type, string bufVarName, string fieldName, int depth) + { + return $"{{ let n = Math.min({bufVarName}.ReadSize(), {bufVarName}.Size); {fieldName} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}(); for(let i = 0 ; i < n ; i++) {{ let _e{depth}; {type.ElementType.Apply(this, bufVarName, $"_e{depth}", depth + 1)}; {fieldName}.add(_e{depth});}}}}"; + } + + public virtual string Accept(TMap type, string bufVarName, string fieldName, int depth) + { + return $"{{ let n = Math.min({bufVarName}.ReadSize(), {bufVarName}.Size); {fieldName} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}(); for(let i = 0 ; i < n ; i++) {{ let _k{depth}; {type.KeyType.Apply(this, bufVarName, $"_k{depth}", depth + 1)}; let _v{depth}; {type.ValueType.Apply(this, bufVarName, $"_v{depth}", depth + 1)}; {fieldName}.set(_k{depth}, _v{depth}); }} }}"; + } + + public string Accept(TDateTime type, string bufVarName, string fieldName, int depth) + { + return $"{fieldName} = {bufVarName}.ReadLongAsNumber()"; + } + } +} diff --git a/luban/src/Luban.Typescript/TypeVisitors/DeclaringTypeNameVisitor.cs b/luban/src/Luban.Typescript/TypeVisitors/DeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..158fa91b --- /dev/null +++ b/luban/src/Luban.Typescript/TypeVisitors/DeclaringTypeNameVisitor.cs @@ -0,0 +1,14 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Typescript.TypeVisitors; + +public class DeclaringTypeNameVisitor : DecoratorFuncVisitor<string> +{ + public static DeclaringTypeNameVisitor Ins { get; } = new DeclaringTypeNameVisitor(); + + public override string DoAccept(TType type) + { + return type.IsNullable ? $"{type.Apply(UnderlyingDeclaringTypeNameVisitor.Ins)}|undefined" : type.Apply(UnderlyingDeclaringTypeNameVisitor.Ins); + } +} diff --git a/luban/src/Luban.Typescript/TypeVisitors/JsonDeserializeVisitor.cs b/luban/src/Luban.Typescript/TypeVisitors/JsonDeserializeVisitor.cs new file mode 100644 index 00000000..f37e1109 --- /dev/null +++ b/luban/src/Luban.Typescript/TypeVisitors/JsonDeserializeVisitor.cs @@ -0,0 +1,26 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Typescript.TypeVisitors; + +public class JsonDeserializeVisitor : DecoratorFuncVisitor<string, string, int, string> +{ + public static JsonDeserializeVisitor Ins { get; } = new(); + + public override string DoAccept(TType type, string jsonFieldName, string fieldName, int depth) + { + if (type.IsNullable) + { + return $"if({jsonFieldName} != undefined) {{ {type.Apply(JsonUnderlyingDeserializeVisitor.Ins, jsonFieldName, fieldName, depth)} }} else {{ {fieldName} = undefined }}"; + } + else + { + return type.Apply(JsonUnderlyingDeserializeVisitor.Ins, jsonFieldName, fieldName, depth); + } + } + + //public override string Accept(TBean type, string bytebufName, string fieldName) + //{ + // return type.Apply(TypescriptJsonUnderingConstructorVisitor.Ins, bytebufName, fieldName); + //} +} diff --git a/luban/src/Luban.Typescript/TypeVisitors/JsonUnderlyingDeserializeVisitor.cs b/luban/src/Luban.Typescript/TypeVisitors/JsonUnderlyingDeserializeVisitor.cs new file mode 100644 index 00000000..5c8226c8 --- /dev/null +++ b/luban/src/Luban.Typescript/TypeVisitors/JsonUnderlyingDeserializeVisitor.cs @@ -0,0 +1,100 @@ +using Luban.DataExporter.Builtin.Json; +using Luban.Datas; +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Typescript.TypeVisitors; + +public class JsonUnderlyingDeserializeVisitor : ITypeFuncVisitor<string, string, int, string> +{ + public static JsonUnderlyingDeserializeVisitor Ins { get; } = new JsonUnderlyingDeserializeVisitor(); + + public string Accept(TBool type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TByte type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TShort type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TInt type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TLong type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TFloat type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TDouble type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TEnum type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TString type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TDateTime type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = {jsonVarName}"; + } + + public string Accept(TBean type, string jsonVarName, string fieldName, int depth) + { + if (type.DefBean.IsAbstractType) + { + return $"{fieldName} = {type.DefBean.FullName}.constructorFrom({jsonVarName})"; + } + else + { + return $"{fieldName} = new {type.DefBean.FullName}({jsonVarName})"; + } + } + + public string Accept(TArray type, string jsonVarName, string fieldName, int depth) + { + return $"{{ {fieldName} = []; for(let _ele{depth} of {jsonVarName}) {{ let _e{depth}; {type.ElementType.Apply(this, $"_ele{depth}", $"_e{depth}", depth + 1)}; {fieldName}.push(_e{depth});}}}}"; + } + + public string Accept(TList type, string jsonVarName, string fieldName, int depth) + { + return $"{{ {fieldName} = []; for(let _ele{depth} of {jsonVarName}) {{ let _e{depth}; {type.ElementType.Apply(this, $"_ele{depth}", $"_e{depth}", depth + 1)}; {fieldName}.push(_e{depth});}}}}"; + } + + public string Accept(TSet type, string jsonVarName, string fieldName, int depth) + { + if (type.ElementType.Apply(SimpleJsonTypeVisitor.Ins)) + { + return $"{fieldName} = {jsonVarName}"; + } + else + { + return $"{{ {fieldName} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}(); for(var _ele{depth} of {jsonVarName}) {{ let _e{depth}; {type.ElementType.Apply(this, $"_ele{depth}", $"_e{depth}", depth + 1)}; {fieldName}.add(_e{depth});}}}}"; + } + } + + public string Accept(TMap type, string jsonVarName, string fieldName, int depth) + { + return $"{fieldName} = new {type.Apply(DeclaringTypeNameVisitor.Ins)}(); for(var _entry{depth}_ of {jsonVarName}) {{ let _k{depth}; {type.KeyType.Apply(this, $"_entry{depth}_[0]", $"_k{depth}", depth + 1)}; let _v{depth}; {type.ValueType.Apply(this, $"_entry{depth}_[1]", $"_v{depth}", depth + 1)}; {fieldName}.set(_k{depth}, _v{depth}); }}"; + } +} diff --git a/luban/src/Luban.Typescript/TypeVisitors/UnderlyingDeclaringTypeNameVisitor.cs b/luban/src/Luban.Typescript/TypeVisitors/UnderlyingDeclaringTypeNameVisitor.cs new file mode 100644 index 00000000..72e9520f --- /dev/null +++ b/luban/src/Luban.Typescript/TypeVisitors/UnderlyingDeclaringTypeNameVisitor.cs @@ -0,0 +1,84 @@ +using Luban.Types; +using Luban.TypeVisitors; + +namespace Luban.Typescript.TypeVisitors; + +public class UnderlyingDeclaringTypeNameVisitor : ITypeFuncVisitor<string> +{ + public static UnderlyingDeclaringTypeNameVisitor Ins { get; } = new(); + + public string Accept(TBool type) + { + return "boolean"; + } + + public string Accept(TByte type) + { + return "number"; + } + + public string Accept(TShort type) + { + return "number"; + } + + public string Accept(TInt type) + { + return "number"; + } + + public string Accept(TLong type) + { + return type.IsBigInt ? "bigint" : "number"; + } + + public string Accept(TFloat type) + { + return "number"; + } + + public string Accept(TDouble type) + { + return "number"; + } + + public string Accept(TEnum type) + { + return type.DefEnum.FullName; + } + + public string Accept(TString type) + { + return "string"; + } + + public string Accept(TBean type) + { + return type.DefBean.FullName; + } + + public virtual string Accept(TArray type) + { + return $"{type.ElementType.Apply(this)}[]"; + } + + public virtual string Accept(TList type) + { + return $"{type.ElementType.Apply(this)}[]"; + } + + public virtual string Accept(TSet type) + { + return $"Set<{type.ElementType.Apply(this)}>"; + } + + public virtual string Accept(TMap type) + { + return $"Map<{type.KeyType.Apply(this)}, {type.ValueType.Apply(this)}>"; + } + + public string Accept(TDateTime type) + { + return "number"; + } +} diff --git a/luban/src/Luban.sln b/luban/src/Luban.sln new file mode 100644 index 00000000..1898ceda --- /dev/null +++ b/luban/src/Luban.sln @@ -0,0 +1,145 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34511.84 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban", "Luban\Luban.csproj", "{26003D67-6228-4848-8B8F-985992800237}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.DataLoader.Builtin", "Luban.DataLoader.Builtin\Luban.DataLoader.Builtin.csproj", "{2200760D-A03B-46F8-8968-6818FB0984CD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Core", "Luban.Core\Luban.Core.csproj", "{C89F41B6-D378-4558-A8F8-AEE4A68600DE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.CSharp", "Luban.CSharp\Luban.CSharp.csproj", "{EDEA1339-94A4-4A2D-8C09-707296306F60}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Schema.Builtin", "Luban.Schema.Builtin\Luban.Schema.Builtin.csproj", "{701EA9C0-C680-4FA3-B51B-CEC79BCFE56B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.DataTarget.Builtin", "Luban.DataTarget.Builtin\Luban.DataTarget.Builtin.csproj", "{7D1DC8E2-6581-4E35-A098-A8ED9264361C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.DataValidator.Builtin", "Luban.DataValidator.Builtin\Luban.DataValidator.Builtin.csproj", "{E1E70DDB-FBEC-429D-8FBF-657271949DB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.L10N", "Luban.L10N\Luban.L10N.csproj", "{C5278424-8595-4A09-A1FC-C5703AB1D0A0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Protobuf", "Luban.Protobuf\Luban.Protobuf.csproj", "{B7F83DCC-433F-4364-B1DB-D191BCCC9279}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.FlatBuffers", "Luban.FlatBuffers\Luban.FlatBuffers.csproj", "{0E6A7105-D241-4D13-A0B7-3AC6CC6E091D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.MsgPack", "Luban.MsgPack\Luban.MsgPack.csproj", "{EAE81827-B4AB-4FFD-ADFA-8D1DD8C3F8EE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Bson", "Luban.Bson\Luban.Bson.csproj", "{DB041AE2-4AB0-4BA1-BA6E-611BC9AC3848}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Lua", "Luban.Lua\Luban.Lua.csproj", "{6FCDA8CB-5483-48A9-9BAF-DAAB12CF27E8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Python", "Luban.Python\Luban.Python.csproj", "{37900AA3-7B17-47D6-9318-74E71C0E04B7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Java", "Luban.Java\Luban.Java.csproj", "{4195E08B-F834-4D28-9A2C-32866862B549}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Golang", "Luban.Golang\Luban.Golang.csproj", "{9C22771A-D27E-49AA-A6DC-5D6B165373F0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Typescript", "Luban.Typescript\Luban.Typescript.csproj", "{CA2B5775-0ED2-439E-8946-65C0FC4449F9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Cpp", "Luban.Cpp\Luban.Cpp.csproj", "{7692415C-FED5-4837-8DA0-4949B7E660CC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.Gdscript", "Luban.Gdscript\Luban.Gdscript.csproj", "{70A9132F-8527-4E5E-96C5-A025B880CC0B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luban.PHP", "Luban.PHP\Luban.PHP.csproj", "{96E2962A-53A9-4B73-B90B-BDCE46938B2E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luban.Rust", "Luban.Rust\Luban.Rust.csproj", "{15DC99B5-9ACF-4CB0-BCE4-3BD636A77445}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {26003D67-6228-4848-8B8F-985992800237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26003D67-6228-4848-8B8F-985992800237}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26003D67-6228-4848-8B8F-985992800237}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26003D67-6228-4848-8B8F-985992800237}.Release|Any CPU.Build.0 = Release|Any CPU + {2200760D-A03B-46F8-8968-6818FB0984CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2200760D-A03B-46F8-8968-6818FB0984CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2200760D-A03B-46F8-8968-6818FB0984CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2200760D-A03B-46F8-8968-6818FB0984CD}.Release|Any CPU.Build.0 = Release|Any CPU + {C89F41B6-D378-4558-A8F8-AEE4A68600DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C89F41B6-D378-4558-A8F8-AEE4A68600DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C89F41B6-D378-4558-A8F8-AEE4A68600DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C89F41B6-D378-4558-A8F8-AEE4A68600DE}.Release|Any CPU.Build.0 = Release|Any CPU + {EDEA1339-94A4-4A2D-8C09-707296306F60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDEA1339-94A4-4A2D-8C09-707296306F60}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDEA1339-94A4-4A2D-8C09-707296306F60}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDEA1339-94A4-4A2D-8C09-707296306F60}.Release|Any CPU.Build.0 = Release|Any CPU + {701EA9C0-C680-4FA3-B51B-CEC79BCFE56B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {701EA9C0-C680-4FA3-B51B-CEC79BCFE56B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {701EA9C0-C680-4FA3-B51B-CEC79BCFE56B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {701EA9C0-C680-4FA3-B51B-CEC79BCFE56B}.Release|Any CPU.Build.0 = Release|Any CPU + {7D1DC8E2-6581-4E35-A098-A8ED9264361C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7D1DC8E2-6581-4E35-A098-A8ED9264361C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7D1DC8E2-6581-4E35-A098-A8ED9264361C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7D1DC8E2-6581-4E35-A098-A8ED9264361C}.Release|Any CPU.Build.0 = Release|Any CPU + {E1E70DDB-FBEC-429D-8FBF-657271949DB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E1E70DDB-FBEC-429D-8FBF-657271949DB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E1E70DDB-FBEC-429D-8FBF-657271949DB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E1E70DDB-FBEC-429D-8FBF-657271949DB6}.Release|Any CPU.Build.0 = Release|Any CPU + {C5278424-8595-4A09-A1FC-C5703AB1D0A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5278424-8595-4A09-A1FC-C5703AB1D0A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5278424-8595-4A09-A1FC-C5703AB1D0A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5278424-8595-4A09-A1FC-C5703AB1D0A0}.Release|Any CPU.Build.0 = Release|Any CPU + {B7F83DCC-433F-4364-B1DB-D191BCCC9279}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7F83DCC-433F-4364-B1DB-D191BCCC9279}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7F83DCC-433F-4364-B1DB-D191BCCC9279}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7F83DCC-433F-4364-B1DB-D191BCCC9279}.Release|Any CPU.Build.0 = Release|Any CPU + {0E6A7105-D241-4D13-A0B7-3AC6CC6E091D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E6A7105-D241-4D13-A0B7-3AC6CC6E091D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E6A7105-D241-4D13-A0B7-3AC6CC6E091D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E6A7105-D241-4D13-A0B7-3AC6CC6E091D}.Release|Any CPU.Build.0 = Release|Any CPU + {EAE81827-B4AB-4FFD-ADFA-8D1DD8C3F8EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EAE81827-B4AB-4FFD-ADFA-8D1DD8C3F8EE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EAE81827-B4AB-4FFD-ADFA-8D1DD8C3F8EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EAE81827-B4AB-4FFD-ADFA-8D1DD8C3F8EE}.Release|Any CPU.Build.0 = Release|Any CPU + {DB041AE2-4AB0-4BA1-BA6E-611BC9AC3848}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DB041AE2-4AB0-4BA1-BA6E-611BC9AC3848}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DB041AE2-4AB0-4BA1-BA6E-611BC9AC3848}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DB041AE2-4AB0-4BA1-BA6E-611BC9AC3848}.Release|Any CPU.Build.0 = Release|Any CPU + {6FCDA8CB-5483-48A9-9BAF-DAAB12CF27E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6FCDA8CB-5483-48A9-9BAF-DAAB12CF27E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6FCDA8CB-5483-48A9-9BAF-DAAB12CF27E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6FCDA8CB-5483-48A9-9BAF-DAAB12CF27E8}.Release|Any CPU.Build.0 = Release|Any CPU + {37900AA3-7B17-47D6-9318-74E71C0E04B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {37900AA3-7B17-47D6-9318-74E71C0E04B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {37900AA3-7B17-47D6-9318-74E71C0E04B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {37900AA3-7B17-47D6-9318-74E71C0E04B7}.Release|Any CPU.Build.0 = Release|Any CPU + {4195E08B-F834-4D28-9A2C-32866862B549}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4195E08B-F834-4D28-9A2C-32866862B549}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4195E08B-F834-4D28-9A2C-32866862B549}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4195E08B-F834-4D28-9A2C-32866862B549}.Release|Any CPU.Build.0 = Release|Any CPU + {9C22771A-D27E-49AA-A6DC-5D6B165373F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C22771A-D27E-49AA-A6DC-5D6B165373F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C22771A-D27E-49AA-A6DC-5D6B165373F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C22771A-D27E-49AA-A6DC-5D6B165373F0}.Release|Any CPU.Build.0 = Release|Any CPU + {CA2B5775-0ED2-439E-8946-65C0FC4449F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA2B5775-0ED2-439E-8946-65C0FC4449F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA2B5775-0ED2-439E-8946-65C0FC4449F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA2B5775-0ED2-439E-8946-65C0FC4449F9}.Release|Any CPU.Build.0 = Release|Any CPU + {7692415C-FED5-4837-8DA0-4949B7E660CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7692415C-FED5-4837-8DA0-4949B7E660CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7692415C-FED5-4837-8DA0-4949B7E660CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7692415C-FED5-4837-8DA0-4949B7E660CC}.Release|Any CPU.Build.0 = Release|Any CPU + {70A9132F-8527-4E5E-96C5-A025B880CC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {70A9132F-8527-4E5E-96C5-A025B880CC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {70A9132F-8527-4E5E-96C5-A025B880CC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {70A9132F-8527-4E5E-96C5-A025B880CC0B}.Release|Any CPU.Build.0 = Release|Any CPU + {96E2962A-53A9-4B73-B90B-BDCE46938B2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96E2962A-53A9-4B73-B90B-BDCE46938B2E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96E2962A-53A9-4B73-B90B-BDCE46938B2E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96E2962A-53A9-4B73-B90B-BDCE46938B2E}.Release|Any CPU.Build.0 = Release|Any CPU + {15DC99B5-9ACF-4CB0-BCE4-3BD636A77445}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {15DC99B5-9ACF-4CB0-BCE4-3BD636A77445}.Debug|Any CPU.Build.0 = Debug|Any CPU + {15DC99B5-9ACF-4CB0-BCE4-3BD636A77445}.Release|Any CPU.ActiveCfg = Release|Any CPU + {15DC99B5-9ACF-4CB0-BCE4-3BD636A77445}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E62A389E-FD26-4B63-BE70-46C8D436FB5F} + EndGlobalSection +EndGlobal diff --git a/luban/src/Luban.sln.DotSettings b/luban/src/Luban.sln.DotSettings new file mode 100644 index 00000000..06b71d5d --- /dev/null +++ b/luban/src/Luban.sln.DotSettings @@ -0,0 +1,2 @@ +<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> + <s:Boolean x:Key="/Default/CodeEditing/SuppressUninitializedWarningFix/Enabled/@EntryValue">False</s:Boolean></wpf:ResourceDictionary> \ No newline at end of file diff --git a/luban/src/Luban/.editorconfig b/luban/src/Luban/.editorconfig new file mode 100644 index 00000000..b1150bed --- /dev/null +++ b/luban/src/Luban/.editorconfig @@ -0,0 +1,134 @@ +# Rules in this file were initially inferred by Visual Studio IntelliCode from the D:\workspace\luban\src\Luban\Source\ codebase based on best match to current usage at 2021/11/10 +# You can modify the rules from these initially generated values to suit your own policies +# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference +[*.cs] + + +#Core editorconfig formatting - indentation + +#use soft tabs (spaces) for indentation +indent_style = space + +#Formatting - indentation options + +#csharp_indent_case_contents_when_block +csharp_indent_case_contents_when_block = false + +#Formatting - new line options + +#place catch statements on a new line +csharp_new_line_before_catch = true +#place else statements on a new line +csharp_new_line_before_else = true +#require finally statements to be on a new line after the closing brace +csharp_new_line_before_finally = true +#require members of object initializers to be on the same line +csharp_new_line_before_members_in_object_initializers = false +#require braces to be on a new line for object_collection_array_initializers, control_blocks, properties, lambdas, types, methods, and accessors (also known as "Allman" style) +csharp_new_line_before_open_brace = object_collection_array_initializers, control_blocks, properties, lambdas, types, methods, accessors + +#Formatting - organize using options + +#do not place System.* using directives before other using directives +dotnet_sort_system_directives_first = false + +#Formatting - spacing options + +#require NO space between a cast and the value +csharp_space_after_cast = false +#require a space before the colon for bases or interfaces in a type declaration +csharp_space_after_colon_in_inheritance_clause = true +#require a space after a keyword in a control flow statement such as a for loop +csharp_space_after_keywords_in_control_flow_statements = true +#require a space before the colon for bases or interfaces in a type declaration +csharp_space_before_colon_in_inheritance_clause = true +#remove space within empty argument list parentheses +csharp_space_between_method_call_empty_parameter_list_parentheses = false +#remove space between method call name and opening parenthesis +csharp_space_between_method_call_name_and_opening_parenthesis = false +#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call +csharp_space_between_method_call_parameter_list_parentheses = false +#remove space within empty parameter list parentheses for a method declaration +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list. +csharp_space_between_method_declaration_parameter_list_parentheses = false + +#Formatting - wrapping options + +#leave code block on single line +csharp_preserve_single_line_blocks = true +#leave statements and member declarations on the same line +csharp_preserve_single_line_statements = true + +#Style - Code block preferences + +#prefer curly braces even for one line of code +csharp_prefer_braces = true:suggestion + +#Style - expression bodied member options + +#prefer expression-bodied members for accessors +csharp_style_expression_bodied_accessors = true:suggestion +#prefer block bodies for constructors +csharp_style_expression_bodied_constructors = false:suggestion +#prefer block bodies for methods +csharp_style_expression_bodied_methods = false:suggestion +#prefer expression-bodied members for properties +csharp_style_expression_bodied_properties = true:suggestion + +#Style - expression level options + +#prefer out variables to be declared inline in the argument list of a method call when possible +csharp_style_inlined_variable_declaration = true:suggestion +#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them +dotnet_style_predefined_type_for_member_access = true:suggestion + +#Style - Expression-level preferences + +#prefer objects to be initialized using object initializers when possible +dotnet_style_object_initializer = true:suggestion +#prefer inferred tuple element names +dotnet_style_prefer_inferred_tuple_names = true:suggestion + +#Style - implicit and explicit types + +#prefer var over explicit type in all cases, unless overridden by another code style rule +csharp_style_var_elsewhere = true:suggestion +#prefer explicit type over var to declare variables with built-in system types such as int +csharp_style_var_for_built_in_types = false:suggestion +#prefer var when the type is already mentioned on the right-hand side of a declaration expression +csharp_style_var_when_type_is_apparent = true:suggestion + +#Style - language keyword and framework type options + +#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion + +#Style - Miscellaneous preferences + +#prefer local functions over anonymous functions +csharp_style_pattern_local_over_anonymous_function = true:suggestion + +#Style - modifier options + +#prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods. +dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion + +#Style - Modifier preferences + +#when this rule is set to a list of modifiers, prefer the specified ordering. +csharp_preferred_modifier_order = public,private,internal,static,readonly,async,override,new:suggestion + +#Style - Pattern matching + +#prefer pattern matching instead of is expression with type casts +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion + +#Style - qualification options + +#prefer fields not to be prefaced with this. or Me. in Visual Basic +dotnet_style_qualification_for_field = false:suggestion +#prefer methods not to be prefaced with this. or Me. in Visual Basic +dotnet_style_qualification_for_method = false:suggestion +#prefer properties not to be prefaced with this. or Me. in Visual Basic +dotnet_style_qualification_for_property = false:suggestion diff --git a/luban/src/Luban/Luban.csproj b/luban/src/Luban/Luban.csproj new file mode 100644 index 00000000..dae116f7 --- /dev/null +++ b/luban/src/Luban/Luban.csproj @@ -0,0 +1,87 @@ +<!-- + - MIT License + - + - Copyright (c) 2023 Code Philosophy Technology Ltd. + - + - Permission is hereby granted, free of charge, to any person obtaining a copy + - of this software and associated documentation files (the "Software"), to deal + - in the Software without restriction, including without limitation the rights + - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + - copies of the Software, and to permit persons to whom the Software is + - furnished to do so, subject to the following conditions: + - + - The above copyright notice and this permission notice shall be included in all + - copies or substantial portions of the Software. + - + - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + - SOFTWARE. + --> + +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>disable</Nullable> + <OutputType>Exe</OutputType> + <RepositoryUrl>https://github.com/focus-creative-games/luban</RepositoryUrl> + <PackageReadmeFile>README.md</PackageReadmeFile> + <PackAsTool>True</PackAsTool> + <FileVersion>$(AssemblyVersion)</FileVersion> + <Version>3.10.0</Version> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="CommandLineParser" Version="2.9.1" /> + <PackageReference Include="YamlDotNet.NetCore" Version="1.0.0" /> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\Luban.Bson\Luban.Bson.csproj" /> + <ProjectReference Include="..\Luban.Cpp\Luban.Cpp.csproj" /> + <ProjectReference Include="..\Luban.CSharp\Luban.CSharp.csproj" /> + <ProjectReference Include="..\Luban.Core\Luban.Core.csproj" /> + <ProjectReference Include="..\Luban.DataTarget.Builtin\Luban.DataTarget.Builtin.csproj" /> + <ProjectReference Include="..\Luban.DataLoader.Builtin\Luban.DataLoader.Builtin.csproj" /> + <ProjectReference Include="..\Luban.DataValidator.Builtin\Luban.DataValidator.Builtin.csproj" /> + <ProjectReference Include="..\Luban.FlatBuffers\Luban.FlatBuffers.csproj" /> + <ProjectReference Include="..\Luban.Gdscript\Luban.Gdscript.csproj" /> + <ProjectReference Include="..\Luban.Golang\Luban.Golang.csproj" /> + <ProjectReference Include="..\Luban.Java\Luban.Java.csproj" /> + <ProjectReference Include="..\Luban.L10N\Luban.L10N.csproj" /> + <ProjectReference Include="..\Luban.Lua\Luban.Lua.csproj" /> + <ProjectReference Include="..\Luban.MsgPack\Luban.MsgPack.csproj" /> + <ProjectReference Include="..\Luban.PHP\Luban.PHP.csproj" /> + <ProjectReference Include="..\Luban.Protobuf\Luban.Protobuf.csproj" /> + <ProjectReference Include="..\Luban.Python\Luban.Python.csproj" /> + <ProjectReference Include="..\Luban.Rust\Luban.Rust.csproj" /> + <ProjectReference Include="..\Luban.Schema.Builtin\Luban.Schema.Builtin.csproj" /> + <ProjectReference Include="..\Luban.Typescript\Luban.Typescript.csproj" /> + </ItemGroup> + + <ItemGroup> + <Folder Include="Plugin\" /> + </ItemGroup> + + <ItemGroup> + <None Include="..\..\README.md"> + <Pack>True</Pack> + <PackagePath>\</PackagePath> + </None> + </ItemGroup> + + <ItemGroup> + <None Update="nlog.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Update="Templates\common\flatbuffers\enum.sbn"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + </ItemGroup> + +</Project> diff --git a/luban/src/Luban/Program.cs b/luban/src/Luban/Program.cs new file mode 100644 index 00000000..4b294e66 --- /dev/null +++ b/luban/src/Luban/Program.cs @@ -0,0 +1,320 @@ +using CommandLine; +using Luban.DataLoader; +using Luban.Pipeline; +using Luban.Schema; +using Luban.Tmpl; +using Luban.Utils; +using NLog; +using System.Text; + +namespace Luban; + +internal static class Program +{ + + private class CommandOptions + { + + [Option('s', "schemaCollector", Required = false, HelpText = "schema collector name")] + public string SchemaCollector { get; set; } = "default"; + + [Option("conf", Required = true, HelpText = "luban conf file")] + public string ConfigFile { get; set; } + + [Option('t', "target", Required = true, HelpText = "target name")] + public string Target { get; set; } + + [Option('c', "codeTarget", Required = false, HelpText = "code target name")] + public IEnumerable<string> CodeTargets { get; set; } + + [Option('d', "dataTarget", Required = false, HelpText = "data target name")] + public IEnumerable<string> DataTargets { get; set; } + + [Option('p', "pipeline", Required = false, HelpText = "pipeline name")] + public string Pipeline { get; set; } = "default"; + + [Option('f', "forceLoadTableDatas", Required = false, HelpText = "force load table datas when not any dataTarget")] + public bool ForceLoadTableDatas { get; set; } + + [Option('i', "includeTag", Required = false, HelpText = "include tag")] + public IEnumerable<string> IncludeTags { get; set; } + + [Option('e', "excludeTag", Required = false, HelpText = "exclude tag")] + public IEnumerable<string> ExcludeTags { get; set; } + + [Option("variant", Required = false, HelpText = "field variants")] + public IEnumerable<string> Variants { get; set; } + + [Option('o', "outputTable", Required = false, HelpText = "output table")] + public IEnumerable<string> OutputTables { get; set; } + + [Option("timeZone", Required = false, HelpText = "time zone")] + public string TimeZone { get; set; } + + [Option("customTemplateDir", Required = false, HelpText = "custom template dirs")] + public IEnumerable<string> CustomTemplateDirs { get; set; } + + [Option("validationFailAsError", Required = false, HelpText = "validation fail as error")] + public bool ValidationFailAsError { get; set; } + + [Option('x', "xargs", Required = false, HelpText = "args like -x a=1 -x b=2")] + public IEnumerable<string> Xargs { get; set; } + + [Option('l', "logConfig", Required = false, Default = "nlog.xml", HelpText = "nlog config file")] + public string LogConfig { get; set; } + + [Option('w', "watchDir", Required = false, HelpText = "watch dir and regererate when dir changes")] + public IEnumerable<string> WatchDirs { get; set; } + + [Option('v', "verbose", Required = false, HelpText = "verbose")] + public bool Verbose { get; set; } + } + + private static ILogger s_logger; + + private static void Main(string[] args) + { + CommandOptions opts = ParseArgs(args); + SetupApp(opts); + + if (opts.WatchDirs != null && opts.WatchDirs.Any()) + { + RunLoop(opts, opts.WatchDirs); + } + else + { + RunOnce(opts); + } + } + + private static void RunOnce(CommandOptions opts) + { + RunGeneration(opts, true); + } + + private static volatile bool s_anyChange = false; + + private static void RunLoop(CommandOptions opts, IEnumerable<string> watchDirs) + { + var watcher = new DirectoryWatcher(opts.WatchDirs.ToArray(), () => s_anyChange = true); + s_anyChange = true; + while (true) + { + if (s_anyChange) + { + s_anyChange = false; + RunGeneration(opts, false); + } + Thread.Sleep(1000); + } + } + + private static void RunGeneration(CommandOptions opts, bool exitOnError) + { + try + { + IConfigLoader rootLoader = new GlobalConfigLoader(); + var config = rootLoader.Load(opts.ConfigFile); + GenerationContext.GlobalConf = config; + + + var launcher = new SimpleLauncher(); + launcher.Start(ParseXargs(config.Xargs, opts.Xargs)); + AddCustomTemplateDirs(opts.CustomTemplateDirs); + + var pipeline = PipelineManager.Ins.CreatePipeline(opts.Pipeline); + pipeline.Run(CreatePipelineArgs(opts, config)); + if (exitOnError && opts.ValidationFailAsError && GenerationContext.Current.AnyValidatorFail) + { + s_logger.Error("encounter some validation failure. exit code: 1"); + Environment.Exit(1); + } + s_logger.Info("bye~"); + } + catch (Exception e) + { + PrettyPrintException(e); + s_logger.Error("run failed!!!"); + if (exitOnError) + { + Environment.Exit(1); + } + } + } + + private static void PrettyPrintException(Exception e) + { + if (TryExtractDataCreateException(e, out var dce)) + { + s_logger.Error($"======================================================================="); + s_logger.Error("解析失败!"); + s_logger.Error($"文件: {dce.OriginDataLocation}"); + s_logger.Error($"错误位置: {dce.DataLocationInFile}"); + s_logger.Error($"Err: {dce.OriginErrorMsg}"); + s_logger.Error($"字段: {dce.VariableFullPathStr}"); + s_logger.Error($"======================================================================="); + return; + } + do + { + s_logger.Error("===> {}", e.Message); + e = e.InnerException; + } while (e != null); + } + + private static bool TryExtractDataCreateException(Exception e, out DataCreateException extract) + { + if (e is DataCreateException dce) + { + extract = dce; + return true; + } + + if (e is AggregateException ae) + { + foreach (var innerException in ae.InnerExceptions) + { + if (TryExtractDataCreateException(innerException, out extract)) + { + return true; + } + } + } + + if (e.InnerException != null) + { + if (TryExtractDataCreateException(e.InnerException, out extract)) + { + return true; + } + } + extract = null; + return false; + } + + private static void AddCustomTemplateDirs(IEnumerable<string> dirs) + { + foreach (var dir in dirs) + { + TemplateManager.Ins.AddTemplateSearchPath(dir, true, true); + } + } + + private static CommandOptions ParseArgs(string[] args) + { + var helpWriter = new StringWriter(); + var parser = new Parser(settings => + { + settings.AllowMultiInstance = true; + settings.HelpWriter = helpWriter; + }); + + var result = parser.ParseArguments<CommandOptions>(args); + if (result.Tag == ParserResultType.NotParsed) + { + Console.Error.WriteLine(helpWriter.ToString()); + Environment.Exit(1); + } + return ((Parsed<CommandOptions>)result).Value; + } + + + private static Dictionary<string, string> ParseXargs0(IEnumerable<string> xargs) + { + var result = new Dictionary<string, string>(); + if (xargs == null) + { + return result; + } + foreach (var arg in xargs) + { + string[] pair = arg.Split('=', 2); + if (pair.Length != 2) + { + throw new Exception($"invalid xargs:{arg}"); + } + + if (!result.TryAdd(pair[0], pair[1])) + { + throw new Exception($"duplicate xargs:{arg}"); + } + } + return result; + } + + private static Dictionary<string, string> ParseXargs(IEnumerable<string> defaultXargs, IEnumerable<string> cmdXargs) + { + var defaultXargsMap = ParseXargs0(defaultXargs); + var cmdXargsMap = ParseXargs0(cmdXargs); + foreach (var kv in cmdXargsMap) + { + defaultXargsMap[kv.Key] = kv.Value; + } + return defaultXargsMap; + } + + private static Dictionary<string, string> ParseVariants(IEnumerable<string> variants) + { + var result = new Dictionary<string, string>(); + if (variants == null) + { + return result; + } + foreach (var variant in variants) + { + string[] pair = variant.Split('=', 2); + if (pair.Length != 2) + { + throw new Exception($"invalid variant:{variant}"); + } + + if (!result.TryAdd(pair[0], pair[1])) + { + throw new Exception($"duplicate variant:{variant}"); + } + } + return result; + } + + private static PipelineArguments CreatePipelineArgs(CommandOptions opts, LubanConfig config) + { + return new PipelineArguments() + { + Target = opts.Target, + ForceLoadTableDatas = opts.ForceLoadTableDatas, + SchemaCollector = opts.SchemaCollector, + Config = config, + OutputTables = opts.OutputTables?.ToList() ?? new List<string>(), + CodeTargets = opts.CodeTargets?.ToList() ?? new List<string>(), + DataTargets = opts.DataTargets?.ToList() ?? new List<string>(), + IncludeTags = opts.IncludeTags?.ToList() ?? new List<string>(), + ExcludeTags = opts.ExcludeTags?.ToList() ?? new List<string>(), + Variants = ParseVariants(opts.Variants), + TimeZone = opts.TimeZone, + }; + } + + private static void SetupApp(CommandOptions opts) + { + ConsoleUtil.EnableQuickEditMode(false); + Console.OutputEncoding = Encoding.UTF8; + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + + int processorCount = Environment.ProcessorCount; + ThreadPool.SetMinThreads(Math.Max(4, processorCount), 0); + ThreadPool.SetMaxThreads(Math.Max(16, processorCount * 2), 2); + + NLog.LogManager.Setup().LoadConfigurationFromFile(opts.LogConfig); + s_logger = LogManager.GetCurrentClassLogger(); + PrintCopyRight(); + } + + private static void PrintCopyRight() + { + s_logger.Info(" =========================================================================================="); + s_logger.Info(""); + s_logger.Info(" Luban is developed by Code Philosophy Technology Co., LTD. https://code-philosophy.com"); + s_logger.Info(""); + s_logger.Info(" =========================================================================================="); + } +} diff --git a/luban/src/Luban/Utils/ConsoleUtil.cs b/luban/src/Luban/Utils/ConsoleUtil.cs new file mode 100644 index 00000000..a27229a9 --- /dev/null +++ b/luban/src/Luban/Utils/ConsoleUtil.cs @@ -0,0 +1,70 @@ +using System.Runtime.InteropServices; + +namespace Luban.Utils; + +public static class ConsoleUtil +{ + private static class NativeFunctions + { + public enum StdHandle : int + { + STD_INPUT_HANDLE = -10, + STD_OUTPUT_HANDLE = -11, + STD_ERROR_HANDLE = -12, + } + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern IntPtr GetStdHandle(int nStdHandle); //returns Handle + + public enum ConsoleMode : uint + { + ENABLE_ECHO_INPUT = 0x0004, + ENABLE_EXTENDED_FLAGS = 0x0080, + ENABLE_INSERT_MODE = 0x0020, + ENABLE_LINE_INPUT = 0x0002, + ENABLE_MOUSE_INPUT = 0x0010, + ENABLE_PROCESSED_INPUT = 0x0001, + ENABLE_QUICK_EDIT_MODE = 0x0040, + ENABLE_WINDOW_INPUT = 0x0008, + ENABLE_VIRTUAL_TERMINAL_INPUT = 0x0200, + + //screen buffer handle + ENABLE_PROCESSED_OUTPUT = 0x0001, + ENABLE_WRAP_AT_EOL_OUTPUT = 0x0002, + ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004, + DISABLE_NEWLINE_AUTO_RETURN = 0x0008, + ENABLE_LVB_GRID_WORLDWIDE = 0x0010 + } + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern bool GetConsoleMode(IntPtr hConsoleHandle, out uint lpMode); + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern bool SetConsoleMode(IntPtr hConsoleHandle, uint dwMode); + } + + public static void EnableQuickEditMode(bool enable) + { + if (System.OperatingSystem.IsWindows()) + { + //QuickEdit lets the user select text in the console window with the mouse, to copy to the windows clipboard. + //But selecting text stops the console process (e.g. unzipping). This may not be always wanted. + IntPtr consoleHandle = NativeFunctions.GetStdHandle((int)NativeFunctions.StdHandle.STD_INPUT_HANDLE); + UInt32 consoleMode; + + NativeFunctions.GetConsoleMode(consoleHandle, out consoleMode); + if (enable) + { + consoleMode |= ((uint)NativeFunctions.ConsoleMode.ENABLE_QUICK_EDIT_MODE); + } + else + { + consoleMode &= ~((uint)NativeFunctions.ConsoleMode.ENABLE_QUICK_EDIT_MODE); + } + + consoleMode |= ((uint)NativeFunctions.ConsoleMode.ENABLE_EXTENDED_FLAGS); + + NativeFunctions.SetConsoleMode(consoleHandle, consoleMode); + } + } +} diff --git a/luban/src/Luban/Utils/DirectoryWatcher.cs b/luban/src/Luban/Utils/DirectoryWatcher.cs new file mode 100644 index 00000000..30ac8e42 --- /dev/null +++ b/luban/src/Luban/Utils/DirectoryWatcher.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Luban.Utils +{ + internal class DirectoryWatcher + { + private static readonly NLog.Logger s_logger = NLog.LogManager.GetCurrentClassLogger(); + + private readonly List<FileSystemWatcher> _watchers = new List<FileSystemWatcher>(); + + private readonly Action _onChange; + + private readonly object _watchLocker = new object(); + + public DirectoryWatcher(string[] files, Action onChange) + { + this._onChange = onChange; + + s_logger.Info("watching dirs: {0}", string.Join(",", files)); + foreach (var file in files) + { + var watcher = new FileSystemWatcher(file); + + watcher.NotifyFilter = // NotifyFilters.Attributes + //| NotifyFilters.CreationTime + NotifyFilters.DirectoryName + | NotifyFilters.FileName + //| NotifyFilters.LastAccess + | NotifyFilters.LastWrite + //| NotifyFilters.Security + | NotifyFilters.Size; + + watcher.Changed += this.OnChange; + watcher.Created += this.OnChange; + watcher.Deleted += this.OnChange; + watcher.Renamed += this.OnChange; + + //watcher.Filter = "*.txt"; + watcher.IncludeSubdirectories = true; + watcher.EnableRaisingEvents = true; + + this._watchers.Add(watcher); + } + } + + private static readonly List<string> _filterSuffixs = new List<string> + { + ".xlsx", + ".csv", + ".xls", + ".xlsm", + ".json", + ".lua", + ".xml", + ".yml", + }; + + private void OnChange(object sender, FileSystemEventArgs e) + { + var dirtyName = e.Name; + if (string.IsNullOrWhiteSpace(dirtyName) + || !_filterSuffixs.Any(dirtyName.EndsWith) + || dirtyName.Contains('~') + || dirtyName.Contains('$')) + { + return; + } + + lock (_watchLocker) + { + s_logger.Trace("== mark dirty:{}", e.FullPath); + + try + { + this._onChange(); + } + catch (Exception e2) + { + s_logger.Error(e2, "OnChange exception"); + } + } + } + } +} diff --git a/luban/src/Luban/nlog.xml b/luban/src/Luban/nlog.xml new file mode 100644 index 00000000..8c390bc0 --- /dev/null +++ b/luban/src/Luban/nlog.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8" ?> +<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <targets> + <default-wrapper xsi:type="AsyncWrapper" + name="default-wrapper" + queueLimit="1000000" + timeToSleepBetweenBatches="1" + batchSize="1000" + overflowAction="Block" + /> + + <target name="logconsole" xsi:type="ColoredConsole" useDefaultRowHighlightingRules="false" + layout="${date}|${level:uppercase=true}|${message}${onexception:${newline}${exception:format=tostring}${exception:format=StackTrace}}" > + <highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" /> + <highlight-row condition="level == LogLevel.Error" foregroundColor="Red" /> + <highlight-row condition="level == LogLevel.Fatal" foregroundColor="Red" backgroundColor="White" /> + </target> + </targets> + + <rules> + <logger name="*" minlevel="Info" writeTo="logconsole" /> + </rules> +</nlog> diff --git a/luban/src/nuget.config b/luban/src/nuget.config new file mode 100644 index 00000000..05097ed5 --- /dev/null +++ b/luban/src/nuget.config @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <packageSources> + <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> + </packageSources> + <packageRestore> + <add key="enabled" value="True" /> + <add key="automatic" value="True" /> + </packageRestore> + <bindingRedirects> + <add key="skip" value="False" /> + </bindingRedirects> + <packageManagement> + <add key="format" value="0" /> + <add key="disabled" value="False" /> + </packageManagement> +</configuration> \ No newline at end of file