升级框架
This commit is contained in:
Binary file not shown.
@@ -2,19 +2,15 @@
|
||||
"Export": {
|
||||
"NetworkProtocolDirectory": {
|
||||
"Value": "..//NetworkProtocol/",
|
||||
"Comment": "网络协议文件所在的文件夹位置"
|
||||
"Comment": "ProtoBuf文件所在的文件夹位置"
|
||||
},
|
||||
"NetworkProtocolServerDirectory": {
|
||||
"Value": "../../Entity/Generate/NetworkProtocol/",
|
||||
"Comment": "网络协议生成到服务端的文件夹位置"
|
||||
"Comment": "ProtoBuf生成到服务端的文件夹位置"
|
||||
},
|
||||
"NetworkProtocolClientDirectory": {
|
||||
"Value": "../../../Fishing2/Assets/Scripts/Generate/NetworkProtocol/",
|
||||
"Comment": "网络协议生成到客户端的文件夹位置"
|
||||
},
|
||||
"Serializes": {
|
||||
"Value": [],
|
||||
"Comment": "自定义序列化器,暂不支持"
|
||||
"Comment": "ProtoBuf生成到客户端的文件夹位置"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
Tools/ProtocolExportTool/Fantasy.ProtocolExportTool
Normal file
BIN
Tools/ProtocolExportTool/Fantasy.ProtocolExportTool
Normal file
Binary file not shown.
120
Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.deps.json
Normal file
120
Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.deps.json
Normal file
@@ -0,0 +1,120 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"Fantasy.ProtocolExportTool/1.0.0": {
|
||||
"dependencies": {
|
||||
"Spectre.Console": "0.54.0",
|
||||
"System.CommandLine": "2.0.0",
|
||||
"System.Text.Json": "9.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"Fantasy.ProtocolExportTool.dll": {}
|
||||
}
|
||||
},
|
||||
"Spectre.Console/0.54.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Spectre.Console.dll": {
|
||||
"assemblyVersion": "0.0.0.0",
|
||||
"fileVersion": "0.54.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.CommandLine/2.0.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/System.CommandLine.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.0.25.52411"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/net8.0/zh-Hans/System.CommandLine.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Pipelines/9.0.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/System.IO.Pipelines.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.24.52809"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Text.Encodings.Web/9.0.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/System.Text.Encodings.Web.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.24.52809"
|
||||
}
|
||||
},
|
||||
"runtimeTargets": {
|
||||
"runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll": {
|
||||
"rid": "browser",
|
||||
"assetType": "runtime",
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.24.52809"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Text.Json/9.0.0": {
|
||||
"dependencies": {
|
||||
"System.IO.Pipelines": "9.0.0",
|
||||
"System.Text.Encodings.Web": "9.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/System.Text.Json.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.24.52809"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Fantasy.ProtocolExportTool/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Spectre.Console/0.54.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-StDXCFayfy0yB1xzUHT2tgEpV1/HFTiS4JgsAQS49EYTfMixSwwucaQs/bIOCwXjWwIQTMuxjUIxcB5XsJkFJA==",
|
||||
"path": "spectre.console/0.54.0",
|
||||
"hashPath": "spectre.console.0.54.0.nupkg.sha512"
|
||||
},
|
||||
"System.CommandLine/2.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-Bjklzc5NoxqAGFi7BcGlY2TWAdB06Bq3a5sfRr3ubMRU80Mf98eyq3Y2UgR6xRV0TLznZmfe5T7mUjOunRNcdA==",
|
||||
"path": "system.commandline/2.0.0",
|
||||
"hashPath": "system.commandline.2.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.Text.Encodings.Web/9.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-e2hMgAErLbKyUUwt18qSBf9T5Y+SFAL3ZedM8fLupkVj8Rj2PZ9oxQ37XX2LF8fTO1wNIxvKpihD7Of7D/NxZw==",
|
||||
"path": "system.text.encodings.web/9.0.0",
|
||||
"hashPath": "system.text.encodings.web.9.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Text.Json/9.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-js7+qAu/9mQvnhA4EfGMZNEzXtJCDxgkgj8ohuxq/Qxv+R56G+ljefhiJHOxTNiw54q8vmABCWUwkMulNdlZ4A==",
|
||||
"path": "system.text.json/9.0.0",
|
||||
"hashPath": "system.text.json.9.0.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.dll
Normal file
BIN
Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.dll
Normal file
Binary file not shown.
BIN
Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.pdb
Normal file
BIN
Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.pdb
Normal file
Binary file not shown.
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net9.0",
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "9.0.0"
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,206 +0,0 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v9.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v9.0": {
|
||||
"Fantasy.Tools.NetworkProtocol/1.0.0": {
|
||||
"dependencies": {
|
||||
"CommandLineParser": "2.9.1",
|
||||
"Microsoft.Extensions.Configuration.Json": "9.0.10",
|
||||
"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/9.0.10": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.10",
|
||||
"Microsoft.Extensions.Primitives": "9.0.10"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.1025.47515"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/9.0.10": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "9.0.10"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.Abstractions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.1025.47515"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions/9.0.10": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "9.0.10",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.10",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.10",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "9.0.10",
|
||||
"Microsoft.Extensions.Primitives": "9.0.10"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.FileExtensions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.1025.47515"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json/9.0.10": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "9.0.10",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.10",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "9.0.10",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.10"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.Json.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.1025.47515"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Abstractions/9.0.10": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "9.0.10"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.FileProviders.Abstractions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.1025.47515"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Physical/9.0.10": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.10",
|
||||
"Microsoft.Extensions.FileSystemGlobbing": "9.0.10",
|
||||
"Microsoft.Extensions.Primitives": "9.0.10"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.FileProviders.Physical.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.1025.47515"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileSystemGlobbing/9.0.10": {
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.FileSystemGlobbing.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.1025.47515"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/9.0.10": {
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Primitives.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.1025.47515"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.3.27908"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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/9.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-UAm3SLGAMlJdowbN+/xnh2UGJkdJoXVm4MsdhZ60dAMS8jteoyCx5WfIab5DKv0TCYpdhVecLJVUjEO3abs9UQ==",
|
||||
"path": "microsoft.extensions.configuration/9.0.10",
|
||||
"hashPath": "microsoft.extensions.configuration.9.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/9.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-ad3JxmFj0uxuFa1CT6oxTCC1lQ0xeRuOvzBRFT/I/ofIXVOnNsH/v2GZkAJWhlpZqKUvSexQZzp3EEAB2CdtJg==",
|
||||
"path": "microsoft.extensions.configuration.abstractions/9.0.10",
|
||||
"hashPath": "microsoft.extensions.configuration.abstractions.9.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions/9.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-kYWY9VRoCKQJCLKAA4Wqn74FVnytqosF7vFq1chJ8st9mGZS6SQrkoZg7GmcpqrRRUWmWDOZI4nFdoFnxsI/Ug==",
|
||||
"path": "microsoft.extensions.configuration.fileextensions/9.0.10",
|
||||
"hashPath": "microsoft.extensions.configuration.fileextensions.9.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json/9.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-bn+qnwuOaDelax8PUw30UTjLOuEd0lGWqUG4Z+oVr4D/gEWouCWOyvCVkyn+PWbftPlnmAmWxd4J+7ljwE8wVw==",
|
||||
"path": "microsoft.extensions.configuration.json/9.0.10",
|
||||
"hashPath": "microsoft.extensions.configuration.json.9.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Abstractions/9.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3+cLxZKUWBbpfIXLLuKcEok9C91PsV1h5xxfUsEnLSXXLNMiPDfrhpb1xajNFcejFPs9Ck/Fi3z71hYDqFBwYg==",
|
||||
"path": "microsoft.extensions.fileproviders.abstractions/9.0.10",
|
||||
"hashPath": "microsoft.extensions.fileproviders.abstractions.9.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Physical/9.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-Eg3YOEMpHWZzAgPD9YvGkQSv97AtG3II6maRQV/voDRORh4bRiyl0mVtT2PKnu1JoD9rJeYgjGCwRvVWMBaqgQ==",
|
||||
"path": "microsoft.extensions.fileproviders.physical/9.0.10",
|
||||
"hashPath": "microsoft.extensions.fileproviders.physical.9.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.FileSystemGlobbing/9.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-KdZAM2YMYBipVp/4tSEWPLnrocd17SL4iaXdgXjR5/nheBXbfR5QfPWYoTyh6C6IW3uKR7TRMwQr2qCvtaCTiA==",
|
||||
"path": "microsoft.extensions.filesystemglobbing/9.0.10",
|
||||
"hashPath": "microsoft.extensions.filesystemglobbing.9.0.10.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/9.0.10": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3pl8D1O5ZwMpDkZAT2uXrhQ6NipkwEgDLMFuURiHTf72TvkoMP61QYH3Vk1yrzVHnHBdNZk3cQACz8Zc7YGNhQ==",
|
||||
"path": "microsoft.extensions.primitives/9.0.10",
|
||||
"hashPath": "microsoft.extensions.primitives.9.0.10.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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,35 +0,0 @@
|
||||
#if SERVER
|
||||
using ProtoBuf;
|
||||
(UsingNamespace)
|
||||
using System;
|
||||
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
|
||||
{
|
||||
#else
|
||||
using ProtoBuf;
|
||||
using System;
|
||||
(UsingNamespace)
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Network.Interface;
|
||||
using Fantasy.Serialize;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace Fantasy
|
||||
{
|
||||
#endif
|
||||
(Content)}
|
||||
Binary file not shown.
@@ -1,21 +1,98 @@
|
||||
@echo off
|
||||
chcp 65001 >nul
|
||||
setlocal
|
||||
|
||||
echo Please select an option:
|
||||
echo 1. Client
|
||||
echo 2. Server
|
||||
echo 3. All
|
||||
REM 设置错误处理 - 确保脚本出错时不会一闪而过
|
||||
if not defined IN_SUBPROCESS (
|
||||
set IN_SUBPROCESS=1
|
||||
cmd /k "%~f0 %*"
|
||||
exit /b
|
||||
)
|
||||
|
||||
set /p choice=Please select an option:
|
||||
echo ==========================================
|
||||
echo Fantasy Protocol Export Tool 2025.2.1422
|
||||
echo ==========================================
|
||||
echo.
|
||||
|
||||
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
|
||||
)
|
||||
REM 获取脚本所在目录
|
||||
set "SCRIPT_DIR=%~dp0"
|
||||
set "APP_DLL=%SCRIPT_DIR%Fantasy.ProtocolExportTool.dll"
|
||||
|
||||
REM 检查 dotnet 是否安装
|
||||
where dotnet >nul 2>nul
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo ==========================================
|
||||
echo 错误:未检测到 .NET 运行时
|
||||
echo ==========================================
|
||||
echo.
|
||||
echo 请先安装 .NET 8.0 SDK 或 Runtime
|
||||
echo.
|
||||
echo 下载地址:
|
||||
echo https://dotnet.microsoft.com/download/dotnet/8.0
|
||||
echo.
|
||||
goto :error
|
||||
)
|
||||
|
||||
REM 检查 .NET 版本
|
||||
for /f "tokens=1 delims=." %%v in ('dotnet --version 2^>nul') do set MAJOR_VERSION=%%v
|
||||
|
||||
if not defined MAJOR_VERSION (
|
||||
echo.
|
||||
echo ==========================================
|
||||
echo 错误:无法获取 .NET 版本
|
||||
echo ==========================================
|
||||
echo.
|
||||
goto :error
|
||||
)
|
||||
|
||||
if %MAJOR_VERSION% LSS 8 (
|
||||
echo.
|
||||
echo ==========================================
|
||||
echo 错误:.NET 版本过低
|
||||
echo ==========================================
|
||||
echo.
|
||||
dotnet --version
|
||||
echo 需要版本: 8.0 或更高
|
||||
echo.
|
||||
echo 请升级到 .NET 8.0 或更高版本
|
||||
echo.
|
||||
echo 下载地址:
|
||||
echo https://dotnet.microsoft.com/download/dotnet/8.0
|
||||
echo.
|
||||
goto :error
|
||||
)
|
||||
|
||||
dotnet --version
|
||||
echo.
|
||||
echo 正在启动导出工具...
|
||||
echo.
|
||||
|
||||
REM 运行导出工具
|
||||
dotnet "%APP_DLL%" export --silent
|
||||
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo ==========================================
|
||||
echo × 导出失败
|
||||
echo ==========================================
|
||||
echo.
|
||||
echo 提示:请检查 ExporterSettings.json 配置文件是否正确
|
||||
echo.
|
||||
goto :error
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ==========================================
|
||||
echo √ 导出完成!
|
||||
echo ==========================================
|
||||
echo.
|
||||
echo 按任意键退出...
|
||||
pause >nul
|
||||
exit /b 0
|
||||
|
||||
:error
|
||||
echo.
|
||||
echo 按任意键退出...
|
||||
pause >nul
|
||||
exit /b 1
|
||||
|
||||
@@ -1,24 +1,115 @@
|
||||
#!/bin/bash
|
||||
# Fantasy Protocol Export Tool - 运行脚本
|
||||
# 此脚本用于快速运行协议导出工具
|
||||
|
||||
echo "1. Client"
|
||||
echo "2. Server"
|
||||
echo "3. All"
|
||||
# 错误处理函数 - 确保脚本出错时不会一闪而过
|
||||
error_exit() {
|
||||
echo ""
|
||||
echo "按回车键退出..."
|
||||
read -r
|
||||
exit 1
|
||||
}
|
||||
|
||||
read -n 1 -p "Please select an option:" choice
|
||||
# 成功退出函数
|
||||
success_exit() {
|
||||
echo ""
|
||||
echo "按回车键退出..."
|
||||
read -r
|
||||
exit 0
|
||||
}
|
||||
|
||||
# 设置错误捕获
|
||||
trap 'echo ""; echo "=========================================="; echo "✗ 发生未预期的错误"; echo "=========================================="; error_exit' ERR
|
||||
|
||||
# 获取脚本所在目录
|
||||
SCRIPT_DIR=$(cd $(dirname "$0") && pwd)
|
||||
APP_DLL="$SCRIPT_DIR/Fantasy.ProtocolExportTool.dll"
|
||||
|
||||
##############################################
|
||||
# 检测 .NET 运行时
|
||||
##############################################
|
||||
check_dotnet() {
|
||||
# 检查是否安装了 dotnet
|
||||
if ! command -v dotnet &> /dev/null; then
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "错误:未检测到 .NET 运行时"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "请先安装 .NET 8.0 SDK 或 Runtime"
|
||||
echo ""
|
||||
echo "下载地址:"
|
||||
echo " https://dotnet.microsoft.com/download/dotnet/8.0"
|
||||
echo ""
|
||||
echo "安装说明:"
|
||||
echo " macOS: brew install dotnet@8"
|
||||
echo " Linux: 参考官方文档安装对应发行版的包"
|
||||
echo ""
|
||||
error_exit
|
||||
fi
|
||||
|
||||
# 检查 .NET 版本
|
||||
DOTNET_VERSION=$(dotnet --version 2>/dev/null || echo "0.0.0")
|
||||
MAJOR_VERSION=$(echo "$DOTNET_VERSION" | cut -d'.' -f1)
|
||||
|
||||
if [ -z "$MAJOR_VERSION" ] || [ "$MAJOR_VERSION" = "0" ]; then
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "错误:无法获取 .NET 版本"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
error_exit
|
||||
fi
|
||||
|
||||
if [ "$MAJOR_VERSION" -lt 8 ]; then
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "错误:.NET 版本过低"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "当前版本: $DOTNET_VERSION"
|
||||
echo "需要版本: 8.0 或更高"
|
||||
echo ""
|
||||
echo "请升级到 .NET 8.0 或更高版本"
|
||||
echo ""
|
||||
echo "下载地址:"
|
||||
echo " https://dotnet.microsoft.com/download/dotnet/8.0"
|
||||
echo ""
|
||||
error_exit
|
||||
fi
|
||||
|
||||
echo "✓ 检测到 .NET $DOTNET_VERSION"
|
||||
}
|
||||
|
||||
##############################################
|
||||
# 主程序
|
||||
##############################################
|
||||
|
||||
echo "=========================================="
|
||||
echo "Fantasy Protocol Export Tool 2025.2.1422"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
|
||||
# 检测 .NET
|
||||
check_dotnet
|
||||
|
||||
echo ""
|
||||
script_dir=$(cd $(dirname $0) && pwd)
|
||||
case $choice in
|
||||
1)
|
||||
dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 1 --f $script_dir
|
||||
;;
|
||||
2)
|
||||
dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 2 --f $script_dir
|
||||
;;
|
||||
3)
|
||||
dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 3 --f $script_dir
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option"
|
||||
;;
|
||||
esac
|
||||
echo "正在启动导出工具..."
|
||||
echo ""
|
||||
|
||||
# 使用静默模式(从 ExporterSettings.json 读取配置)
|
||||
if dotnet "$APP_DLL" export --silent; then
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "✓ 导出完成!"
|
||||
echo "=========================================="
|
||||
success_exit
|
||||
else
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "✗ 导出失败"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "提示:请检查 ExporterSettings.json 配置文件是否正确"
|
||||
error_exit
|
||||
fi
|
||||
|
||||
BIN
Tools/ProtocolExportTool/Spectre.Console.dll
Normal file
BIN
Tools/ProtocolExportTool/Spectre.Console.dll
Normal file
Binary file not shown.
BIN
Tools/ProtocolExportTool/System.CommandLine.dll
Normal file
BIN
Tools/ProtocolExportTool/System.CommandLine.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Tools/ProtocolExportTool/runtimes/.DS_Store
vendored
BIN
Tools/ProtocolExportTool/runtimes/.DS_Store
vendored
Binary file not shown.
BIN
Tools/ProtocolExportTool/runtimes/browser/.DS_Store
vendored
BIN
Tools/ProtocolExportTool/runtimes/browser/.DS_Store
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user