Files
Max-Cocos-Demo/protos/pkg1.common.proto
2025-10-28 21:55:41 +08:00

18 lines
415 B
Protocol Buffer
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package pkg1;
// 通用协议码定义,稳定标识每种业务消息类型
enum MessageCode {
MSG_UNKNOWN = 0;
// 用户相关
MSG_USER = 1001;
// 示例Bar 消息
MSG_BAR = 1002;
}
// 统一的包裹消息,承载协议码与具体消息的二进制负载
message Envelope {
int32 code = 1; // 对应 MessageCode
bytes payload = 2; // 具体消息 encode 后的字节
}