mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
50 lines
1.0 KiB
C#
50 lines
1.0 KiB
C#
using System;
|
|
using Google.Protobuf;
|
|
|
|
namespace Plugins.JNGame.Network.Entity
|
|
{
|
|
public class JNetParam
|
|
{
|
|
|
|
//请求处理 Id (用来找到处理方法)
|
|
private int _hId;
|
|
public int HId => _hId;
|
|
|
|
//请求Id (请求标识)
|
|
private int _id;
|
|
public int ID => _id;
|
|
|
|
|
|
//请求参数
|
|
private IMessage _data;
|
|
public IMessage Data => _data;
|
|
|
|
|
|
private byte[] _bytes;
|
|
|
|
public byte[] Bytes => _bytes;
|
|
|
|
public JNetParam(int id,int hId)
|
|
{
|
|
_hId = hId;
|
|
_id = id;
|
|
_bytes = Array.Empty<byte>();
|
|
}
|
|
|
|
//构造器
|
|
public static JNetParam Build(int id,int hId){
|
|
return new JNetParam(id,hId);
|
|
}
|
|
|
|
|
|
public JNetParam SetData(IMessage data){
|
|
this._data = data;
|
|
return this;
|
|
}
|
|
public JNetParam SetByte(byte[] bytes){
|
|
this._bytes = bytes;
|
|
return this;
|
|
}
|
|
|
|
}
|
|
} |