提交示例代码
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.
14
物品和背包的完整代码/Config/NetworkProtocol/Inner/InnerMessage.proto
Normal file
14
物品和背包的完整代码/Config/NetworkProtocol/Inner/InnerMessage.proto
Normal file
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
package Sining.Message;
|
||||
message G2A_TestMessage // IRouteMessage
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
message G2A_TestRequest // IRouteRequest,G2A_TestResponse
|
||||
{
|
||||
|
||||
}
|
||||
message G2A_TestResponse // IRouteResponse
|
||||
{
|
||||
|
||||
}
|
||||
1
物品和背包的完整代码/Config/NetworkProtocol/OpCode.Cache
Normal file
1
物品和背包的完整代码/Config/NetworkProtocol/OpCode.Cache
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
114
物品和背包的完整代码/Config/NetworkProtocol/Outer/OuterMessage.proto
Normal file
114
物品和背包的完整代码/Config/NetworkProtocol/Outer/OuterMessage.proto
Normal file
@@ -0,0 +1,114 @@
|
||||
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;
|
||||
string PassWord = 2;
|
||||
}
|
||||
/// 服务器返回登陆状态给客户端
|
||||
message G2C_LoginResponse // IResponse
|
||||
{
|
||||
|
||||
}
|
||||
/// 客户端请求服务器使用物品
|
||||
message C2G_UseItemRequest // IRequest,G2C_UseItemResponse
|
||||
{
|
||||
int64 ItemId = 1;
|
||||
int32 Count = 2;
|
||||
int32 ContainerType = 3; // ContainerType
|
||||
}
|
||||
message G2C_UseItemResponse // IResponse
|
||||
{
|
||||
|
||||
}
|
||||
/// 装备基础信息类
|
||||
message EquipInfo
|
||||
{
|
||||
int32 Durable = 1; // 当前耐久度
|
||||
int32 DurableMax = 2; // 最大耐久度
|
||||
repeated int32 MainKeys = 3; // 主属性的Key
|
||||
repeated int32 EquipAttrKeys = 4; // 主属性改变属性Key
|
||||
repeated int32 EquipAttrValues = 5; // 主属性的对应数值
|
||||
repeated int32 EquipAttrSValues = 6; // 主属性的附加数值
|
||||
// 比如强化等级,副属性,词缀等。都可以在这里添加
|
||||
}
|
||||
/// 物品基础信息类
|
||||
message ItemInfo
|
||||
{
|
||||
int64 ItemId = 1; // 物品Id
|
||||
int32 Container = 2; // 属于容器的类型
|
||||
int32 ConfigId = 3; // 配置表Id
|
||||
int64 CellId = 4; // 格子的Id
|
||||
int32 Count = 5; // 物品的数量
|
||||
bool IsBind = 6; // 是否是绑定
|
||||
EquipInfo EquipInfo = 7; // 装备信息
|
||||
// 后面可能会有装备词条 也会在这里定义的,现在没有所以就是先不管了
|
||||
}
|
||||
/// 容器信息类
|
||||
message ContainerInfo
|
||||
{
|
||||
int32 CurrentCellCount = 1; // 容器当前可用的格子数量
|
||||
int32 ConfigId = 2; // 容器的配置表Id
|
||||
repeated ItemInfo Items = 3; // 容器内的物品列表
|
||||
}
|
||||
/// 物品变更协议(服务器推送给客户端)
|
||||
message G2C_UpdateItems // IMessage
|
||||
{
|
||||
int32 ItemReason = 1; // 物品的操作原因,具体可以看代码的ItemReason.cs。
|
||||
repeated ItemInfo Items = 2; // 变更物品列表
|
||||
}
|
||||
/// 通知服务器客户端初始化完成
|
||||
message C2G_GameInitCompleteRequest // IRequest,G2C_GameInitCompleteResponse
|
||||
{
|
||||
bool PushContainer = 1; // 是否推送容器数据到客户端
|
||||
bool PushUnitInfo = 2; // 是否推送角色的数据
|
||||
bool Aoi = 3; // 是否推送周围玩家和单位的数据
|
||||
}
|
||||
message G2C_GameInitCompleteResponse // IResponse
|
||||
{
|
||||
|
||||
}
|
||||
/// 推送所有容器数据给客户端
|
||||
message G2C_PushAllContainerInfo // IMessage
|
||||
{
|
||||
repeated ContainerInfo Containers = 1; // 容器的数据列表
|
||||
}
|
||||
/// 推送单个的容器数据给客户端
|
||||
message G2C_PushContainerInfo // IMessage
|
||||
{
|
||||
ContainerInfo Container = 1; // 容器的数据
|
||||
}
|
||||
/// 通知服务器创建一个物品到背包容器中。
|
||||
message C2G_StartCreateItem // IMessage
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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