提交示例代码

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,4 @@
(é" MultiThread*Gate2KCP8 ś@řUH
ę" MultiThread*Chat@ůUH
ë" MultiThread*Map@úUH

View File

@@ -0,0 +1,2 @@
$ 测试服" fantasy_main*MongoDB

Binary file not shown.

View File

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

View File

@@ -0,0 +1 @@
{"WorksheetNames":["ProcessConfig","MachineConfig","WorldConfig","SceneConfig","SceneTypeConfig"],"Tables":{"MachineConfig":1727164776000,"SceneConfig":1731926283644,"WorldConfig":1727164776000,"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,5 @@
{"List":[
{"Id":1001,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":20000,"InnerPort":11000,"SceneType":3},
{"Id":1002,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Chat","NetworkProtocol":null,"OuterPort":0,"InnerPort":11001,"SceneType":8},
{"Id":1003,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeType":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11002,"SceneType":4}
]}

View File

@@ -0,0 +1,3 @@
{"List":[
{"Id":1,"WorldName":"测试服","DbConnection":null,"DbName":"fantasy_main","DbType":"MongoDB"}
]}

Binary file not shown.

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
package Sining.Message;
/// Gate登录到Chat服务器
message G2Chat_LoginRequest // IRouteRequest,Chat2G_LoginResponse
{
string UserName = 1;
long UnitId = 2;
long GateRouteId = 3;
}
message Chat2G_LoginResponse // IRouteResponse
{
int64 ChatRouteId = 1;
}
/// Gate通知Chat服务器下线
message G2Chat_OfflineRequest // IRouteRequest,Chat2G_OfflineResponse
{
}
message Chat2G_OfflineResponse // IRouteResponse
{
}
/// Chat通知Gate发送一个全服广播的聊天信息
message Chat2G_ChatMessage // IRouteMessage
{
ChatInfoTree ChatInfoTree = 1;
}
/// 其他服务器发送聊天消息到Chat
message Other2Chat_ChatMessage // IRouteMessage
{
ChatInfoTree ChatInfoTree = 1;
}
/// Gate登录到Map服务器
message G2M_LoginRequest // IRouteRequest,M2G_LoginResponse
{
long ChatUnitRouteId = 1;
}
message M2G_LoginResponse // IRouteResponse
{
int64 MapRouteId = 1;
}

View File

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

View File

@@ -0,0 +1,102 @@
syntax = "proto3";
package Fantasy.Network.Message;
// 协议分为:
// ProtoBuf:可以在Outer和Inner文件里使用。
// MemoryPack:可以在Outer和Inner文件里使用。
// Bson:仅支持在Inner文件里使用。
// 使用方式:
// 在message协议上方添加// Protocol+空格+协议名字
// 例如:// Protocol ProtoBuf 或 // Protocol MemoryPack
/// 登录游戏
message C2G_LoginRequest // IRequest,G2C_LoginResponse
{
string UserName = 1;
}
message G2C_LoginResponse // IResponse
{
}
/// 退出游戏
message C2G_ExitRequest // IRequest,G2C_ExitResponse
{
}
message G2C_ExitResponse // IResponse
{
}
/// 发送一个聊天消息给Chat服务器中间是经过Gate中转的
message C2Chat_SendMessageRequest // ICustomRouteRequest,Chat2C_SendMessageResponse,ChatRoute
{
ChatInfoTree ChatInfoTree = 1;
}
message Chat2C_SendMessageResponse // ICustomRouteResponse
{
}
// 该消息是Chat发送给Gate服务器让Gate服务器自动转发到客户端
message Chat2C_Message // ICustomRouteMessage,ChatRoute
{
ChatInfoTree ChatInfoTree = 1;
}
/// 聊天消息树
message ChatInfoTree
{
int32 ChatChannelType = 1; // 频道的类型
int64 ChatChannelId = 2; // 频道的ID
int64 UnitId = 3; // 发送人的UnitId
string UserName = 4; // 发送人的名字
repeated int64 Target = 5; // 接收聊天信息的目标数组
repeated ChatInfoNode Node = 6; // 聊天节点
}
/// 聊天信息节点
message ChatInfoNode
{
int32 ChatNodeType = 1; // 节点类型(例如:超链接、普通的内容、表情...
int32 ChatNodeEvent = 2; // 节点分发事件的类型(例如:点击某个字打开某个UI或者执行某些操作
string Content = 3; // 信息内容
string Color = 4; // 表示这个内容的颜色
byte[] Data = 5; // 表示附加的一些数据
}
/// 聊天位置信息节点
message ChatPositionNode
{
string MapName = 1;
float PosX = 2;
float PosY = 3;
float PosZ = 4;
}
/// 聊天位置信息节点
message ChatOpenUINode
{
string UIName = 1;
}
/// 聊天连接信息节点
message ChatLinkNode
{
string Link = 1;
}
/// 装备信息实体
message Item
{
string Level = 1;
string Name = 2;
string HP = 3;
string MP = 4;
}

View File

@@ -0,0 +1,3 @@
// Route协议定义(需要定义1000以上、因为1000以内的框架预留)
GateRoute = 1001 // Gate
ChatRoute = 1002 // Chat