diff --git a/.vs/HaoYueNet/FileContentIndex/264911a7-fcbf-45b9-9f01-f6b4684fb7a8.vsidx b/.vs/HaoYueNet/FileContentIndex/264911a7-fcbf-45b9-9f01-f6b4684fb7a8.vsidx new file mode 100644 index 0000000..69d6885 Binary files /dev/null and b/.vs/HaoYueNet/FileContentIndex/264911a7-fcbf-45b9-9f01-f6b4684fb7a8.vsidx differ diff --git a/.vs/HaoYueNet/FileContentIndex/52ba0b33-f7ac-464a-b93d-8478ef174812.vsidx b/.vs/HaoYueNet/FileContentIndex/52ba0b33-f7ac-464a-b93d-8478ef174812.vsidx new file mode 100644 index 0000000..24ac6f8 Binary files /dev/null and b/.vs/HaoYueNet/FileContentIndex/52ba0b33-f7ac-464a-b93d-8478ef174812.vsidx differ diff --git a/.vs/HaoYueNet/FileContentIndex/e611adbc-4f6c-4e85-99e1-a2450d1969e8.vsidx b/.vs/HaoYueNet/FileContentIndex/e611adbc-4f6c-4e85-99e1-a2450d1969e8.vsidx new file mode 100644 index 0000000..04a5321 Binary files /dev/null and b/.vs/HaoYueNet/FileContentIndex/e611adbc-4f6c-4e85-99e1-a2450d1969e8.vsidx differ diff --git a/.vs/HaoYueNet/FileContentIndex/ff9b6839-1a82-4879-9ad5-c21bf2a1418b.vsidx b/.vs/HaoYueNet/FileContentIndex/ff9b6839-1a82-4879-9ad5-c21bf2a1418b.vsidx new file mode 100644 index 0000000..2618334 Binary files /dev/null and b/.vs/HaoYueNet/FileContentIndex/ff9b6839-1a82-4879-9ad5-c21bf2a1418b.vsidx differ diff --git a/ProtobufCore/Protocol Buffers - Google's data interchange format.txt b/.vs/HaoYueNet/FileContentIndex/read.lock similarity index 100% rename from ProtobufCore/Protocol Buffers - Google's data interchange format.txt rename to .vs/HaoYueNet/FileContentIndex/read.lock diff --git a/.vs/HaoYueNet/v17/.futdcache.v2 b/.vs/HaoYueNet/v17/.futdcache.v2 new file mode 100644 index 0000000..2ccc4fc Binary files /dev/null and b/.vs/HaoYueNet/v17/.futdcache.v2 differ diff --git a/.vs/ProjectEvaluation/haoyuenet.metadata.v5.2 b/.vs/ProjectEvaluation/haoyuenet.metadata.v5.2 new file mode 100644 index 0000000..9abec33 Binary files /dev/null and b/.vs/ProjectEvaluation/haoyuenet.metadata.v5.2 differ diff --git a/.vs/ProjectEvaluation/haoyuenet.projects.v5.2 b/.vs/ProjectEvaluation/haoyuenet.projects.v5.2 new file mode 100644 index 0000000..93cb95e Binary files /dev/null and b/.vs/ProjectEvaluation/haoyuenet.projects.v5.2 differ diff --git a/NetLib/Google.Protobuf.dll b/NetLib/Google.Protobuf.dll new file mode 100644 index 0000000..7663c31 Binary files /dev/null and b/NetLib/Google.Protobuf.dll differ diff --git a/NetLib/HaoYueNet.ClientNetwork/HaoYueNet.ClientNetwork.csproj b/NetLib/HaoYueNet.ClientNetwork/HaoYueNet.ClientNetwork.csproj index 2f87e16..2238ead 100644 --- a/NetLib/HaoYueNet.ClientNetwork/HaoYueNet.ClientNetwork.csproj +++ b/NetLib/HaoYueNet.ClientNetwork/HaoYueNet.ClientNetwork.csproj @@ -1,13 +1,15 @@ - net6.0 + net7.0 enable enable - + + ..\Google.Protobuf.dll + diff --git a/NetLib/HaoYueNet.ClientNetwork/NetworkHelperCore.cs b/NetLib/HaoYueNet.ClientNetwork/NetworkHelperCore.cs index e83ceec..7ae0a6f 100644 --- a/NetLib/HaoYueNet.ClientNetwork/NetworkHelperCore.cs +++ b/NetLib/HaoYueNet.ClientNetwork/NetworkHelperCore.cs @@ -1,14 +1,6 @@ -using HunterProtobufCore; -using ProtoBuf; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; +using Google.Protobuf; +using HunterProtobufCore; using System.Net.Sockets; -using System.Text; -using System.Threading; -using System.Threading.Tasks; namespace HaoYueNet.ClientNetwork { @@ -159,9 +151,9 @@ namespace HaoYueNet.ClientNetwork { LogOut("准备数据 CMDID=> "+CMDID); HunterNet_C2S _c2sdata = new HunterNet_C2S(); - _c2sdata.HunterNetCore_CmdID = CMDID; - _c2sdata.HunterNetCore_Data = data; - byte[] _finaldata = Serizlize(_c2sdata); + _c2sdata.HunterNetCoreCmdID = CMDID; + _c2sdata.HunterNetCoreData = ByteString.CopyFrom(data); + byte[] _finaldata = Serizlize(_c2sdata); SendToSocket(_finaldata); } @@ -239,7 +231,7 @@ namespace HaoYueNet.ClientNetwork HunterNet_S2C _c2s = DeSerizlize(data); - OnDataCallBack((int)_c2s.HunterNetCore_CmdID, (int)_c2s.HunterNetCore_ERRORCode, _c2s.HunterNetCore_Data); + OnDataCallBack(_c2s.HunterNetCoreCmdID, _c2s.HunterNetCoreERRORCode, _c2s.HunterNetCoreData.ToArray()); } private void Recive(object o) @@ -332,25 +324,19 @@ namespace HaoYueNet.ClientNetwork } } - public static byte[] Serizlize(T MsgObj) + public static byte[] Serizlize(IMessage msg) { - using (MemoryStream ms = new MemoryStream()) - { - Serializer.Serialize(ms, MsgObj); - byte[] data1 = ms.ToArray(); - return data1; - } + return msg.ToByteArray(); } - public static T DeSerizlize(byte[] MsgObj) + public static T DeSerizlize(byte[] bytes) { - using (MemoryStream ms = new MemoryStream(MsgObj)) - { - var ds_obj = Serializer.Deserialize(ms); - return ds_obj; - } + var msgType = typeof(T); + object msg = Activator.CreateInstance(msgType); + ((IMessage)msg).MergeFrom(bytes); + return (T)msg; } - + public void LogOut(string Msg) { //Console.WriteLine(Msg); diff --git a/NetLib/HaoYueNet.ClientNetwork/ProtobufHunterNetCore.cs b/NetLib/HaoYueNet.ClientNetwork/ProtobufHunterNetCore.cs new file mode 100644 index 0000000..97eeea6 --- /dev/null +++ b/NetLib/HaoYueNet.ClientNetwork/ProtobufHunterNetCore.cs @@ -0,0 +1,506 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protobuf_HunterNetCore.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace HunterProtobufCore { + + /// Holder for reflection information generated from protobuf_HunterNetCore.proto + public static partial class ProtobufHunterNetCoreReflection { + + #region Descriptor + /// File descriptor for protobuf_HunterNetCore.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ProtobufHunterNetCoreReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Chxwcm90b2J1Zl9IdW50ZXJOZXRDb3JlLnByb3RvEhJIdW50ZXJQcm90b2J1", + "ZkNvcmUiSAoNSHVudGVyTmV0X0MyUxIbChNIdW50ZXJOZXRDb3JlX0NtZElE", + "GAEgASgFEhoKEkh1bnRlck5ldENvcmVfRGF0YRgCIAEoDCJpCg1IdW50ZXJO", + "ZXRfUzJDEhsKE0h1bnRlck5ldENvcmVfQ21kSUQYASABKAUSHwoXSHVudGVy", + "TmV0Q29yZV9FUlJPUkNvZGUYAiABKAUSGgoSSHVudGVyTmV0Q29yZV9EYXRh", + "GAMgASgMQgJIAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::HunterProtobufCore.HunterNet_C2S), global::HunterProtobufCore.HunterNet_C2S.Parser, new[]{ "HunterNetCoreCmdID", "HunterNetCoreData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::HunterProtobufCore.HunterNet_S2C), global::HunterProtobufCore.HunterNet_S2C.Parser, new[]{ "HunterNetCoreCmdID", "HunterNetCoreERRORCode", "HunterNetCoreData" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + ///上行 + /// + public sealed partial class HunterNet_C2S : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HunterNet_C2S()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::HunterProtobufCore.ProtobufHunterNetCoreReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S(HunterNet_C2S other) : this() { + hunterNetCoreCmdID_ = other.hunterNetCoreCmdID_; + hunterNetCoreData_ = other.hunterNetCoreData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S Clone() { + return new HunterNet_C2S(this); + } + + /// Field number for the "HunterNetCore_CmdID" field. + public const int HunterNetCoreCmdIDFieldNumber = 1; + private int hunterNetCoreCmdID_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreCmdID { + get { return hunterNetCoreCmdID_; } + set { + hunterNetCoreCmdID_ = value; + } + } + + /// Field number for the "HunterNetCore_Data" field. + public const int HunterNetCoreDataFieldNumber = 2; + private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString HunterNetCoreData { + get { return hunterNetCoreData_; } + set { + hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HunterNet_C2S); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HunterNet_C2S other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HunterNetCoreCmdID != other.HunterNetCoreCmdID) return false; + if (HunterNetCoreData != other.HunterNetCoreData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HunterNetCoreCmdID != 0) hash ^= HunterNetCoreCmdID.GetHashCode(); + if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HunterNetCoreCmdID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HunterNet_C2S other) { + if (other == null) { + return; + } + if (other.HunterNetCoreCmdID != 0) { + HunterNetCoreCmdID = other.HunterNetCoreCmdID; + } + if (other.HunterNetCoreData.Length != 0) { + HunterNetCoreData = other.HunterNetCoreData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 18: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 18: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + /// + ///下行 + /// + public sealed partial class HunterNet_S2C : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HunterNet_S2C()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::HunterProtobufCore.ProtobufHunterNetCoreReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C(HunterNet_S2C other) : this() { + hunterNetCoreCmdID_ = other.hunterNetCoreCmdID_; + hunterNetCoreERRORCode_ = other.hunterNetCoreERRORCode_; + hunterNetCoreData_ = other.hunterNetCoreData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C Clone() { + return new HunterNet_S2C(this); + } + + /// Field number for the "HunterNetCore_CmdID" field. + public const int HunterNetCoreCmdIDFieldNumber = 1; + private int hunterNetCoreCmdID_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreCmdID { + get { return hunterNetCoreCmdID_; } + set { + hunterNetCoreCmdID_ = value; + } + } + + /// Field number for the "HunterNetCore_ERRORCode" field. + public const int HunterNetCoreERRORCodeFieldNumber = 2; + private int hunterNetCoreERRORCode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreERRORCode { + get { return hunterNetCoreERRORCode_; } + set { + hunterNetCoreERRORCode_ = value; + } + } + + /// Field number for the "HunterNetCore_Data" field. + public const int HunterNetCoreDataFieldNumber = 3; + private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString HunterNetCoreData { + get { return hunterNetCoreData_; } + set { + hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HunterNet_S2C); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HunterNet_S2C other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HunterNetCoreCmdID != other.HunterNetCoreCmdID) return false; + if (HunterNetCoreERRORCode != other.HunterNetCoreERRORCode) return false; + if (HunterNetCoreData != other.HunterNetCoreData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HunterNetCoreCmdID != 0) hash ^= HunterNetCoreCmdID.GetHashCode(); + if (HunterNetCoreERRORCode != 0) hash ^= HunterNetCoreERRORCode.GetHashCode(); + if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + output.WriteRawTag(16); + output.WriteInt32(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + output.WriteRawTag(16); + output.WriteInt32(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HunterNetCoreCmdID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HunterNet_S2C other) { + if (other == null) { + return; + } + if (other.HunterNetCoreCmdID != 0) { + HunterNetCoreCmdID = other.HunterNetCoreCmdID; + } + if (other.HunterNetCoreERRORCode != 0) { + HunterNetCoreERRORCode = other.HunterNetCoreERRORCode; + } + if (other.HunterNetCoreData.Length != 0) { + HunterNetCoreData = other.HunterNetCoreData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 16: { + HunterNetCoreERRORCode = input.ReadInt32(); + break; + } + case 26: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 16: { + HunterNetCoreERRORCode = input.ReadInt32(); + break; + } + case 26: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/NetLib/HaoYueNet.ClientNetwork/protobuf_HunterNetCore.cs b/NetLib/HaoYueNet.ClientNetwork/protobuf_HunterNetCore.cs deleted file mode 100644 index 740871f..0000000 --- a/NetLib/HaoYueNet.ClientNetwork/protobuf_HunterNetCore.cs +++ /dev/null @@ -1,120 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj b/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj index 048926c..d0e9994 100644 --- a/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj +++ b/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj @@ -9,7 +9,7 @@ Properties HaoYueNet.ClientNetworkNet4x HaoYueNet.ClientNetworkNet4x - v4.5.2 + v4.8 512 true @@ -32,12 +32,24 @@ 4 - - False - .\protobuf-net.dll + + ..\Google.Protobuf.dll + + ..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\..\packages\System.Memory.4.5.5\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 + @@ -48,10 +60,14 @@ - + + + + + \ No newline at end of file diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs b/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs index 911f662..b258f9f 100644 --- a/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs +++ b/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs @@ -1,14 +1,10 @@ -using HunterProtobufCore; -using ProtoBuf; +using Google.Protobuf; +using HunterProtobufCore; 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 { @@ -159,9 +155,9 @@ namespace HaoYueNet.ClientNetworkNet4x { LogOut("准备数据 CMDID=> "+CMDID); HunterNet_C2S _c2sdata = new HunterNet_C2S(); - _c2sdata.HunterNetCore_CmdID = CMDID; - _c2sdata.HunterNetCore_Data = data; - byte[] _finaldata = Serizlize(_c2sdata); + _c2sdata.HunterNetCoreCmdID = CMDID; + _c2sdata.HunterNetCoreData = ByteString.CopyFrom(data); + byte[] _finaldata = Serizlize(_c2sdata); SendToSocket(_finaldata); } @@ -239,7 +235,7 @@ namespace HaoYueNet.ClientNetworkNet4x HunterNet_S2C _c2s = DeSerizlize(data); - OnDataCallBack((int)_c2s.HunterNetCore_CmdID, (int)_c2s.HunterNetCore_ERRORCode, _c2s.HunterNetCore_Data); + OnDataCallBack(_c2s.HunterNetCoreCmdID, _c2s.HunterNetCoreERRORCode, _c2s.HunterNetCoreData.ToArray()); } private void Recive(object o) @@ -332,25 +328,19 @@ namespace HaoYueNet.ClientNetworkNet4x } } - public static byte[] Serizlize(T MsgObj) + public static byte[] Serizlize(IMessage msg) { - using (MemoryStream ms = new MemoryStream()) - { - Serializer.Serialize(ms, MsgObj); - byte[] data1 = ms.ToArray(); - return data1; - } + return msg.ToByteArray(); } - public static T DeSerizlize(byte[] MsgObj) + public static T DeSerizlize(byte[] bytes) { - using (MemoryStream ms = new MemoryStream(MsgObj)) - { - var ds_obj = Serializer.Deserialize(ms); - return ds_obj; - } + var msgType = typeof(T); + object msg = Activator.CreateInstance(msgType); + ((IMessage)msg).MergeFrom(bytes); + return (T)msg; } - + public void LogOut(string Msg) { //Console.WriteLine(Msg); diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/ProtobufHunterNetCore.cs b/NetLib/HaoYueNet.ClientNetworkNet4x/ProtobufHunterNetCore.cs new file mode 100644 index 0000000..97eeea6 --- /dev/null +++ b/NetLib/HaoYueNet.ClientNetworkNet4x/ProtobufHunterNetCore.cs @@ -0,0 +1,506 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protobuf_HunterNetCore.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace HunterProtobufCore { + + /// Holder for reflection information generated from protobuf_HunterNetCore.proto + public static partial class ProtobufHunterNetCoreReflection { + + #region Descriptor + /// File descriptor for protobuf_HunterNetCore.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ProtobufHunterNetCoreReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Chxwcm90b2J1Zl9IdW50ZXJOZXRDb3JlLnByb3RvEhJIdW50ZXJQcm90b2J1", + "ZkNvcmUiSAoNSHVudGVyTmV0X0MyUxIbChNIdW50ZXJOZXRDb3JlX0NtZElE", + "GAEgASgFEhoKEkh1bnRlck5ldENvcmVfRGF0YRgCIAEoDCJpCg1IdW50ZXJO", + "ZXRfUzJDEhsKE0h1bnRlck5ldENvcmVfQ21kSUQYASABKAUSHwoXSHVudGVy", + "TmV0Q29yZV9FUlJPUkNvZGUYAiABKAUSGgoSSHVudGVyTmV0Q29yZV9EYXRh", + "GAMgASgMQgJIAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::HunterProtobufCore.HunterNet_C2S), global::HunterProtobufCore.HunterNet_C2S.Parser, new[]{ "HunterNetCoreCmdID", "HunterNetCoreData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::HunterProtobufCore.HunterNet_S2C), global::HunterProtobufCore.HunterNet_S2C.Parser, new[]{ "HunterNetCoreCmdID", "HunterNetCoreERRORCode", "HunterNetCoreData" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + ///上行 + /// + public sealed partial class HunterNet_C2S : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HunterNet_C2S()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::HunterProtobufCore.ProtobufHunterNetCoreReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S(HunterNet_C2S other) : this() { + hunterNetCoreCmdID_ = other.hunterNetCoreCmdID_; + hunterNetCoreData_ = other.hunterNetCoreData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S Clone() { + return new HunterNet_C2S(this); + } + + /// Field number for the "HunterNetCore_CmdID" field. + public const int HunterNetCoreCmdIDFieldNumber = 1; + private int hunterNetCoreCmdID_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreCmdID { + get { return hunterNetCoreCmdID_; } + set { + hunterNetCoreCmdID_ = value; + } + } + + /// Field number for the "HunterNetCore_Data" field. + public const int HunterNetCoreDataFieldNumber = 2; + private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString HunterNetCoreData { + get { return hunterNetCoreData_; } + set { + hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HunterNet_C2S); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HunterNet_C2S other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HunterNetCoreCmdID != other.HunterNetCoreCmdID) return false; + if (HunterNetCoreData != other.HunterNetCoreData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HunterNetCoreCmdID != 0) hash ^= HunterNetCoreCmdID.GetHashCode(); + if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HunterNetCoreCmdID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HunterNet_C2S other) { + if (other == null) { + return; + } + if (other.HunterNetCoreCmdID != 0) { + HunterNetCoreCmdID = other.HunterNetCoreCmdID; + } + if (other.HunterNetCoreData.Length != 0) { + HunterNetCoreData = other.HunterNetCoreData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 18: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 18: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + /// + ///下行 + /// + public sealed partial class HunterNet_S2C : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HunterNet_S2C()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::HunterProtobufCore.ProtobufHunterNetCoreReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C(HunterNet_S2C other) : this() { + hunterNetCoreCmdID_ = other.hunterNetCoreCmdID_; + hunterNetCoreERRORCode_ = other.hunterNetCoreERRORCode_; + hunterNetCoreData_ = other.hunterNetCoreData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C Clone() { + return new HunterNet_S2C(this); + } + + /// Field number for the "HunterNetCore_CmdID" field. + public const int HunterNetCoreCmdIDFieldNumber = 1; + private int hunterNetCoreCmdID_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreCmdID { + get { return hunterNetCoreCmdID_; } + set { + hunterNetCoreCmdID_ = value; + } + } + + /// Field number for the "HunterNetCore_ERRORCode" field. + public const int HunterNetCoreERRORCodeFieldNumber = 2; + private int hunterNetCoreERRORCode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreERRORCode { + get { return hunterNetCoreERRORCode_; } + set { + hunterNetCoreERRORCode_ = value; + } + } + + /// Field number for the "HunterNetCore_Data" field. + public const int HunterNetCoreDataFieldNumber = 3; + private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString HunterNetCoreData { + get { return hunterNetCoreData_; } + set { + hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HunterNet_S2C); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HunterNet_S2C other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HunterNetCoreCmdID != other.HunterNetCoreCmdID) return false; + if (HunterNetCoreERRORCode != other.HunterNetCoreERRORCode) return false; + if (HunterNetCoreData != other.HunterNetCoreData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HunterNetCoreCmdID != 0) hash ^= HunterNetCoreCmdID.GetHashCode(); + if (HunterNetCoreERRORCode != 0) hash ^= HunterNetCoreERRORCode.GetHashCode(); + if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + output.WriteRawTag(16); + output.WriteInt32(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + output.WriteRawTag(16); + output.WriteInt32(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HunterNetCoreCmdID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HunterNet_S2C other) { + if (other == null) { + return; + } + if (other.HunterNetCoreCmdID != 0) { + HunterNetCoreCmdID = other.HunterNetCoreCmdID; + } + if (other.HunterNetCoreERRORCode != 0) { + HunterNetCoreERRORCode = other.HunterNetCoreERRORCode; + } + if (other.HunterNetCoreData.Length != 0) { + HunterNetCoreData = other.HunterNetCoreData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 16: { + HunterNetCoreERRORCode = input.ReadInt32(); + break; + } + case 26: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 16: { + HunterNetCoreERRORCode = input.ReadInt32(); + break; + } + case 26: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/app.config b/NetLib/HaoYueNet.ClientNetworkNet4x/app.config new file mode 100644 index 0000000..ca8a1fe --- /dev/null +++ b/NetLib/HaoYueNet.ClientNetworkNet4x/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/packages.config b/NetLib/HaoYueNet.ClientNetworkNet4x/packages.config new file mode 100644 index 0000000..b184c7a --- /dev/null +++ b/NetLib/HaoYueNet.ClientNetworkNet4x/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf-net.dll b/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf-net.dll deleted file mode 100644 index a50bb36..0000000 Binary files a/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf-net.dll and /dev/null differ diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf_HunterNetCore.cs b/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf_HunterNetCore.cs deleted file mode 100644 index 740871f..0000000 --- a/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf_HunterNetCore.cs +++ /dev/null @@ -1,120 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 diff --git a/NetLib/HaoYueNet.ServerNetwork/HaoYueNet.ServerNetwork.csproj b/NetLib/HaoYueNet.ServerNetwork/HaoYueNet.ServerNetwork.csproj index 2f87e16..2238ead 100644 --- a/NetLib/HaoYueNet.ServerNetwork/HaoYueNet.ServerNetwork.csproj +++ b/NetLib/HaoYueNet.ServerNetwork/HaoYueNet.ServerNetwork.csproj @@ -1,13 +1,15 @@ - net6.0 + net7.0 enable enable - + + ..\Google.Protobuf.dll + diff --git a/NetLib/HaoYueNet.ServerNetwork/NetWork/SocketManager.cs b/NetLib/HaoYueNet.ServerNetwork/NetWork/SocketManager.cs index 164c525..e0d21dd 100644 --- a/NetLib/HaoYueNet.ServerNetwork/NetWork/SocketManager.cs +++ b/NetLib/HaoYueNet.ServerNetwork/NetWork/SocketManager.cs @@ -1,5 +1,5 @@ -using HunterProtobufCore; -using ProtoBuf; +using Google.Protobuf; +using HunterProtobufCore; using System; using System.Collections; using System.Collections.Generic; @@ -9,6 +9,7 @@ using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; +using static Google.Protobuf.Reflection.FieldOptions.Types; namespace HaoYueNet.ServerNetwork @@ -727,10 +728,10 @@ namespace HaoYueNet.ServerNetwork { AsyncUserToken token = GetAsyncUserTokenForSocket(sk); HunterNet_S2C _s2cdata = new HunterNet_S2C(); - _s2cdata.HunterNetCore_CmdID = CMDID; - _s2cdata.HunterNetCore_Data = data; - _s2cdata.HunterNetCore_ERRORCode = ERRCODE; - byte[] _finaldata = Serizlize(_s2cdata); + _s2cdata.HunterNetCoreCmdID = CMDID; + _s2cdata.HunterNetCoreData = ByteString.CopyFrom(data); + _s2cdata.HunterNetCoreERRORCode = ERRCODE; + byte[] _finaldata = Serizlize(_s2cdata); SendWithIndex(token, _finaldata); } @@ -762,7 +763,6 @@ namespace HaoYueNet.ServerNetwork private void DataCallBackReady(AsyncUserToken sk, byte[] data) { - //增加接收计数 sk.RevIndex = MaxRevIndexNum; @@ -776,7 +776,7 @@ namespace HaoYueNet.ServerNetwork try { HunterNet_C2S _s2c = DeSerizlize(data); - DataCallBack(sk, (int)_s2c.HunterNetCore_CmdID, _s2c.HunterNetCore_Data); + DataCallBack(sk, (int)_s2c.HunterNetCoreCmdID, _s2c.HunterNetCoreData.ToArray()); } catch (Exception ex) { @@ -816,25 +816,17 @@ namespace HaoYueNet.ServerNetwork } #endregion - public static byte[] Serizlize(T MsgObj) + public static byte[] Serizlize(IMessage msg) { - using (MemoryStream ms = new MemoryStream()) - { - Serializer.Serialize(ms, MsgObj); - byte[] data1 = ms.ToArray(); - return data1; - } + return msg.ToByteArray(); } - public static T DeSerizlize(byte[] MsgObj) + public static T DeSerizlize(byte[] bytes) { - using (MemoryStream ms = new MemoryStream(MsgObj)) - { - var ds_obj = Serializer.Deserialize(ms); - //ds_obj = MySet(ds_obj); - return ds_obj; - } - + var msgType = typeof(T); + object msg = Activator.CreateInstance(msgType); + ((IMessage)msg).MergeFrom(bytes); + return (T)msg; } } } diff --git a/NetLib/HaoYueNet.ServerNetwork/ProtobufHunterNetCore.cs b/NetLib/HaoYueNet.ServerNetwork/ProtobufHunterNetCore.cs new file mode 100644 index 0000000..97eeea6 --- /dev/null +++ b/NetLib/HaoYueNet.ServerNetwork/ProtobufHunterNetCore.cs @@ -0,0 +1,506 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protobuf_HunterNetCore.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace HunterProtobufCore { + + /// Holder for reflection information generated from protobuf_HunterNetCore.proto + public static partial class ProtobufHunterNetCoreReflection { + + #region Descriptor + /// File descriptor for protobuf_HunterNetCore.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ProtobufHunterNetCoreReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Chxwcm90b2J1Zl9IdW50ZXJOZXRDb3JlLnByb3RvEhJIdW50ZXJQcm90b2J1", + "ZkNvcmUiSAoNSHVudGVyTmV0X0MyUxIbChNIdW50ZXJOZXRDb3JlX0NtZElE", + "GAEgASgFEhoKEkh1bnRlck5ldENvcmVfRGF0YRgCIAEoDCJpCg1IdW50ZXJO", + "ZXRfUzJDEhsKE0h1bnRlck5ldENvcmVfQ21kSUQYASABKAUSHwoXSHVudGVy", + "TmV0Q29yZV9FUlJPUkNvZGUYAiABKAUSGgoSSHVudGVyTmV0Q29yZV9EYXRh", + "GAMgASgMQgJIAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::HunterProtobufCore.HunterNet_C2S), global::HunterProtobufCore.HunterNet_C2S.Parser, new[]{ "HunterNetCoreCmdID", "HunterNetCoreData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::HunterProtobufCore.HunterNet_S2C), global::HunterProtobufCore.HunterNet_S2C.Parser, new[]{ "HunterNetCoreCmdID", "HunterNetCoreERRORCode", "HunterNetCoreData" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + ///上行 + /// + public sealed partial class HunterNet_C2S : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HunterNet_C2S()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::HunterProtobufCore.ProtobufHunterNetCoreReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S(HunterNet_C2S other) : this() { + hunterNetCoreCmdID_ = other.hunterNetCoreCmdID_; + hunterNetCoreData_ = other.hunterNetCoreData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S Clone() { + return new HunterNet_C2S(this); + } + + /// Field number for the "HunterNetCore_CmdID" field. + public const int HunterNetCoreCmdIDFieldNumber = 1; + private int hunterNetCoreCmdID_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreCmdID { + get { return hunterNetCoreCmdID_; } + set { + hunterNetCoreCmdID_ = value; + } + } + + /// Field number for the "HunterNetCore_Data" field. + public const int HunterNetCoreDataFieldNumber = 2; + private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString HunterNetCoreData { + get { return hunterNetCoreData_; } + set { + hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HunterNet_C2S); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HunterNet_C2S other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HunterNetCoreCmdID != other.HunterNetCoreCmdID) return false; + if (HunterNetCoreData != other.HunterNetCoreData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HunterNetCoreCmdID != 0) hash ^= HunterNetCoreCmdID.GetHashCode(); + if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HunterNetCoreCmdID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HunterNet_C2S other) { + if (other == null) { + return; + } + if (other.HunterNetCoreCmdID != 0) { + HunterNetCoreCmdID = other.HunterNetCoreCmdID; + } + if (other.HunterNetCoreData.Length != 0) { + HunterNetCoreData = other.HunterNetCoreData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 18: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 18: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + /// + ///下行 + /// + public sealed partial class HunterNet_S2C : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HunterNet_S2C()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::HunterProtobufCore.ProtobufHunterNetCoreReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C(HunterNet_S2C other) : this() { + hunterNetCoreCmdID_ = other.hunterNetCoreCmdID_; + hunterNetCoreERRORCode_ = other.hunterNetCoreERRORCode_; + hunterNetCoreData_ = other.hunterNetCoreData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C Clone() { + return new HunterNet_S2C(this); + } + + /// Field number for the "HunterNetCore_CmdID" field. + public const int HunterNetCoreCmdIDFieldNumber = 1; + private int hunterNetCoreCmdID_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreCmdID { + get { return hunterNetCoreCmdID_; } + set { + hunterNetCoreCmdID_ = value; + } + } + + /// Field number for the "HunterNetCore_ERRORCode" field. + public const int HunterNetCoreERRORCodeFieldNumber = 2; + private int hunterNetCoreERRORCode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreERRORCode { + get { return hunterNetCoreERRORCode_; } + set { + hunterNetCoreERRORCode_ = value; + } + } + + /// Field number for the "HunterNetCore_Data" field. + public const int HunterNetCoreDataFieldNumber = 3; + private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString HunterNetCoreData { + get { return hunterNetCoreData_; } + set { + hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HunterNet_S2C); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HunterNet_S2C other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HunterNetCoreCmdID != other.HunterNetCoreCmdID) return false; + if (HunterNetCoreERRORCode != other.HunterNetCoreERRORCode) return false; + if (HunterNetCoreData != other.HunterNetCoreData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HunterNetCoreCmdID != 0) hash ^= HunterNetCoreCmdID.GetHashCode(); + if (HunterNetCoreERRORCode != 0) hash ^= HunterNetCoreERRORCode.GetHashCode(); + if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + output.WriteRawTag(16); + output.WriteInt32(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + output.WriteRawTag(16); + output.WriteInt32(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HunterNetCoreCmdID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HunterNet_S2C other) { + if (other == null) { + return; + } + if (other.HunterNetCoreCmdID != 0) { + HunterNetCoreCmdID = other.HunterNetCoreCmdID; + } + if (other.HunterNetCoreERRORCode != 0) { + HunterNetCoreERRORCode = other.HunterNetCoreERRORCode; + } + if (other.HunterNetCoreData.Length != 0) { + HunterNetCoreData = other.HunterNetCoreData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 16: { + HunterNetCoreERRORCode = input.ReadInt32(); + break; + } + case 26: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 16: { + HunterNetCoreERRORCode = input.ReadInt32(); + break; + } + case 26: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/NetLib/HaoYueNet.ServerNetwork/protobuf_HunterNetCore.cs b/NetLib/HaoYueNet.ServerNetwork/protobuf_HunterNetCore.cs deleted file mode 100644 index 740871f..0000000 --- a/NetLib/HaoYueNet.ServerNetwork/protobuf_HunterNetCore.cs +++ /dev/null @@ -1,120 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 diff --git a/ProtobufCore/Desc/HunterNetCore.protodesc b/ProtobufCore/Desc/HunterNetCore.protodesc deleted file mode 100644 index f301c8b..0000000 --- a/ProtobufCore/Desc/HunterNetCore.protodesc +++ /dev/null @@ -1,10 +0,0 @@ - - -proto/HunterNetCore.protoStargoogle/protobuf/any.proto"o - HunterNet_C2S/ -HunterNetCore_CmdID (RHunterNetCoreCmdID- -HunterNetCore_Data ( RHunterNetCoreData" - HunterNet_S2C/ -HunterNetCore_CmdID (RHunterNetCoreCmdID7 -HunterNetCore_ERRORCode (RHunterNetCoreERRORCode- -HunterNetCore_Data ( RHunterNetCoreDataBHbproto3 \ No newline at end of file diff --git a/ProtobufCore/Desc/HunterStar.protodesc b/ProtobufCore/Desc/HunterStar.protodesc deleted file mode 100644 index ad75f3a..0000000 Binary files a/ProtobufCore/Desc/HunterStar.protodesc and /dev/null differ diff --git a/ProtobufCore/Desc/KyCmdProtocol.protodesc b/ProtobufCore/Desc/KyCmdProtocol.protodesc deleted file mode 100644 index 3117303..0000000 Binary files a/ProtobufCore/Desc/KyCmdProtocol.protodesc and /dev/null differ diff --git a/ProtobufCore/Desc/KyMsgProtocol.protodesc b/ProtobufCore/Desc/KyMsgProtocol.protodesc deleted file mode 100644 index eb3d4a3..0000000 --- a/ProtobufCore/Desc/KyMsgProtocol.protodesc +++ /dev/null @@ -1,267 +0,0 @@ - -3 -proto/KyMsgProtocol.protoCC"* -SystemErrorReponse -State (RState"F -SystemErrorInfoReponse -State (RState -ErrMsg ( RErrMsg" - CreateRoles -Acc ( RAcc -UserName ( RUserName -Sex (RSex -ZoneID (RZoneID -occup (Roccup* -PlatformDataList ( RPlatformDataList"Z -CreateRolesReponse -State (RState. - SubRoleinfo ( 2 .CC.RoleinfoR SubRoleinfo" -Roleinfo -JobID (RJobID -CurLv (RCurLv -CurExp (RCurExp - NextLvExp (R NextLvExp -POW (RPOW -AGL (RAGL -CON (RCON -INT (RINT -NickName ( RNickName -Sex - (RSex -Position ( RPosition -Regtime ( RRegtime -Lasttime ( RLasttime -Isdel (RIsdel -Deltime ( RDeltime -RoleID (RRoleID -MapCode (RMapCode$ - RoleDirection (R RoleDirection -PosX (RPosX -PosY (RPosY -LifeV (RLifeV -MaxLifeV (RMaxLifeV -MagicV (RMagicV - MaxMagicV (R MaxMagicV -ZoneID (RZoneID -RolePic (RRolePic -KillLv (RKillLv -Vitality (RVitality - VitalityTop (R VitalityTop -Vigor (RVigor -VigorTop (RVigorTop -Mate (RMate -Faction! (RFaction -Dianjuan" (RDianjuan -Yuanbao# (RYuanbao -Money1$ (RMoney1 - -Reputation% (R -Reputation -Prestige& (RPrestige" - Contribution' (R Contribution& -Transmigration( (RTransmigration -PKMode) (RPKMode$ - TeacherPlayer* (R TeacherPlayer" - AbilityPoint+ (R AbilityPoint - MyIntroduce, (R MyIntroduce3 - SkillInfoList- ( 2 .CC.SkillInfoR SkillInfoList$ - isFlashplayer. (R isFlashplayer"s - SkillInfo -DBID (RDBID -SkillID (RSkillID - -SkillLevel (R -SkillLevel -UsedNum (RUsedNum"8 - GetRolesList -Acc ( RAcc -ZoneID (RZoneID"[ -GetRolesListReponse -State (RState. - SubRoleinfo ( 2 .CC.RoleinfoR SubRoleinfo"7 - InitialGame -Acc ( RAcc -RoleID (RRoleID"Z -InitialGameReponse -State (RState. - SubRoleinfo ( 2 .CC.RoleinfoR SubRoleinfo"" -PlayGame -RoleID (RRoleID") -PlayGameReponse -RoleID (RRoleID" - -SpriteMove -RoleID (RRoleID -MapCode (RMapCode -action (Raction -toX (RtoX -toY (RtoY - extAction (R extAction -fromX (RfromX -fromY (RfromY& -startMoveTicks (RstartMoveTicks - -pathString - ( R -pathString" - targetRoleID (R targetRoleID" -SpriteMovePosition -RoleID (RRoleID -MapCode (RMapCode -ToMapX (RToMapX -ToMapY (RToMapY - -ToDiection (R -ToDiection - clientTicks (R clientTicks -action (Raction -TryRun (RTryRun"E -SpriteMovePositionReponse -RoleID (RRoleID -xxx (Rxxx" -SpriteExchangeMap -RoleID (RRoleID - -TeleportID (R -TeleportID - -NewMapCode (R -NewMapCode - ToNewMapX (R ToNewMapX - ToNewMapY (R ToNewMapY$ - ToNewDiection (R ToNewDiection -State (RState"J -OthersLeaveMap -RoleID (RRoleID - SpriteTypes (R SpriteTypes" -RoleInfoDataMini -RoleID (RRoleID -RoleName ( RRoleName -RoleSex (RRoleSex - -Occupation (R -Occupation -Level (RLevel -MapCode (RMapCode -PosX (RPosX -PosY (RPosY$ - RoleDirection (R RoleDirection -LifeV - (RLifeV -MaxLifeV (RMaxLifeV -MagicV (RMagicV - MaxMagicV (R MaxMagicV -ZoneID (RZoneID - SkillList (R SkillList" -MonsterInfoData -RoleID (RRoleID -RoleName ( RRoleName -RoleSex (RRoleSex -Level (RLevel - -Experience (R -Experience -PosX (RPosX -PosY (RPosY$ - RoleDirection (R RoleDirection -LifeV (RLifeV -MaxLifeV - (RMaxLifeV -MagicV (RMagicV - MaxMagicV (R MaxMagicV$ - EquipmentBody (R EquipmentBody - ExtensionID (R ExtensionID - MonsterType (R MonsterType" - MasterRoleID (R MasterRoleID$ - AiControlType (R AiControlType - AnimalSound ( R AnimalSound" - MonsterLevel (R MonsterLevel" - ZhongDuStart (R ZhongDuStart& -ZhongDuSeconds (RZhongDuSeconds - -FaintStart (R -FaintStart" - FaintSeconds (R FaintSeconds( -BattleWitchSide (RBattleWitchSide" - ProAttackData -roleID (RroleID -roleX (RroleX -roleY (RroleY - magicCode (R magicCode7 - AttackObjList ( 2.CC.AttackObjInfoR AttackObjList - WeaponsType (R WeaponsTypeA -PointAttackdoube ( 2.CC.PointAttackDoubleRPointAttackdoube$ - BallisticGUID ( R BallisticGUID"5 - PointAttack -PosX (RPosX -PosY (RPosY"; -PointAttackDouble -PosX (RPosX -PosY (RPosY" - AttackObjInfo -enemy (Renemy -enemyX (RenemyX -enemyY (RenemyY - -realEnemyX (R -realEnemyX - -realEnemyY (R -realEnemyY" -ProAttackDataReponse$ - attackerLevel (R attackerLevel& -attackerRoleID (RattackerRoleID -SkillID (RSkillID8 - AttackObjList ( 2.CC.AttackDataInfoR AttackObjList" - attackerPosX (R attackerPosX" - attackerPosY (R attackerPosYA -PointAttackdoube ( 2.CC.PointAttackDoubleRPointAttackdoube$ - BallisticGUID ( R BallisticGUID" -AttackDataInfo$ - injuredRoleID (R injuredRoleID -burst (Rburst -injure (Rinjure$ - newExperience (R newExperience, -currentExperience (RcurrentExperience -newLevel (RnewLevel" - MerlinInjuer (R MerlinInjuer - -MerlinType (R -MerlinType( -injuredRoleLife (RinjuredRoleLife0 -injuredRoleMaxLifeV - (RinjuredRoleMaxLifeV* -injuredRoleMagic (RinjuredRoleMagic2 -injuredRoleMaxMagicV (RinjuredRoleMaxMagicV - injuredType (R injuredType"P - -DBAddSkill -RoleID (RRoleID -SkillID (RSkillID -Lvl (RLvl"= -DBAddSkillReponse -State (RState -DBID (RDBID" -AttackReadyData - -AttackerID (R -AttackerID -SkillID (RSkillIDA -PointAttackdoube ( 2.CC.PointAttackDoubleRPointAttackdoube - NextSkillID ( R NextSkillID"5 -SpriteMonsterDead - MonsterList (R MonsterList" -PLAYBallisticData -roleID (RroleID -roleX (RroleX -roleY (RroleY - magicCode (R magicCodeA -PointAttackdoube ( 2.CC.PointAttackDoubleRPointAttackdoube$ - BallisticGUID ( R BallisticGUID" -WorldEffectData -roleID (RroleID -roleX (RroleX -roleY (RroleY - magicCode (R magicCodeA -PointAttackdoube ( 2.CC.PointAttackDoubleRPointAttackdoube" -OtherEffectDatabproto3 \ No newline at end of file diff --git a/ProtobufCore/Desc/protobuf_HunterNetCore.protodesc b/ProtobufCore/Desc/protobuf_HunterNetCore.protodesc deleted file mode 100644 index 08ff949..0000000 --- a/ProtobufCore/Desc/protobuf_HunterNetCore.protodesc +++ /dev/null @@ -1,10 +0,0 @@ - - -"proto/protobuf_HunterNetCore.protoHunterProtobufCore"o - HunterNet_C2S/ -HunterNetCore_CmdID (RHunterNetCoreCmdID- -HunterNetCore_Data ( RHunterNetCoreData" - HunterNet_S2C/ -HunterNetCore_CmdID (RHunterNetCoreCmdID7 -HunterNetCore_ERRORCode (RHunterNetCoreERRORCode- -HunterNetCore_Data ( RHunterNetCoreDataBHbproto3 \ No newline at end of file diff --git a/ProtobufCore/Desc/protobuf_HunterStar.protodesc b/ProtobufCore/Desc/protobuf_HunterStar.protodesc deleted file mode 100644 index 1603b67..0000000 Binary files a/ProtobufCore/Desc/protobuf_HunterStar.protodesc and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/Enyim.Caching.dll b/ProtobufCore/Protoc-Tools/Enyim.Caching.dll deleted file mode 100644 index 0e44cd7..0000000 Binary files a/ProtobufCore/Protoc-Tools/Enyim.Caching.dll and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/IKVM-LICENSE b/ProtobufCore/Protoc-Tools/IKVM-LICENSE deleted file mode 100644 index d3ae2c8..0000000 --- a/ProtobufCore/Protoc-Tools/IKVM-LICENSE +++ /dev/null @@ -1,425 +0,0 @@ -IMPORTANT NOTICE - - Copyright (C) 1998-2008 Free Software Foundation, Inc. - Copyright (C) 1996-2012 Oracle and/or its affiliates - Copyright (C) 2002-2012 Jeroen Frijters - - Some files in this distribution are part of GNU Classpath or OpenJDK and - are licensed under the GNU General Public License (GPL) version 2 - with "Classpath" exception. This applies in particular to: - - IKVM.OpenJDK.*.dll - - some of the *.java files (see each file header for license) - - See http://www.gnu.org/software/classpath/ for information on the - GNU Classpath license and "Classpath" exception. - - See below for a full copy of the GPL license and the Sun version of the - "Classpath" exception. - ------------------------------------------------------------------------------ - - Copyright (C) 2002-2012 Jeroen Frijters - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jeroen Frijters - jeroen@frijters.net - ------------------------------------------------------------------------------ - -The GNU General Public License (GPL) - -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Everyone is permitted to copy and distribute verbatim copies of this license -document, but changing it is not allowed. - -Preamble - -The licenses for most software are designed to take away your freedom to share -and change it. By contrast, the GNU General Public License is intended to -guarantee your freedom to share and change free software--to make sure the -software is free for all its users. This General Public License applies to -most of the Free Software Foundation's software and to any other program whose -authors commit to using it. (Some other Free Software Foundation software is -covered by the GNU Library General Public License instead.) You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our -General Public Licenses are designed to make sure that you have the freedom to -distribute copies of free software (and charge for this service if you wish), -that you receive source code or can get it if you want it, that you can change -the software or use pieces of it in new free programs; and that you know you -can do these things. - -To protect your rights, we need to make restrictions that forbid anyone to deny -you these rights or to ask you to surrender the rights. These restrictions -translate to certain responsibilities for you if you distribute copies of the -software, or if you modify it. - -For example, if you distribute copies of such a program, whether gratis or for -a fee, you must give the recipients all the rights that you have. You must -make sure that they, too, receive or can get the source code. And you must -show them these terms so they know their rights. - -We protect your rights with two steps: (1) copyright the software, and (2) -offer you this license which gives you legal permission to copy, distribute -and/or modify the software. - -Also, for each author's protection and ours, we want to make certain that -everyone understands that there is no warranty for this free software. If the -software is modified by someone else and passed on, we want its recipients to -know that what they have is not the original, so that any problems introduced -by others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We -wish to avoid the danger that redistributors of a free program will -individually obtain patent licenses, in effect making the program proprietary. -To prevent this, we have made it clear that any patent must be licensed for -everyone's free use or not licensed at all. - -The precise terms and conditions for copying, distribution and modification -follow. - -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a notice -placed by the copyright holder saying it may be distributed under the terms of -this General Public License. The "Program", below, refers to any such program -or work, and a "work based on the Program" means either the Program or any -derivative work under copyright law: that is to say, a work containing the -Program or a portion of it, either verbatim or with modifications and/or -translated into another language. (Hereinafter, translation is included -without limitation in the term "modification".) Each licensee is addressed as -"you". - -Activities other than copying, distribution and modification are not covered by -this License; they are outside its scope. The act of running the Program is -not restricted, and the output from the Program is covered only if its contents -constitute a work based on the Program (independent of having been made by -running the Program). Whether that is true depends on what the Program does. - -1. You may copy and distribute verbatim copies of the Program's source code as -you receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice and -disclaimer of warranty; keep intact all the notices that refer to this License -and to the absence of any warranty; and give any other recipients of the -Program a copy of this License along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you may -at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, thus -forming a work based on the Program, and copy and distribute such modifications -or work under the terms of Section 1 above, provided that you also meet all of -these conditions: - - a) You must cause the modified files to carry prominent notices stating - that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in whole or - in part contains or is derived from the Program or any part thereof, to be - licensed as a whole at no charge to all third parties under the terms of - this License. - - c) If the modified program normally reads commands interactively when run, - you must cause it, when started running for such interactive use in the - most ordinary way, to print or display an announcement including an - appropriate copyright notice and a notice that there is no warranty (or - else, saying that you provide a warranty) and that users may redistribute - the program under these conditions, and telling the user how to view a copy - of this License. (Exception: if the Program itself is interactive but does - not normally print such an announcement, your work based on the Program is - not required to print an announcement.) - -These requirements apply to the modified work as a whole. If identifiable -sections of that work are not derived from the Program, and can be reasonably -considered independent and separate works in themselves, then this License, and -its terms, do not apply to those sections when you distribute them as separate -works. But when you distribute the same sections as part of a whole which is a -work based on the Program, the distribution of the whole must be on the terms -of this License, whose permissions for other licensees extend to the entire -whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your -rights to work written entirely by you; rather, the intent is to exercise the -right to control the distribution of derivative or collective works based on -the Program. - -In addition, mere aggregation of another work not based on the Program with the -Program (or with a work based on the Program) on a volume of a storage or -distribution medium does not bring the other work under the scope of this -License. - -3. You may copy and distribute the Program (or a work based on it, under -Section 2) in object code or executable form under the terms of Sections 1 and -2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable source - code, which must be distributed under the terms of Sections 1 and 2 above - on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three years, to - give any third party, for a charge no more than your cost of physically - performing source distribution, a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of Sections 1 - and 2 above on a medium customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer to - distribute corresponding source code. (This alternative is allowed only - for noncommercial distribution and only if you received the program in - object code or executable form with such an offer, in accord with - Subsection b above.) - -The source code for a work means the preferred form of the work for making -modifications to it. For an executable work, complete source code means all -the source code for all modules it contains, plus any associated interface -definition files, plus the scripts used to control compilation and installation -of the executable. However, as a special exception, the source code -distributed need not include anything that is normally distributed (in either -source or binary form) with the major components (compiler, kernel, and so on) -of the operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the source -code from the same place counts as distribution of the source code, even though -third parties are not compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Program except as -expressly provided under this License. Any attempt otherwise to copy, modify, -sublicense or distribute the Program is void, and will automatically terminate -your rights under this License. However, parties who have received copies, or -rights, from you under this License will not have their licenses terminated so -long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed it. -However, nothing else grants you permission to modify or distribute the Program -or its derivative works. These actions are prohibited by law if you do not -accept this License. Therefore, by modifying or distributing the Program (or -any work based on the Program), you indicate your acceptance of this License to -do so, and all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the Program), -the recipient automatically receives a license from the original licensor to -copy, distribute or modify the Program subject to these terms and conditions. -You may not impose any further restrictions on the recipients' exercise of the -rights granted herein. You are not responsible for enforcing compliance by -third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), conditions -are imposed on you (whether by court order, agreement or otherwise) that -contradict the conditions of this License, they do not excuse you from the -conditions of this License. If you cannot distribute so as to satisfy -simultaneously your obligations under this License and any other pertinent -obligations, then as a consequence you may not distribute the Program at all. -For example, if a patent license would not permit royalty-free redistribution -of the Program by all those who receive copies directly or indirectly through -you, then the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply and -the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or -other property right claims or to contest validity of any such claims; this -section has the sole purpose of protecting the integrity of the free software -distribution system, which is implemented by public license practices. Many -people have made generous contributions to the wide range of software -distributed through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing to -distribute software through any other system and a licensee cannot impose that -choice. - -This section is intended to make thoroughly clear what is believed to be a -consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain -countries either by patents or by copyrighted interfaces, the original -copyright holder who places the Program under this License may add an explicit -geographical distribution limitation excluding those countries, so that -distribution is permitted only in or among countries not thus excluded. In -such case, this License incorporates the limitation as if written in the body -of this License. - -9. The Free Software Foundation may publish revised and/or new versions of the -General Public License from time to time. Such new versions will be similar in -spirit to the present version, but may differ in detail to address new problems -or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any later -version", you have the option of following the terms and conditions either of -that version or of any later version published by the Free Software Foundation. -If the Program does not specify a version number of this License, you may -choose any version ever published by the Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free programs -whose distribution conditions are different, write to the author to ask for -permission. For software which is copyrighted by the Free Software Foundation, -write to the Free Software Foundation; we sometimes make exceptions for this. -Our decision will be guided by the two goals of preserving the free status of -all derivatives of our free software and of promoting the sharing and reuse of -software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR -THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE -STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE -PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND -PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, -YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL -ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE -PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR -INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA -BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER -OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -END OF TERMS AND CONDITIONS - -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible -use to the public, the best way to achieve this is to make it free software -which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach -them to the start of each source file to most effectively convey the exclusion -of warranty; and each file should have at least the "copyright" line and a -pointer to where the full notice is found. - - One line to give the program's name and a brief idea of what it does. - - Copyright (C) - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., 59 - Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this when it -starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author Gnomovision comes - with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free - software, and you are welcome to redistribute it under certain conditions; - type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may be -called something other than 'show w' and 'show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your school, -if any, to sign a "copyright disclaimer" for the program, if necessary. Here -is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - 'Gnomovision' (which makes passes at compilers) written by James Hacker. - - signature of Ty Coon, 1 April 1989 - - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General Public -License instead of this License. - - -"CLASSPATH" EXCEPTION TO THE GPL - -Certain source files distributed by Oracle America and/or its affiliates are -subject to the following clarification and special exception to the GPL, but -only where Oracle has expressly included in the particular source file's header -the words "Oracle designates this particular file as subject to the "Classpath" -exception as provided by Oracle in the LICENSE file that accompanied this code." - - Linking this library statically or dynamically with other modules is making - a combined work based on this library. Thus, the terms and conditions of - the GNU General Public License cover the whole combination. - - As a special exception, the copyright holders of this library give you - permission to link this library with independent modules to produce an - executable, regardless of the license terms of these independent modules, - and to copy and distribute the resulting executable under terms of your - choice, provided that you also meet, for each linked independent module, - the terms and conditions of the license of that module. An independent - module is a module which is not derived from or based on this library. If - you modify this library, you may extend this exception to your version of - the library, but you are not obligated to do so. If you do not wish to do - so, delete this exception statement from your version. - ------------------------------------------------------------------------------ - - ------------------------------------------------------------------------- - $Id: LICENSE,v 1.7.4.1 2012/06/12 08:44:39 jfrijters Exp $ - ------------------------------------------------------------------------- - Copyright (c) 1999 Visual Numerics Inc. All Rights Reserved. - - Permission to use, copy, modify, and distribute this software is freely - granted by Visual Numerics, Inc., provided that the copyright notice - above and the following warranty disclaimer are preserved in human - readable form. - - Because this software is licenses free of charge, it is provided - "AS IS", with NO WARRANTY. TO THE EXTENT PERMITTED BY LAW, VNI - DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED - TO ITS PERFORMANCE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - VNI WILL NOT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING OUT OF THE USE - OF OR INABILITY TO USE THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO DIRECT, - INDIRECT, SPECIAL, CONSEQUENTIAL, PUNITIVE, AND EXEMPLARY DAMAGES, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - - This Java code is based on C code in the package fdlibm, - which can be obtained from www.netlib.org. - The original fdlibm C code contains the following notice. - - Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - - Developed at SunSoft, a Sun Microsystems, Inc. business. - Permission to use, copy, modify, and distribute this - software is freely granted, provided that this notice - is preserved. - ------------------------------------------------------------------------------ diff --git a/ProtobufCore/Protoc-Tools/IKVM.Reflection.dll b/ProtobufCore/Protoc-Tools/IKVM.Reflection.dll deleted file mode 100644 index c2b777c..0000000 Binary files a/ProtobufCore/Protoc-Tools/IKVM.Reflection.dll and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/MiscUtil.dll b/ProtobufCore/Protoc-Tools/MiscUtil.dll deleted file mode 100644 index 2c3cbbb..0000000 Binary files a/ProtobufCore/Protoc-Tools/MiscUtil.dll and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/NHibernate lgpl.txt b/ProtobufCore/Protoc-Tools/NHibernate lgpl.txt deleted file mode 100644 index 866688d..0000000 --- a/ProtobufCore/Protoc-Tools/NHibernate lgpl.txt +++ /dev/null @@ -1,460 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - diff --git a/ProtobufCore/Protoc-Tools/NHibernate.dll b/ProtobufCore/Protoc-Tools/NHibernate.dll deleted file mode 100644 index f8b0bc2..0000000 Binary files a/ProtobufCore/Protoc-Tools/NHibernate.dll and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/ProtoSharp.Core.dll b/ProtobufCore/Protoc-Tools/ProtoSharp.Core.dll deleted file mode 100644 index 52dc1bd..0000000 Binary files a/ProtobufCore/Protoc-Tools/ProtoSharp.Core.dll and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/Protocol Buffers.ppt b/ProtobufCore/Protoc-Tools/Protocol Buffers.ppt deleted file mode 100644 index 71dcfc7..0000000 Binary files a/ProtobufCore/Protoc-Tools/Protocol Buffers.ppt and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/bcl.proto b/ProtobufCore/Protoc-Tools/bcl.proto deleted file mode 100644 index 35de280..0000000 --- a/ProtobufCore/Protoc-Tools/bcl.proto +++ /dev/null @@ -1,53 +0,0 @@ -// this is prototype only!!! - -package bcl; - -message TimeSpan { - optional sint64 value = 1; // the size of the timespan (in units of the selected scale) - optional TimeSpanScale scale = 2 [default = DAYS]; // the scale of the timespan - enum TimeSpanScale { - DAYS = 0; - HOURS = 1; - MINUTES = 2; - SECONDS = 3; - MILLISECONDS = 4; - TICKS = 5; - - MINMAX = 15; // dubious - } -} - -message DateTime { - optional sint64 value = 1; // the offset (in units of the selected scale) from 1970/01/01 - optional TimeSpanScale scale = 2 [default = DAYS]; // the scale of the timespan - enum TimeSpanScale { - DAYS = 0; - HOURS = 1; - MINUTES = 2; - SECONDS = 3; - MILLISECONDS = 4; - TICKS = 5; - - MINMAX = 15; // dubious - } -} - -message NetObjectProxy { - optional int32 existingObjectKey = 1; // for a tracked object, the key of the **first** time this object was seen - optional int32 newObjectKey = 2; // for a tracked object, a **new** key, the first time this object is seen - optional int32 existingTypeKey = 3; // for dynamic typing, the key of the **first** time this type was seen - optional int32 newTypeKey = 4; // for dynamic typing, a **new** key, the first time this type is seen - optional string typeName = 8; // for dynamic typing, the name of the type (only present along with newTypeKey) - optional bytes payload = 10; // the new string/value (only present along with newObjectKey) -} - -message Guid { - optional fixed64 lo = 1; // the first 8 bytes of the guid - optional fixed64 hi = 2; // the second 8 bytes of the guid -} - -message Decimal { - optional uint64 lo = 1; // the first 64 bits of the underlying value - optional uint32 hi = 2; // the last 32 bis of the underlying value - optional uint32 signScale = 3; // the number of decimal digits (bits 1-16), and the sign (bit 0) -} \ No newline at end of file diff --git a/ProtobufCore/Protoc-Tools/log4net.dll b/ProtobufCore/Protoc-Tools/log4net.dll deleted file mode 100644 index ffc57e1..0000000 Binary files a/ProtobufCore/Protoc-Tools/log4net.dll and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/nunit.framework.dll b/ProtobufCore/Protoc-Tools/nunit.framework.dll deleted file mode 100644 index d67143f..0000000 Binary files a/ProtobufCore/Protoc-Tools/nunit.framework.dll and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/nwind.groups.proto b/ProtobufCore/Protoc-Tools/nwind.groups.proto deleted file mode 100644 index ae89388..0000000 --- a/ProtobufCore/Protoc-Tools/nwind.groups.proto +++ /dev/null @@ -1,5 +0,0 @@ -package DAL; - -message Database { - repeated group Order Orders = 1; -} diff --git a/ProtobufCore/Protoc-Tools/nwind.groups.proto.bin b/ProtobufCore/Protoc-Tools/nwind.groups.proto.bin deleted file mode 100644 index 4e6004e..0000000 Binary files a/ProtobufCore/Protoc-Tools/nwind.groups.proto.bin and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/nwind.proto b/ProtobufCore/Protoc-Tools/nwind.proto deleted file mode 100644 index bbc5cc7..0000000 --- a/ProtobufCore/Protoc-Tools/nwind.proto +++ /dev/null @@ -1,31 +0,0 @@ -package DAL; - -message Database { - repeated Order Orders = 1; -} - -message Order { - optional int32 OrderID = 1; - optional string CustomerID = 2; - optional int32 EmployeeID = 3; - optional bcl.DateTime OrderDate = 4; - optional bcl.DateTime RequiredDate = 5; - optional bcl.DateTime ShippedDate = 6; - optional int32 ShipVia = 7; - optional bcl.Decimal Freight = 8; - optional string ShipName = 9; - optional string ShipAddress = 10; - optional string ShipCity = 11; - optional string ShipRegion = 12; - optional string ShipPostalCode = 13; - optional string ShipCountry = 14; - repeated OrderLine Lines = 15; -} - -message OrderLine { - optional int32 OrderID = 1; - optional int32 ProductID = 2; - optional bcl.Decimal UnitPrice = 3; - optional sint32 Quantity = 4; - optional float Discount = 5; -} diff --git a/ProtobufCore/Protoc-Tools/nwind.proto.bin b/ProtobufCore/Protoc-Tools/nwind.proto.bin deleted file mode 100644 index b7484d2..0000000 Binary files a/ProtobufCore/Protoc-Tools/nwind.proto.bin and /dev/null differ diff --git a/ProtobufCore/Protoc-Tools/protoc-license.txt b/ProtobufCore/Protoc-Tools/protoc-license.txt deleted file mode 100644 index b462b56..0000000 --- a/ProtobufCore/Protoc-Tools/protoc-license.txt +++ /dev/null @@ -1,15 +0,0 @@ -Protocol Buffers - Google's data interchange format -Copyright 2008 Google Inc. -http://code.google.com/p/protobuf/ - -This package contains a precompiled Win32 binary version of the protocol buffer -compiler (protoc). This binary is intended for Windows users who want to -use Protocol Buffers in Java or Python but do not want to compile protoc -themselves. To install, simply place this binary somewhere in your PATH. - -This binary was built using MinGW, but the output is the same regardless of -the C++ compiler used. - -You will still need to download the source code package in order to obtain the -Java or Python runtime libraries. Get it from: - http://code.google.com/p/protobuf/downloads/ diff --git a/ProtobufCore/Protoc-Tools/protoc.exe b/ProtobufCore/Protoc-Tools/protoc.exe deleted file mode 100644 index db74054..0000000 Binary files a/ProtobufCore/Protoc-Tools/protoc.exe and /dev/null differ diff --git a/ProtobufCore/Protogen-Tools/common.xslt b/ProtobufCore/Protogen-Tools/common.xslt deleted file mode 100644 index 85c3721..0000000 --- a/ProtobufCore/Protogen-Tools/common.xslt +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - Node not handled: / - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ProtobufCore/Protogen-Tools/csharp.xslt b/ProtobufCore/Protogen-Tools/csharp.xslt deleted file mode 100644 index 6cd9219..0000000 --- a/ProtobufCore/Protogen-Tools/csharp.xslt +++ /dev/null @@ -1,628 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - - - - - - -using ; - - - - -using ; - - - - - - - CSharp template for protobuf-net. - Options: - General: - "help" - this page - Additional serializer support: - "xml" - enable explicit xml support (XmlSerializer) - "datacontract" - enable data-contract support (DataContractSerializer; requires .NET 3.0) - "binary" - enable binary support (BinaryFormatter; not supported on Silverlight) - Other: - "protoRpc" - enable proto-rpc client - "observable" - change notification (observer pattern) support - "preObservable" - pre-change notification (observer pattern) support (requires .NET 3.5) - "partialMethods" - provide partial methods for changes (requires C# 3.0) - "detectMissing" - provide *Specified properties to indicate whether fields are present - "lightFramework" - omit additional attributes not included in CF/Silverlight - "asynchronous" - emit asynchronous methods for use with WCF - "clientProxy" - emit asynchronous client proxy class - "import" - additional namespaces to import (semicolon delimited) - "fixCase" - change type/member names (types/properties become PascalCase; fields become camelCase) - - - - - - Invalid options: xml and data-contract serialization are mutually exclusive. - - - -// Option: xml serialization ([XmlType]/[XmlElement]) enabled - -// Option: data-contract serialization ([DataContract]/[DataMember]) enabled - -// Option: binary serialization (ISerializable) enabled - -// Option: observable (OnPropertyChanged) enabled - -// Option: pre-observable (OnPropertyChanging) enabled - -// Option: partial methods (On*Changing/On*Changed) enabled - -// Option: missing-value detection (*Specified/ShouldSerialize*/Reset*) enabled - -// Option: light framework (CF/Silverlight) enabled - -// Option: proto-rpc enabled - - - - - - - - - -// Generated from: - - - - - - - -namespace -{ - - -} - - -// Note: requires additional types generated from: - - - - - - - - - - - - - - - - [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"")] - [global::System.Runtime.Serialization.DataContract(Name=@"")] - [global::System.Xml.Serialization.XmlType(TypeName=@"")] - public partial class : global::ProtoBuf.IExtensible, global::System.Runtime.Serialization.ISerializable, global::System.ComponentModel.INotifyPropertyChanged, global::System.ComponentModel.INotifyPropertyChanging - { - public () {} - - protected (global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) - : this() { global::ProtoBuf.Serializer.Merge(info, this); } - void global::System.Runtime.Serialization.ISerializable.GetObjectData(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) - { global::ProtoBuf.Serializer.Serialize(info, this); } - - public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - protected virtual void OnPropertyChanged(string propertyName) - { if(PropertyChanged != null) PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(propertyName)); } - - public event global::System.ComponentModel.PropertyChangingEventHandler PropertyChanging; - protected virtual void OnPropertyChanging(string propertyName) - { if(PropertyChanging != null) PropertyChanging(this, new global::System.ComponentModel.PropertyChangingEventArgs(propertyName)); } - - private global::ProtoBuf.IExtension extensionObject; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } - } - - - - - - - - - - - - - - - - [global::ProtoBuf.ProtoContract(Name=@"")] - [global::System.Runtime.Serialization.DataContract(Name=@"")] - - [global::System.Xml.Serialization.XmlType(TypeName=@"")] - public enum - { - - } - - - - - - 0 - - [global::ProtoBuf.ProtoEnum(Name=@"", Value=)] - [global::System.Runtime.Serialization.EnumMember(Value=@"")] - [global::System.Xml.Serialization.XmlEnum(@"")] - = , - - - - - - - - - - - - - - - - - - - - - - @ - - |abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while| - - - - FixedSize - Group - TwosComplement - ZigZag - Default - - - - - struct - struct - struct - struct - struct - struct - struct - struct - struct - class - class - struct - struct - struct - struct - struct - struct - none - - - Field type not implemented: (.) - - - - - - - double - double - float - long - ulong - int - ulong - uint - bool - string - byte[] - uint - int - long - int - long - - - - - - Field type not implemented: (.) - - - - - - - - - @"" - . - - - /* - - */ null - () - - - - - - - - - . - . - - - - - - - - - - "" - null - null - . - default() - - - - global::System.Obsolete, - - - - - - - - ? - private = ; - [global::ProtoBuf.ProtoMember(, IsRequired = false, Name=@"", DataFormat = global::ProtoBuf.DataFormat.)] - [global::System.ComponentModel.DefaultValue()] - [global::System.Xml.Serialization.XmlElement(@"", Order = )] - - [global::System.Runtime.Serialization.DataMember(Name=@"", Order = , IsRequired = false)] - - - - - - - - - - - - - - - private ; - [global::ProtoBuf.ProtoMember(, IsRequired = true, Name=@"", DataFormat = global::ProtoBuf.DataFormat.)] - [global::System.Xml.Serialization.XmlElement(@"", Order = )] - - [global::System.Runtime.Serialization.DataMember(Name=@"", Order = , IsRequired = true)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - public - { - get { return ; } - set { OnChanging(value); OnPropertyChanging(@""); = value; OnPropertyChanged(@""); OnChanged();} - } - partial void OnChanging( value); - partial void OnChanged(); - [global::System.Xml.Serialization.XmlIgnore] - [global::System.ComponentModel.Browsable(false)] - public bool Specified - { - get { return this. != null; } - set { if (value == (this.== null)) this. = value ? this. : ()null; } - } - private bool ShouldSerialize() { return Specified; } - private void Reset() { Specified = false; } - - - - - - - private readonly global::System.Collections.Generic.List<> = new global::System.Collections.Generic.List<>(); - [global::ProtoBuf.ProtoMember(, Name=@"", DataFormat = global::ProtoBuf.DataFormat., Options = global::ProtoBuf.MemberSerializationOptions.Packed)] - [global::System.Runtime.Serialization.DataMember(Name=@"", Order = , IsRequired = false)] - - [global::System.Xml.Serialization.XmlElement(@"", Order = )] - - public global::System.Collections.Generic.List<> - { - get { return ; } - set { = value; } - } - - - - - [global::System.ServiceModel.ServiceContract(Name = @"")] - public interface I - { - - } - - - public class Client : global::ProtoBuf.ServiceModel.RpcClient - { - public Client() : base(typeof(I)) { } - - } - - - - - - - - [global::System.ServiceModel.OperationContract(Name = @"")] - [global::ProtoBuf.ServiceModel.ProtoBehavior] - - ( request); - - [global::System.ServiceModel.OperationContract(AsyncPattern = true, Name = @"")] - global::System.IAsyncResult Begin( request, global::System.AsyncCallback callback, object state); - End(global::System.IAsyncResult ar); - - - - - ( request) - { - return () Send(@"", request); - } - - - - - - - - - public partial class CompletedEventArgs : global::System.ComponentModel.AsyncCompletedEventArgs - { - private object[] results; - - public CompletedEventArgs(object[] results, global::System.Exception exception, bool cancelled, object userState) - : base(exception, cancelled, userState) - { - this.results = results; - } - - public Result - { - get { - base.RaiseExceptionIfNecessary(); - return ()(this.results[0]); - } - } - } - - - - - - - - [global::System.Diagnostics.DebuggerStepThroughAttribute()] - public partial class Client : global::System.ServiceModel.ClientBase<I>, I - { - - public Client() - {} - public Client(string endpointConfigurationName) - : base(endpointConfigurationName) - {} - public Client(string endpointConfigurationName, string remoteAddress) - : base(endpointConfigurationName, remoteAddress) - {} - public Client(string endpointConfigurationName, global::System.ServiceModel.EndpointAddress remoteAddress) - : base(endpointConfigurationName, remoteAddress) - {} - public Client(global::System.ServiceModel.Channels.Binding binding, global::System.ServiceModel.EndpointAddress remoteAddress) - : base(binding, remoteAddress) - {} - - - } - - - - - - private BeginOperationDelegate onBeginDelegate; - private EndOperationDelegate onEndDelegate; - private global::System.Threading.SendOrPostCallback onCompletedDelegate; - - public event global::System.EventHandler<CompletedEventArgs> Completed; - - public ( request) - { - return base.Channel.(request); - } - - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public global::System.IAsyncResult Begin( request, global::System.AsyncCallback callback, object asyncState) - { - return base.Channel.Begin(request, callback, asyncState); - } - - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public End(global::System.IAsyncResult result) - { - return base.Channel.End(result); - } - - private global::System.IAsyncResult OnBegin(object[] inValues, global::System.AsyncCallback callback, object asyncState) - { - request = (()(inValues[0])); - return this.Begin(request, callback, asyncState); - } - - private object[] OnEnd(global::System.IAsyncResult result) - { - retVal = this.End(result); - return new object[] { - retVal}; - } - - private void OnCompleted(object state) - { - if ((this.Completed != null)) - { - InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.Completed(this, new CompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); - } - } - - public void Async( request) - { - this.Async(request, null); - } - - public void Async( request, object userState) - { - if ((this.onBeginDelegate == null)) - { - this.onBeginDelegate = new BeginOperationDelegate(this.OnBegin); - } - if ((this.onEndDelegate == null)) - { - this.onEndDelegate = new EndOperationDelegate(this.OnEnd); - } - if ((this.onCompletedDelegate == null)) - { - this.onCompletedDelegate = new global::System.Threading.SendOrPostCallback(this.OnCompleted); - } - base.InvokeAsync(this.onBeginDelegate, new object[] { - request}, this.onEndDelegate, this.onCompletedDelegate, userState); - } - - - diff --git a/ProtobufCore/Protogen-Tools/protobuf-net.dll b/ProtobufCore/Protogen-Tools/protobuf-net.dll deleted file mode 100644 index ade23fd..0000000 Binary files a/ProtobufCore/Protogen-Tools/protobuf-net.dll and /dev/null differ diff --git a/ProtobufCore/Protogen-Tools/protobuf-net.xml b/ProtobufCore/Protogen-Tools/protobuf-net.xml deleted file mode 100644 index a6e609d..0000000 --- a/ProtobufCore/Protogen-Tools/protobuf-net.xml +++ /dev/null @@ -1,2845 +0,0 @@ - - - - protobuf-net - - - - - Provides support for common .NET types that do not have a direct representation - in protobuf, using the definitions from bcl.proto - - - - - Creates a new instance of the specified type, bypassing the constructor. - - The type to create - The new instance - If the platform does not support constructor-skipping - - - - Writes a TimeSpan to a protobuf stream - - - - - Parses a TimeSpan from a protobuf stream - - - - - Parses a DateTime from a protobuf stream - - - - - Writes a DateTime to a protobuf stream - - - - - Parses a decimal from a protobuf stream - - - - - Writes a decimal to a protobuf stream - - - - - Writes a Guid to a protobuf stream - - - - - Parses a Guid from a protobuf stream - - - - - Reads an *implementation specific* bundled .NET object, including (as options) type-metadata, identity/re-use, etc. - - - - - Writes an *implementation specific* bundled .NET object, including (as options) type-metadata, identity/re-use, etc. - - - - - Optional behaviours that introduce .NET-specific functionality - - - - - No special behaviour - - - - - Enables full object-tracking/full-graph support. - - - - - Embeds the type information into the stream, allowing usage with types not known in advance. - - - - - If false, the constructor for the type is bypassed during deserialization, meaning any field initializers - or other initialization code is skipped. - - - - - Provides a simple buffer-based implementation of an extension object. - - - - - Provides addition capability for supporting unexpected fields during - protocol-buffer serialization/deserialization. This allows for loss-less - round-trip/merge, even when the data is not fully understood. - - - - - Requests a stream into which any unexpected fields can be persisted. - - A new stream suitable for storing data. - - - - Indicates that all unexpected fields have now been stored. The - implementing class is responsible for closing the stream. If - "commit" is not true the data may be discarded. - - The stream originally obtained by BeginAppend. - True if the append operation completed successfully. - - - - Requests a stream of the unexpected fields previously stored. - - A prepared stream of the unexpected fields. - - - - Indicates that all unexpected fields have now been read. The - implementing class is responsible for closing the stream. - - The stream originally obtained by BeginQuery. - - - - Requests the length of the raw binary stream; this is used - when serializing sub-entities to indicate the expected size. - - The length of the binary stream representing unexpected data. - - - Specifies a method on the root-contract in an hierarchy to be invoked before serialization. - - - Specifies a method on the root-contract in an hierarchy to be invoked after serialization. - - - Specifies a method on the root-contract in an hierarchy to be invoked before deserialization. - - - Specifies a method on the root-contract in an hierarchy to be invoked after deserialization. - - - - Pushes a null reference onto the stack. Note that this should only - be used to return a null (or set a variable to null); for null-tests - use BranchIfTrue / BranchIfFalse. - - - - - Creates a new "using" block (equivalent) around a variable; - the variable must exist, and note that (unlike in C#) it is - the variables *final* value that gets disposed. If you need - *original* disposal, copy your variable first. - - It is the callers responsibility to ensure that the variable's - scope fully-encapsulates the "using"; if not, the variable - may be re-used (and thus re-assigned) unexpectedly. - - - - - Sub-format to use when serializing/deserializing data - - - - - Uses the default encoding for the data-type. - - - - - When applied to signed integer-based data (including Decimal), this - indicates that zigzag variant encoding will be used. This means that values - with small magnitude (regardless of sign) take a small amount - of space to encode. - - - - - When applied to signed integer-based data (including Decimal), this - indicates that two's-complement variant encoding will be used. - This means that any -ve number will take 10 bytes (even for 32-bit), - so should only be used for compatibility. - - - - - When applied to signed integer-based data (including Decimal), this - indicates that a fixed amount of space will be used. - - - - - When applied to a sub-message, indicates that the value should be treated - as group-delimited. - - - - - Simple base class for supporting unexpected fields allowing - for loss-less round-tips/merge, even if the data is not understod. - The additional fields are (by default) stored in-memory in a buffer. - - As an example of an alternative implementation, you might - choose to use the file system (temporary files) as the back-end, tracking - only the paths [such an object would ideally be IDisposable and use - a finalizer to ensure that the files are removed]. - - - - - Indicates that the implementing type has support for protocol-buffer - extensions. - - Can be implemented by deriving from Extensible. - - - - Retrieves the extension object for the current - instance, optionally creating it if it does not already exist. - - Should a new extension object be - created if it does not already exist? - The extension object if it exists (or was created), or null - if the extension object does not exist or is not available. - The createIfMissing argument is false during serialization, - and true during deserialization upon encountering unexpected fields. - - - - Retrieves the extension object for the current - instance, optionally creating it if it does not already exist. - - Should a new extension object be - created if it does not already exist? - The extension object if it exists (or was created), or null - if the extension object does not exist or is not available. - The createIfMissing argument is false during serialization, - and true during deserialization upon encountering unexpected fields. - - - - Provides a simple, default implementation for extension support, - optionally creating it if it does not already exist. Designed to be called by - classes implementing . - - Should a new extension object be - created if it does not already exist? - The extension field to check (and possibly update). - The extension object if it exists (or was created), or null - if the extension object does not exist or is not available. - The createIfMissing argument is false during serialization, - and true during deserialization upon encountering unexpected fields. - - - - Appends the value as an additional (unexpected) data-field for the instance. - Note that for non-repeated sub-objects, this equates to a merge operation; - for repeated sub-objects this adds a new instance to the set; for simple - values the new value supercedes the old value. - - Note that appending a value does not remove the old value from - the stream; avoid repeatedly appending values for the same field. - The type of the value to append. - The extensible object to append the value to. - The field identifier; the tag should not be defined as a known data-field for the instance. - The value to append. - - - - Appends the value as an additional (unexpected) data-field for the instance. - Note that for non-repeated sub-objects, this equates to a merge operation; - for repeated sub-objects this adds a new instance to the set; for simple - values the new value supercedes the old value. - - Note that appending a value does not remove the old value from - the stream; avoid repeatedly appending values for the same field. - The data-type of the field. - The data-format to use when encoding the value. - The extensible object to append the value to. - The field identifier; the tag should not be defined as a known data-field for the instance. - The value to append. - - - - Queries an extensible object for an additional (unexpected) data-field for the instance. - The value returned is the composed value after merging any duplicated content; if the - value is "repeated" (a list), then use GetValues instead. - - The data-type of the field. - The extensible object to obtain the value from. - The field identifier; the tag should not be defined as a known data-field for the instance. - The effective value of the field, or the default value if not found. - - - - Queries an extensible object for an additional (unexpected) data-field for the instance. - The value returned is the composed value after merging any duplicated content; if the - value is "repeated" (a list), then use GetValues instead. - - The data-type of the field. - The extensible object to obtain the value from. - The field identifier; the tag should not be defined as a known data-field for the instance. - The data-format to use when decoding the value. - The effective value of the field, or the default value if not found. - - - - Queries an extensible object for an additional (unexpected) data-field for the instance. - The value returned (in "value") is the composed value after merging any duplicated content; - if the value is "repeated" (a list), then use GetValues instead. - - The data-type of the field. - The effective value of the field, or the default value if not found. - The extensible object to obtain the value from. - The field identifier; the tag should not be defined as a known data-field for the instance. - True if data for the field was present, false otherwise. - - - - Queries an extensible object for an additional (unexpected) data-field for the instance. - The value returned (in "value") is the composed value after merging any duplicated content; - if the value is "repeated" (a list), then use GetValues instead. - - The data-type of the field. - The effective value of the field, or the default value if not found. - The extensible object to obtain the value from. - The field identifier; the tag should not be defined as a known data-field for the instance. - The data-format to use when decoding the value. - True if data for the field was present, false otherwise. - - - - Queries an extensible object for an additional (unexpected) data-field for the instance. - The value returned (in "value") is the composed value after merging any duplicated content; - if the value is "repeated" (a list), then use GetValues instead. - - The data-type of the field. - The effective value of the field, or the default value if not found. - The extensible object to obtain the value from. - The field identifier; the tag should not be defined as a known data-field for the instance. - The data-format to use when decoding the value. - Allow tags that are present as part of the definition; for example, to query unknown enum values. - True if data for the field was present, false otherwise. - - - - Queries an extensible object for an additional (unexpected) data-field for the instance. - Each occurrence of the field is yielded separately, making this usage suitable for "repeated" - (list) fields. - - The extended data is processed lazily as the enumerator is iterated. - The data-type of the field. - The extensible object to obtain the value from. - The field identifier; the tag should not be defined as a known data-field for the instance. - An enumerator that yields each occurrence of the field. - - - - Queries an extensible object for an additional (unexpected) data-field for the instance. - Each occurrence of the field is yielded separately, making this usage suitable for "repeated" - (list) fields. - - The extended data is processed lazily as the enumerator is iterated. - The data-type of the field. - The extensible object to obtain the value from. - The field identifier; the tag should not be defined as a known data-field for the instance. - The data-format to use when decoding the value. - An enumerator that yields each occurrence of the field. - - - - Queries an extensible object for an additional (unexpected) data-field for the instance. - The value returned (in "value") is the composed value after merging any duplicated content; - if the value is "repeated" (a list), then use GetValues instead. - - The data-type of the field. - The model to use for configuration. - The effective value of the field, or the default value if not found. - The extensible object to obtain the value from. - The field identifier; the tag should not be defined as a known data-field for the instance. - The data-format to use when decoding the value. - Allow tags that are present as part of the definition; for example, to query unknown enum values. - True if data for the field was present, false otherwise. - - - - Queries an extensible object for an additional (unexpected) data-field for the instance. - Each occurrence of the field is yielded separately, making this usage suitable for "repeated" - (list) fields. - - The extended data is processed lazily as the enumerator is iterated. - The model to use for configuration. - The data-type of the field. - The extensible object to obtain the value from. - The field identifier; the tag should not be defined as a known data-field for the instance. - The data-format to use when decoding the value. - An enumerator that yields each occurrence of the field. - - - - Appends the value as an additional (unexpected) data-field for the instance. - Note that for non-repeated sub-objects, this equates to a merge operation; - for repeated sub-objects this adds a new instance to the set; for simple - values the new value supercedes the old value. - - Note that appending a value does not remove the old value from - the stream; avoid repeatedly appending values for the same field. - The model to use for configuration. - The data-format to use when encoding the value. - The extensible object to append the value to. - The field identifier; the tag should not be defined as a known data-field for the instance. - The value to append. - - - - This class acts as an internal wrapper allowing us to do a dynamic - methodinfo invoke; an't put into Serializer as don't want on public - API; can't put into Serializer<T> since we need to invoke - accross classes, which isn't allowed in Silverlight) - - - - - All this does is call GetExtendedValuesTyped with the correct type for "instance"; - this ensures that we don't get issues with subclasses declaring conflicting types - - the caller must respect the fields defined for the type they pass in. - - - - - All this does is call GetExtendedValuesTyped with the correct type for "instance"; - this ensures that we don't get issues with subclasses declaring conflicting types - - the caller must respect the fields defined for the type they pass in. - - - - - Stores the given value into the instance's stream; the serializer - is inferred from TValue and format. - - Needs to be public to be callable thru reflection in Silverlight - - - - Not all frameworks are created equal (fx1.1 vs fx2.0, - micro-framework, compact-framework, - silverlight, etc). This class simply wraps up a few things that would - otherwise make the real code unnecessarily messy, providing fallback - implementations if necessary. - - - - - Intended to be a direct map to regular TypeCode, but: - - with missing types - - existing on WinRT - - - - - Specifies the method used to infer field tags for members of the type - under consideration. Tags are deduced using the invariant alphabetic - sequence of the members' names; this makes implicit field tags very brittle, - and susceptible to changes such as field names (normally an isolated - change). - - - - - No members are serialized implicitly; all members require a suitable - attribute such as [ProtoMember]. This is the recmomended mode for - most scenarios. - - - - - Public properties and fields are eligible for implicit serialization; - this treats the public API as a contract. Ordering beings from ImplicitFirstTag. - - - - - Public and non-public fields are eligible for implicit serialization; - this acts as a state/implementation serializer. Ordering beings from ImplicitFirstTag. - - - - - Represents the set of serialization callbacks to be used when serializing/deserializing a type. - - - - Called before serializing an instance - - - Called before deserializing an instance - - - Called after serializing an instance - - - Called after deserializing an instance - - - - True if any callback is set, else False - - - - - Represents a type at runtime for use with protobuf, allowing the field mappings (etc) to be defined - - - - - Get the name of the type being represented - - - - - Adds a known sub-type to the inheritance model - - - - - Adds a known sub-type to the inheritance model - - - - - Assigns the callbacks to use during serialiation/deserialization. - - The method (or null) called before serialization begins. - The method (or null) called when serialization is complete. - The method (or null) called before deserialization begins (or when a new instance is created during deserialization). - The method (or null) called when deserialization is complete. - The set of callbacks. - - - - Assigns the callbacks to use during serialiation/deserialization. - - The name of the method (or null) called before serialization begins. - The name of the method (or null) called when serialization is complete. - The name of the method (or null) called before deserialization begins (or when a new instance is created during deserialization). - The name of the method (or null) called when deserialization is complete. - The set of callbacks. - - - - Designate a factory-method to use to create instances of this type - - - - - Designate a factory-method to use to create instances of this type - - - - - Throws an exception if the type has been made immutable - - - - - Adds a member (by name) to the MetaType - - - - - Adds a member (by name) to the MetaType, returning the ValueMember rather than the fluent API. - This is otherwise identical to Add. - - - - - Adds a member (by name) to the MetaType - - - - - Performs serialization of this type via a surrogate; all - other serialization options are ignored and handled - by the surrogate's configuration. - - - - - Adds a set of members (by name) to the MetaType - - - - - Adds a member (by name) to the MetaType - - - - - Adds a member (by name) to the MetaType, including an itemType and defaultType for representing lists - - - - - Adds a member (by name) to the MetaType, including an itemType and defaultType for representing lists, returning the ValueMember rather than the fluent API. - This is otherwise identical to Add. - - - - - Returns the ValueMember instances associated with this type - - - - - Returns the SubType instances associated with this type - - - - - Compiles the serializer for this type; this is *not* a full - standalone compile, but can significantly boost performance - while allowing additional types to be added. - - An in-place compile can access non-public types / members - - - - Gets the base-type for this type - - - - - When used to compile a model, should public serialization/deserialzation methods - be included for this type? - - - - - Should this type be treated as a reference by default? - - - - - Indicates whether the current type has defined callbacks - - - - - Indicates whether the current type has defined subtypes - - - - - Returns the set of callbacks defined for this type - - - - - Gets or sets the name of this contract. - - - - - The runtime type that the meta-type represents - - - - - Gets or sets whether the type should use a parameterless constructor (the default), - or whether the type should skip the constructor completely. This option is not supported - on compact-framework. - - - - - The concrete type to create when a new instance of this type is needed; this may be useful when dealing - with dynamic proxies, or with interface-based APIs - - - - - Returns the ValueMember that matchs a given field number, or null if not found - - - - - Returns the ValueMember that matchs a given member (property/field), or null if not found - - - - - Gets or sets a value indicating that an enum should be treated directly as an int/short/etc, rather - than enforcing .proto enum rules. This is useful *in particul* for [Flags] enums. - - - - - Gets or sets a value indicating that this type should NOT be treated as a list, even if it has - familiar list-like characteristics (enumerable, add, etc) - - - - - Provides protobuf serialization support for a number of types that can be defined at runtime - - - - - Provides protobuf serialization support for a number of types - - - - - Resolve a System.Type to the compiler-specific type - - - - - Resolve a System.Type to the compiler-specific type - - - - - This is the more "complete" version of Serialize, which handles single instances of mapped types. - The value is written as a complete field, including field-header and (for sub-objects) a - length-prefix - In addition to that, this provides support for: - - basic values; individual int / string / Guid / etc - - IEnumerable sequences of any type handled by TrySerializeAuxiliaryType - - - - - - Writes a protocol-buffer representation of the given instance to the supplied stream. - - The existing instance to be serialized (cannot be null). - The destination stream to write to. - - - - Writes a protocol-buffer representation of the given instance to the supplied stream. - - The existing instance to be serialized (cannot be null). - The destination stream to write to. - Additional information about this serialization operation. - - - - Writes a protocol-buffer representation of the given instance to the supplied writer. - - The existing instance to be serialized (cannot be null). - The destination writer to write to. - - - - Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed - data - useful with network IO. - - The type being merged. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - How to encode the length prefix. - The tag used as a prefix to each record (only used with base-128 style prefixes). - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed - data - useful with network IO. - - The type being merged. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - How to encode the length prefix. - The tag used as a prefix to each record (only used with base-128 style prefixes). - Used to resolve types on a per-field basis. - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed - data - useful with network IO. - - The type being merged. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - How to encode the length prefix. - The tag used as a prefix to each record (only used with base-128 style prefixes). - Used to resolve types on a per-field basis. - Returns the number of bytes consumed by this operation (includes length-prefix overheads and any skipped data). - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Reads a sequence of consecutive length-prefixed items from a stream, using - either base-128 or fixed-length prefixes. Base-128 prefixes with a tag - are directly comparable to serializing multiple items in succession - (use the tag to emulate the implicit behavior - when serializing a list/array). When a tag is - specified, any records with different tags are silently omitted. The - tag is ignored. The tag is ignores for fixed-length prefixes. - - The binary stream containing the serialized records. - The prefix style used in the data. - The tag of records to return (if non-positive, then no tag is - expected and all records are returned). - On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified). - The type of object to deserialize (can be null if "resolver" is specified). - The sequence of deserialized objects. - - - - Reads a sequence of consecutive length-prefixed items from a stream, using - either base-128 or fixed-length prefixes. Base-128 prefixes with a tag - are directly comparable to serializing multiple items in succession - (use the tag to emulate the implicit behavior - when serializing a list/array). When a tag is - specified, any records with different tags are silently omitted. The - tag is ignored. The tag is ignores for fixed-length prefixes. - - The binary stream containing the serialized records. - The prefix style used in the data. - The tag of records to return (if non-positive, then no tag is - expected and all records are returned). - On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified). - The type of object to deserialize (can be null if "resolver" is specified). - The sequence of deserialized objects. - Additional information about this serialization operation. - - - - Reads a sequence of consecutive length-prefixed items from a stream, using - either base-128 or fixed-length prefixes. Base-128 prefixes with a tag - are directly comparable to serializing multiple items in succession - (use the tag to emulate the implicit behavior - when serializing a list/array). When a tag is - specified, any records with different tags are silently omitted. The - tag is ignored. The tag is ignores for fixed-length prefixes. - - The type of object to deserialize. - The binary stream containing the serialized records. - The prefix style used in the data. - The tag of records to return (if non-positive, then no tag is - expected and all records are returned). - The sequence of deserialized objects. - - - - Reads a sequence of consecutive length-prefixed items from a stream, using - either base-128 or fixed-length prefixes. Base-128 prefixes with a tag - are directly comparable to serializing multiple items in succession - (use the tag to emulate the implicit behavior - when serializing a list/array). When a tag is - specified, any records with different tags are silently omitted. The - tag is ignored. The tag is ignores for fixed-length prefixes. - - The type of object to deserialize. - The binary stream containing the serialized records. - The prefix style used in the data. - The tag of records to return (if non-positive, then no tag is - expected and all records are returned). - The sequence of deserialized objects. - Additional information about this serialization operation. - - - - Writes a protocol-buffer representation of the given instance to the supplied stream, - with a length-prefix. This is useful for socket programming, - as DeserializeWithLengthPrefix can be used to read the single object back - from an ongoing stream. - - The type being serialized. - The existing instance to be serialized (cannot be null). - How to encode the length prefix. - The destination stream to write to. - The tag used as a prefix to each record (only used with base-128 style prefixes). - - - - Writes a protocol-buffer representation of the given instance to the supplied stream, - with a length-prefix. This is useful for socket programming, - as DeserializeWithLengthPrefix can be used to read the single object back - from an ongoing stream. - - The type being serialized. - The existing instance to be serialized (cannot be null). - How to encode the length prefix. - The destination stream to write to. - The tag used as a prefix to each record (only used with base-128 style prefixes). - Additional information about this serialization operation. - - - - Applies a protocol-buffer stream to an existing instance (which may be null). - - The type (including inheritance) to consider. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Applies a protocol-buffer stream to an existing instance (which may be null). - - The type (including inheritance) to consider. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - Additional information about this serialization operation. - - - - Applies a protocol-buffer stream to an existing instance (which may be null). - - The type (including inheritance) to consider. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - The number of bytes to consume. - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Applies a protocol-buffer stream to an existing instance (which may be null). - - The type (including inheritance) to consider. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - The number of bytes to consume (or -1 to read to the end of the stream). - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - Additional information about this serialization operation. - - - - Applies a protocol-buffer reader to an existing instance (which may be null). - - The type (including inheritance) to consider. - The existing instance to be modified (can be null). - The reader to apply to the instance (cannot be null). - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - This is the more "complete" version of Deserialize, which handles single instances of mapped types. - The value is read as a complete field, including field-header and (for sub-objects) a - length-prefix..kmc - - In addition to that, this provides support for: - - basic values; individual int / string / Guid / etc - - IList sets of any type handled by TryDeserializeAuxiliaryType - - - - - Creates a new runtime model, to which the caller - can add support for a range of types. A model - can be used "as is", or can be compiled for - optimal performance. - - - - - Applies common proxy scenarios, resolving the actual type to consider - - - - - Indicates whether the supplied type is explicitly modelled by the model - - - - - Provides the key that represents a given type in the current model. - The type is also normalized for proxies at the same time. - - - - - Provides the key that represents a given type in the current model. - - - - - Writes a protocol-buffer representation of the given instance to the supplied stream. - - Represents the type (including inheritance) to consider. - The existing instance to be serialized (cannot be null). - The destination stream to write to. - - - - Applies a protocol-buffer stream to an existing instance (which may be null). - - Represents the type (including inheritance) to consider. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Create a deep clone of the supplied instance; any sub-items are also cloned. - - - - - Indicates that while an inheritance tree exists, the exact type encountered was not - specified in that hierarchy and cannot be processed. - - - - - Indicates that the given type was not expected, and cannot be processed. - - - - - Indicates that the given type cannot be constructed; it may still be possible to - deserialize into existing instances. - - - - - Returns true if the type supplied is either a recognised contract type, - or a *list* of a recognised contract type. - - Note that primitives always return false, even though the engine - will, if forced, try to serialize such - True if this type is recognised as a serializable entity, else false - - - - Returns true if the type supplied is a basic type with inbuilt handling, - a recognised contract type, or a *list* of a basic / contract type. - - - - - Returns true if the type supplied is a basic type with inbuilt handling, - or a *list* of a basic type with inbuilt handling - - - - - Suggest a .proto definition for the given type - - The type to generate a .proto definition for, or null to generate a .proto that represents the entire model - The .proto definition as a string - - - - Creates a new IFormatter that uses protocol-buffer [de]serialization. - - A new IFormatter to be used during [de]serialization. - The type of object to be [de]deserialized by the formatter. - - - - Used to provide custom services for writing and parsing type names when using dynamic types. Both parsing and formatting - are provided on a single API as it is essential that both are mapped identically at all times. - - - - - Indicates the type of callback to be used - - - - - Invoked before an object is serialized - - - - - Invoked after an object is serialized - - - - - Invoked before an object is deserialized (or when a new instance is created) - - - - - Invoked after an object is deserialized - - - - - Returns a sequence of the Type instances that can be - processed by this model. - - - - - Suggest a .proto definition for the given type - - The type to generate a .proto definition for, or null to generate a .proto that represents the entire model - The .proto definition as a string - - - - Adds support for an additional type in this model, optionally - appplying inbuilt patterns. If the type is already known to the - model, the existing type is returned **without** applying - any additional behaviour. - - Inbuilt patterns include: - [ProtoContract]/[ProtoMember(n)] - [DataContract]/[DataMember(Order=n)] - [XmlType]/[XmlElement(Order=n)] - [On{Des|S}erializ{ing|ed}] - ShouldSerialize*/*Specified - - The type to be supported - Whether to apply the inbuilt configuration patterns (via attributes etc), or - just add the type with no additional configuration (the type must then be manually configured). - The MetaType representing this type, allowing - further configuration. - - - - Verifies that the model is still open to changes; if not, an exception is thrown - - - - - Prevents further changes to this model - - - - - Provides the key that represents a given type in the current model. - - - - - Writes a protocol-buffer representation of the given instance to the supplied stream. - - Represents the type (including inheritance) to consider. - The existing instance to be serialized (cannot be null). - The destination stream to write to. - - - - Applies a protocol-buffer stream to an existing instance (which may be null). - - Represents the type (including inheritance) to consider. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Compiles the serializers individually; this is *not* a full - standalone compile, but can significantly boost performance - while allowing additional types to be added. - - An in-place compile can access non-public types / members - - - - Fully compiles the current model into a static-compiled model instance - - A full compilation is restricted to accessing public types / members - An instance of the newly created compiled type-model - - - - Fully compiles the current model into a static-compiled serialization dll - (the serialization dll still requires protobuf-net for support services). - - A full compilation is restricted to accessing public types / members - The name of the TypeModel class to create - The path for the new dll - An instance of the newly created compiled type-model - - - - Fully compiles the current model into a static-compiled serialization dll - (the serialization dll still requires protobuf-net for support services). - - A full compilation is restricted to accessing public types / members - An instance of the newly created compiled type-model - - - - Global default that - enables/disables automatic tag generation based on the existing name / order - of the defined members. See - for usage and important warning / explanation. - You must set the global default before attempting to serialize/deserialize any - impacted type. - - - - - Global default that determines whether types are considered serializable - if they have [DataContract] / [XmlType]. With this enabled, ONLY - types marked as [ProtoContract] are added automatically. - - - - - Global switch that enables or disables the implicit - handling of "zero defaults"; meanning: if no other default is specified, - it assumes bools always default to false, integers to zero, etc. - - If this is disabled, no such assumptions are made and only *explicit* - default values are processed. This is enabled by default to - preserve similar logic to v1. - - - - - Global switch that determines whether types with a .ToString() and a Parse(string) - should be serialized as strings. - - - - - The default model, used to support ProtoBuf.Serializer - - - - - Obtains the MetaType associated with a given Type for the current model, - allowing additional configuration. - - - - - Should serializers be compiled on demand? It may be useful - to disable this for debugging purposes. - - - - - Should support for unexpected types be added automatically? - If false, an exception is thrown when unexpected types - are encountered. - - - - - The amount of time to wait if there are concurrent metadata access operations - - - - - If a lock-contention is detected, this event signals the *owner* of the lock responsible for the blockage, indicating - what caused the problem; this is only raised if the lock-owning code successfully completes. - - - - - Represents configuration options for compiling a model to - a standalone assembly. - - - - - Import framework options from an existing type - - - - - The TargetFrameworkAttribute FrameworkName value to burn into the generated assembly - - - - - The TargetFrameworkAttribute FrameworkDisplayName value to burn into the generated assembly - - - - - The name of the TypeModel class to create - - - - - The path for the new dll - - - - - The runtime version for the generated assembly - - - - - The runtime version for the generated assembly - - - - - The acecssibility of the generated serializer - - - - - Type accessibility - - - - - Available to all callers - - - - - Available to all callers in the same assembly, or assemblies specified via [InternalsVisibleTo(...)] - - - - - Contains the stack-trace of the owning code when a lock-contention scenario is detected - - - - - The stack-trace of the code that owned the lock when a lock-contention scenario occurred - - - - - Event-type that is raised when a lock-contention scenario is detected - - - - - Represents an inherited type in a type hierarchy. - - - - - Creates a new SubType instance. - - The field-number that is used to encapsulate the data (as a nested - message) for the derived dype. - The sub-type to be considered. - Specific encoding style to use; in particular, Grouped can be used to avoid buffering, but is not the default. - - - - The field-number that is used to encapsulate the data (as a nested - message) for the derived dype. - - - - - The sub-type to be considered. - - - - - Event arguments needed to perform type-formatting functions; this could be resolving a Type to a string suitable for serialization, or could - be requesting a Type from a string. If no changes are made, a default implementation will be used (from the assembly-qualified names). - - - - - The type involved in this map; if this is initially null, a Type is expected to be provided for the string in FormattedName. - - - - - The formatted-name involved in this map; if this is initially null, a formatted-name is expected from the type in Type. - - - - - Delegate type used to perform type-formatting functions; the sender originates as the type-model. - - - - - Represents a member (property/field) that is mapped to a protobuf field - - - - - Creates a new ValueMember instance - - - - - Creates a new ValueMember instance - - - - - Specifies methods for working with optional data members. - - Provides a method (null for none) to query whether this member should - be serialized; it must be of the form "bool {Method}()". The member is only serialized if the - method returns true. - Provides a method (null for none) to indicate that a member was - deserialized; it must be of the form "void {Method}(bool)", and will be called with "true" - when data is found. - - - - The number that identifies this member in a protobuf stream - - - - - Gets the member (field/property) which this member relates to. - - - - - Within a list / array / etc, the type of object for each item in the list (especially useful with ArrayList) - - - - - The underlying type of the member - - - - - For abstract types (IList etc), the type of concrete object to create (if required) - - - - - The type the defines the member - - - - - The default value of the item (members with this value will not be serialized) - - - - - Specifies the rules used to process the field; this is used to determine the most appropriate - wite-type, but also to describe subtypes within that wire-type (such as SignedVariant) - - - - - Indicates whether this field should follow strict encoding rules; this means (for example) that if a "fixed32" - is encountered when "variant" is defined, then it will fail (throw an exception) when parsing. Note that - when serializing the defined type is always used. - - - - - Indicates whether this field should use packed encoding (which can save lots of space for repeated primitive values). - This option only applies to list/array data of primitive types (int, double, etc). - - - - - Indicates whether this field should *repace* existing values (the default is false, meaning *append*). - This option only applies to list/array data. - - - - - Indicates whether this field is mandatory. - - - - - Enables full object-tracking/full-graph support. - - - - - Embeds the type information into the stream, allowing usage with types not known in advance. - - - - - Gets the logical name for this member in the schema (this is not critical for binary serialization, but may be used - when inferring a schema). - - - - - Should lists have extended support for null values? Note this makes the serialization less efficient. - - - - - Specifies the type of prefix that should be applied to messages. - - - - - No length prefix is applied to the data; the data is terminated only be the end of the stream. - - - - - A base-128 length prefix is applied to the data (efficient for short messages). - - - - - A fixed-length (little-endian) length prefix is applied to the data (useful for compatibility). - - - - - A fixed-length (big-endian) length prefix is applied to the data (useful for compatibility). - - - - - Indicates that a type is defined for protocol-buffer serialization. - - - - - Gets or sets the defined name of the type. - - - - - Gets or sets the fist offset to use with implicit field tags; - only uesd if ImplicitFields is set. - - - - - If specified, alternative contract markers (such as markers for XmlSerailizer or DataContractSerializer) are ignored. - - - - - If specified, do NOT treat this type as a list, even if it looks like one. - - - - - Gets or sets the mechanism used to automatically infer field tags - for members. This option should be used in advanced scenarios only. - Please review the important notes against the ImplicitFields enumeration. - - - - - Enables/disables automatic tag generation based on the existing name / order - of the defined members. This option is not used for members marked - with ProtoMemberAttribute, as intended to provide compatibility with - WCF serialization. WARNING: when adding new fields you must take - care to increase the Order for new elements, otherwise data corruption - may occur. - - If not explicitly specified, the default is assumed from Serializer.GlobalOptions.InferTagFromName. - - - - Has a InferTagFromName value been explicitly set? if not, the default from the type-model is assumed. - - - - - Specifies an offset to apply to [DataMember(Order=...)] markers; - this is useful when working with mex-generated classes that have - a different origin (usually 1 vs 0) than the original data-contract. - - This value is added to the Order of each member. - - - - - If true, the constructor for the type is bypassed during deserialization, meaning any field initializers - or other initialization code is skipped. - - - - - Used to define protocol-buffer specific behavior for - enumerated values. - - - - - Indicates whether this instance has a customised value mapping - - true if a specific value is set - - - - Gets or sets the specific value to use for this enum during serialization. - - - - - Gets or sets the defined name of the enum, as used in .proto - (this name is not used during serialization). - - - - - Indicates an error during serialization/deserialization of a proto stream. - - - - Creates a new ProtoException instance. - - - Creates a new ProtoException instance. - - - Creates a new ProtoException instance. - - - - Indicates that a member should be excluded from serialization; this - is only normally used when using implict fields. - - - - - Indicates that a member should be excluded from serialization; this - is only normally used when using implict fields. This allows - ProtoIgnoreAttribute usage - even for partial classes where the individual members are not - under direct control. - - - - - Creates a new ProtoPartialIgnoreAttribute instance. - - Specifies the member to be ignored. - - - - The name of the member to be ignored. - - - - - Indicates the known-types to support for an individual - message. This serializes each level in the hierarchy as - a nested message to retain wire-compatibility with - other protocol-buffer implementations. - - - - - Creates a new instance of the ProtoIncludeAttribute. - - The unique index (within the type) that will identify this data. - The additional type to serialize/deserialize. - - - - Creates a new instance of the ProtoIncludeAttribute. - - The unique index (within the type) that will identify this data. - The additional type to serialize/deserialize. - - - - Gets the unique index (within the type) that will identify this data. - - - - - Gets the additional type to serialize/deserialize. - - - - - Gets the additional type to serialize/deserialize. - - - - - Specifies whether the inherited sype's sub-message should be - written with a length-prefix (default), or with group markers. - - - - - Declares a member to be used in protocol-buffer serialization, using - the given Tag. A DataFormat may be used to optimise the serialization - format (for instance, using zigzag encoding for negative numbers, or - fixed-length encoding for large values. - - - - - Compare with another ProtoMemberAttribute for sorting purposes - - - - - Compare with another ProtoMemberAttribute for sorting purposes - - - - - Creates a new ProtoMemberAttribute instance. - - Specifies the unique tag used to identify this member within the type. - - - - Gets or sets the original name defined in the .proto; not used - during serialization. - - - - - Gets or sets the data-format to be used when encoding this value. - - - - - Gets the unique tag used to identify this member within the type. - - - - - Gets or sets a value indicating whether this member is mandatory. - - - - - Gets a value indicating whether this member is packed. - This option only applies to list/array data of primitive types (int, double, etc). - - - - - Indicates whether this field should *repace* existing values (the default is false, meaning *append*). - This option only applies to list/array data. - - - - - Enables full object-tracking/full-graph support. - - - - - Embeds the type information into the stream, allowing usage with types not known in advance. - - - - - Gets or sets a value indicating whether this member is packed (lists/arrays). - - - - - Additional (optional) settings that control serialization of members - - - - - Default; no additional options - - - - - Indicates that repeated elements should use packed (length-prefixed) encoding - - - - - Indicates that the given item is required - - - - - Enables full object-tracking/full-graph support - - - - - Embeds the type information into the stream, allowing usage with types not known in advance - - - - - Indicates whether this field should *repace* existing values (the default is false, meaning *append*). - This option only applies to list/array data. - - - - - Declares a member to be used in protocol-buffer serialization, using - the given Tag and MemberName. This allows ProtoMemberAttribute usage - even for partial classes where the individual members are not - under direct control. - A DataFormat may be used to optimise the serialization - format (for instance, using zigzag encoding for negative numbers, or - fixed-length encoding for large values. - - - - - Creates a new ProtoMemberAttribute instance. - - Specifies the unique tag used to identify this member within the type. - Specifies the member to be serialized. - - - - The name of the member to be serialized. - - - - - A stateful reader, used to read a protobuf stream. Typical usage would be (sequentially) to call - ReadFieldHeader and (after matching the field) an appropriate Read* method. - - - - - Creates a new reader against a stream - - The source stream - The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects - Additional context about this serialization operation - - - - Creates a new reader against a stream - - The source stream - The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects - Additional context about this serialization operation - The number of bytes to read, or -1 to read until the end of the stream - - - - Releases resources used by the reader, but importantly does not Dispose the - underlying stream; in many typical use-cases the stream is used for different - processes, so it is assumed that the consumer will Dispose their stream separately. - - - - - Reads an unsigned 32-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Reads a signed 16-bit integer from the stream: Variant, Fixed32, Fixed64, SignedVariant - - - - - Reads an unsigned 16-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Reads an unsigned 8-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Reads a signed 8-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant - - - - - Reads a signed 32-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant - - - - - Reads a signed 64-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant - - - - - Reads a string from the stream (using UTF8); supported wire-types: String - - - - - Throws an exception indication that the given value cannot be mapped to an enum. - - - - - Reads a double-precision number from the stream; supported wire-types: Fixed32, Fixed64 - - - - - Reads (merges) a sub-message from the stream, internally calling StartSubItem and EndSubItem, and (in between) - parsing the message in accordance with the model associated with the reader - - - - - Makes the end of consuming a nested message in the stream; the stream must be either at the correct EndGroup - marker, or all fields of the sub-message must have been consumed (in either case, this means ReadFieldHeader - should return zero) - - - - - Begins consuming a nested message in the stream; supported wire-types: StartGroup, String - - The token returned must be help and used when callining EndSubItem - - - - Reads a field header from the stream, setting the wire-type and retuning the field number. If no - more fields are available, then 0 is returned. This methods respects sub-messages. - - - - - Looks ahead to see whether the next field in the stream is what we expect - (typically; what we've just finished reading - for example ot read successive list items) - - - - - Compares the streams current wire-type to the hinted wire-type, updating the reader if necessary; for example, - a Variant may be updated to SignedVariant. If the hinted wire-type is unrelated then no change is made. - - - - - Verifies that the stream's current wire-type is as expected, or a specialized sub-type (for example, - SignedVariant) - in which case the current wire-type is updated. Otherwise an exception is thrown. - - - - - Discards the data for the current field. - - - - - Reads an unsigned 64-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Reads a single-precision number from the stream; supported wire-types: Fixed32, Fixed64 - - - - - Reads a boolean value from the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - - Reads a byte-sequence from the stream, appending them to an existing byte-sequence (which can be null); supported wire-types: String - - - - - Reads the length-prefix of a message from a stream without buffering additional data, allowing a fixed-length - reader to be created. - - - - - Reads a little-endian encoded integer. An exception is thrown if the data is not all available. - - - - - Reads a big-endian encoded integer. An exception is thrown if the data is not all available. - - - - - Reads a varint encoded integer. An exception is thrown if the data is not all available. - - - - - Reads a string (of a given lenth, in bytes) directly from the source into a pre-existing buffer. An exception is thrown if the data is not all available. - - - - - Reads a given number of bytes directly from the source. An exception is thrown if the data is not all available. - - - - - Reads a string (of a given lenth, in bytes) directly from the source. An exception is thrown if the data is not all available. - - - - - Reads the length-prefix of a message from a stream without buffering additional data, allowing a fixed-length - reader to be created. - - - - The number of bytes consumed; 0 if no data available - - - - Copies the current field into the instance as extension data - - - - - Indicates whether the reader still has data remaining in the current sub-item, - additionally setting the wire-type for the next field if there is more data. - This is used when decoding packed data. - - - - - Utility method, not intended for public use; this helps maintain the root object is complex scenarios - - - - - Reads a Type from the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String - - - - - Gets the number of the field being processed. - - - - - Indicates the underlying proto serialization format on the wire. - - - - - Gets / sets a flag indicating whether strings should be checked for repetition; if - true, any repeated UTF-8 byte sequence will result in the same String instance, rather - than a second instance of the same string. Enabled by default. Note that this uses - a custom interner - the system-wide string interner is not used. - - - - - Addition information about this deserialization operation. - - - - - Returns the position of the current reader (note that this is not necessarily the same as the position - in the underlying stream, if multiple readers are used on the same stream) - - - - - Get the TypeModel associated with this reader - - - - - Represents an output stream for writing protobuf data. - - Why is the API backwards (static methods with writer arguments)? - See: http://marcgravell.blogspot.com/2010/03/last-will-be-first-and-first-will-be.html - - - - - Write an encapsulated sub-object, using the supplied unique key (reprasenting a type). - - The object to write. - The key that uniquely identifies the type within the model. - The destination. - - - - Write an encapsulated sub-object, using the supplied unique key (reprasenting a type) - but the - caller is asserting that this relationship is non-recursive; no recursion check will be - performed. - - The object to write. - The key that uniquely identifies the type within the model. - The destination. - - - - Writes a field-header, indicating the format of the next data we plan to write. - - - - - Writes a byte-array to the stream; supported wire-types: String - - - - - Writes a byte-array to the stream; supported wire-types: String - - - - - Indicates the start of a nested record. - - The instance to write. - The destination. - A token representing the state of the stream; this token is given to EndSubItem. - - - - Indicates the end of a nested record. - - The token obtained from StartubItem. - The destination. - - - - Creates a new writer against a stream - - The destination stream - The model to use for serialization; this can be null, but this will impair the ability to serialize sub-objects - Additional context about this serialization operation - - - - Flushes data to the underlying stream, and releases any resources. The underlying stream is *not* disposed - by this operation. - - - - - Writes any buffered data (if possible) to the underlying stream. - - The writer to flush - It is not always possible to fully flush, since some sequences - may require values to be back-filled into the byte-stream. - - - - Writes an unsigned 32-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Writes a string to the stream; supported wire-types: String - - - - - Writes an unsigned 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Writes a signed 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant - - - - - Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Writes a signed 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant - - - - - Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Writes an unsigned 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Writes a signed 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant - - - - - Writes a signed 32-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant - - - - - Writes a double-precision number to the stream; supported wire-types: Fixed32, Fixed64 - - - - - Writes a single-precision number to the stream; supported wire-types: Fixed32, Fixed64 - - - - - Throws an exception indicating that the given enum cannot be mapped to a serialized value. - - - - - Writes a boolean to the stream; supported wire-types: Variant, Fixed32, Fixed64 - - - - - Copies any extension data stored for the instance to the underlying stream - - - - - Used for packed encoding; indicates that the next field should be skipped rather than - a field header written. Note that the field number must match, else an exception is thrown - when the attempt is made to write the (incorrect) field. The wire-type is taken from the - subsequent call to WriteFieldHeader. Only primitive types can be packed. - - - - - Specifies a known root object to use during reference-tracked serialization - - - - - Writes a Type to the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String - - - - - Addition information about this serialization operation. - - - - - Get the TypeModel associated with this writer - - - - - Additional information about a serialization operation - - - - - Convert a SerializationContext to a StreamingContext - - - - - Convert a StreamingContext to a SerializationContext - - - - - Gets or sets a user-defined object containing additional information about this serialization/deserialization operation. - - - - - A default SerializationContext, with minimal information. - - - - - Gets or sets the source or destination of the transmitted data. - - - - - Provides protocol-buffer serialization capability for concrete, attributed types. This - is a *default* model, but custom serializer models are also supported. - - - Protocol-buffer serialization is a compact binary format, designed to take - advantage of sparse data and knowledge of specific data types; it is also - extensible, allowing a type to be deserialized / merged even if some data is - not recognised. - - - - - The field number that is used as a default when serializing/deserializing a list of objects. - The data is treated as repeated message with field number 1. - - - - - Suggest a .proto definition for the given type - - The type to generate a .proto definition for - The .proto definition as a string - - - - Create a deep clone of the supplied instance; any sub-items are also cloned. - - - - - Applies a protocol-buffer stream to an existing instance. - - The type being merged. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Creates a new instance from a protocol-buffer stream - - The type to be created. - The binary stream to apply to the new instance (cannot be null). - A new, initialized instance. - - - - Writes a protocol-buffer representation of the given instance to the supplied stream. - - The existing instance to be serialized (cannot be null). - The destination stream to write to. - - - - Serializes a given instance and deserializes it as a different type; - this can be used to translate between wire-compatible objects (where - two .NET types represent the same data), or to promote/demote a type - through an inheritance hierarchy. - - No assumption of compatibility is made between the types. - The type of the object being copied. - The type of the new object to be created. - The existing instance to use as a template. - A new instane of type TNewType, with the data from TOldType. - - - - Writes a protocol-buffer representation of the given instance to the supplied SerializationInfo. - - The type being serialized. - The existing instance to be serialized (cannot be null). - The destination SerializationInfo to write to. - - - - Writes a protocol-buffer representation of the given instance to the supplied SerializationInfo. - - The type being serialized. - The existing instance to be serialized (cannot be null). - The destination SerializationInfo to write to. - Additional information about this serialization operation. - - - - Writes a protocol-buffer representation of the given instance to the supplied XmlWriter. - - The type being serialized. - The existing instance to be serialized (cannot be null). - The destination XmlWriter to write to. - - - - Applies a protocol-buffer from an XmlReader to an existing instance. - - The type being merged. - The existing instance to be modified (cannot be null). - The XmlReader containing the data to apply to the instance (cannot be null). - - - - Applies a protocol-buffer from a SerializationInfo to an existing instance. - - The type being merged. - The existing instance to be modified (cannot be null). - The SerializationInfo containing the data to apply to the instance (cannot be null). - - - - Applies a protocol-buffer from a SerializationInfo to an existing instance. - - The type being merged. - The existing instance to be modified (cannot be null). - The SerializationInfo containing the data to apply to the instance (cannot be null). - Additional information about this serialization operation. - - - - Precompiles the serializer for a given type. - - - - - Creates a new IFormatter that uses protocol-buffer [de]serialization. - - The type of object to be [de]deserialized by the formatter. - A new IFormatter to be used during [de]serialization. - - - - Reads a sequence of consecutive length-prefixed items from a stream, using - either base-128 or fixed-length prefixes. Base-128 prefixes with a tag - are directly comparable to serializing multiple items in succession - (use the tag to emulate the implicit behavior - when serializing a list/array). When a tag is - specified, any records with different tags are silently omitted. The - tag is ignored. The tag is ignores for fixed-length prefixes. - - The type of object to deserialize. - The binary stream containing the serialized records. - The prefix style used in the data. - The tag of records to return (if non-positive, then no tag is - expected and all records are returned). - The sequence of deserialized objects. - - - - Creates a new instance from a protocol-buffer stream that has a length-prefix - on data (to assist with network IO). - - The type to be created. - The binary stream to apply to the new instance (cannot be null). - How to encode the length prefix. - A new, initialized instance. - - - - Creates a new instance from a protocol-buffer stream that has a length-prefix - on data (to assist with network IO). - - The type to be created. - The binary stream to apply to the new instance (cannot be null). - How to encode the length prefix. - The expected tag of the item (only used with base-128 prefix style). - A new, initialized instance. - - - - Applies a protocol-buffer stream to an existing instance, using length-prefixed - data - useful with network IO. - - The type being merged. - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - How to encode the length prefix. - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Writes a protocol-buffer representation of the given instance to the supplied stream, - with a length-prefix. This is useful for socket programming, - as DeserializeWithLengthPrefix/MergeWithLengthPrefix can be used to read the single object back - from an ongoing stream. - - The type being serialized. - The existing instance to be serialized (cannot be null). - How to encode the length prefix. - The destination stream to write to. - - - - Writes a protocol-buffer representation of the given instance to the supplied stream, - with a length-prefix. This is useful for socket programming, - as DeserializeWithLengthPrefix/MergeWithLengthPrefix can be used to read the single object back - from an ongoing stream. - - The type being serialized. - The existing instance to be serialized (cannot be null). - How to encode the length prefix. - The destination stream to write to. - The tag used as a prefix to each record (only used with base-128 style prefixes). - - - Indicates the number of bytes expected for the next message. - The stream containing the data to investigate for a length. - The algorithm used to encode the length. - The length of the message, if it could be identified. - True if a length could be obtained, false otherwise. - - - Indicates the number of bytes expected for the next message. - The buffer containing the data to investigate for a length. - The offset of the first byte to read from the buffer. - The number of bytes to read from the buffer. - The algorithm used to encode the length. - The length of the message, if it could be identified. - True if a length could be obtained, false otherwise. - - - - Releases any internal buffers that have been reserved for efficiency; this does not affect any serialization - operations; simply: it can be used (optionally) to release the buffers for garbage collection (at the expense - of having to re-allocate a new buffer for the next operation, rather than re-use prior buffers). - - - - - Provides non-generic access to the default serializer. - - - - - Create a deep clone of the supplied instance; any sub-items are also cloned. - - - - - Writes a protocol-buffer representation of the given instance to the supplied stream. - - The existing instance to be serialized (cannot be null). - The destination stream to write to. - - - - Creates a new instance from a protocol-buffer stream - - The type to be created. - The binary stream to apply to the new instance (cannot be null). - A new, initialized instance. - - - Applies a protocol-buffer stream to an existing instance. - The existing instance to be modified (cannot be null). - The binary stream to apply to the instance (cannot be null). - The updated instance - - - - Writes a protocol-buffer representation of the given instance to the supplied stream, - with a length-prefix. This is useful for socket programming, - as DeserializeWithLengthPrefix/MergeWithLengthPrefix can be used to read the single object back - from an ongoing stream. - - The existing instance to be serialized (cannot be null). - How to encode the length prefix. - The destination stream to write to. - The tag used as a prefix to each record (only used with base-128 style prefixes). - - - - Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed - data - useful with network IO. - - The existing instance to be modified (can be null). - The binary stream to apply to the instance (cannot be null). - How to encode the length prefix. - Used to resolve types on a per-field basis. - The updated instance; this may be different to the instance argument if - either the original instance was null, or the stream defines a known sub-type of the - original instance. - - - - Indicates whether the supplied type is explicitly modelled by the model - - - - - Global switches that change the behavior of protobuf-net - - - - - - - - - - Maps a field-number to a type - - - - - Perform the steps necessary to serialize this data. - - The value to be serialized. - The writer entity that is accumulating the output data. - - - - Perform the steps necessary to deserialize this data. - - The current value, if appropriate. - The reader providing the input data. - The updated / replacement value. - - - Emit the IL necessary to perform the given actions - to serialize this data. - - Details and utilities for the method being generated. - The source of the data to work against; - If the value is only needed once, then LoadValue is sufficient. If - the value is needed multiple times, then note that a "null" - means "the top of the stack", in which case you should create your - own copy - GetLocalWithValue. - - - - Emit the IL necessary to perform the given actions to deserialize this data. - - Details and utilities for the method being generated. - For nested values, the instance holding the values; note - that this is not always provided - a null means not supplied. Since this is always - a variable or argument, it is not necessary to consume this value. - - - - The type that this serializer is intended to work for. - - - - - Indicates whether a Read operation replaces the existing value, or - extends the value. If false, the "value" parameter to Read is - discarded, and should be passed in as null. - - - - - Now all Read operations return a value (although most do); if false no - value should be expected. - - - - - Uses protocol buffer serialization on the specified operation; note that this - must be enabled on both the client and server. - - - - - Configuration element to swap out DatatContractSerilaizer with the XmlProtoSerializer for a given endpoint. - - - - - - Creates a new ProtoBehaviorExtension instance. - - - - - Creates a behavior extension based on the current configuration settings. - - The behavior extension. - - - - Gets the type of behavior. - - - - - Behavior to swap out DatatContractSerilaizer with the XmlProtoSerializer for a given endpoint. - - Add the following to the server and client app.config in the system.serviceModel section: - - - - - - - - - - - - - - Configure your endpoints to have a behaviorConfiguration as follows: - - - - - - - - - - - - - Describes a WCF operation behaviour that can perform protobuf serialization - - - - - Create a new ProtoOperationBehavior instance - - - - - Creates a protobuf serializer if possible (falling back to the default WCF serializer) - - - - - The type-model that should be used with this behaviour - - - - - An xml object serializer that can embed protobuf data in a base-64 hunk (looking like a byte[]) - - - - - Attempt to create a new serializer for the given model and type - - A new serializer instance if the type is recognised by the model; null otherwise - - - - Creates a new serializer for the given model and type - - - - - Ends an object in the output - - - - - Begins an object in the output - - - - - Writes the body of an object in the output - - - - - Indicates whether this is the start of an object we are prepared to handle - - - - - Reads the body of an object - - - - - Used to hold particulars relating to nested objects. This is opaque to the caller - simply - give back the token you are given at the end of an object. - - - - - Indicates the encoding used to represent an individual value in a protobuf stream - - - - - Represents an error condition - - - - - Base-128 variant-length encoding - - - - - Fixed-length 8-byte encoding - - - - - Length-variant-prefixed encoding - - - - - Indicates the start of a group - - - - - Indicates the end of a group - - - - - Fixed-length 4-byte encoding - 10 - - - - This is not a formal wire-type in the "protocol buffers" spec, but - denotes a variant integer that should be interpreted using - zig-zag semantics (so -ve numbers aren't a significant overhead) - - - - diff --git a/ProtobufCore/Protogen-Tools/protogen.exe b/ProtobufCore/Protogen-Tools/protogen.exe deleted file mode 100644 index 715751b..0000000 Binary files a/ProtobufCore/Protogen-Tools/protogen.exe and /dev/null differ diff --git a/ProtobufCore/Protogen-Tools/protogen.exe.config b/ProtobufCore/Protogen-Tools/protogen.exe.config deleted file mode 100644 index e59af44..0000000 --- a/ProtobufCore/Protogen-Tools/protogen.exe.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ProtobufCore/Protogen-Tools/vb.xslt b/ProtobufCore/Protogen-Tools/vb.xslt deleted file mode 100644 index b1d9162..0000000 --- a/ProtobufCore/Protogen-Tools/vb.xslt +++ /dev/null @@ -1,745 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VisualBasic template for protobuf-net. - Options: - General: - "help" - this page - Additional serializer support: - "xml" - enable explicit xml support (XmlSerializer) - "datacontract" - enable data-contract support (DataContractSerializer; requires .NET 3.0) - "binary" - enable binary support (BinaryFormatter; not supported on Silverlight) - Other: - "protoRpc" - enable proto-rpc client - "observable" - change notification (observer pattern) support - "preObservable" - pre-change notification (observer pattern) support (requires .NET 3.5) - "partialMethods" - provide partial methods for changes (requires C# 3.0) - "detectMissing" - provide *Specified properties to indicate whether fields are present - "lightFramework" - omit additional attributes not included in CF/Silverlight - "asynchronous" - emit asynchronous methods for use with WCF - "clientProxy" - emit asynchronous client proxy class - - - - - - Invalid options: xml and data-contract serialization are mutually exclusive. - - - ' Generated from - - ' Option: xml serialization ([XmlType]/[XmlElement]) enabled - - ' Option: data-contract serialization ([DataContract]/[DataMember]) enabled - - ' Option: binary serialization (ISerializable) enabled - - ' Option: observable (OnPropertyChanged) enabled - - ' Option: pre-observable (OnPropertyChanging) enabled - - ' Option: partial methods (On*Changing/On*Changed) enabled - - ' Option: missing-value detection (*Specified/ShouldSerialize*/Reset*) enabled - - ' Option: light framework (CF/Silverlight) enabled - - ' Option: proto-rpc enabled - - - - - -' Generated from: - - - - - - -Namespace - - - -End Namespace - - -' Note: requires additional types generated from: - - - - -<Global.System.Serializable, Global.ProtoBuf.ProtoContract(Name:="")> _ -<Global.System.Runtime.Serialization.DataContract(Name:="")> _ - - -<Global.System.Serializable, Global.ProtoBuf.ProtoContract(Name:="")> _ -<Global.System.Xml.Serialization.XmlType(TypeName:="")> _ - - -<Global.System.Serializable, Global.ProtoBuf.ProtoContract(Name:="")> _ - -Public Partial Class - implements Global.ProtoBuf.IExtensible, Global.System.Runtime.Serialization.ISerializable, Global.System.ComponentModel.INotifyPropertyChanged, Global.System.ComponentModel.INotifyPropertyChanging - - Public Sub New - End Sub - - Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) - MyBase.New() - Global.ProtoBuf.Serializer.Merge(info, Me) - End Sub - - Sub GetObjectData(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) implements Global.System.Runtime.Serialization.ISerializable.GetObjectData - Global.ProtoBuf.Serializer.Serialize(info, Me) - End Sub - - - Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged - Protected Overridable Sub OnPropertyChanged(ByVal propertyName As String) - RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs(propertyName)) - End Sub - - Public Event PropertyChanging As Global.System.ComponentModel.PropertyChangingEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanging.PropertyChanging - Protected Overridable Sub OnPropertyChanging(ByVal propertyName As String) - RaiseEvent PropertyChanging(Me, New Global.System.ComponentModel.PropertyChangingEventArgs(propertyName)) - End Sub - - Private extensionObject As Global.ProtoBuf.IExtension - Function GetExtensionObject(createIfMissing As Boolean) As Global.ProtoBuf.IExtension Implements Global.ProtoBuf.IExtensible.GetExtensionObject - Return Global.ProtoBuf.Extensible.GetExtensionObject(extensionObject, createIfMissing) - End Function -End Class - - - - - - - - - - - - Public Enum - - End Enum - - - - - - - = - - 0 - - - - - - - - - - - - - - - FixedSize - Group - TwosComplement - ZigZag - Default - - - - - struct - struct - struct - struct - struct - struct - struct - struct - struct - class - class - struct - struct - struct - struct - struct - struct - none - - - Field type not implemented: (.) - - - - - - - double - Double - Single - Long - ULong - Integer - ULong - UInteger - Boolean - String - Byte() - UInteger - Integer - Long - Integer - Long - - - - - - Field type not implemented: (.) - - - - - - - - - "" - . - ' - CType(, ) - - - - - - - - - . - . - - - - - - - - - 0.0 - 0.0F - 0L - 0L - 0 - 0L - 0 - False - "" - Nothing - 0 - 0 - 0L - 0 - 0L - Nothing - . - Nothing - - - - - - - - - - - Nullable(Of ) - - - - Private = - - - Private = - - - - - <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - - - <Global.System.ComponentModel.DefaultValue(CType(, ))> _ - - - <Global.System.ComponentModel.DefaultValue(CType(, ))> _ - - - <Global.System.Xml.Serialization.XmlElement("", Order:=)> _ - - <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - - - <Global.System.ComponentModel.DefaultValue(CType(, ))> _ - - - <Global.System.ComponentModel.DefaultValue(CType(, ))> _ - - - <Global.System.Runtime.Serialization.DataMember(Name:="", Order:=, IsRequired:=False)> _ - - <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - - <Global.System.ComponentModel.DefaultValue(CType(, ))> _ - - <Global.System.ComponentModel.DefaultValue(CType(, ))> _ - - - <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - <Global.System.Runtime.Serialization.DataMember(Name:="", Order:=, IsRequired:=False)> _ - - <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - <Global.System.Xml.Serialization.XmlElement("", Order:=)> _ - - <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Private - - - <Global.ProtoBuf.ProtoMember(, IsRequired:=True, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - <Global.System.Runtime.Serialization.DataMember(Name:="", Order:=, IsRequired:=True)> _ - - <Global.ProtoBuf.ProtoMember(, IsRequired:=True, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - <Global.System.Xml.Serialization.XmlElement("", Order:=)> _ - - <Global.ProtoBuf.ProtoMember(, IsRequired:=True, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - - - - - - - - - - - - - - - - - - - Public Property - - - Public Property - - - Get - - Return - - If Not Is Nothing Then - Return - Else - Return - End If - Return - - End Get - - - Set() - - - Set() - - - OnChanging(value) - OnPropertyChanging("") - = value - OnPropertyChanged("") OnChanged() - End Set - End Property - - partial void OnChanging( value); - partial void OnChanged(); - <Global.System.Xml.Serialization.XmlIgnore> _ - <Global.System.ComponentModel.Browsable(false)> _ - - - Public Property Specified As Boolean - Get - Return .HasValue - End Get - Set (ByVal value As Boolean) - If Not .HasValue Then - If value = True then = - Else - If value = False then = Nothing - End If - End Set - End Property - - - Public Property Specified As Boolean - Get - Return IsNot Nothing - End Get - Set (ByVal value As Boolean) - If Is Nothing Then - If value = True then = - Else - If value = False then = Nothing - End If - End Set - End Property - - - Private Function ShouldSerialize() As Boolean - Return Specified - End Function - Private Sub Reset() - Specified = false - End Sub - - - - - - - - - Private ReadOnly as Global.System.Collections.Generic.List(Of ) = New Global.System.Collections.Generic.List(Of )() - - - Private ReadOnly as Global.System.Collections.Generic.List(Of ) = New Global.System.Collections.Generic.List(Of )() - - - - - <Global.ProtoBuf.ProtoMember(, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - <Global.System.Runtime.Serialization.DataMember(Name:="", Order:=, IsRequired:=False)> _ - - - <Global.ProtoBuf.ProtoMember(, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - <Global.System.Xml.Serialization.XmlElement("", Order:=)> _ - - - <Global.ProtoBuf.ProtoMember(, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _ - - - Public ReadOnly Property As Global.System.Collections.Generic.List(Of ) - - Public ReadOnly Property As Global.System.Collections.Generic.List(Of ) - - - Get - Return - End Get - - - - Set (value As Global.System.Collections.Generic.List(Of )) - - - Set (value As Global.System.Collections.Generic.List(Of )) - - - = value - End Set - - End Property - - - - - <Global.System.ServiceModel.ServiceContract(Name:="")> _ - - Public Interface I - - End Interface - - - Public Class Client : Global.ProtoBuf.ServiceModel.RpcClient - public Client() : base(typeof(I)) { } - - - End Class - - - - - - - - <Global.System.ServiceModel.OperationContract(Name:="")> _ - <Global.ProtoBuf.ServiceModel.ProtoBehavior()> _ - - ( request); - - <Global.System.ServiceModel.OperationContract(AsyncPattern:=True, Name:="")> _ - Global.System.IAsyncResult Begin( request, Global.System.AsyncCallback callback, object state); - End(Global.System.IAsyncResult ar); - - - - - ( request) - { - return () Send("", request); - } - - - - - - - - - Public Class CompletedEventArgs : Global.System.ComponentModel.AsyncCompletedEventArgs - private object[] results; - - public CompletedEventArgs(object[] results, Global.System.Exception exception, bool cancelled, object userState) - : base(exception, cancelled, userState) - { - this.results = results; - } - - public Result - { - get { - base.RaiseExceptionIfNecessary(); - return ()(this.results[0]); - } - } - End Class - - - - - - - - <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ - public partial class Client : Global.System.ServiceModel.ClientBase<I>, I - { - - public Client() - {} - public Client(string endpointConfigurationName) - : base(endpointConfigurationName) - {} - public Client(string endpointConfigurationName, string remoteAddress) - : base(endpointConfigurationName, remoteAddress) - {} - public Client(string endpointConfigurationName, Global.System.ServiceModel.EndpointAddress remoteAddress) - : base(endpointConfigurationName, remoteAddress) - {} - public Client(Global.System.ServiceModel.Channels.Binding binding, Global.System.ServiceModel.EndpointAddress remoteAddress) - : base(binding, remoteAddress) - {} - - - } - - - - - - private BeginOperationDelegate onBeginDelegate; - private EndOperationDelegate onEndDelegate; - private Global.System.Threading.SendOrPostCallback onCompletedDelegate; - - public event Global.System.EventHandler<CompletedEventArgs> Completed; - - public ( request) - { - return base.Channel.(request); - } - - <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ - public Global.System.IAsyncResult Begin( request, Global.System.AsyncCallback callback, object asyncState) - { - return base.Channel.Begin(request, callback, asyncState); - } - - <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ - public End(Global.System.IAsyncResult result) - { - return base.Channel.End(result); - } - - private Global.System.IAsyncResult OnBegin(object[] inValues, Global.System.AsyncCallback callback, object asyncState) - { - request = (()(inValues[0])); - return this.Begin(request, callback, asyncState); - } - - private object[] OnEnd(Global.System.IAsyncResult result) - { - retVal = this.End(result); - return new object[] { - retVal}; - } - - private void OnCompleted(object state) - { - if ((this.Completed != null)) - { - InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.Completed(this, new CompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); - } - } - - public void Async( request) - { - this.Async(request, null); - } - - public void Async( request, object userState) - { - if ((this.onBeginDelegate == null)) - { - this.onBeginDelegate = new BeginOperationDelegate(this.OnBegin); - } - if ((this.onEndDelegate == null)) - { - this.onEndDelegate = new EndOperationDelegate(this.OnEnd); - } - if ((this.onCompletedDelegate == null)) - { - this.onCompletedDelegate = new Global.System.Threading.SendOrPostCallback(this.OnCompleted); - } - base.InvokeAsync(this.onBeginDelegate, new object[] { - request}, this.onEndDelegate, this.onCompletedDelegate, userState); - } - - - - - [] - - - |AddHandler|AddressOf|Alias|And|AndAlso|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDec|CDbl|Char|CInt|Class|CLng|CObj|Const|Continue|CSByte|CShort|CSng|CStr|CType|CUInt|CULng|CUShort|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|False|Finally|For|Friend|Function|Get|GetType|GetXMLNamespace|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|Narrowing|New|Next|Not|Nothing|NotInheritable|NotOverridable|Object|Of|On|Operator|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|REM|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|True|Try|TryCast|TypeOf|Variant|Wend|UInteger|ULong|UShort|Using|When|While|Widening|With|WithEvents|WriteOnly|Xor| - - - diff --git a/ProtobufCore/Protogen-Tools/xml.xslt b/ProtobufCore/Protogen-Tools/xml.xslt deleted file mode 100644 index a8b1828..0000000 --- a/ProtobufCore/Protogen-Tools/xml.xslt +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - Xml template for protobuf-net. - - This template writes the proto descriptor as xml. - No options available. - - - - - - - - - - - diff --git a/ProtobufCore/Target/protobuf_HunterNetCore.cs b/ProtobufCore/Target/protobuf_HunterNetCore.cs deleted file mode 100644 index 740871f..0000000 --- a/ProtobufCore/Target/protobuf_HunterNetCore.cs +++ /dev/null @@ -1,120 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 diff --git a/ProtobufCore/build.bat b/ProtobufCore/build.bat deleted file mode 100644 index 5df9e2d..0000000 --- a/ProtobufCore/build.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -cd.. -set "protopath=%cd%" -cd protocol -protoc --proto_path=./proto --cpp_out=out "./proto/KyCmdProtocol.proto" -protoc --proto_path=./proto --cpp_out=out "./proto/KyMsgProtocol.proto" -pause \ No newline at end of file diff --git a/ProtobufCore/build_cs.bat b/ProtobufCore/build_cs.bat new file mode 100644 index 0000000..94d0344 --- /dev/null +++ b/ProtobufCore/build_cs.bat @@ -0,0 +1,17 @@ +@echo off + +set "PROTOC_EXE=%cd%\protoc.exe" +set "WORK_DIR=%cd%\proto" +set "CS_OUT_PATH=%cd%\out\CS" + +echo "==>>buildStart" +for /f "delims=" %%i in ('dir /b proto "proto/*.proto"') do ( + echo build file:%%%i + %PROTOC_EXE% --proto_path="%WORK_DIR%" --csharp_out="%CS_OUT_PATH%" "%WORK_DIR%\%%i" +) +echo "==>>build finish" +echo "==>>copy cs" + +::copy %cd%\out\CS\ ..\Project2\Assets\Scripts\HotFix\ProtoBuf\ + +pause \ No newline at end of file diff --git a/ProtobufCore/out/CS/ProtobufHunterNetCore.cs b/ProtobufCore/out/CS/ProtobufHunterNetCore.cs new file mode 100644 index 0000000..97eeea6 --- /dev/null +++ b/ProtobufCore/out/CS/ProtobufHunterNetCore.cs @@ -0,0 +1,506 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protobuf_HunterNetCore.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace HunterProtobufCore { + + /// Holder for reflection information generated from protobuf_HunterNetCore.proto + public static partial class ProtobufHunterNetCoreReflection { + + #region Descriptor + /// File descriptor for protobuf_HunterNetCore.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ProtobufHunterNetCoreReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Chxwcm90b2J1Zl9IdW50ZXJOZXRDb3JlLnByb3RvEhJIdW50ZXJQcm90b2J1", + "ZkNvcmUiSAoNSHVudGVyTmV0X0MyUxIbChNIdW50ZXJOZXRDb3JlX0NtZElE", + "GAEgASgFEhoKEkh1bnRlck5ldENvcmVfRGF0YRgCIAEoDCJpCg1IdW50ZXJO", + "ZXRfUzJDEhsKE0h1bnRlck5ldENvcmVfQ21kSUQYASABKAUSHwoXSHVudGVy", + "TmV0Q29yZV9FUlJPUkNvZGUYAiABKAUSGgoSSHVudGVyTmV0Q29yZV9EYXRh", + "GAMgASgMQgJIAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::HunterProtobufCore.HunterNet_C2S), global::HunterProtobufCore.HunterNet_C2S.Parser, new[]{ "HunterNetCoreCmdID", "HunterNetCoreData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::HunterProtobufCore.HunterNet_S2C), global::HunterProtobufCore.HunterNet_S2C.Parser, new[]{ "HunterNetCoreCmdID", "HunterNetCoreERRORCode", "HunterNetCoreData" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + ///上行 + /// + public sealed partial class HunterNet_C2S : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HunterNet_C2S()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::HunterProtobufCore.ProtobufHunterNetCoreReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S(HunterNet_C2S other) : this() { + hunterNetCoreCmdID_ = other.hunterNetCoreCmdID_; + hunterNetCoreData_ = other.hunterNetCoreData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_C2S Clone() { + return new HunterNet_C2S(this); + } + + /// Field number for the "HunterNetCore_CmdID" field. + public const int HunterNetCoreCmdIDFieldNumber = 1; + private int hunterNetCoreCmdID_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreCmdID { + get { return hunterNetCoreCmdID_; } + set { + hunterNetCoreCmdID_ = value; + } + } + + /// Field number for the "HunterNetCore_Data" field. + public const int HunterNetCoreDataFieldNumber = 2; + private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString HunterNetCoreData { + get { return hunterNetCoreData_; } + set { + hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HunterNet_C2S); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HunterNet_C2S other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HunterNetCoreCmdID != other.HunterNetCoreCmdID) return false; + if (HunterNetCoreData != other.HunterNetCoreData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HunterNetCoreCmdID != 0) hash ^= HunterNetCoreCmdID.GetHashCode(); + if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HunterNetCoreCmdID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreCmdID); + } + if (HunterNetCoreData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HunterNet_C2S other) { + if (other == null) { + return; + } + if (other.HunterNetCoreCmdID != 0) { + HunterNetCoreCmdID = other.HunterNetCoreCmdID; + } + if (other.HunterNetCoreData.Length != 0) { + HunterNetCoreData = other.HunterNetCoreData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 18: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 18: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + /// + ///下行 + /// + public sealed partial class HunterNet_S2C : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HunterNet_S2C()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::HunterProtobufCore.ProtobufHunterNetCoreReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C(HunterNet_S2C other) : this() { + hunterNetCoreCmdID_ = other.hunterNetCoreCmdID_; + hunterNetCoreERRORCode_ = other.hunterNetCoreERRORCode_; + hunterNetCoreData_ = other.hunterNetCoreData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HunterNet_S2C Clone() { + return new HunterNet_S2C(this); + } + + /// Field number for the "HunterNetCore_CmdID" field. + public const int HunterNetCoreCmdIDFieldNumber = 1; + private int hunterNetCoreCmdID_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreCmdID { + get { return hunterNetCoreCmdID_; } + set { + hunterNetCoreCmdID_ = value; + } + } + + /// Field number for the "HunterNetCore_ERRORCode" field. + public const int HunterNetCoreERRORCodeFieldNumber = 2; + private int hunterNetCoreERRORCode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int HunterNetCoreERRORCode { + get { return hunterNetCoreERRORCode_; } + set { + hunterNetCoreERRORCode_ = value; + } + } + + /// Field number for the "HunterNetCore_Data" field. + public const int HunterNetCoreDataFieldNumber = 3; + private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString HunterNetCoreData { + get { return hunterNetCoreData_; } + set { + hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HunterNet_S2C); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HunterNet_S2C other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HunterNetCoreCmdID != other.HunterNetCoreCmdID) return false; + if (HunterNetCoreERRORCode != other.HunterNetCoreERRORCode) return false; + if (HunterNetCoreData != other.HunterNetCoreData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HunterNetCoreCmdID != 0) hash ^= HunterNetCoreCmdID.GetHashCode(); + if (HunterNetCoreERRORCode != 0) hash ^= HunterNetCoreERRORCode.GetHashCode(); + if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + output.WriteRawTag(16); + output.WriteInt32(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HunterNetCoreCmdID != 0) { + output.WriteRawTag(8); + output.WriteInt32(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + output.WriteRawTag(16); + output.WriteInt32(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(HunterNetCoreData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HunterNetCoreCmdID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreCmdID); + } + if (HunterNetCoreERRORCode != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HunterNetCoreERRORCode); + } + if (HunterNetCoreData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HunterNet_S2C other) { + if (other == null) { + return; + } + if (other.HunterNetCoreCmdID != 0) { + HunterNetCoreCmdID = other.HunterNetCoreCmdID; + } + if (other.HunterNetCoreERRORCode != 0) { + HunterNetCoreERRORCode = other.HunterNetCoreERRORCode; + } + if (other.HunterNetCoreData.Length != 0) { + HunterNetCoreData = other.HunterNetCoreData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 16: { + HunterNetCoreERRORCode = input.ReadInt32(); + break; + } + case 26: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + HunterNetCoreCmdID = input.ReadInt32(); + break; + } + case 16: { + HunterNetCoreERRORCode = input.ReadInt32(); + break; + } + case 26: { + HunterNetCoreData = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/ProtobufCore/proto2cpp.exe b/ProtobufCore/proto2cpp.exe new file mode 100644 index 0000000..04e976a Binary files /dev/null and b/ProtobufCore/proto2cpp.exe differ diff --git a/ProtobufCore/protobuf-net.dll b/ProtobufCore/protobuf-net.dll deleted file mode 100644 index 942e33b..0000000 Binary files a/ProtobufCore/protobuf-net.dll and /dev/null differ diff --git a/ProtobufCore/protoc.exe b/ProtobufCore/protoc.exe index db74054..f101dae 100644 Binary files a/ProtobufCore/protoc.exe and b/ProtobufCore/protoc.exe differ diff --git a/ProtobufCore/protoc_net.bat b/ProtobufCore/protoc_net.bat deleted file mode 100644 index 0c9f56e..0000000 --- a/ProtobufCore/protoc_net.bat +++ /dev/null @@ -1,2 +0,0 @@ -call protoc proto\protobuf_HunterNetCore.proto --descriptor_set_out=Desc\protobuf_HunterNetCore.protodesc -pause \ No newline at end of file diff --git a/ProtobufCore/protogen.exe.config b/ProtobufCore/protogen.exe.config deleted file mode 100644 index e59af44..0000000 --- a/ProtobufCore/protogen.exe.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ProtobufCore/protogen_net.bat b/ProtobufCore/protogen_net.bat deleted file mode 100644 index 1a3510d..0000000 --- a/ProtobufCore/protogen_net.bat +++ /dev/null @@ -1,2 +0,0 @@ -call Protogen-Tools\protogen -i:Desc\protobuf_HunterNetCore.protodesc -o:Target\protobuf_HunterNetCore.cs -p:detectMissing - diff --git a/ProtobufCore/update_build.bat b/ProtobufCore/update_build.bat new file mode 100644 index 0000000..02b1fe1 --- /dev/null +++ b/ProtobufCore/update_build.bat @@ -0,0 +1,6 @@ +call proto2cpp.exe protoc.exe +cd.. +set "protopath=%cd%" +cd new_server_proto +copy %cd%\out\cpp\ %protopath%\newhxserver\ProtocolSrc\ +pause \ No newline at end of file diff --git a/Simple/SimpleClient/Network/NetBase.cs b/Simple/SimpleClient/Network/NetBase.cs index 83aedbd..dbc2f7f 100644 --- a/Simple/SimpleClient/Network/NetBase.cs +++ b/Simple/SimpleClient/Network/NetBase.cs @@ -1,4 +1,4 @@ -using ProtoBuf; +using Google.Protobuf; using System; using System.Collections.Generic; using System.Linq; @@ -9,24 +9,17 @@ namespace SimpleClient { public static class NetBase { - //序列化 - public static byte[] Serizlize(T MsgObj) + public static byte[] Serizlize(IMessage msg) { - using (MemoryStream ms = new MemoryStream()) - { - Serializer.Serialize(ms, MsgObj); - byte[] data1 = ms.ToArray(); - return data1; - } + return msg.ToByteArray(); } - //反序列化 - public static T DeSerizlize(byte[] MsgObj) + + public static T DeSerizlize(byte[] bytes) { - using (MemoryStream ms = new MemoryStream(MsgObj)) - { - var ds_obj = Serializer.Deserialize(ms); - return ds_obj; - } + var msgType = typeof(T); + object msg = Activator.CreateInstance(msgType); + ((IMessage)msg).MergeFrom(bytes); + return (T)msg; } } diff --git a/Simple/SimpleClient/SimpleClient.csproj b/Simple/SimpleClient/SimpleClient.csproj index 7a081c4..9459fbb 100644 --- a/Simple/SimpleClient/SimpleClient.csproj +++ b/Simple/SimpleClient/SimpleClient.csproj @@ -1,19 +1,29 @@ - + Exe - net6.0 + net7.0 enable enable - - + + + + + + + + + ..\..\NetLib\Google.Protobuf.dll + + + diff --git a/Simple/SimpleServer/SimpleServer.csproj b/Simple/SimpleServer/SimpleServer.csproj index 10b64d3..f7477f1 100644 --- a/Simple/SimpleServer/SimpleServer.csproj +++ b/Simple/SimpleServer/SimpleServer.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net7.0 enable enable