提交示例代码

This commit is contained in:
Bob.Song
2026-03-05 11:39:06 +08:00
commit 25958f58c3
2534 changed files with 209593 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,2 @@
# 127.0.0.1 127.0.0.1" 127.0.0.1

View File

@@ -0,0 +1,2 @@


View File

@@ -0,0 +1,5 @@
&é" MultiThread* Addressable@ůUH
(ę" MultiThread*Gate2KCP8 ś@úUH
ë" MultiThread*Map@űUH
ě" MultiThread*Mail@üUH

View File

@@ -0,0 +1,2 @@
9 测试服mongodb://127.0.0.1" fantasy_mail*MongoDB

Binary file not shown.

View File

@@ -0,0 +1 @@
// 自定义导出配置文件,用于配置自定义导出自定义程序的路径

View File

@@ -0,0 +1 @@
{"WorksheetNames":["ProcessConfig","MachineConfig","WorldConfig","SceneConfig","SceneTypeConfig"],"Tables":{"MachineConfig":1739296621442,"SceneConfig":1739530293874,"WorldConfig":1739530344968,"ProcessConfig":1727164776000}}

Binary file not shown.

View File

@@ -0,0 +1,3 @@
{"List":[
{"Id":1,"OuterIP":"127.0.0.1","OuterBindIP":"127.0.0.1","InnerBindIP":"127.0.0.1"}
]}

View File

@@ -0,0 +1,3 @@
{"List":[
{"Id":1,"MachineId":1,"StartupGroup":0}
]}

View File

@@ -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":"Mail","NetworkProtocol":null,"OuterPort":0,"InnerPort":11004,"SceneType":9}
]}

View File

@@ -0,0 +1,3 @@
{"List":[
{"Id":1,"WorldName":"测试服","DbConnection":"mongodb://127.0.0.1","DbName":"fantasy_mail","DbType":"MongoDB"}
]}

Binary file not shown.

View File

@@ -0,0 +1,38 @@
syntax = "proto3";
package Sining.Message;
/// Gate服务器登陆到Mail服务器
message G2Mail_LoginRequest // IRouteRequest,Mail2G_LoginResponse
{
string Name = 1;
int64 AccountId = 2;
int64 CreateTime = 3;
int64 GateRouteId = 4;
}
message Mail2G_LoginResponse // IRouteResponse
{
int64 MailUnitRouteId = 1;
}
/// 发送一个Gate服务器发送给Mail之间的测试协议
message G2Mail_TestMessage // IRouteMessage
{
string Tag = 1;
}
/// 发送给Mail服务器进行下线
message G2Mail_ExitRequest // IRouteRequest,Mail2G_ExitResponse
{
}
message Mail2G_ExitResponse // IRouteResponse
{
}
/// 其他服务器发送邮件
// Protocol Bson
message Other2Mail_SendMailRequest // IRouteRequest,Mail2Other_SendMailResponse
{
MailBox MailBox = 1;
}
message Mail2Other_SendMailResponse // IRouteResponse
{
}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1,165 @@
syntax = "proto3";
package Fantasy.Network.Message;
// 协议分为:
// ProtoBuf:可以在Outer和Inner文件里使用。
// MemoryPack:可以在Outer和Inner文件里使用。
// Bson:仅支持在Inner文件里使用。
// 使用方式:
// 在message协议上方添加// Protocol+空格+协议名字
// 例如:// Protocol ProtoBuf 或 // Protocol MemoryPack
/// 登陆到Gate服务器
message C2G_LoginRequest // IRequest,G2C_LoginResponse
{
string Name = 1; // 登陆的用户名,现在情况下是如果不存在服务器会自动创建一个新的账号。
}
message G2C_LoginResponse // IResponse
{
}
/// 客户端通知服务器退出游戏
message C2G_Exit // IMessage
{
}
/// 测试Mail自定义Route协议
message C2Mail_TestRequest // ICustomRouteRequest,Mail2C_TestResponse,MailRoute
{
string Tag = 1;
}
message Mail2C_TestResponse // ICustomRouteResponse
{
string Tag = 1;
}
/// 一个邮件的完整信息
message MailInfo
{
int64 MailId = 1;
int64 OwnerId = 2;
string Title = 3;
string Content = 4;
int64 CreateTime = 5;
int64 ExpireTime = 6;
int32 Money = 7;
int32 MailState = 8;
int32 MailType = 9;
repeated ItemInfo Items = 10;
}
/// 一个邮件的简单版消息
message MailSimplifyInfo
{
int64 MailId = 1;
int64 OwnerId = 2;
string Title = 3;
string Content = 4;
int64 CreateTime = 5;
int64 ExpireTime = 6;
int32 MailState = 7;
int32 MailType = 8;
}
/// 一个简单的物品信息
message ItemInfo
{
int64 ItemId = 1;
string Name = 2;
}
/// Mail通知客户端有新的邮件
message Mail2C_HaveMail // ICustomRouteMessage,MailRoute
{
MailSimplifyInfo Mail = 1;
}
/// Mail通知客户端邮件状态变化
message Mail2C_MailState // ICustomRouteMessage,MailRoute
{
int32 MailState = 1;
int64 MailId = 2;
}
/// 客户端获取档期所有邮件的信息
message C2Mail_GetHaveMailRequest // ICustomRouteRequest,Mail2C_GetHaveMailResposne,MailRoute
{
}
message Mail2C_GetHaveMailResposne // ICustomRouteResponse
{
repeated MailSimplifyInfo Mails = 1;
}
/// 客户端发开一个邮件
message C2Mail_OpenMailRequest // ICustomRouteRequest,Mail2C_OpenMailResposne,MailRoute
{
int64 MailId = 1;
bool ReturnMailInfo = 2;
}
message Mail2C_OpenMailResposne // ICustomRouteResponse
{
MailInfo MailInfo = 1;
}
/// 客户端领取邮件的附件
message C2Mail_ReceiveMailRequest // ICustomRouteRequest,Mail2C_ReceiveMailResponse,MailRoute
{
int64 MailId = 1;
bool Money = 2;
repeated int64 ItemId = 3;
}
message Mail2C_ReceiveMailResponse // ICustomRouteResponse
{
}
/// 客户端通知服务器删除一个邮件
message C2Mail_RemoveMailRequest // ICustomRouteRequest,Mail2C_RemoveMailResponse,MailRoute
{
int64 MailId = 1;
}
message Mail2C_RemoveMailResponse // ICustomRouteResponse
{
}
/// 客户端玩家发送邮件到另外一个玩家
message C2Mail_SendMailRequest // ICustomRouteRequest,Mail2C_SendMailResponse,MailRoute
{
string UserName = 1;
string Title = 2;
string Content = 3;
int32 Money = 4;
repeated int64 ItemId = 5;
}
message Mail2C_SendMailResponse // ICustomRouteResponse
{
}

View File

@@ -0,0 +1,2 @@
// Route协议定义(需要定义1000以上、因为1000以内的框架预留)
MailRoute = 1001 // Mail

View File

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