mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交帧同步案例
This commit is contained in:
50
JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs
Normal file
50
JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using Google.Protobuf;
|
||||
using UnityEditor;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
//构造器
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f311c8c368584fab839dd72819fc55da
|
||||
timeCreated: 1706004134
|
Reference in New Issue
Block a user