diff --git a/.vs/HaoYueNet/DesignTimeBuild/.dtbcache.v2 b/.vs/HaoYueNet/DesignTimeBuild/.dtbcache.v2
index 59f948d..ad2dd79 100644
Binary files a/.vs/HaoYueNet/DesignTimeBuild/.dtbcache.v2 and b/.vs/HaoYueNet/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/.vs/HaoYueNet/project-colors.json b/.vs/HaoYueNet/project-colors.json
index fc2c392..d80be9a 100644
--- a/.vs/HaoYueNet/project-colors.json
+++ b/.vs/HaoYueNet/project-colors.json
@@ -30,7 +30,27 @@
"ProjectGuid": "696f6aae-2d41-48f7-8fcd-e95cfe2a6519",
"DisplayName": "HaoYueNet.ClientNetwork",
"ColorIndex": 5
+ },
+ "33d77124-2d10-4799-b432-dcc8f0f3d1ca": {
+ "ProjectGuid": "33d77124-2d10-4799-b432-dcc8f0f3d1ca",
+ "DisplayName": "SimpleServer",
+ "ColorIndex": 6
+ },
+ "c558aca4-e59e-4f4d-94b7-2b78da272cf3": {
+ "ProjectGuid": "c558aca4-e59e-4f4d-94b7-2b78da272cf3",
+ "DisplayName": "SimpleClient",
+ "ColorIndex": 7
+ },
+ "a2cad164-0816-4d1d-9793-1b1f398c9d29": {
+ "ProjectGuid": "a2cad164-0816-4d1d-9793-1b1f398c9d29",
+ "DisplayName": "Simple",
+ "ColorIndex": 8
+ },
+ "5559b94a-da9e-4cf7-b799-2bcaa1f11f49": {
+ "ProjectGuid": "5559b94a-da9e-4cf7-b799-2bcaa1f11f49",
+ "DisplayName": "SimpleServer",
+ "ColorIndex": 9
}
},
- "NextColorIndex": 6
+ "NextColorIndex": 10
}
\ No newline at end of file
diff --git a/.vs/HaoYueNet/v17/.futdcache.v1 b/.vs/HaoYueNet/v17/.futdcache.v1
index 6d16ed6..76c651b 100644
Binary files a/.vs/HaoYueNet/v17/.futdcache.v1 and b/.vs/HaoYueNet/v17/.futdcache.v1 differ
diff --git a/HaoYueNet.sln b/HaoYueNet.sln
index 3bcf399..e6224d0 100644
--- a/HaoYueNet.sln
+++ b/HaoYueNet.sln
@@ -11,9 +11,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HaoYueNet.ServerNetwork", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HaoYueNet.ClientNetwork", "NetLib\HaoYueNet.ClientNetwork\HaoYueNet.ClientNetwork.csproj", "{696F6AAE-2D41-48F7-8FCD-E95CFE2A6519}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleClient", "Simple\SimpleClient\SimpleClient.csproj", "{C558ACA4-E59E-4F4D-94B7-2B78DA272CF3}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleClient", "Simple\SimpleClient\SimpleClient.csproj", "{C558ACA4-E59E-4F4D-94B7-2B78DA272CF3}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleServer", "Simple\SimpleServer\SimpleServer.csproj", "{5559B94A-DA9E-4CF7-B799-2BCAA1F11F49}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleServer", "Simple\SimpleServer\SimpleServer.csproj", "{5559B94A-DA9E-4CF7-B799-2BCAA1F11F49}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HaoYueNet.ClientNetworkNet4x", "NetLib\HaoYueNet.ClientNetworkNet4x\HaoYueNet.ClientNetworkNet4x.csproj", "{27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -37,6 +39,10 @@ Global
{5559B94A-DA9E-4CF7-B799-2BCAA1F11F49}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5559B94A-DA9E-4CF7-B799-2BCAA1F11F49}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5559B94A-DA9E-4CF7-B799-2BCAA1F11F49}.Release|Any CPU.Build.0 = Release|Any CPU
+ {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -46,6 +52,7 @@ Global
{696F6AAE-2D41-48F7-8FCD-E95CFE2A6519} = {D0066C06-A89A-4E05-80E0-D8232FB0FF3C}
{C558ACA4-E59E-4F4D-94B7-2B78DA272CF3} = {A2CAD164-0816-4D1D-9793-1B1F398C9D29}
{5559B94A-DA9E-4CF7-B799-2BCAA1F11F49} = {A2CAD164-0816-4D1D-9793-1B1F398C9D29}
+ {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC} = {D0066C06-A89A-4E05-80E0-D8232FB0FF3C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {22107F03-013F-4871-AC8E-F082694E2679}
diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj b/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj
new file mode 100644
index 0000000..01a126b
--- /dev/null
+++ b/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj
@@ -0,0 +1,74 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}
+ Library
+ Properties
+ HaoYueNet.ClientNetworkNet4x
+ HaoYueNet.ClientNetworkNet4x
+ v4.8
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\..\packages\protobuf-net.3.0.101\lib\net461\protobuf-net.dll
+
+
+ ..\..\packages\protobuf-net.Core.3.0.101\lib\net461\protobuf-net.Core.dll
+
+
+
+ ..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
+
+
+ ..\..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll
+
+
+
+ ..\..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll
+
+
+
+ ..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
+
+
+ ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs b/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs
new file mode 100644
index 0000000..95f137e
--- /dev/null
+++ b/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs
@@ -0,0 +1,360 @@
+using HunterProtobufCore;
+using ProtoBuf;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace HaoYueNet.ClientNetworkNet4x
+{
+ public class NetworkHelperCore
+ {
+ private Socket client;
+
+ ///
+ /// 心跳包数据
+ ///
+ private byte[] HeartbeatData = new byte[5] { 0x05, 0x00, 0x00, 0x00, 0x00 };
+
+ ////响应倒计时计数最大值
+ //private static int MaxRevIndexNum = 6;
+
+ ////发送倒计时计数最大值
+ //private static int MaxSendIndexNum = 3;
+
+ //响应倒计时计数最大值
+ private static int MaxRevIndexNum = 50;
+
+ //发送倒计时计数最大值
+ private static int MaxSendIndexNum = 3;
+
+ //响应倒计时计数
+ private static int RevIndex=0;
+ //发送倒计时计数
+ private static int SendIndex=0;
+
+ //计时器间隔
+ private static int TimerInterval = 3000;
+
+ private System.Timers.Timer _heartTimer;
+
+ public void Init(string IP, int port)
+ {
+
+ LogOut("==>初始化网络核心");
+
+ RevIndex = MaxRevIndexNum;
+ SendIndex = MaxSendIndexNum;
+
+ client = new Socket(SocketType.Stream, ProtocolType.Tcp);
+ //IPAddress ip = IPAddress.Parse(IP);
+ //IPEndPoint point = new IPEndPoint(ip, port);
+
+ LogOut("连接到IP "+ IP + ":"+ port);
+
+ //带回调的
+ //client.BeginConnect(ip, port, new AsyncCallback(CallBackMethod) , client);
+ try
+ {
+ client.Connect(IP, port);
+ Thread thread = new Thread(Recive);
+ thread.IsBackground = true;
+ thread.Start(client);
+ LogOut("连接成功!");
+
+ _heartTimer = new System.Timers.Timer();
+ _heartTimer.Interval = TimerInterval;
+ _heartTimer.Elapsed += CheckUpdatetimer_Elapsed;
+ _heartTimer.AutoReset = true;
+ _heartTimer.Enabled = true;
+ LogOut("开启心跳包检测");
+
+ OnConnected(true);
+ }
+ catch
+ {
+ OnConnected(false);
+ }
+ }
+
+ ~NetworkHelperCore()
+ {
+ client.Close();
+ }
+
+ private void SendToSocket(byte[] data)
+ {
+ data = SendDataWithHead(data);
+ try
+ {
+ SendWithIndex(data);
+ }
+ catch (Exception ex)
+ {
+ //连接断开
+ OnCloseReady();
+ return;
+ }
+ LogOut("发送消息,消息长度=> "+data.Length);
+ }
+
+ private void SendHeartbeat()
+ {
+ try
+ {
+ SendWithIndex(HeartbeatData);
+ }
+ catch (Exception ex)
+ {
+ //连接断开
+ OnCloseReady();
+ return;
+ }
+ LogOut("发送心跳包");
+ }
+
+ ///
+ /// 发送数据并计数
+ ///
+ ///
+ private void SendWithIndex(byte[] data)
+ {
+ //增加发送计数
+ SendIndex = MaxSendIndexNum;
+ //发送数据
+ client.Send(data);
+ }
+
+ //拼接头长度
+ private byte[] SendDataWithHead(byte[] message)
+ {
+
+ MemoryStream memoryStream = new MemoryStream();//创建一个内存流
+
+ byte[] BagHead = BitConverter.GetBytes(message.Length + 4);//往字节数组中写入包头(包头自身的长度和消息体的长度)的长度
+
+ memoryStream.Write(BagHead, 0, BagHead.Length);//将包头写入内存流
+
+ memoryStream.Write(message, 0, message.Length);//将消息体写入内存流
+
+ byte[] HeadAndBody = memoryStream.ToArray();//将内存流中的数据写入字节数组
+
+ memoryStream.Close();//关闭内存
+ memoryStream.Dispose();//释放资源
+
+ return HeadAndBody;
+ }
+
+ ///
+ /// 供外部调用 发送消息
+ ///
+ ///
+ /// 序列化之后的数据
+ public void SendToServer(int CMDID,byte[] data)
+ {
+ LogOut("准备数据 CMDID=> "+CMDID);
+ HunterNet_C2S _c2sdata = new HunterNet_C2S();
+ _c2sdata.HunterNetCore_CmdID = CMDID;
+ _c2sdata.HunterNetCore_Data = data;
+ byte[] _finaldata = Serizlize(_c2sdata);
+ SendToSocket(_finaldata);
+ }
+
+ public delegate void OnDataCallBack_Data(int CMDID, int ERRCODE, byte[] data);
+
+ public event OnDataCallBack_Data OnDataCallBack;
+
+ public delegate void delegate_NoData();
+
+ public delegate void delegate_Bool(bool IsConnected);
+
+ public event delegate_NoData OnClose;
+
+ public event delegate_Bool OnConnected;
+
+ public delegate void delegate_str(string Msg);
+
+ ///
+ /// 网络库调试日志输出
+ ///
+ public event delegate_str OnLogOut;
+
+ /////
+ ///// 用于调用者回调的虚函数
+ /////
+ /////
+ //public virtual void DataCallBack(int CMDID,int ERRCODE,byte[] data)
+ //{
+
+ //}
+
+ /////
+ ///// 断开连接
+ /////
+ /////
+ //public virtual void OnClose()
+ //{
+
+ //}
+
+ ///
+ /// 做好处理的连接管理
+ ///
+ private void OnCloseReady()
+ {
+ LogOut("关闭心跳包计数");
+ _heartTimer.Enabled = false;
+ LogOut("关闭连接");
+ OnClose();
+ //关闭Socket连接
+ client.Close();
+ }
+
+
+ ///
+ /// 主动关闭连接
+ ///
+ public void CloseConntect()
+ {
+ OnCloseReady();
+ }
+
+ private void DataCallBackReady(byte[] data)
+ {
+
+ //增加接收计数
+ RevIndex = MaxRevIndexNum;
+
+ //不处理心跳包
+ if (data.Length == 1 && data[0] == 0x00)
+ {
+ LogOut("收到心跳包");
+ return;
+ }
+
+ HunterNet_S2C _c2s = DeSerizlize(data);
+
+ OnDataCallBack((int)_c2s.HunterNetCore_CmdID, (int)_c2s.HunterNetCore_ERRORCode, _c2s.HunterNetCore_Data);
+ }
+
+ private void Recive(object o)
+ {
+ var client = o as Socket;
+ MemoryStream memoryStream = new MemoryStream();//开辟一个内存流
+
+ while (true)
+ {
+ byte[] buffer = new byte[1024 * 1024 * 2];
+ int effective=0;
+ try
+ {
+ effective = client.Receive(buffer);
+ if (effective == 0)
+ {
+ continue;
+ }
+ }
+ catch(Exception ex)
+ {
+ //远程主机强迫关闭了一个现有的连接
+ OnCloseReady();
+ return;
+ //断开连接
+ }
+
+
+ memoryStream.Write(buffer, 0, effective);//将接受到的数据写入内存流中
+ byte[] getData = memoryStream.ToArray();//将内存流中的消息体写入字节数组
+ int StartIndex = 0;//设置一个读取数据的起始下标
+
+ while (true)
+ {
+
+
+ if (effective > 0)//如果接受到的消息不为0(不为空)
+ {
+ int HeadLength = 0;//包头长度(包头+包体)
+ if (getData.Length - StartIndex < 4)//包头接受不完整
+ {
+ HeadLength = -1;
+ }
+ else
+ {
+ //如果包头接受完整 转换成int类型的数值
+ HeadLength = BitConverter.ToInt32(getData, StartIndex);
+ }
+ //包头接受完整但是消息体不完整 //包头接受不完整
+ //↓↓↓↓↓↓↓↓ ↓↓↓
+ if (getData.Length - StartIndex < HeadLength || HeadLength == -1)
+ {
+ memoryStream.Close();//关闭内存流
+ memoryStream.Dispose();//释放内存资源
+ memoryStream = new MemoryStream();//创建新的内存流
+ memoryStream.Write(getData, StartIndex, getData.Length - StartIndex);//从新将接受的消息写入内存流
+ break;
+ }
+ else
+ {
+ //把头去掉,就可以吃了,蛋白质是牛肉的六倍
+ DataCallBackReady(getData.Skip(StartIndex+4).Take(HeadLength-4).ToArray());
+ StartIndex += HeadLength;//当读取一条完整的数据后,读取数据的起始下标应为当前接受到的消息体的长度(当前数据的尾部或下一条消息的首部)
+ }
+ }
+ }
+
+ }
+ }
+
+ private void CheckUpdatetimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
+ {
+ //接收服务器数据计数
+ RevIndex--;
+ if (RevIndex <= 0)
+ {
+ //判定掉线
+ OnCloseReady();
+ return;
+ }
+
+ //发送计数
+ SendIndex--;
+ if (SendIndex <= 0)//需要发送心跳包了
+ {
+ //重置倒计时计数
+ SendIndex = MaxSendIndexNum;
+
+ SendHeartbeat();
+ }
+ }
+
+ public static byte[] Serizlize(T MsgObj)
+ {
+ using (MemoryStream ms = new MemoryStream())
+ {
+ Serializer.Serialize(ms, MsgObj);
+ byte[] data1 = ms.ToArray();
+ return data1;
+ }
+ }
+
+ public static T DeSerizlize(byte[] MsgObj)
+ {
+ using (MemoryStream ms = new MemoryStream(MsgObj))
+ {
+ var ds_obj = Serializer.Deserialize(ms);
+ return ds_obj;
+ }
+ }
+
+ public void LogOut(string Msg)
+ {
+ //Console.WriteLine(Msg);
+ OnLogOut(Msg);
+ }
+ }
+}
diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/Properties/AssemblyInfo.cs b/NetLib/HaoYueNet.ClientNetworkNet4x/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..9b358e6
--- /dev/null
+++ b/NetLib/HaoYueNet.ClientNetworkNet4x/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("HaoYueNet.ClientNetworkNet4x")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HaoYueNet.ClientNetworkNet4x")]
+[assembly: AssemblyCopyright("Copyright © 2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("27e139e2-f5f5-47df-99d8-04dc7ebebeec")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/packages.config b/NetLib/HaoYueNet.ClientNetworkNet4x/packages.config
new file mode 100644
index 0000000..244f32d
--- /dev/null
+++ b/NetLib/HaoYueNet.ClientNetworkNet4x/packages.config
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf_HunterNetCore.cs b/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf_HunterNetCore.cs
new file mode 100644
index 0000000..740871f
--- /dev/null
+++ b/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf_HunterNetCore.cs
@@ -0,0 +1,120 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Option: missing-value detection (*Specified/ShouldSerialize*/Reset*) enabled
+
+// Generated from: proto/protobuf_HunterNetCore.proto
+namespace HunterProtobufCore
+{
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"HunterNet_C2S")]
+ public partial class HunterNet_C2S : global::ProtoBuf.IExtensible
+ {
+ public HunterNet_C2S() {}
+
+ private int? _HunterNetCore_CmdID;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"HunterNetCore_CmdID", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int? HunterNetCore_CmdID
+ {
+ get { return _HunterNetCore_CmdID; }
+ set { _HunterNetCore_CmdID = value; }
+ }
+ [global::System.Xml.Serialization.XmlIgnore]
+ [global::System.ComponentModel.Browsable(false)]
+ public bool HunterNetCore_CmdIDSpecified
+ {
+ get { return this._HunterNetCore_CmdID != null; }
+ set { if (value == (this._HunterNetCore_CmdID== null)) this._HunterNetCore_CmdID = value ? this.HunterNetCore_CmdID : (int?)null; }
+ }
+ private bool ShouldSerializeHunterNetCore_CmdID() { return HunterNetCore_CmdIDSpecified; }
+ private void ResetHunterNetCore_CmdID() { HunterNetCore_CmdIDSpecified = false; }
+
+ private byte[] _HunterNetCore_Data;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"HunterNetCore_Data", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public byte[] HunterNetCore_Data
+ {
+ get { return _HunterNetCore_Data; }
+ set { _HunterNetCore_Data = value; }
+ }
+ [global::System.Xml.Serialization.XmlIgnore]
+ [global::System.ComponentModel.Browsable(false)]
+ public bool HunterNetCore_DataSpecified
+ {
+ get { return this._HunterNetCore_Data != null; }
+ set { if (value == (this._HunterNetCore_Data== null)) this._HunterNetCore_Data = value ? this.HunterNetCore_Data : (byte[])null; }
+ }
+ private bool ShouldSerializeHunterNetCore_Data() { return HunterNetCore_DataSpecified; }
+ private void ResetHunterNetCore_Data() { HunterNetCore_DataSpecified = false; }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"HunterNet_S2C")]
+ public partial class HunterNet_S2C : global::ProtoBuf.IExtensible
+ {
+ public HunterNet_S2C() {}
+
+ private int? _HunterNetCore_CmdID;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"HunterNetCore_CmdID", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int? HunterNetCore_CmdID
+ {
+ get { return _HunterNetCore_CmdID; }
+ set { _HunterNetCore_CmdID = value; }
+ }
+ [global::System.Xml.Serialization.XmlIgnore]
+ [global::System.ComponentModel.Browsable(false)]
+ public bool HunterNetCore_CmdIDSpecified
+ {
+ get { return this._HunterNetCore_CmdID != null; }
+ set { if (value == (this._HunterNetCore_CmdID== null)) this._HunterNetCore_CmdID = value ? this.HunterNetCore_CmdID : (int?)null; }
+ }
+ private bool ShouldSerializeHunterNetCore_CmdID() { return HunterNetCore_CmdIDSpecified; }
+ private void ResetHunterNetCore_CmdID() { HunterNetCore_CmdIDSpecified = false; }
+
+ private int? _HunterNetCore_ERRORCode;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"HunterNetCore_ERRORCode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int? HunterNetCore_ERRORCode
+ {
+ get { return _HunterNetCore_ERRORCode; }
+ set { _HunterNetCore_ERRORCode = value; }
+ }
+ [global::System.Xml.Serialization.XmlIgnore]
+ [global::System.ComponentModel.Browsable(false)]
+ public bool HunterNetCore_ERRORCodeSpecified
+ {
+ get { return this._HunterNetCore_ERRORCode != null; }
+ set { if (value == (this._HunterNetCore_ERRORCode== null)) this._HunterNetCore_ERRORCode = value ? this.HunterNetCore_ERRORCode : (int?)null; }
+ }
+ private bool ShouldSerializeHunterNetCore_ERRORCode() { return HunterNetCore_ERRORCodeSpecified; }
+ private void ResetHunterNetCore_ERRORCode() { HunterNetCore_ERRORCodeSpecified = false; }
+
+ private byte[] _HunterNetCore_Data;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"HunterNetCore_Data", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public byte[] HunterNetCore_Data
+ {
+ get { return _HunterNetCore_Data; }
+ set { _HunterNetCore_Data = value; }
+ }
+ [global::System.Xml.Serialization.XmlIgnore]
+ [global::System.ComponentModel.Browsable(false)]
+ public bool HunterNetCore_DataSpecified
+ {
+ get { return this._HunterNetCore_Data != null; }
+ set { if (value == (this._HunterNetCore_Data== null)) this._HunterNetCore_Data = value ? this.HunterNetCore_Data : (byte[])null; }
+ }
+ private bool ShouldSerializeHunterNetCore_Data() { return HunterNetCore_DataSpecified; }
+ private void ResetHunterNetCore_Data() { HunterNetCore_DataSpecified = false; }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+}
\ No newline at end of file