升级框架

This commit is contained in:
2026-01-18 16:37:46 +08:00
parent 917d82d3e8
commit 58911b2ef4
156 changed files with 6485 additions and 3410 deletions

View File

@@ -2,52 +2,52 @@ syntax = "proto3";
package Sining.Message;
///通知游戏服角色进入该游戏服
message G2Common_EnterRequest // IRouteRequest,G2Common_EnterResponse
message G2Common_EnterRequest // IAddressRequest,G2Common_EnterResponse
{
int64 AccountId = 1; //账号id
int64 GateRouteId = 2; //网关路由地址
int32 RouteType = 3; //登陆的路由类型
}
message G2Common_EnterResponse // IRouteResponse
message G2Common_EnterResponse // IAddressResponse
{
int64 UnitRouteId = 1; //实体的路由id
int32 RouteType = 2; //登陆的场景类型
}
message G2Common_ExitRequest // IRouteRequest,Common2G_ExitResponse
message G2Common_ExitRequest // IAddressRequest,Common2G_ExitResponse
{
int64 AccountId = 1; //账号id
int64 GateRouteId = 2;//网关路由地址
}
message Common2G_ExitResponse // IRouteResponse
message Common2G_ExitResponse // IAddressResponse
{
}
///获取玩家基础信息
message S2G_GetPlayerBasicInfoRequest // IRouteRequest,G2S_GetPlayerBasicInfoResponse
message S2G_GetPlayerBasicInfoRequest // IAddressRequest,G2S_GetPlayerBasicInfoResponse
{
repeated int64 IdList = 1; // 查询列表
}
///获取玩家基础信息响应
message G2S_GetPlayerBasicInfoResponse // IRouteResponse
message G2S_GetPlayerBasicInfoResponse // IAddressResponse
{
repeated RoleSimpleInfo RoleList = 1;
}
message S2G_ChatMessage // IRouteMessage
message S2G_ChatMessage // IAddressMessage
{
ChatMessageInfo Message = 1; //聊天内容
repeated int64 IdList = 2; // 群发列表
}
///创建聊天频道
message Club2Chat_CreateChannel // IRouteMessage
message Club2Chat_CreateChannel // IAddressMessage
{
int64 ChannelId = 1; //频道id
}
@@ -55,7 +55,7 @@ message Club2Chat_CreateChannel // IRouteMessage
/// 请求进入房间
message G2Map_EnterMapRequest // IRouteRequest,Map2G_EnterMapResponse
message G2Map_EnterMapRequest // IAddressRequest,Map2G_EnterMapResponse
{
string RoomCode = 1; //房间代码
int64 AccountId = 2; //账号id
@@ -63,7 +63,7 @@ message G2Map_EnterMapRequest // IRouteRequest,Map2G_EnterMapResponse
}
/// 请求进入房间响应
message Map2G_EnterMapResponse // IRouteResponse
message Map2G_EnterMapResponse // IAddressResponse
{
string RoomCode = 1; //房间代码
int32 MapId = 2; //地图id
@@ -72,13 +72,13 @@ message Map2G_EnterMapResponse // IRouteResponse
/// 请求离开房间
message G2Map_ExitRoomRequest // IRouteRequest,Map2G_ExiRoomResponse
message G2Map_ExitRoomRequest // IAddressRequest,Map2G_ExiRoomResponse
{
string RoomCode = 1; //房间代码
int64 AccountId = 2; //账号id
}
/// 请求离开房间响应
message Map2G_ExiRoomResponse // IRouteResponse
message Map2G_ExiRoomResponse // IAddressResponse
{
}

View File

@@ -0,0 +1,20 @@
{
"Export": {
"NetworkProtocolDirectory": {
"Value": "..//NetworkProtocol/",
"Comment": "网络协议文件所在的文件夹位置"
},
"NetworkProtocolServerDirectory": {
"Value": "../../Entity/Generate/NetworkProtocol/",
"Comment": "网络协议生成到服务端的文件夹位置"
},
"NetworkProtocolClientDirectory": {
"Value": "../../../Fishing2/Assets/Scripts/Generate/NetworkProtocol/",
"Comment": "网络协议生成到客户端的文件夹位置"
},
"Serializes": {
"Value": [],
"Comment": "自定义序列化器,暂不支持"
}
}
}

View File

@@ -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
)

View File

@@ -0,0 +1,24 @@
#!/bin/bash
echo "1. Client"
echo "2. Server"
echo "3. All"
read -n 1 -p "Please select an option:" choice
echo ""
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

Binary file not shown.

Binary file not shown.

View File

@@ -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生成到客户端的文件夹位置"
}
}
}
}

Binary file not shown.

View 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"
}
}
}

View File

@@ -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
}
}
}

View File

@@ -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

View File

@@ -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

Binary file not shown.

Binary file not shown.