提交示例代码
This commit is contained in:
BIN
聊天系统课程代码/Config/NetworkProtocol/.DS_Store
vendored
Normal file
BIN
聊天系统课程代码/Config/NetworkProtocol/.DS_Store
vendored
Normal file
Binary file not shown.
42
聊天系统课程代码/Config/NetworkProtocol/Inner/InnerMessage.proto
Normal file
42
聊天系统课程代码/Config/NetworkProtocol/Inner/InnerMessage.proto
Normal 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;
|
||||
}
|
||||
|
||||
1
聊天系统课程代码/Config/NetworkProtocol/OpCode.Cache
Normal file
1
聊天系统课程代码/Config/NetworkProtocol/OpCode.Cache
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
102
聊天系统课程代码/Config/NetworkProtocol/Outer/OuterMessage.proto
Normal file
102
聊天系统课程代码/Config/NetworkProtocol/Outer/OuterMessage.proto
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
3
聊天系统课程代码/Config/NetworkProtocol/RouteType.Config
Normal file
3
聊天系统课程代码/Config/NetworkProtocol/RouteType.Config
Normal file
@@ -0,0 +1,3 @@
|
||||
// Route协议定义(需要定义1000以上、因为1000以内的框架预留)
|
||||
GateRoute = 1001 // Gate
|
||||
ChatRoute = 1002 // Chat
|
||||
Reference in New Issue
Block a user