[+] proto

This commit is contained in:
ALEXTANG
2023-05-17 21:38:44 +08:00
parent d8f8fd01d9
commit b04fff4ec9
7 changed files with 94 additions and 87 deletions

View File

@@ -51,6 +51,21 @@ namespace GameProto
[Serializable,global::ProtoBuf.ProtoContract(Name = @"CSPkgBody")]
public partial class CSPkgBody
{
[global::ProtoBuf.ProtoMember(1)]
public CSActLoginReq ActLoginReq { get; set; }
[global::ProtoBuf.ProtoMember(2)]
public CSActLoginRes ActLoginRes { get; set; }
}
// 消息结果
[Serializable,global::ProtoBuf.ProtoContract(Name = @"ProtoResult")]
public partial class ProtoResult
{
[global::ProtoBuf.ProtoMember(3)]
public List<string> Params = new List<string>();
}
// 协议ID

View File

@@ -0,0 +1,47 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using ProtoBuf;
using TEngine;
using System.Collections.Generic;
namespace GameProto
{
// 这个文件只放协议,和协议头
// 角色登录结果请求
[Serializable,global::ProtoBuf.ProtoContract(Name = @"CSActLoginReq")]
public partial class CSActLoginReq
{
[global::ProtoBuf.ProtoMember(1)]
public uint Uin { get; set; }
[global::ProtoBuf.ProtoMember(2)]
public uint SvrID { get; set; }
[global::ProtoBuf.ProtoMember(3)]
public uint AuthTime { get; set; }
}
// 角色登录结果返回
[Serializable,global::ProtoBuf.ProtoContract(Name = @"CSActLoginRes")]
public partial class CSActLoginRes
{
[global::ProtoBuf.ProtoMember(1)]
public ProtoResult Result { get; set; }
[global::ProtoBuf.ProtoMember(2)]
public uint Uin { get; set; }
[global::ProtoBuf.ProtoMember(3)]
public uint RoleID { get; set; }
}
}

View File

@@ -1,43 +0,0 @@
syntax = "proto3";
package GameProto;
// 对外服数据协议
message ExternalMessage {
// 请求命令类型: 0 心跳1 业务
int32 cmdCode = 1;
// 协议开关,用于一些协议级别的开关控制,比如 安全加密校验等。 : 0 不校验
int32 protocolSwitch = 2;
// 业务路由高16为主, 低16为子
int32 cmdMerge = 3;
// 响应码: 0:成功, 其他为有错误
sint32 responseStatus = 4;
// 验证信息: 当 responseStatus == -1001 时, 会有值
string validMsg = 5;
// 业务请求数据
bytes data = 6;
}
// int 包装类
message IntPb {
// int 值
sint32 intValue = 1;
}
// int list 包装类
message IntListPb {
// intList
repeated sint32 intValues = 1;
}
// long 包装类
message LongPb {
// long 值
sint64 longValue = 1;
}
// long list 包装类
message LongListPb {
// longList
repeated sint64 longValues = 1;
}

View File

@@ -1,8 +0,0 @@
syntax = "proto3";
package GameProto;
// 游戏全局基础数据,和协议无关,就放结构
// 导入定义
import "ProtoBase";

View File

@@ -1,36 +0,0 @@
syntax = "proto3";
package GameProto;
// 这个文件只放协议,和协议头
// 消息协议
message CSPkg
{
CSPkgHead Head = 1; //消息协议头
CSPkgBody Body = 2; //消息协议体
}
// 消息协议头
message CSPkgHead
{
uint32 MsgId = 1; //协议号
uint32 MsgLength = 2; //协议长度
uint32 MsgVersion = 3; //协议版本
uint32 Echo = 4; //回带字段
uint32 SvrTime = 5; //服务器时间
}
// 消息协议体
message CSPkgBody
{
}
// 协议ID
enum CSMsgID
{
CS_START = 0;
CS_HeartBeat = 10001;
CS_END = 10000;
}

View File

@@ -23,7 +23,16 @@ message CSPkgHead
//
message CSPkgBody
{
CSActLoginReq ActLoginReq = 1; //
CSActLoginRes ActLoginRes = 2; //
}
//
message ProtoResult
{
int32 Ret =1; //,0
int32 ParamCnt =2; //
repeated string Params = 3;//Ret描述的文本参数
}

View File

@@ -0,0 +1,23 @@
syntax = "proto3";
package GameProto;
// 这个文件只放协议,和协议头
MsgId CS_CMD_ACT_LOGIN_REQ = 2001; //帐号登录请求
// 角色登录结果请求
message CSActLoginReq
{
uint32 Uin = 1; //帐号Uin
uint32 SvrID = 2; //服务器ID
uint32 AuthTime = 3; //账户认证的时间
uint32 NetworkType = 4, //网络类型
}
MsgId CS_CMD_ACT_LOGIN_RES = 2002; //帐号登录回包
// 角色登录结果返回
message CSActLoginRes
{
ProtoResult Result = 1; //返回操作结果
uint32 Uin = 2; //帐号Uin
uint32 RoleID = 3; //角色ID
}