C# Class Messenger.PBCodec

Show file Open project: dreamanlan/CSharpGameFramework Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
Decode ( byte data, PBChannel t_query, object &msg, int &id ) : bool

解码protobuf消息

Encode ( int id, object msg ) : byte[]

编码protobuf消息

Method Details

Decode() public static method

解码protobuf消息
public static Decode ( byte data, PBChannel t_query, object &msg, int &id ) : bool
data byte 字节数据
t_query PBChannel 消息(id->type)查询函数
msg object 返回的消息object
id int 返回的消息id
return bool

Encode() public static method

编码protobuf消息
public static Encode ( int id, object msg ) : byte[]
id int 消息id
msg object 消息object
return byte[]