ソースを参照

彻底删除google.protobuf,使用protobuf-net

tanghai 5 年 前
コミット
193ca8296b
99 ファイル変更657 行追加12928 行削除
  1. 15 0
      Client-Server.sln
  2. BIN
      Proto/Proto2CS.dll
  3. BIN
      Proto/Proto2CS.exe
  4. BIN
      Proto/Proto2CS.pdb
  5. 2 2
      Proto/Proto2CS.runtimeconfig.dev.json
  6. BIN
      Proto/protoc
  7. BIN
      Proto/protoc.exe
  8. 106 1
      Server/Model/Module/Message/InnerMessage.cs
  9. 23 23
      Server/Model/Module/Message/InnerOpcode.cs
  10. 0 79
      Server/ThirdParty/Google.Protobuf/ByteArray.cs
  11. 0 11
      Server/ThirdParty/Google.Protobuf/ByteArray.cs.meta
  12. 0 378
      Server/ThirdParty/Google.Protobuf/ByteString.cs
  13. 0 11
      Server/ThirdParty/Google.Protobuf/ByteString.cs.meta
  14. 0 1293
      Server/ThirdParty/Google.Protobuf/CodedInputStream.cs
  15. 0 11
      Server/ThirdParty/Google.Protobuf/CodedInputStream.cs.meta
  16. 0 304
      Server/ThirdParty/Google.Protobuf/CodedOutputStream.ComputeSize.cs
  17. 0 11
      Server/ThirdParty/Google.Protobuf/CodedOutputStream.ComputeSize.cs.meta
  18. 0 770
      Server/ThirdParty/Google.Protobuf/CodedOutputStream.cs
  19. 0 11
      Server/ThirdParty/Google.Protobuf/CodedOutputStream.cs.meta
  20. 0 379
      Server/ThirdParty/Google.Protobuf/FieldCodec.cs
  21. 0 11
      Server/ThirdParty/Google.Protobuf/FieldCodec.cs.meta
  22. 0 69
      Server/ThirdParty/Google.Protobuf/ICustomDiagnosticMessage.cs
  23. 0 11
      Server/ThirdParty/Google.Protobuf/ICustomDiagnosticMessage.cs.meta
  24. 0 64
      Server/ThirdParty/Google.Protobuf/IMessage.cs
  25. 0 11
      Server/ThirdParty/Google.Protobuf/IMessage.cs.meta
  26. 0 129
      Server/ThirdParty/Google.Protobuf/InvalidProtocolBufferException.cs
  27. 0 11
      Server/ThirdParty/Google.Protobuf/InvalidProtocolBufferException.cs.meta
  28. 0 110
      Server/ThirdParty/Google.Protobuf/LimitedInputStream.cs
  29. 0 11
      Server/ThirdParty/Google.Protobuf/LimitedInputStream.cs.meta
  30. 0 178
      Server/ThirdParty/Google.Protobuf/MessageExtensions.cs
  31. 0 11
      Server/ThirdParty/Google.Protobuf/MessageExtensions.cs.meta
  32. 0 241
      Server/ThirdParty/Google.Protobuf/MessageParser.cs
  33. 0 11
      Server/ThirdParty/Google.Protobuf/MessageParser.cs.meta
  34. 0 64
      Server/ThirdParty/Google.Protobuf/PropertyInfoExtensions.cs
  35. 0 11
      Server/ThirdParty/Google.Protobuf/PropertyInfoExtensions.cs.meta
  36. 0 79
      Server/ThirdParty/Google.Protobuf/ProtoPreconditions.cs
  37. 0 11
      Server/ThirdParty/Google.Protobuf/ProtoPreconditions.cs.meta
  38. 0 581
      Server/ThirdParty/Google.Protobuf/RepeatedField.cs
  39. 0 11
      Server/ThirdParty/Google.Protobuf/RepeatedField.cs.meta
  40. 0 64
      Server/ThirdParty/Google.Protobuf/StreamExtensions.cs
  41. 0 11
      Server/ThirdParty/Google.Protobuf/StreamExtensions.cs.meta
  42. 0 104
      Server/ThirdParty/Google.Protobuf/WireFormat.cs
  43. 0 11
      Server/ThirdParty/Google.Protobuf/WireFormat.cs.meta
  44. 6 0
      Server/ThirdParty/Server.ThirdParty.csproj
  45. 17 114
      Tools/Proto2CS/Program.cs
  46. 0 1
      Unity/Assets/Hotfix/Module/Message/NetOuterComponentSystem.cs
  47. 0 118
      Unity/Assets/Model/Base/Helper/Dumper.cs
  48. 0 4
      Unity/Assets/Model/Base/Helper/StringHelper.cs
  49. 1 1
      Unity/Assets/Model/Base/Log.cs
  50. 0 3
      Unity/Assets/Model/Module/Message/IMessagePacker.cs
  51. 0 16
      Unity/Assets/Model/Module/Message/OpcodeTypeComponent.cs
  52. 410 2300
      Unity/Assets/Model/Module/Message/OuterMessage.cs
  53. 25 106
      Unity/Assets/Model/Module/Message/OuterOpcode.cs
  54. 4 50
      Unity/Assets/Model/Module/Message/ProtobufHelper.cs
  55. 0 15
      Unity/Assets/Model/Module/Message/ProtobufPacker.cs
  56. 2 10
      Unity/Assets/Model/Module/Message/Session.cs
  57. 8 0
      Unity/Assets/Model/Move.meta
  58. 0 79
      Unity/Assets/ThirdParty/Google.Protobuf/ByteArray.cs
  59. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/ByteArray.cs.meta
  60. 0 378
      Unity/Assets/ThirdParty/Google.Protobuf/ByteString.cs
  61. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/ByteString.cs.meta
  62. 0 1293
      Unity/Assets/ThirdParty/Google.Protobuf/CodedInputStream.cs
  63. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/CodedInputStream.cs.meta
  64. 0 304
      Unity/Assets/ThirdParty/Google.Protobuf/CodedOutputStream.ComputeSize.cs
  65. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/CodedOutputStream.ComputeSize.cs.meta
  66. 0 770
      Unity/Assets/ThirdParty/Google.Protobuf/CodedOutputStream.cs
  67. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/CodedOutputStream.cs.meta
  68. 0 379
      Unity/Assets/ThirdParty/Google.Protobuf/FieldCodec.cs
  69. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/FieldCodec.cs.meta
  70. 0 69
      Unity/Assets/ThirdParty/Google.Protobuf/ICustomDiagnosticMessage.cs
  71. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/ICustomDiagnosticMessage.cs.meta
  72. 0 64
      Unity/Assets/ThirdParty/Google.Protobuf/IMessage.cs
  73. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/IMessage.cs.meta
  74. 0 129
      Unity/Assets/ThirdParty/Google.Protobuf/InvalidProtocolBufferException.cs
  75. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/InvalidProtocolBufferException.cs.meta
  76. 0 110
      Unity/Assets/ThirdParty/Google.Protobuf/LimitedInputStream.cs
  77. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/LimitedInputStream.cs.meta
  78. 0 178
      Unity/Assets/ThirdParty/Google.Protobuf/MessageExtensions.cs
  79. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/MessageExtensions.cs.meta
  80. 0 241
      Unity/Assets/ThirdParty/Google.Protobuf/MessageParser.cs
  81. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/MessageParser.cs.meta
  82. 0 64
      Unity/Assets/ThirdParty/Google.Protobuf/PropertyInfoExtensions.cs
  83. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/PropertyInfoExtensions.cs.meta
  84. 0 79
      Unity/Assets/ThirdParty/Google.Protobuf/ProtoPreconditions.cs
  85. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/ProtoPreconditions.cs.meta
  86. 0 581
      Unity/Assets/ThirdParty/Google.Protobuf/RepeatedField.cs
  87. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/RepeatedField.cs.meta
  88. 0 64
      Unity/Assets/ThirdParty/Google.Protobuf/StreamExtensions.cs
  89. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/StreamExtensions.cs.meta
  90. 0 104
      Unity/Assets/ThirdParty/Google.Protobuf/WireFormat.cs
  91. 0 11
      Unity/Assets/ThirdParty/Google.Protobuf/WireFormat.cs.meta
  92. 18 16
      Unity/Packages/packages-lock.json
  93. 3 0
      Unity/Unity.Editor.csproj
  94. 3 0
      Unity/Unity.Hotfix.csproj
  95. 3 0
      Unity/Unity.HotfixView.csproj
  96. 3 0
      Unity/Unity.Model.csproj
  97. 3 0
      Unity/Unity.ModelView.csproj
  98. 3 0
      Unity/Unity.ThirdParty.csproj
  99. 2 2
      Unity/Unity.sln

+ 15 - 0
Client-Server.sln

@@ -29,6 +29,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.ModelView", "Unity\Un
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server.ThirdParty", "Server\ThirdParty\Server.ThirdParty.csproj", "{5CC830C4-3F2E-46AD-8160-3A0B032ACA5B}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proto2CS", "Tools\Proto2CS\Proto2CS.csproj", "{8CE3862F-0F7C-4759-A0E5-266AC3991E32}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -159,6 +161,18 @@ Global
 		{5CC830C4-3F2E-46AD-8160-3A0B032ACA5B}.Release|x64.Build.0 = Release|Any CPU
 		{5CC830C4-3F2E-46AD-8160-3A0B032ACA5B}.Release|x86.ActiveCfg = Release|Any CPU
 		{5CC830C4-3F2E-46AD-8160-3A0B032ACA5B}.Release|x86.Build.0 = Release|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|x64.Build.0 = Debug|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|x86.Build.0 = Debug|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|Any CPU.Build.0 = Release|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|x64.ActiveCfg = Release|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|x64.Build.0 = Release|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|x86.ActiveCfg = Release|Any CPU
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -174,6 +188,7 @@ Global
 		{D31345DE-9B88-525C-8E9C-744C99AE7509} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
 		{2F8409C1-DA01-D464-DBF2-00C6449E459E} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
 		{5CC830C4-3F2E-46AD-8160-3A0B032ACA5B} = {46008B91-6EC0-448B-8D1A-D8C6D2EEBEF4}
+		{8CE3862F-0F7C-4759-A0E5-266AC3991E32} = {4BC66C3C-D55F-4FAA-A2F5-29E8EB1797AE}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {EABC01E3-3EB5-47EF-B46E-AAD8BB3585F1}

BIN
Proto/Proto2CS.dll


BIN
Proto/Proto2CS.exe


BIN
Proto/Proto2CS.pdb


+ 2 - 2
Proto/Proto2CS.runtimeconfig.dev.json

@@ -1,8 +1,8 @@
 {
   "runtimeOptions": {
     "additionalProbingPaths": [
-      "C:\\Users\\Administrator\\.dotnet\\store\\|arch|\\|tfm|",
-      "C:\\Users\\Administrator\\.nuget\\packages"
+      "/Users/tanghai/.dotnet/store/|arch|/|tfm|",
+      "/Users/tanghai/.nuget/packages"
     ]
   }
 }

BIN
Proto/protoc


BIN
Proto/protoc.exe


+ 106 - 1
Server/Model/Module/Message/InnerMessage.cs

@@ -1,4 +1,5 @@
-
+using ET;
+using ProtoBuf;
 using System.Collections.Generic;
 namespace ET
 {
@@ -6,282 +7,386 @@ namespace ET
 /// 传送unit
 /// </summary>
 	[Message(InnerOpcode.M2M_TrasferUnitRequest)]
+	[ProtoContract]
 	public partial class M2M_TrasferUnitRequest: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public Unit Unit { get; set; }
 
 	}
 
 	[Message(InnerOpcode.M2M_TrasferUnitResponse)]
+	[ProtoContract]
 	public partial class M2M_TrasferUnitResponse: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
+		[ProtoMember(1)]
 		public long InstanceId { get; set; }
 
 	}
 
 	[Message(InnerOpcode.M2A_Reload)]
+	[ProtoContract]
 	public partial class M2A_Reload: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
 	}
 
 	[Message(InnerOpcode.A2M_Reload)]
+	[ProtoContract]
 	public partial class A2M_Reload: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
 	}
 
 	[Message(InnerOpcode.G2G_LockRequest)]
+	[ProtoContract]
 	public partial class G2G_LockRequest: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public long Id { get; set; }
 
+		[ProtoMember(2)]
 		public string Address { get; set; }
 
 	}
 
 	[Message(InnerOpcode.G2G_LockResponse)]
+	[ProtoContract]
 	public partial class G2G_LockResponse: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
 	}
 
 	[Message(InnerOpcode.G2G_LockReleaseRequest)]
+	[ProtoContract]
 	public partial class G2G_LockReleaseRequest: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public long Id { get; set; }
 
+		[ProtoMember(2)]
 		public string Address { get; set; }
 
 	}
 
 	[Message(InnerOpcode.G2G_LockReleaseResponse)]
+	[ProtoContract]
 	public partial class G2G_LockReleaseResponse: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectAddRequest)]
+	[ProtoContract]
 	public partial class ObjectAddRequest: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public long Key { get; set; }
 
+		[ProtoMember(2)]
 		public long InstanceId { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectAddResponse)]
+	[ProtoContract]
 	public partial class ObjectAddResponse: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectLockRequest)]
+	[ProtoContract]
 	public partial class ObjectLockRequest: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public long Key { get; set; }
 
+		[ProtoMember(2)]
 		public long InstanceId { get; set; }
 
+		[ProtoMember(3)]
 		public int Time { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectLockResponse)]
+	[ProtoContract]
 	public partial class ObjectLockResponse: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectUnLockRequest)]
+	[ProtoContract]
 	public partial class ObjectUnLockRequest: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public long Key { get; set; }
 
+		[ProtoMember(2)]
 		public long OldInstanceId { get; set; }
 
+		[ProtoMember(3)]
 		public long InstanceId { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectUnLockResponse)]
+	[ProtoContract]
 	public partial class ObjectUnLockResponse: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectRemoveRequest)]
+	[ProtoContract]
 	public partial class ObjectRemoveRequest: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public long Key { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectRemoveResponse)]
+	[ProtoContract]
 	public partial class ObjectRemoveResponse: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectGetRequest)]
+	[ProtoContract]
 	public partial class ObjectGetRequest: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public long Key { get; set; }
 
 	}
 
 	[Message(InnerOpcode.ObjectGetResponse)]
+	[ProtoContract]
 	public partial class ObjectGetResponse: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
+		[ProtoMember(1)]
 		public long InstanceId { get; set; }
 
 	}
 
 	[Message(InnerOpcode.R2G_GetLoginKey)]
+	[ProtoContract]
 	public partial class R2G_GetLoginKey: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public string Account { get; set; }
 
 	}
 
 	[Message(InnerOpcode.G2R_GetLoginKey)]
+	[ProtoContract]
 	public partial class G2R_GetLoginKey: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
+		[ProtoMember(1)]
 		public long Key { get; set; }
 
+		[ProtoMember(2)]
 		public long GateId { get; set; }
 
 	}
 
 	[Message(InnerOpcode.G2M_CreateUnit)]
+	[ProtoContract]
 	public partial class G2M_CreateUnit: IActorRequest
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(93)]
 		public long ActorId { get; set; }
 
+		[ProtoMember(1)]
 		public long PlayerId { get; set; }
 
+		[ProtoMember(2)]
 		public long GateSessionId { get; set; }
 
 	}
 
 	[Message(InnerOpcode.M2G_CreateUnit)]
+	[ProtoContract]
 	public partial class M2G_CreateUnit: IActorResponse
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(91)]
 		public int Error { get; set; }
 
+		[ProtoMember(92)]
 		public string Message { get; set; }
 
 // 自己的unit id
 // 自己的unit id
+		[ProtoMember(1)]
 		public long UnitId { get; set; }
 
 // 所有的unit
 // 所有的unit
+		[ProtoMember(2)]
 		public List<UnitInfo> Units = new List<UnitInfo>();
 
 	}
 
 	[Message(InnerOpcode.G2M_SessionDisconnect)]
+	[ProtoContract]
 	public partial class G2M_SessionDisconnect: IActorLocationMessage
 	{
+		[ProtoMember(90)]
 		public int RpcId { get; set; }
 
+		[ProtoMember(94)]
 		public long ActorId { get; set; }
 
 	}

+ 23 - 23
Server/Model/Module/Message/InnerOpcode.cs

@@ -2,28 +2,28 @@ namespace ET
 {
 	public static partial class InnerOpcode
 	{
-		 public const ushort M2M_TrasferUnitRequest = 1001;
-		 public const ushort M2M_TrasferUnitResponse = 1002;
-		 public const ushort M2A_Reload = 1003;
-		 public const ushort A2M_Reload = 1004;
-		 public const ushort G2G_LockRequest = 1005;
-		 public const ushort G2G_LockResponse = 1006;
-		 public const ushort G2G_LockReleaseRequest = 1007;
-		 public const ushort G2G_LockReleaseResponse = 1008;
-		 public const ushort ObjectAddRequest = 1009;
-		 public const ushort ObjectAddResponse = 1010;
-		 public const ushort ObjectLockRequest = 1011;
-		 public const ushort ObjectLockResponse = 1012;
-		 public const ushort ObjectUnLockRequest = 1013;
-		 public const ushort ObjectUnLockResponse = 1014;
-		 public const ushort ObjectRemoveRequest = 1015;
-		 public const ushort ObjectRemoveResponse = 1016;
-		 public const ushort ObjectGetRequest = 1017;
-		 public const ushort ObjectGetResponse = 1018;
-		 public const ushort R2G_GetLoginKey = 1019;
-		 public const ushort G2R_GetLoginKey = 1020;
-		 public const ushort G2M_CreateUnit = 1021;
-		 public const ushort M2G_CreateUnit = 1022;
-		 public const ushort G2M_SessionDisconnect = 1023;
+		 public const ushort M2M_TrasferUnitRequest = 10001;
+		 public const ushort M2M_TrasferUnitResponse = 10002;
+		 public const ushort M2A_Reload = 10003;
+		 public const ushort A2M_Reload = 10004;
+		 public const ushort G2G_LockRequest = 10005;
+		 public const ushort G2G_LockResponse = 10006;
+		 public const ushort G2G_LockReleaseRequest = 10007;
+		 public const ushort G2G_LockReleaseResponse = 10008;
+		 public const ushort ObjectAddRequest = 10009;
+		 public const ushort ObjectAddResponse = 10010;
+		 public const ushort ObjectLockRequest = 10011;
+		 public const ushort ObjectLockResponse = 10012;
+		 public const ushort ObjectUnLockRequest = 10013;
+		 public const ushort ObjectUnLockResponse = 10014;
+		 public const ushort ObjectRemoveRequest = 10015;
+		 public const ushort ObjectRemoveResponse = 10016;
+		 public const ushort ObjectGetRequest = 10017;
+		 public const ushort ObjectGetResponse = 10018;
+		 public const ushort R2G_GetLoginKey = 10019;
+		 public const ushort G2R_GetLoginKey = 10020;
+		 public const ushort G2M_CreateUnit = 10021;
+		 public const ushort M2G_CreateUnit = 10022;
+		 public const ushort G2M_SessionDisconnect = 10023;
 	}
 }

+ 0 - 79
Server/ThirdParty/Google.Protobuf/ByteArray.cs

@@ -1,79 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Provides a utility routine to copy small arrays much more quickly than Buffer.BlockCopy
-    /// </summary>
-    internal static class ByteArray
-    {
-        /// <summary>
-        /// The threshold above which you should use Buffer.BlockCopy rather than ByteArray.Copy
-        /// </summary>
-        private const int CopyThreshold = 12;
-
-        /// <summary>
-        /// Determines which copy routine to use based on the number of bytes to be copied.
-        /// </summary>
-        internal static void Copy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count)
-        {
-            if (count > CopyThreshold)
-            {
-                Buffer.BlockCopy(src, srcOffset, dst, dstOffset, count);
-            }
-            else
-            {
-                int stop = srcOffset + count;
-                for (int i = srcOffset; i < stop; i++)
-                {
-                    dst[dstOffset++] = src[i];
-                }
-            }
-        }
-
-        /// <summary>
-        /// Reverses the order of bytes in the array
-        /// </summary>
-        internal static void Reverse(byte[] bytes)
-        {
-            for (int first = 0, last = bytes.Length - 1; first < last; first++, last--)
-            {
-                byte temp = bytes[first];
-                bytes[first] = bytes[last];
-                bytes[last] = temp;
-            }
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/ByteArray.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: cc6f6a4c966390c4da2d54d15368bd0d
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 378
Server/ThirdParty/Google.Protobuf/ByteString.cs

@@ -1,378 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using Google.Protobuf.Compatibility;
-using MongoDB.Bson.Serialization.Attributes;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Immutable array of bytes.
-    /// </summary>
-    public sealed class ByteString : IEnumerable<byte>, IEquatable<ByteString>
-    {
-        private static readonly ByteString empty = new ByteString(new byte[0]);
-
-        public byte[] bytes;
-
-        /// <summary>
-        /// Unsafe operations that can cause IO Failure and/or other catestrophic side-effects.
-        /// </summary>
-        public static class Unsafe
-        {
-            /// <summary>
-            /// Constructs a new ByteString from the given byte array. The array is
-            /// *not* copied, and must not be modified after this constructor is called.
-            /// </summary>
-            public static ByteString FromBytes(byte[] bytes)
-            {
-                return new ByteString(bytes);
-            }
-
-            /// <summary>
-            /// Provides direct, unrestricted access to the bytes contained in this instance.
-            /// You must not modify or resize the byte array returned by this method.
-            /// </summary>
-            public static byte[] GetBuffer(ByteString bytes)
-            {
-                return bytes.bytes;
-            }
-        }
-
-        /// <summary>
-        /// Internal use only.  Ensure that the provided array is not mutated and belongs to this instance.
-        /// </summary>
-        internal static ByteString AttachBytes(byte[] bytes)
-        {
-            return new ByteString(bytes);
-        }
-        
-        public ByteString()
-        {}
-
-        public ByteString(List<byte> list)
-        {
-            this.bytes = list.ToArray();
-        }
-        /// <summary>
-        /// Constructs a new ByteString from the given byte array. The array is
-        /// *not* copied, and must not be modified after this constructor is called.
-        /// </summary>
-        public ByteString(byte[] bytes)
-        {
-            this.bytes = bytes;
-        }
-
-        /// <summary>
-        /// Returns an empty ByteString.
-        /// </summary>
-        public static ByteString Empty
-        {
-            get { return empty; }
-        }
-
-        /// <summary>
-        /// Returns the length of this ByteString in bytes.
-        /// </summary>
-        [BsonIgnore]
-        public int Length
-        {
-            get { return bytes.Length; }
-        }
-
-        /// <summary>
-        /// Returns <c>true</c> if this byte string is empty, <c>false</c> otherwise.
-        /// </summary>
-        [BsonIgnore]
-        public bool IsEmpty
-        {
-            get { return Length == 0; }
-        }
-
-        /// <summary>
-        /// Converts this <see cref="ByteString"/> into a byte array.
-        /// </summary>
-        /// <remarks>The data is copied - changes to the returned array will not be reflected in this <c>ByteString</c>.</remarks>
-        /// <returns>A byte array with the same data as this <c>ByteString</c>.</returns>
-        public byte[] ToByteArray()
-        {
-            return (byte[]) bytes.Clone();
-        }
-
-        /// <summary>
-        /// Converts this <see cref="ByteString"/> into a standard base64 representation.
-        /// </summary>
-        /// <returns>A base64 representation of this <c>ByteString</c>.</returns>
-        public string ToBase64()
-        {
-            return Convert.ToBase64String(bytes);
-        }
-
-        /// <summary>
-        /// Constructs a <see cref="ByteString" /> from the Base64 Encoded String.
-        /// </summary>
-        public static ByteString FromBase64(string bytes)
-        {
-            // By handling the empty string explicitly, we not only optimize but we fix a
-            // problem on CF 2.0. See issue 61 for details.
-            return bytes == "" ? Empty : new ByteString(Convert.FromBase64String(bytes));
-        }
-
-        /// <summary>
-        /// Constructs a <see cref="ByteString"/> from data in the given stream, synchronously.
-        /// </summary>
-        /// <remarks>If successful, <paramref name="stream"/> will be read completely, from the position
-        /// at the start of the call.</remarks>
-        /// <param name="stream">The stream to copy into a ByteString.</param>
-        /// <returns>A ByteString with content read from the given stream.</returns>
-        public static ByteString FromStream(Stream stream)
-        {
-            ProtoPreconditions.CheckNotNull(stream, "stream");
-            int capacity = stream.CanSeek ? checked((int) (stream.Length - stream.Position)) : 0;
-            var memoryStream = new MemoryStream(capacity);
-            stream.CopyTo(memoryStream);
-
-            // Avoid an extra copy if we can.
-            byte[] bytes = memoryStream.Length == memoryStream.Capacity ? memoryStream.GetBuffer() : memoryStream.ToArray();
-
-            return AttachBytes(bytes);
-        }
-
-        /// <summary>
-        /// Constructs a <see cref="ByteString" /> from the given array. The contents
-        /// are copied, so further modifications to the array will not
-        /// be reflected in the returned ByteString.
-        /// This method can also be invoked in <c>ByteString.CopyFrom(0xaa, 0xbb, ...)</c> form
-        /// which is primarily useful for testing.
-        /// </summary>
-        public static ByteString CopyFrom(params byte[] bytes)
-        {
-            return new ByteString((byte[]) bytes.Clone());
-        }
-
-        /// <summary>
-        /// Constructs a <see cref="ByteString" /> from a portion of a byte array.
-        /// </summary>
-        public static ByteString CopyFrom(byte[] bytes, int offset, int count)
-        {
-            byte[] portion = new byte[count];
-            ByteArray.Copy(bytes, offset, portion, 0, count);
-            return new ByteString(portion);
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="ByteString" /> by encoding the specified text with
-        /// the given encoding.
-        /// </summary>
-        public static ByteString CopyFrom(string text, Encoding encoding)
-        {
-            return new ByteString(encoding.GetBytes(text));
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="ByteString" /> by encoding the specified text in UTF-8.
-        /// </summary>
-        public static ByteString CopyFromUtf8(string text)
-        {
-            return CopyFrom(text, Encoding.UTF8);
-        }
-
-        /// <summary>
-        /// Retuns the byte at the given index.
-        /// </summary>
-        [BsonIgnore]
-        public byte this[int index]
-        {
-            get { return bytes[index]; }
-        }
-
-        /// <summary>
-        /// Converts this <see cref="ByteString"/> into a string by applying the given encoding.
-        /// </summary>
-        /// <remarks>
-        /// This method should only be used to convert binary data which was the result of encoding
-        /// text with the given encoding.
-        /// </remarks>
-        /// <param name="encoding">The encoding to use to decode the binary data into text.</param>
-        /// <returns>The result of decoding the binary data with the given decoding.</returns>
-        public string ToString(Encoding encoding)
-        {
-            return encoding.GetString(bytes, 0, bytes.Length);
-        }
-
-        /// <summary>
-        /// Converts this <see cref="ByteString"/> into a string by applying the UTF-8 encoding.
-        /// </summary>
-        /// <remarks>
-        /// This method should only be used to convert binary data which was the result of encoding
-        /// text with UTF-8.
-        /// </remarks>
-        /// <returns>The result of decoding the binary data with the given decoding.</returns>
-        public string ToStringUtf8()
-        {
-            return ToString(Encoding.UTF8);
-        }
-
-        /// <summary>
-        /// Returns an iterator over the bytes in this <see cref="ByteString"/>.
-        /// </summary>
-        /// <returns>An iterator over the bytes in this object.</returns>
-        public IEnumerator<byte> GetEnumerator()
-        {
-            return ((IEnumerable<byte>) bytes).GetEnumerator();
-        }
-
-        /// <summary>
-        /// Returns an iterator over the bytes in this <see cref="ByteString"/>.
-        /// </summary>
-        /// <returns>An iterator over the bytes in this object.</returns>
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
-
-        /// <summary>
-        /// Creates a CodedInputStream from this ByteString's data.
-        /// </summary>
-        public CodedInputStream CreateCodedInput()
-        {
-            // We trust CodedInputStream not to reveal the provided byte array or modify it
-            return new CodedInputStream(bytes);
-        }
-
-        /// <summary>
-        /// Compares two byte strings for equality.
-        /// </summary>
-        /// <param name="lhs">The first byte string to compare.</param>
-        /// <param name="rhs">The second byte string to compare.</param>
-        /// <returns><c>true</c> if the byte strings are equal; false otherwise.</returns>
-        public static bool operator ==(ByteString lhs, ByteString rhs)
-        {
-            if (ReferenceEquals(lhs, rhs))
-            {
-                return true;
-            }
-            if (ReferenceEquals(lhs, null) || ReferenceEquals(rhs, null))
-            {
-                return false;
-            }
-            if (lhs.bytes.Length != rhs.bytes.Length)
-            {
-                return false;
-            }
-            for (int i = 0; i < lhs.Length; i++)
-            {
-                if (rhs.bytes[i] != lhs.bytes[i])
-                {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        /// <summary>
-        /// Compares two byte strings for inequality.
-        /// </summary>
-        /// <param name="lhs">The first byte string to compare.</param>
-        /// <param name="rhs">The second byte string to compare.</param>
-        /// <returns><c>false</c> if the byte strings are equal; true otherwise.</returns>
-        public static bool operator !=(ByteString lhs, ByteString rhs)
-        {
-            return !(lhs == rhs);
-        }
-
-        /// <summary>
-        /// Compares this byte string with another object.
-        /// </summary>
-        /// <param name="obj">The object to compare this with.</param>
-        /// <returns><c>true</c> if <paramref name="obj"/> refers to an equal <see cref="ByteString"/>; <c>false</c> otherwise.</returns>
-        public override bool Equals(object obj)
-        {
-            return this == (obj as ByteString);
-        }
-
-        /// <summary>
-        /// Returns a hash code for this object. Two equal byte strings
-        /// will return the same hash code.
-        /// </summary>
-        /// <returns>A hash code for this object.</returns>
-        public override int GetHashCode()
-        {
-            int ret = 23;
-            foreach (byte b in bytes)
-            {
-                ret = (ret * 31) + b;
-            }
-            return ret;
-        }
-
-        /// <summary>
-        /// Compares this byte string with another.
-        /// </summary>
-        /// <param name="other">The <see cref="ByteString"/> to compare this with.</param>
-        /// <returns><c>true</c> if <paramref name="other"/> refers to an equal byte string; <c>false</c> otherwise.</returns>
-        public bool Equals(ByteString other)
-        {
-            return this == other;
-        }
-
-        /// <summary>
-        /// Used internally by CodedOutputStream to avoid creating a copy for the write
-        /// </summary>
-        internal void WriteRawBytesTo(CodedOutputStream outputStream)
-        {
-            outputStream.WriteRawBytes(bytes, 0, bytes.Length);
-        }
-
-        /// <summary>
-        /// Copies the entire byte array to the destination array provided at the offset specified.
-        /// </summary>
-        public void CopyTo(byte[] array, int position)
-        {
-            ByteArray.Copy(bytes, 0, array, position, bytes.Length);
-        }
-
-        /// <summary>
-        /// Writes the entire byte array to the provided stream
-        /// </summary>
-        public void WriteTo(Stream outputStream)
-        {
-            outputStream.Write(bytes, 0, bytes.Length);
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/ByteString.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 0495e4b3ba1ec7f498d877a234323a35
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 1293
Server/ThirdParty/Google.Protobuf/CodedInputStream.cs

@@ -1,1293 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using Google.Protobuf.Collections;
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Reads and decodes protocol message fields.
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// This class is generally used by generated code to read appropriate
-    /// primitives from the stream. It effectively encapsulates the lowest
-    /// levels of protocol buffer format.
-    /// </para>
-    /// <para>
-    /// Repeated fields and map fields are not handled by this class; use <see cref="RepeatedField{T}"/>
-    /// and <see cref="MapField{TKey, TValue}"/> to serialize such fields.
-    /// </para>
-    /// </remarks>
-    public sealed class CodedInputStream : IDisposable
-    {
-        /// <summary>
-        /// Whether to leave the underlying stream open when disposing of this stream.
-        /// This is always true when there's no stream.
-        /// </summary>
-        private bool leaveOpen;
-
-        /// <summary>
-        /// Buffer of data read from the stream or provided at construction time.
-        /// </summary>
-        private byte[] buffer;
-
-        /// <summary>
-        /// The index of the buffer at which we need to refill from the stream (if there is one).
-        /// </summary>
-        private int bufferSize;
-
-        private int bufferSizeAfterLimit = 0;
-        /// <summary>
-        /// The position within the current buffer (i.e. the next byte to read)
-        /// </summary>
-        private int bufferPos = 0;
-
-        /// <summary>
-        /// The stream to read further input from, or null if the byte array buffer was provided
-        /// directly on construction, with no further data available.
-        /// </summary>
-        private readonly Stream input;
-
-        /// <summary>
-        /// The last tag we read. 0 indicates we've read to the end of the stream
-        /// (or haven't read anything yet).
-        /// </summary>
-        private uint lastTag = 0;
-
-        /// <summary>
-        /// The next tag, used to store the value read by PeekTag.
-        /// </summary>
-        private uint nextTag = 0;
-        private bool hasNextTag = false;
-
-        internal const int DefaultRecursionLimit = 64;
-        internal const int DefaultSizeLimit = 64 << 20; // 64MB
-        internal const int BufferSize = 4096;
-
-        /// <summary>
-        /// The total number of bytes read before the current buffer. The
-        /// total bytes read up to the current position can be computed as
-        /// totalBytesRetired + bufferPos.
-        /// </summary>
-        private int totalBytesRetired = 0;
-
-        /// <summary>
-        /// The absolute position of the end of the current message.
-        /// </summary> 
-        private int currentLimit = int.MaxValue;
-
-        private int recursionDepth = 0;
-
-        private int recursionLimit;
-        private int sizeLimit;
-
-        #region Construction
-        // Note that the checks are performed such that we don't end up checking obviously-valid things
-        // like non-null references for arrays we've just created.
-
-        /// <summary>
-        /// Creates a new CodedInputStream reading data from the given byte array.
-        /// </summary>
-        public CodedInputStream(byte[] buffer) : this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), 0, buffer.Length, true)
-        {            
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="CodedInputStream"/> that reads from the given byte array slice.
-        /// </summary>
-        public CodedInputStream(byte[] buffer, int offset, int length)
-            : this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), offset, offset + length, true)
-        {            
-            if (offset < 0 || offset > buffer.Length)
-            {
-                throw new ArgumentOutOfRangeException("offset", "Offset must be within the buffer");
-            }
-            if (length < 0 || offset + length > buffer.Length)
-            {
-                throw new ArgumentOutOfRangeException("length", "Length must be non-negative and within the buffer");
-            }
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="CodedInputStream"/> reading data from the given stream, which will be disposed
-        /// when the returned object is disposed.
-        /// </summary>
-        /// <param name="input">The stream to read from.</param>
-        public CodedInputStream(Stream input) : this(input, false)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="CodedInputStream"/> reading data from the given stream.
-        /// </summary>
-        /// <param name="input">The stream to read from.</param>
-        /// <param name="leaveOpen"><c>true</c> to leave <paramref name="input"/> open when the returned
-        /// <c cref="CodedInputStream"/> is disposed; <c>false</c> to dispose of the given stream when the
-        /// returned object is disposed.</param>
-        public CodedInputStream(Stream input, bool leaveOpen)
-            : this(ProtoPreconditions.CheckNotNull(input, "input"), new byte[BufferSize], 0, 0, leaveOpen)
-        {
-        }
-        
-        /// <summary>
-        /// Creates a new CodedInputStream reading data from the given
-        /// stream and buffer, using the default limits.
-        /// </summary>
-        internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, bool leaveOpen)
-        {
-            this.input = input;
-            this.buffer = buffer;
-            this.bufferPos = bufferPos;
-            this.bufferSize = bufferSize;
-            this.sizeLimit = DefaultSizeLimit;
-            this.recursionLimit = DefaultRecursionLimit;
-            this.leaveOpen = leaveOpen;
-        }
-        
-        public void Reset(byte[] buf, int offset, int length)
-        {
-            this.buffer = buf;
-            this.bufferPos = offset;
-            this.bufferSize = length;
-            this.sizeLimit = DefaultSizeLimit;
-            this.recursionLimit = DefaultRecursionLimit;
-            this.leaveOpen = true;
-
-            bufferSizeAfterLimit = 0;
-            lastTag = 0;
-            nextTag = 0;
-            hasNextTag = false;
-            totalBytesRetired = 0;
-            currentLimit = int.MaxValue;
-            sizeLimit = 0;
-            recursionDepth = 0;
-        }
-
-        /// <summary>
-        /// Creates a new CodedInputStream reading data from the given
-        /// stream and buffer, using the specified limits.
-        /// </summary>
-        /// <remarks>
-        /// This chains to the version with the default limits instead of vice versa to avoid
-        /// having to check that the default values are valid every time.
-        /// </remarks>
-        internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, int sizeLimit, int recursionLimit, bool leaveOpen)
-            : this(input, buffer, bufferPos, bufferSize, leaveOpen)
-        {
-            if (sizeLimit <= 0)
-            {
-                throw new ArgumentOutOfRangeException("sizeLimit", "Size limit must be positive");
-            }
-            if (recursionLimit <= 0)
-            {
-                throw new ArgumentOutOfRangeException("recursionLimit!", "Recursion limit must be positive");
-            }
-            this.sizeLimit = sizeLimit;
-            this.recursionLimit = recursionLimit;
-        }
-        #endregion
-
-        /// <summary>
-        /// Creates a <see cref="CodedInputStream"/> with the specified size and recursion limits, reading
-        /// from an input stream.
-        /// </summary>
-        /// <remarks>
-        /// This method exists separately from the constructor to reduce the number of constructor overloads.
-        /// It is likely to be used considerably less frequently than the constructors, as the default limits
-        /// are suitable for most use cases.
-        /// </remarks>
-        /// <param name="input">The input stream to read from</param>
-        /// <param name="sizeLimit">The total limit of data to read from the stream.</param>
-        /// <param name="recursionLimit">The maximum recursion depth to allow while reading.</param>
-        /// <returns>A <c>CodedInputStream</c> reading from <paramref name="input"/> with the specified size
-        /// and recursion limits.</returns>
-        public static CodedInputStream CreateWithLimits(Stream input, int sizeLimit, int recursionLimit)
-        {
-            // Note: we may want an overload accepting leaveOpen
-            return new CodedInputStream(input, new byte[BufferSize], 0, 0, sizeLimit, recursionLimit, false);
-        }
-
-        /// <summary>
-        /// Returns the current position in the input stream, or the position in the input buffer
-        /// </summary>
-        public long Position 
-        {
-            get
-            {
-                if (input != null)
-                {
-                    return input.Position - ((bufferSize + bufferSizeAfterLimit) - bufferPos);
-                }
-                return bufferPos;
-            }
-        }
-
-        /// <summary>
-        /// Returns the last tag read, or 0 if no tags have been read or we've read beyond
-        /// the end of the stream.
-        /// </summary>
-        internal uint LastTag { get { return lastTag; } }
-
-        /// <summary>
-        /// Returns the size limit for this stream.
-        /// </summary>
-        /// <remarks>
-        /// This limit is applied when reading from the underlying stream, as a sanity check. It is
-        /// not applied when reading from a byte array data source without an underlying stream.
-        /// The default value is 64MB.
-        /// </remarks>
-        /// <value>
-        /// The size limit.
-        /// </value>
-        public int SizeLimit { get { return sizeLimit; } }
-
-        /// <summary>
-        /// Returns the recursion limit for this stream. This limit is applied whilst reading messages,
-        /// to avoid maliciously-recursive data.
-        /// </summary>
-        /// <remarks>
-        /// The default limit is 64.
-        /// </remarks>
-        /// <value>
-        /// The recursion limit for this stream.
-        /// </value>
-        public int RecursionLimit { get { return recursionLimit; } }
-
-        /// <summary>
-        /// Disposes of this instance, potentially closing any underlying stream.
-        /// </summary>
-        /// <remarks>
-        /// As there is no flushing to perform here, disposing of a <see cref="CodedInputStream"/> which
-        /// was constructed with the <c>leaveOpen</c> option parameter set to <c>true</c> (or one which
-        /// was constructed to read from a byte array) has no effect.
-        /// </remarks>
-        public void Dispose()
-        {
-            if (!leaveOpen)
-            {
-                input.Dispose();
-            }
-        }
-
-        #region Validation
-        /// <summary>
-        /// Verifies that the last call to ReadTag() returned tag 0 - in other words,
-        /// we've reached the end of the stream when we expected to.
-        /// </summary>
-        /// <exception cref="InvalidProtocolBufferException">The 
-        /// tag read was not the one specified</exception>
-        internal void CheckReadEndOfStreamTag()
-        {
-            if (lastTag != 0)
-            {
-                throw InvalidProtocolBufferException.MoreDataAvailable();
-            }
-        }
-        #endregion
-
-        #region Reading of tags etc
-
-        /// <summary>
-        /// Peeks at the next field tag. This is like calling <see cref="ReadTag"/>, but the
-        /// tag is not consumed. (So a subsequent call to <see cref="ReadTag"/> will return the
-        /// same value.)
-        /// </summary>
-        public uint PeekTag()
-        {
-            if (hasNextTag)
-            {
-                return nextTag;
-            }
-
-            uint savedLast = lastTag;
-            nextTag = ReadTag();
-            hasNextTag = true;
-            lastTag = savedLast; // Undo the side effect of ReadTag
-            return nextTag;
-        }
-
-        /// <summary>
-        /// Reads a field tag, returning the tag of 0 for "end of stream".
-        /// </summary>
-        /// <remarks>
-        /// If this method returns 0, it doesn't necessarily mean the end of all
-        /// the data in this CodedInputStream; it may be the end of the logical stream
-        /// for an embedded message, for example.
-        /// </remarks>
-        /// <returns>The next field tag, or 0 for end of stream. (0 is never a valid tag.)</returns>
-        public uint ReadTag()
-        {
-            if (hasNextTag)
-            {
-                lastTag = nextTag;
-                hasNextTag = false;
-                return lastTag;
-            }
-
-            // Optimize for the incredibly common case of having at least two bytes left in the buffer,
-            // and those two bytes being enough to get the tag. This will be true for fields up to 4095.
-            if (bufferPos + 2 <= bufferSize)
-            {
-                int tmp = buffer[bufferPos++];
-                if (tmp < 128)
-                {
-                    lastTag = (uint)tmp;
-                }
-                else
-                {
-                    int result = tmp & 0x7f;
-                    if ((tmp = buffer[bufferPos++]) < 128)
-                    {
-                        result |= tmp << 7;
-                        lastTag = (uint) result;
-                    }
-                    else
-                    {
-                        // Nope, rewind and go the potentially slow route.
-                        bufferPos -= 2;
-                        lastTag = ReadRawVarint32();
-                    }
-                }
-            }
-            else
-            {
-                if (IsAtEnd)
-                {
-                    lastTag = 0;
-                    return 0; // This is the only case in which we return 0.
-                }
-
-                lastTag = ReadRawVarint32();
-            }
-            if (lastTag == 0)
-            {
-                // If we actually read zero, that's not a valid tag.
-                throw InvalidProtocolBufferException.InvalidTag();
-            }
-            return lastTag;
-        }
-
-        /// <summary>
-        /// Skips the data for the field with the tag we've just read.
-        /// This should be called directly after <see cref="ReadTag"/>, when
-        /// the caller wishes to skip an unknown field.
-        /// </summary>
-        /// <remarks>
-        /// This method throws <see cref="InvalidProtocolBufferException"/> if the last-read tag was an end-group tag.
-        /// If a caller wishes to skip a group, they should skip the whole group, by calling this method after reading the
-        /// start-group tag. This behavior allows callers to call this method on any field they don't understand, correctly
-        /// resulting in an error if an end-group tag has not been paired with an earlier start-group tag.
-        /// </remarks>
-        /// <exception cref="InvalidProtocolBufferException">The last tag was an end-group tag</exception>
-        /// <exception cref="InvalidOperationException">The last read operation read to the end of the logical stream</exception>
-        public void SkipLastField()
-        {
-            if (lastTag == 0)
-            {
-                throw new InvalidOperationException("SkipLastField cannot be called at the end of a stream");
-            }
-            switch (WireFormat.GetTagWireType(lastTag))
-            {
-                case WireFormat.WireType.StartGroup:
-                    SkipGroup(lastTag);
-                    break;
-                case WireFormat.WireType.EndGroup:
-                    throw new InvalidProtocolBufferException("SkipLastField called on an end-group tag, indicating that the corresponding start-group was missing");
-                case WireFormat.WireType.Fixed32:
-                    ReadFixed32();
-                    break;
-                case WireFormat.WireType.Fixed64:
-                    ReadFixed64();
-                    break;
-                case WireFormat.WireType.LengthDelimited:
-                    var length = ReadLength();
-                    SkipRawBytes(length);
-                    break;
-                case WireFormat.WireType.Varint:
-                    ReadRawVarint32();
-                    break;
-            }
-        }
-
-        private void SkipGroup(uint startGroupTag)
-        {
-            // Note: Currently we expect this to be the way that groups are read. We could put the recursion
-            // depth changes into the ReadTag method instead, potentially...
-            recursionDepth++;
-            if (recursionDepth >= recursionLimit)
-            {
-                throw InvalidProtocolBufferException.RecursionLimitExceeded();
-            }
-            uint tag;
-            while (true)
-            {
-                tag = ReadTag();
-                if (tag == 0)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                // Can't call SkipLastField for this case- that would throw.
-                if (WireFormat.GetTagWireType(tag) == WireFormat.WireType.EndGroup)
-                {
-                    break;
-                }
-                // This recursion will allow us to handle nested groups.
-                SkipLastField();
-            }
-            int startField = WireFormat.GetTagFieldNumber(startGroupTag);
-            int endField = WireFormat.GetTagFieldNumber(tag);
-            if (startField != endField)
-            {
-                throw new InvalidProtocolBufferException("Mismatched end-group tag. Started with field " + startField + "; ended with field " + endField);
-            }
-            recursionDepth--;
-        }
-
-        /// <summary>
-        /// Reads a double field from the stream.
-        /// </summary>
-        public double ReadDouble()
-        {
-            return BitConverter.Int64BitsToDouble((long) ReadRawLittleEndian64());
-        }
-
-        /// <summary>
-        /// Reads a float field from the stream.
-        /// </summary>
-        public float ReadFloat()
-        {
-            if (BitConverter.IsLittleEndian && 4 <= bufferSize - bufferPos)
-            {
-                float ret = BitConverter.ToSingle(buffer, bufferPos);
-                bufferPos += 4;
-                return ret;
-            }
-            else
-            {
-                byte[] rawBytes = ReadRawBytes(4);
-                if (!BitConverter.IsLittleEndian)
-                {
-                    ByteArray.Reverse(rawBytes);
-                }
-                return BitConverter.ToSingle(rawBytes, 0);
-            }
-        }
-
-        /// <summary>
-        /// Reads a uint64 field from the stream.
-        /// </summary>
-        public ulong ReadUInt64()
-        {
-            return ReadRawVarint64();
-        }
-
-        /// <summary>
-        /// Reads an int64 field from the stream.
-        /// </summary>
-        public long ReadInt64()
-        {
-            return (long) ReadRawVarint64();
-        }
-
-        /// <summary>
-        /// Reads an int32 field from the stream.
-        /// </summary>
-        public int ReadInt32()
-        {
-            return (int) ReadRawVarint32();
-        }
-
-        /// <summary>
-        /// Reads a fixed64 field from the stream.
-        /// </summary>
-        public ulong ReadFixed64()
-        {
-            return ReadRawLittleEndian64();
-        }
-
-        /// <summary>
-        /// Reads a fixed32 field from the stream.
-        /// </summary>
-        public uint ReadFixed32()
-        {
-            return ReadRawLittleEndian32();
-        }
-
-        /// <summary>
-        /// Reads a bool field from the stream.
-        /// </summary>
-        public bool ReadBool()
-        {
-            return ReadRawVarint32() != 0;
-        }
-
-        /// <summary>
-        /// Reads a string field from the stream.
-        /// </summary>
-        public string ReadString()
-        {
-            int length = ReadLength();
-            // No need to read any data for an empty string.
-            if (length == 0)
-            {
-                return "";
-            }
-            if (length <= bufferSize - bufferPos)
-            {
-                // Fast path:  We already have the bytes in a contiguous buffer, so
-                //   just copy directly from it.
-                String result = CodedOutputStream.Utf8Encoding.GetString(buffer, bufferPos, length);
-                bufferPos += length;
-                return result;
-            }
-            // Slow path: Build a byte array first then copy it.
-            return CodedOutputStream.Utf8Encoding.GetString(ReadRawBytes(length), 0, length);
-        }
-
-        /// <summary>
-        /// Reads an embedded message field value from the stream.
-        /// </summary>   
-        public void ReadMessage(IMessage builder)
-        {
-            int length = ReadLength();
-            if (recursionDepth >= recursionLimit)
-            {
-                throw InvalidProtocolBufferException.RecursionLimitExceeded();
-            }
-            int oldLimit = PushLimit(length);
-            ++recursionDepth;
-            builder.MergeFrom(this);
-            CheckReadEndOfStreamTag();
-            // Check that we've read exactly as much data as expected.
-            if (!ReachedLimit)
-            {
-                throw InvalidProtocolBufferException.TruncatedMessage();
-            }
-            --recursionDepth;
-            PopLimit(oldLimit);
-        }
-
-        /// <summary>
-        /// Reads a bytes field value from the stream.
-        /// </summary>   
-        public ByteString ReadBytes()
-        {
-            int length = ReadLength();
-            if (length <= bufferSize - bufferPos && length > 0)
-            {
-                // Fast path:  We already have the bytes in a contiguous buffer, so
-                //   just copy directly from it.
-                ByteString result = ByteString.CopyFrom(buffer, bufferPos, length);
-                bufferPos += length;
-                return result;
-            }
-            else
-            {
-                // Slow path:  Build a byte array and attach it to a new ByteString.
-                return ByteString.AttachBytes(ReadRawBytes(length));
-            }
-        }
-
-        /// <summary>
-        /// Reads a uint32 field value from the stream.
-        /// </summary>   
-        public uint ReadUInt32()
-        {
-            return ReadRawVarint32();
-        }
-
-        /// <summary>
-        /// Reads an enum field value from the stream.
-        /// </summary>   
-        public int ReadEnum()
-        {
-            // Currently just a pass-through, but it's nice to separate it logically from WriteInt32.
-            return (int) ReadRawVarint32();
-        }
-
-        /// <summary>
-        /// Reads an sfixed32 field value from the stream.
-        /// </summary>   
-        public int ReadSFixed32()
-        {
-            return (int) ReadRawLittleEndian32();
-        }
-
-        /// <summary>
-        /// Reads an sfixed64 field value from the stream.
-        /// </summary>   
-        public long ReadSFixed64()
-        {
-            return (long) ReadRawLittleEndian64();
-        }
-
-        /// <summary>
-        /// Reads an sint32 field value from the stream.
-        /// </summary>   
-        public int ReadSInt32()
-        {
-            return DecodeZigZag32(ReadRawVarint32());
-        }
-
-        /// <summary>
-        /// Reads an sint64 field value from the stream.
-        /// </summary>   
-        public long ReadSInt64()
-        {
-            return DecodeZigZag64(ReadRawVarint64());
-        }
-
-        /// <summary>
-        /// Reads a length for length-delimited data.
-        /// </summary>
-        /// <remarks>
-        /// This is internally just reading a varint, but this method exists
-        /// to make the calling code clearer.
-        /// </remarks>
-        public int ReadLength()
-        {
-            return (int) ReadRawVarint32();
-        }
-
-        /// <summary>
-        /// Peeks at the next tag in the stream. If it matches <paramref name="tag"/>,
-        /// the tag is consumed and the method returns <c>true</c>; otherwise, the
-        /// stream is left in the original position and the method returns <c>false</c>.
-        /// </summary>
-        public bool MaybeConsumeTag(uint tag)
-        {
-            if (PeekTag() == tag)
-            {
-                hasNextTag = false;
-                return true;
-            }
-            return false;
-        }
-
-        #endregion
-
-        #region Underlying reading primitives
-
-        /// <summary>
-        /// Same code as ReadRawVarint32, but read each byte individually, checking for
-        /// buffer overflow.
-        /// </summary>
-        private uint SlowReadRawVarint32()
-        {
-            int tmp = ReadRawByte();
-            if (tmp < 128)
-            {
-                return (uint) tmp;
-            }
-            int result = tmp & 0x7f;
-            if ((tmp = ReadRawByte()) < 128)
-            {
-                result |= tmp << 7;
-            }
-            else
-            {
-                result |= (tmp & 0x7f) << 7;
-                if ((tmp = ReadRawByte()) < 128)
-                {
-                    result |= tmp << 14;
-                }
-                else
-                {
-                    result |= (tmp & 0x7f) << 14;
-                    if ((tmp = ReadRawByte()) < 128)
-                    {
-                        result |= tmp << 21;
-                    }
-                    else
-                    {
-                        result |= (tmp & 0x7f) << 21;
-                        result |= (tmp = ReadRawByte()) << 28;
-                        if (tmp >= 128)
-                        {
-                            // Discard upper 32 bits.
-                            for (int i = 0; i < 5; i++)
-                            {
-                                if (ReadRawByte() < 128)
-                                {
-                                    return (uint) result;
-                                }
-                            }
-                            throw InvalidProtocolBufferException.MalformedVarint();
-                        }
-                    }
-                }
-            }
-            return (uint) result;
-        }
-
-        /// <summary>
-        /// Reads a raw Varint from the stream.  If larger than 32 bits, discard the upper bits.
-        /// This method is optimised for the case where we've got lots of data in the buffer.
-        /// That means we can check the size just once, then just read directly from the buffer
-        /// without constant rechecking of the buffer length.
-        /// </summary>
-        internal uint ReadRawVarint32()
-        {
-            if (bufferPos + 5 > bufferSize)
-            {
-                return SlowReadRawVarint32();
-            }
-
-            int tmp = buffer[bufferPos++];
-            if (tmp < 128)
-            {
-                return (uint) tmp;
-            }
-            int result = tmp & 0x7f;
-            if ((tmp = buffer[bufferPos++]) < 128)
-            {
-                result |= tmp << 7;
-            }
-            else
-            {
-                result |= (tmp & 0x7f) << 7;
-                if ((tmp = buffer[bufferPos++]) < 128)
-                {
-                    result |= tmp << 14;
-                }
-                else
-                {
-                    result |= (tmp & 0x7f) << 14;
-                    if ((tmp = buffer[bufferPos++]) < 128)
-                    {
-                        result |= tmp << 21;
-                    }
-                    else
-                    {
-                        result |= (tmp & 0x7f) << 21;
-                        result |= (tmp = buffer[bufferPos++]) << 28;
-                        if (tmp >= 128)
-                        {
-                            // Discard upper 32 bits.
-                            // Note that this has to use ReadRawByte() as we only ensure we've
-                            // got at least 5 bytes at the start of the method. This lets us
-                            // use the fast path in more cases, and we rarely hit this section of code.
-                            for (int i = 0; i < 5; i++)
-                            {
-                                if (ReadRawByte() < 128)
-                                {
-                                    return (uint) result;
-                                }
-                            }
-                            throw InvalidProtocolBufferException.MalformedVarint();
-                        }
-                    }
-                }
-            }
-            return (uint) result;
-        }
-
-        /// <summary>
-        /// Reads a varint from the input one byte at a time, so that it does not
-        /// read any bytes after the end of the varint. If you simply wrapped the
-        /// stream in a CodedInputStream and used ReadRawVarint32(Stream)
-        /// then you would probably end up reading past the end of the varint since
-        /// CodedInputStream buffers its input.
-        /// </summary>
-        /// <param name="input"></param>
-        /// <returns></returns>
-        internal static uint ReadRawVarint32(Stream input)
-        {
-            int result = 0;
-            int offset = 0;
-            for (; offset < 32; offset += 7)
-            {
-                int b = input.ReadByte();
-                if (b == -1)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                result |= (b & 0x7f) << offset;
-                if ((b & 0x80) == 0)
-                {
-                    return (uint) result;
-                }
-            }
-            // Keep reading up to 64 bits.
-            for (; offset < 64; offset += 7)
-            {
-                int b = input.ReadByte();
-                if (b == -1)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                if ((b & 0x80) == 0)
-                {
-                    return (uint) result;
-                }
-            }
-            throw InvalidProtocolBufferException.MalformedVarint();
-        }
-
-        /// <summary>
-        /// Reads a raw varint from the stream.
-        /// </summary>
-        internal ulong ReadRawVarint64()
-        {
-            int shift = 0;
-            ulong result = 0;
-            while (shift < 64)
-            {
-                byte b = ReadRawByte();
-                result |= (ulong) (b & 0x7F) << shift;
-                if ((b & 0x80) == 0)
-                {
-                    return result;
-                }
-                shift += 7;
-            }
-            throw InvalidProtocolBufferException.MalformedVarint();
-        }
-
-        /// <summary>
-        /// Reads a 32-bit little-endian integer from the stream.
-        /// </summary>
-        internal uint ReadRawLittleEndian32()
-        {
-            uint b1 = ReadRawByte();
-            uint b2 = ReadRawByte();
-            uint b3 = ReadRawByte();
-            uint b4 = ReadRawByte();
-            return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24);
-        }
-
-        /// <summary>
-        /// Reads a 64-bit little-endian integer from the stream.
-        /// </summary>
-        internal ulong ReadRawLittleEndian64()
-        {
-            ulong b1 = ReadRawByte();
-            ulong b2 = ReadRawByte();
-            ulong b3 = ReadRawByte();
-            ulong b4 = ReadRawByte();
-            ulong b5 = ReadRawByte();
-            ulong b6 = ReadRawByte();
-            ulong b7 = ReadRawByte();
-            ulong b8 = ReadRawByte();
-            return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24)
-                   | (b5 << 32) | (b6 << 40) | (b7 << 48) | (b8 << 56);
-        }
-
-        /// <summary>
-        /// Decode a 32-bit value with ZigZag encoding.
-        /// </summary>
-        /// <remarks>
-        /// ZigZag encodes signed integers into values that can be efficiently
-        /// encoded with varint.  (Otherwise, negative values must be 
-        /// sign-extended to 64 bits to be varint encoded, thus always taking
-        /// 10 bytes on the wire.)
-        /// </remarks>
-        internal static int DecodeZigZag32(uint n)
-        {
-            return (int)(n >> 1) ^ -(int)(n & 1);
-        }
-
-        /// <summary>
-        /// Decode a 32-bit value with ZigZag encoding.
-        /// </summary>
-        /// <remarks>
-        /// ZigZag encodes signed integers into values that can be efficiently
-        /// encoded with varint.  (Otherwise, negative values must be 
-        /// sign-extended to 64 bits to be varint encoded, thus always taking
-        /// 10 bytes on the wire.)
-        /// </remarks>
-        internal static long DecodeZigZag64(ulong n)
-        {
-            return (long)(n >> 1) ^ -(long)(n & 1);
-        }
-        #endregion
-
-        #region Internal reading and buffer management
-
-        /// <summary>
-        /// Sets currentLimit to (current position) + byteLimit. This is called
-        /// when descending into a length-delimited embedded message. The previous
-        /// limit is returned.
-        /// </summary>
-        /// <returns>The old limit.</returns>
-        internal int PushLimit(int byteLimit)
-        {
-            if (byteLimit < 0)
-            {
-                throw InvalidProtocolBufferException.NegativeSize();
-            }
-            byteLimit += totalBytesRetired + bufferPos;
-            int oldLimit = currentLimit;
-            if (byteLimit > oldLimit)
-            {
-                throw InvalidProtocolBufferException.TruncatedMessage();
-            }
-            currentLimit = byteLimit;
-
-            RecomputeBufferSizeAfterLimit();
-
-            return oldLimit;
-        }
-
-        private void RecomputeBufferSizeAfterLimit()
-        {
-            bufferSize += bufferSizeAfterLimit;
-            int bufferEnd = totalBytesRetired + bufferSize;
-            if (bufferEnd > currentLimit)
-            {
-                // Limit is in current buffer.
-                bufferSizeAfterLimit = bufferEnd - currentLimit;
-                bufferSize -= bufferSizeAfterLimit;
-            }
-            else
-            {
-                bufferSizeAfterLimit = 0;
-            }
-        }
-
-        /// <summary>
-        /// Discards the current limit, returning the previous limit.
-        /// </summary>
-        internal void PopLimit(int oldLimit)
-        {
-            currentLimit = oldLimit;
-            RecomputeBufferSizeAfterLimit();
-        }
-
-        /// <summary>
-        /// Returns whether or not all the data before the limit has been read.
-        /// </summary>
-        /// <returns></returns>
-        internal bool ReachedLimit
-        {
-            get
-            {
-                if (currentLimit == int.MaxValue)
-                {
-                    return false;
-                }
-                int currentAbsolutePosition = totalBytesRetired + bufferPos;
-                return currentAbsolutePosition >= currentLimit;
-            }
-        }
-
-        /// <summary>
-        /// Returns true if the stream has reached the end of the input. This is the
-        /// case if either the end of the underlying input source has been reached or
-        /// the stream has reached a limit created using PushLimit.
-        /// </summary>
-        public bool IsAtEnd
-        {
-            get { return bufferPos == bufferSize && !RefillBuffer(false); }
-        }
-
-        /// <summary>
-        /// Called when buffer is empty to read more bytes from the
-        /// input.  If <paramref name="mustSucceed"/> is true, RefillBuffer() gurantees that
-        /// either there will be at least one byte in the buffer when it returns
-        /// or it will throw an exception.  If <paramref name="mustSucceed"/> is false,
-        /// RefillBuffer() returns false if no more bytes were available.
-        /// </summary>
-        /// <param name="mustSucceed"></param>
-        /// <returns></returns>
-        private bool RefillBuffer(bool mustSucceed)
-        {
-            if (bufferPos < bufferSize)
-            {
-                throw new InvalidOperationException("RefillBuffer() called when buffer wasn't empty.");
-            }
-
-            if (totalBytesRetired + bufferSize == currentLimit)
-            {
-                // Oops, we hit a limit.
-                if (mustSucceed)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                else
-                {
-                    return false;
-                }
-            }
-
-            totalBytesRetired += bufferSize;
-
-            bufferPos = 0;
-            bufferSize = (input == null) ? 0 : input.Read(buffer, 0, buffer.Length);
-            if (bufferSize < 0)
-            {
-                throw new InvalidOperationException("Stream.Read returned a negative count");
-            }
-            if (bufferSize == 0)
-            {
-                if (mustSucceed)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                else
-                {
-                    return false;
-                }
-            }
-            else
-            {
-                RecomputeBufferSizeAfterLimit();
-                int totalBytesRead =
-                    totalBytesRetired + bufferSize + bufferSizeAfterLimit;
-                if (totalBytesRead > sizeLimit || totalBytesRead < 0)
-                {
-                    throw InvalidProtocolBufferException.SizeLimitExceeded();
-                }
-                return true;
-            }
-        }
-
-        /// <summary>
-        /// Read one byte from the input.
-        /// </summary>
-        /// <exception cref="InvalidProtocolBufferException">
-        /// the end of the stream or the current limit was reached
-        /// </exception>
-        internal byte ReadRawByte()
-        {
-            if (bufferPos == bufferSize)
-            {
-                RefillBuffer(true);
-            }
-            return buffer[bufferPos++];
-        }
-
-        /// <summary>
-        /// Reads a fixed size of bytes from the input.
-        /// </summary>
-        /// <exception cref="InvalidProtocolBufferException">
-        /// the end of the stream or the current limit was reached
-        /// </exception>
-        internal byte[] ReadRawBytes(int size)
-        {
-            if (size < 0)
-            {
-                throw InvalidProtocolBufferException.NegativeSize();
-            }
-
-            if (totalBytesRetired + bufferPos + size > currentLimit)
-            {
-                // Read to the end of the stream (up to the current limit) anyway.
-                SkipRawBytes(currentLimit - totalBytesRetired - bufferPos);
-                // Then fail.
-                throw InvalidProtocolBufferException.TruncatedMessage();
-            }
-
-            if (size <= bufferSize - bufferPos)
-            {
-                // We have all the bytes we need already.
-                byte[] bytes = new byte[size];
-                ByteArray.Copy(buffer, bufferPos, bytes, 0, size);
-                bufferPos += size;
-                return bytes;
-            }
-            else if (size < buffer.Length)
-            {
-                // Reading more bytes than are in the buffer, but not an excessive number
-                // of bytes.  We can safely allocate the resulting array ahead of time.
-
-                // First copy what we have.
-                byte[] bytes = new byte[size];
-                int pos = bufferSize - bufferPos;
-                ByteArray.Copy(buffer, bufferPos, bytes, 0, pos);
-                bufferPos = bufferSize;
-
-                // We want to use RefillBuffer() and then copy from the buffer into our
-                // byte array rather than reading directly into our byte array because
-                // the input may be unbuffered.
-                RefillBuffer(true);
-
-                while (size - pos > bufferSize)
-                {
-                    Buffer.BlockCopy(buffer, 0, bytes, pos, bufferSize);
-                    pos += bufferSize;
-                    bufferPos = bufferSize;
-                    RefillBuffer(true);
-                }
-
-                ByteArray.Copy(buffer, 0, bytes, pos, size - pos);
-                bufferPos = size - pos;
-
-                return bytes;
-            }
-            else
-            {
-                // The size is very large.  For security reasons, we can't allocate the
-                // entire byte array yet.  The size comes directly from the input, so a
-                // maliciously-crafted message could provide a bogus very large size in
-                // order to trick the app into allocating a lot of memory.  We avoid this
-                // by allocating and reading only a small chunk at a time, so that the
-                // malicious message must actually *be* extremely large to cause
-                // problems.  Meanwhile, we limit the allowed size of a message elsewhere.
-
-                // Remember the buffer markers since we'll have to copy the bytes out of
-                // it later.
-                int originalBufferPos = bufferPos;
-                int originalBufferSize = bufferSize;
-
-                // Mark the current buffer consumed.
-                totalBytesRetired += bufferSize;
-                bufferPos = 0;
-                bufferSize = 0;
-
-                // Read all the rest of the bytes we need.
-                int sizeLeft = size - (originalBufferSize - originalBufferPos);
-                List<byte[]> chunks = new List<byte[]>();
-
-                while (sizeLeft > 0)
-                {
-                    byte[] chunk = new byte[Math.Min(sizeLeft, buffer.Length)];
-                    int pos = 0;
-                    while (pos < chunk.Length)
-                    {
-                        int n = (input == null) ? -1 : input.Read(chunk, pos, chunk.Length - pos);
-                        if (n <= 0)
-                        {
-                            throw InvalidProtocolBufferException.TruncatedMessage();
-                        }
-                        totalBytesRetired += n;
-                        pos += n;
-                    }
-                    sizeLeft -= chunk.Length;
-                    chunks.Add(chunk);
-                }
-
-                // OK, got everything.  Now concatenate it all into one buffer.
-                byte[] bytes = new byte[size];
-
-                // Start by copying the leftover bytes from this.buffer.
-                int newPos = originalBufferSize - originalBufferPos;
-                ByteArray.Copy(buffer, originalBufferPos, bytes, 0, newPos);
-
-                // And now all the chunks.
-                foreach (byte[] chunk in chunks)
-                {
-                    Buffer.BlockCopy(chunk, 0, bytes, newPos, chunk.Length);
-                    newPos += chunk.Length;
-                }
-
-                // Done.
-                return bytes;
-            }
-        }
-
-        /// <summary>
-        /// Reads and discards <paramref name="size"/> bytes.
-        /// </summary>
-        /// <exception cref="InvalidProtocolBufferException">the end of the stream
-        /// or the current limit was reached</exception>
-        private void SkipRawBytes(int size)
-        {
-            if (size < 0)
-            {
-                throw InvalidProtocolBufferException.NegativeSize();
-            }
-
-            if (totalBytesRetired + bufferPos + size > currentLimit)
-            {
-                // Read to the end of the stream anyway.
-                SkipRawBytes(currentLimit - totalBytesRetired - bufferPos);
-                // Then fail.
-                throw InvalidProtocolBufferException.TruncatedMessage();
-            }
-
-            if (size <= bufferSize - bufferPos)
-            {
-                // We have all the bytes we need already.
-                bufferPos += size;
-            }
-            else
-            {
-                // Skipping more bytes than are in the buffer.  First skip what we have.
-                int pos = bufferSize - bufferPos;
-
-                // ROK 5/7/2013 Issue #54: should retire all bytes in buffer (bufferSize)
-                // totalBytesRetired += pos;
-                totalBytesRetired += bufferSize;
-                
-                bufferPos = 0;
-                bufferSize = 0;
-
-                // Then skip directly from the InputStream for the rest.
-                if (pos < size)
-                {
-                    if (input == null)
-                    {
-                        throw InvalidProtocolBufferException.TruncatedMessage();
-                    }
-                    SkipImpl(size - pos);
-                    totalBytesRetired += size - pos;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Abstraction of skipping to cope with streams which can't really skip.
-        /// </summary>
-        private void SkipImpl(int amountToSkip)
-        {
-            if (input.CanSeek)
-            {
-                long previousPosition = input.Position;
-                input.Position += amountToSkip;
-                if (input.Position != previousPosition + amountToSkip)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-            }
-            else
-            {
-                byte[] skipBuffer = new byte[Math.Min(1024, amountToSkip)];
-                while (amountToSkip > 0)
-                {
-                    int bytesRead = input.Read(skipBuffer, 0, Math.Min(skipBuffer.Length, amountToSkip));
-                    if (bytesRead <= 0)
-                    {
-                        throw InvalidProtocolBufferException.TruncatedMessage();
-                    }
-                    amountToSkip -= bytesRead;
-                }
-            }
-        }
-
-        #endregion
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/CodedInputStream.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 1df2eb703cafa984fa2b4ea1d596b0cd
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 304
Server/ThirdParty/Google.Protobuf/CodedOutputStream.ComputeSize.cs

@@ -1,304 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-
-namespace Google.Protobuf
-{
-    // This part of CodedOutputStream provides all the static entry points that are used
-    // by generated code and internally to compute the size of messages prior to being
-    // written to an instance of CodedOutputStream.
-    public sealed partial class CodedOutputStream
-    {
-        private const int LittleEndian64Size = 8;
-        private const int LittleEndian32Size = 4;        
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// double field, including the tag.
-        /// </summary>
-        public static int ComputeDoubleSize(double value)
-        {
-            return LittleEndian64Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// float field, including the tag.
-        /// </summary>
-        public static int ComputeFloatSize(float value)
-        {
-            return LittleEndian32Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// uint64 field, including the tag.
-        /// </summary>
-        public static int ComputeUInt64Size(ulong value)
-        {
-            return ComputeRawVarint64Size(value);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// int64 field, including the tag.
-        /// </summary>
-        public static int ComputeInt64Size(long value)
-        {
-            return ComputeRawVarint64Size((ulong) value);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// int32 field, including the tag.
-        /// </summary>
-        public static int ComputeInt32Size(int value)
-        {
-            if (value >= 0)
-            {
-                return ComputeRawVarint32Size((uint) value);
-            }
-            else
-            {
-                // Must sign-extend.
-                return 10;
-            }
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// fixed64 field, including the tag.
-        /// </summary>
-        public static int ComputeFixed64Size(ulong value)
-        {
-            return LittleEndian64Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// fixed32 field, including the tag.
-        /// </summary>
-        public static int ComputeFixed32Size(uint value)
-        {
-            return LittleEndian32Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// bool field, including the tag.
-        /// </summary>
-        public static int ComputeBoolSize(bool value)
-        {
-            return 1;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// string field, including the tag.
-        /// </summary>
-        public static int ComputeStringSize(String value)
-        {
-            int byteArraySize = Utf8Encoding.GetByteCount(value);
-            return ComputeLengthSize(byteArraySize) + byteArraySize;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// group field, including the tag.
-        /// </summary>
-        public static int ComputeGroupSize(IMessage value)
-        {
-            return value.CalculateSize();
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// embedded message field, including the tag.
-        /// </summary>
-        public static int ComputeMessageSize(IMessage value)
-        {
-            int size = value.CalculateSize();
-            return ComputeLengthSize(size) + size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// bytes field, including the tag.
-        /// </summary>
-        public static int ComputeBytesSize(ByteString value)
-        {
-            return ComputeLengthSize(value.Length) + value.Length;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// uint32 field, including the tag.
-        /// </summary>
-        public static int ComputeUInt32Size(uint value)
-        {
-            return ComputeRawVarint32Size(value);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// enum field, including the tag. The caller is responsible for
-        /// converting the enum value to its numeric value.
-        /// </summary>
-        public static int ComputeEnumSize(int value)
-        {
-            // Currently just a pass-through, but it's nice to separate it logically.
-            return ComputeInt32Size(value);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// sfixed32 field, including the tag.
-        /// </summary>
-        public static int ComputeSFixed32Size(int value)
-        {
-            return LittleEndian32Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// sfixed64 field, including the tag.
-        /// </summary>
-        public static int ComputeSFixed64Size(long value)
-        {
-            return LittleEndian64Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// sint32 field, including the tag.
-        /// </summary>
-        public static int ComputeSInt32Size(int value)
-        {
-            return ComputeRawVarint32Size(EncodeZigZag32(value));
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// sint64 field, including the tag.
-        /// </summary>
-        public static int ComputeSInt64Size(long value)
-        {
-            return ComputeRawVarint64Size(EncodeZigZag64(value));
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a length,
-        /// as written by <see cref="WriteLength"/>.
-        /// </summary>
-        public static int ComputeLengthSize(int length)
-        {
-            return ComputeRawVarint32Size((uint) length);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a varint.
-        /// </summary>
-        public static int ComputeRawVarint32Size(uint value)
-        {
-            if ((value & (0xffffffff << 7)) == 0)
-            {
-                return 1;
-            }
-            if ((value & (0xffffffff << 14)) == 0)
-            {
-                return 2;
-            }
-            if ((value & (0xffffffff << 21)) == 0)
-            {
-                return 3;
-            }
-            if ((value & (0xffffffff << 28)) == 0)
-            {
-                return 4;
-            }
-            return 5;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a varint.
-        /// </summary>
-        public static int ComputeRawVarint64Size(ulong value)
-        {
-            if ((value & (0xffffffffffffffffL << 7)) == 0)
-            {
-                return 1;
-            }
-            if ((value & (0xffffffffffffffffL << 14)) == 0)
-            {
-                return 2;
-            }
-            if ((value & (0xffffffffffffffffL << 21)) == 0)
-            {
-                return 3;
-            }
-            if ((value & (0xffffffffffffffffL << 28)) == 0)
-            {
-                return 4;
-            }
-            if ((value & (0xffffffffffffffffL << 35)) == 0)
-            {
-                return 5;
-            }
-            if ((value & (0xffffffffffffffffL << 42)) == 0)
-            {
-                return 6;
-            }
-            if ((value & (0xffffffffffffffffL << 49)) == 0)
-            {
-                return 7;
-            }
-            if ((value & (0xffffffffffffffffL << 56)) == 0)
-            {
-                return 8;
-            }
-            if ((value & (0xffffffffffffffffL << 63)) == 0)
-            {
-                return 9;
-            }
-            return 10;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a tag.
-        /// </summary>
-        public static int ComputeTagSize(int fieldNumber)
-        {
-            return ComputeRawVarint32Size(WireFormat.MakeTag(fieldNumber, 0));
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/CodedOutputStream.ComputeSize.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: c94acc4c66cb8e14ca00789b21ef4dde
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 770
Server/ThirdParty/Google.Protobuf/CodedOutputStream.cs

@@ -1,770 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using Google.Protobuf.Collections;
-using System;
-using System.IO;
-using System.Text;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Encodes and writes protocol message fields.
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// This class is generally used by generated code to write appropriate
-    /// primitives to the stream. It effectively encapsulates the lowest
-    /// levels of protocol buffer format. Unlike some other implementations,
-    /// this does not include combined "write tag and value" methods. Generated
-    /// code knows the exact byte representations of the tags they're going to write,
-    /// so there's no need to re-encode them each time. Manually-written code calling
-    /// this class should just call one of the <c>WriteTag</c> overloads before each value.
-    /// </para>
-    /// <para>
-    /// Repeated fields and map fields are not handled by this class; use <c>RepeatedField&lt;T&gt;</c>
-    /// and <c>MapField&lt;TKey, TValue&gt;</c> to serialize such fields.
-    /// </para>
-    /// </remarks>
-    public sealed partial class CodedOutputStream : IDisposable
-    {
-        // "Local" copy of Encoding.UTF8, for efficiency. (Yes, it makes a difference.)
-        internal static readonly Encoding Utf8Encoding = Encoding.UTF8;
-
-        /// <summary>
-        /// The buffer size used by CreateInstance(Stream).
-        /// </summary>
-        public static readonly int DefaultBufferSize = 4096;
-
-        private bool leaveOpen;
-        private byte[] buffer;
-        private int limit;
-        private int position;
-        private Stream output;
-
-        #region Construction
-        /// <summary>
-        /// Creates a new CodedOutputStream that writes directly to the given
-        /// byte array. If more bytes are written than fit in the array,
-        /// OutOfSpaceException will be thrown.
-        /// </summary>
-        public CodedOutputStream(byte[] flatArray) : this(flatArray, 0, flatArray.Length)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new CodedOutputStream that writes directly to the given
-        /// byte array slice. If more bytes are written than fit in the array,
-        /// OutOfSpaceException will be thrown.
-        /// </summary>
-        private CodedOutputStream(byte[] buffer, int offset, int length)
-        {
-            this.output = null;
-            this.buffer = buffer;
-            this.position = offset;
-            this.limit = offset + length;
-            leaveOpen = true; // Simple way of avoiding trying to dispose of a null reference
-        }
-        
-        public void Reset(byte[] buf, int offset, int length)
-        {
-            this.output = null;
-            this.buffer = buf;
-            this.position = offset;
-            this.limit = offset + length;
-            leaveOpen = true; // Simple way of avoiding trying to dispose of a null reference
-        }
-
-        private CodedOutputStream(Stream output, byte[] buffer, bool leaveOpen)
-        {
-            this.output = ProtoPreconditions.CheckNotNull(output, "output");
-            this.buffer = buffer;
-            this.position = 0;
-            this.limit = buffer.Length;
-            this.leaveOpen = leaveOpen;
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="CodedOutputStream" /> which write to the given stream, and disposes of that
-        /// stream when the returned <c>CodedOutputStream</c> is disposed.
-        /// </summary>
-        /// <param name="output">The stream to write to. It will be disposed when the returned <c>CodedOutputStream is disposed.</c></param>
-        public CodedOutputStream(Stream output) : this(output, DefaultBufferSize, false)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new CodedOutputStream which write to the given stream and uses
-        /// the specified buffer size.
-        /// </summary>
-        /// <param name="output">The stream to write to. It will be disposed when the returned <c>CodedOutputStream is disposed.</c></param>
-        /// <param name="bufferSize">The size of buffer to use internally.</param>
-        public CodedOutputStream(Stream output, int bufferSize) : this(output, new byte[bufferSize], false)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new CodedOutputStream which write to the given stream.
-        /// </summary>
-        /// <param name="output">The stream to write to.</param>
-        /// <param name="leaveOpen">If <c>true</c>, <paramref name="output"/> is left open when the returned <c>CodedOutputStream</c> is disposed;
-        /// if <c>false</c>, the provided stream is disposed as well.</param>
-        public CodedOutputStream(Stream output, bool leaveOpen) : this(output, DefaultBufferSize, leaveOpen)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new CodedOutputStream which write to the given stream and uses
-        /// the specified buffer size.
-        /// </summary>
-        /// <param name="output">The stream to write to.</param>
-        /// <param name="bufferSize">The size of buffer to use internally.</param>
-        /// <param name="leaveOpen">If <c>true</c>, <paramref name="output"/> is left open when the returned <c>CodedOutputStream</c> is disposed;
-        /// if <c>false</c>, the provided stream is disposed as well.</param>
-        public CodedOutputStream(Stream output, int bufferSize, bool leaveOpen) : this(output, new byte[bufferSize], leaveOpen)
-        {
-        }
-        #endregion
-
-        /// <summary>
-        /// Returns the current position in the stream, or the position in the output buffer
-        /// </summary>
-        public long Position
-        {
-            get
-            {
-                if (output != null)
-                {
-                    return output.Position + position;
-                }
-                return position;
-            }
-        }
-
-        #region Writing of values (not including tags)
-
-        /// <summary>
-        /// Writes a double field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteDouble(double value)
-        {
-            WriteRawLittleEndian64((ulong)BitConverter.DoubleToInt64Bits(value));
-        }
-
-        /// <summary>
-        /// Writes a float field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteFloat(float value)
-        {
-            byte[] rawBytes = BitConverter.GetBytes(value);
-            if (!BitConverter.IsLittleEndian)
-            {
-                ByteArray.Reverse(rawBytes);
-            }
-
-            if (limit - position >= 4)
-            {
-                buffer[position++] = rawBytes[0];
-                buffer[position++] = rawBytes[1];
-                buffer[position++] = rawBytes[2];
-                buffer[position++] = rawBytes[3];
-            }
-            else
-            {
-                WriteRawBytes(rawBytes, 0, 4);
-            }
-        }
-
-        /// <summary>
-        /// Writes a uint64 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteUInt64(ulong value)
-        {
-            WriteRawVarint64(value);
-        }
-
-        /// <summary>
-        /// Writes an int64 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteInt64(long value)
-        {
-            WriteRawVarint64((ulong) value);
-        }
-
-        /// <summary>
-        /// Writes an int32 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteInt32(int value)
-        {
-            if (value >= 0)
-            {
-                WriteRawVarint32((uint) value);
-            }
-            else
-            {
-                // Must sign-extend.
-                WriteRawVarint64((ulong) value);
-            }
-        }
-
-        /// <summary>
-        /// Writes a fixed64 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteFixed64(ulong value)
-        {
-            WriteRawLittleEndian64(value);
-        }
-
-        /// <summary>
-        /// Writes a fixed32 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteFixed32(uint value)
-        {
-            WriteRawLittleEndian32(value);
-        }
-
-        /// <summary>
-        /// Writes a bool field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteBool(bool value)
-        {
-            WriteRawByte(value ? (byte) 1 : (byte) 0);
-        }
-
-        /// <summary>
-        /// Writes a string field value, without a tag, to the stream.
-        /// The data is length-prefixed.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteString(string value)
-        {
-            // Optimise the case where we have enough space to write
-            // the string directly to the buffer, which should be common.
-            int length = Utf8Encoding.GetByteCount(value);
-            WriteLength(length);
-            if (limit - position >= length)
-            {
-                if (length == value.Length) // Must be all ASCII...
-                {
-                    for (int i = 0; i < length; i++)
-                    {
-                        buffer[position + i] = (byte)value[i];
-                    }
-                }
-                else
-                {
-                    Utf8Encoding.GetBytes(value, 0, value.Length, buffer, position);
-                }
-                position += length;
-            }
-            else
-            {
-                byte[] bytes = Utf8Encoding.GetBytes(value);
-                WriteRawBytes(bytes);
-            }
-        }
-
-        /// <summary>
-        /// Writes a message, without a tag, to the stream.
-        /// The data is length-prefixed.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteMessage(IMessage value)
-        {
-            WriteLength(value.CalculateSize());
-            value.WriteTo(this);
-        }
-
-        /// <summary>
-        /// Write a byte string, without a tag, to the stream.
-        /// The data is length-prefixed.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteBytes(ByteString value)
-        {
-            WriteLength(value.Length);
-            value.WriteRawBytesTo(this);
-        }
-
-        /// <summary>
-        /// Writes a uint32 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteUInt32(uint value)
-        {
-            WriteRawVarint32(value);
-        }
-
-        /// <summary>
-        /// Writes an enum value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteEnum(int value)
-        {
-            WriteInt32(value);
-        }
-
-        /// <summary>
-        /// Writes an sfixed32 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write.</param>
-        public void WriteSFixed32(int value)
-        {
-            WriteRawLittleEndian32((uint) value);
-        }
-
-        /// <summary>
-        /// Writes an sfixed64 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteSFixed64(long value)
-        {
-            WriteRawLittleEndian64((ulong) value);
-        }
-
-        /// <summary>
-        /// Writes an sint32 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteSInt32(int value)
-        {
-            WriteRawVarint32(EncodeZigZag32(value));
-        }
-
-        /// <summary>
-        /// Writes an sint64 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteSInt64(long value)
-        {
-            WriteRawVarint64(EncodeZigZag64(value));
-        }
-
-        /// <summary>
-        /// Writes a length (in bytes) for length-delimited data.
-        /// </summary>
-        /// <remarks>
-        /// This method simply writes a rawint, but exists for clarity in calling code.
-        /// </remarks>
-        /// <param name="length">Length value, in bytes.</param>
-        public void WriteLength(int length)
-        {
-            WriteRawVarint32((uint) length);
-        }
-
-        #endregion
-
-        #region Raw tag writing
-        /// <summary>
-        /// Encodes and writes a tag.
-        /// </summary>
-        /// <param name="fieldNumber">The number of the field to write the tag for</param>
-        /// <param name="type">The wire format type of the tag to write</param>
-        public void WriteTag(int fieldNumber, WireFormat.WireType type)
-        {
-            WriteRawVarint32(WireFormat.MakeTag(fieldNumber, type));
-        }
-
-        /// <summary>
-        /// Writes an already-encoded tag.
-        /// </summary>
-        /// <param name="tag">The encoded tag</param>
-        public void WriteTag(uint tag)
-        {
-            WriteRawVarint32(tag);
-        }
-
-        /// <summary>
-        /// Writes the given single-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The encoded tag</param>
-        public void WriteRawTag(byte b1)
-        {
-            WriteRawByte(b1);
-        }
-
-        /// <summary>
-        /// Writes the given two-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The first byte of the encoded tag</param>
-        /// <param name="b2">The second byte of the encoded tag</param>
-        public void WriteRawTag(byte b1, byte b2)
-        {
-            WriteRawByte(b1);
-            WriteRawByte(b2);
-        }
-
-        /// <summary>
-        /// Writes the given three-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The first byte of the encoded tag</param>
-        /// <param name="b2">The second byte of the encoded tag</param>
-        /// <param name="b3">The third byte of the encoded tag</param>
-        public void WriteRawTag(byte b1, byte b2, byte b3)
-        {
-            WriteRawByte(b1);
-            WriteRawByte(b2);
-            WriteRawByte(b3);
-        }
-
-        /// <summary>
-        /// Writes the given four-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The first byte of the encoded tag</param>
-        /// <param name="b2">The second byte of the encoded tag</param>
-        /// <param name="b3">The third byte of the encoded tag</param>
-        /// <param name="b4">The fourth byte of the encoded tag</param>
-        public void WriteRawTag(byte b1, byte b2, byte b3, byte b4)
-        {
-            WriteRawByte(b1);
-            WriteRawByte(b2);
-            WriteRawByte(b3);
-            WriteRawByte(b4);
-        }
-
-        /// <summary>
-        /// Writes the given five-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The first byte of the encoded tag</param>
-        /// <param name="b2">The second byte of the encoded tag</param>
-        /// <param name="b3">The third byte of the encoded tag</param>
-        /// <param name="b4">The fourth byte of the encoded tag</param>
-        /// <param name="b5">The fifth byte of the encoded tag</param>
-        public void WriteRawTag(byte b1, byte b2, byte b3, byte b4, byte b5)
-        {
-            WriteRawByte(b1);
-            WriteRawByte(b2);
-            WriteRawByte(b3);
-            WriteRawByte(b4);
-            WriteRawByte(b5);
-        }
-        #endregion
-
-        #region Underlying writing primitives
-        /// <summary>
-        /// Writes a 32 bit value as a varint. The fast route is taken when
-        /// there's enough buffer space left to whizz through without checking
-        /// for each byte; otherwise, we resort to calling WriteRawByte each time.
-        /// </summary>
-        internal void WriteRawVarint32(uint value)
-        {
-            // Optimize for the common case of a single byte value
-            if (value < 128 && position < limit)
-            {
-                buffer[position++] = (byte)value;
-                return;
-            }
-
-            while (value > 127 && position < limit)
-            {
-                buffer[position++] = (byte) ((value & 0x7F) | 0x80);
-                value >>= 7;
-            }
-            while (value > 127)
-            {
-                WriteRawByte((byte) ((value & 0x7F) | 0x80));
-                value >>= 7;
-            }
-            if (position < limit)
-            {
-                buffer[position++] = (byte) value;
-            }
-            else
-            {
-                WriteRawByte((byte) value);
-            }
-        }
-
-        internal void WriteRawVarint64(ulong value)
-        {
-            while (value > 127 && position < limit)
-            {
-                buffer[position++] = (byte) ((value & 0x7F) | 0x80);
-                value >>= 7;
-            }
-            while (value > 127)
-            {
-                WriteRawByte((byte) ((value & 0x7F) | 0x80));
-                value >>= 7;
-            }
-            if (position < limit)
-            {
-                buffer[position++] = (byte) value;
-            }
-            else
-            {
-                WriteRawByte((byte) value);
-            }
-        }
-
-        internal void WriteRawLittleEndian32(uint value)
-        {
-            if (position + 4 > limit)
-            {
-                WriteRawByte((byte) value);
-                WriteRawByte((byte) (value >> 8));
-                WriteRawByte((byte) (value >> 16));
-                WriteRawByte((byte) (value >> 24));
-            }
-            else
-            {
-                buffer[position++] = ((byte) value);
-                buffer[position++] = ((byte) (value >> 8));
-                buffer[position++] = ((byte) (value >> 16));
-                buffer[position++] = ((byte) (value >> 24));
-            }
-        }
-
-        internal void WriteRawLittleEndian64(ulong value)
-        {
-            if (position + 8 > limit)
-            {
-                WriteRawByte((byte) value);
-                WriteRawByte((byte) (value >> 8));
-                WriteRawByte((byte) (value >> 16));
-                WriteRawByte((byte) (value >> 24));
-                WriteRawByte((byte) (value >> 32));
-                WriteRawByte((byte) (value >> 40));
-                WriteRawByte((byte) (value >> 48));
-                WriteRawByte((byte) (value >> 56));
-            }
-            else
-            {
-                buffer[position++] = ((byte) value);
-                buffer[position++] = ((byte) (value >> 8));
-                buffer[position++] = ((byte) (value >> 16));
-                buffer[position++] = ((byte) (value >> 24));
-                buffer[position++] = ((byte) (value >> 32));
-                buffer[position++] = ((byte) (value >> 40));
-                buffer[position++] = ((byte) (value >> 48));
-                buffer[position++] = ((byte) (value >> 56));
-            }
-        }
-
-        internal void WriteRawByte(byte value)
-        {
-            if (position == limit)
-            {
-                RefreshBuffer();
-            }
-
-            buffer[position++] = value;
-        }
-
-        internal void WriteRawByte(uint value)
-        {
-            WriteRawByte((byte) value);
-        }
-
-        /// <summary>
-        /// Writes out an array of bytes.
-        /// </summary>
-        internal void WriteRawBytes(byte[] value)
-        {
-            WriteRawBytes(value, 0, value.Length);
-        }
-
-        /// <summary>
-        /// Writes out part of an array of bytes.
-        /// </summary>
-        internal void WriteRawBytes(byte[] value, int offset, int length)
-        {
-            if (limit - position >= length)
-            {
-                ByteArray.Copy(value, offset, buffer, position, length);
-                // We have room in the current buffer.
-                position += length;
-            }
-            else
-            {
-                // Write extends past current buffer.  Fill the rest of this buffer and
-                // flush.
-                int bytesWritten = limit - position;
-                ByteArray.Copy(value, offset, buffer, position, bytesWritten);
-                offset += bytesWritten;
-                length -= bytesWritten;
-                position = limit;
-                RefreshBuffer();
-
-                // Now deal with the rest.
-                // Since we have an output stream, this is our buffer
-                // and buffer offset == 0
-                if (length <= limit)
-                {
-                    // Fits in new buffer.
-                    ByteArray.Copy(value, offset, buffer, 0, length);
-                    position = length;
-                }
-                else
-                {
-                    // Write is very big.  Let's do it all at once.
-                    output.Write(value, offset, length);
-                }
-            }
-        }
-
-        #endregion
-
-        /// <summary>
-        /// Encode a 32-bit value with ZigZag encoding.
-        /// </summary>
-        /// <remarks>
-        /// ZigZag encodes signed integers into values that can be efficiently
-        /// encoded with varint.  (Otherwise, negative values must be 
-        /// sign-extended to 64 bits to be varint encoded, thus always taking
-        /// 10 bytes on the wire.)
-        /// </remarks>
-        internal static uint EncodeZigZag32(int n)
-        {
-            // Note:  the right-shift must be arithmetic
-            return (uint) ((n << 1) ^ (n >> 31));
-        }
-
-        /// <summary>
-        /// Encode a 64-bit value with ZigZag encoding.
-        /// </summary>
-        /// <remarks>
-        /// ZigZag encodes signed integers into values that can be efficiently
-        /// encoded with varint.  (Otherwise, negative values must be 
-        /// sign-extended to 64 bits to be varint encoded, thus always taking
-        /// 10 bytes on the wire.)
-        /// </remarks>
-        internal static ulong EncodeZigZag64(long n)
-        {
-            return (ulong) ((n << 1) ^ (n >> 63));
-        }
-
-        private void RefreshBuffer()
-        {
-            if (output == null)
-            {
-                // We're writing to a single buffer.
-                throw new OutOfSpaceException();
-            }
-
-            // Since we have an output stream, this is our buffer
-            // and buffer offset == 0
-            output.Write(buffer, 0, position);
-            position = 0;
-        }
-
-        /// <summary>
-        /// Indicates that a CodedOutputStream wrapping a flat byte array
-        /// ran out of space.
-        /// </summary>
-        public sealed class OutOfSpaceException : IOException
-        {
-            internal OutOfSpaceException()
-                : base("CodedOutputStream was writing to a flat byte array and ran out of space.")
-            {
-            }
-        }
-
-        /// <summary>
-        /// Flushes any buffered data and optionally closes the underlying stream, if any.
-        /// </summary>
-        /// <remarks>
-        /// <para>
-        /// By default, any underlying stream is closed by this method. To configure this behaviour,
-        /// use a constructor overload with a <c>leaveOpen</c> parameter. If this instance does not
-        /// have an underlying stream, this method does nothing.
-        /// </para>
-        /// <para>
-        /// For the sake of efficiency, calling this method does not prevent future write calls - but
-        /// if a later write ends up writing to a stream which has been disposed, that is likely to
-        /// fail. It is recommend that you not call any other methods after this.
-        /// </para>
-        /// </remarks>
-        public void Dispose()
-        {
-            Flush();
-            if (!leaveOpen)
-            {
-                output.Dispose();
-            }
-        }
-
-        /// <summary>
-        /// Flushes any buffered data to the underlying stream (if there is one).
-        /// </summary>
-        public void Flush()
-        {
-            if (output != null)
-            {
-                RefreshBuffer();
-            }
-        }
-
-        /// <summary>
-        /// Verifies that SpaceLeft returns zero. It's common to create a byte array
-        /// that is exactly big enough to hold a message, then write to it with
-        /// a CodedOutputStream. Calling CheckNoSpaceLeft after writing verifies that
-        /// the message was actually as big as expected, which can help bugs.
-        /// </summary>
-        public void CheckNoSpaceLeft()
-        {
-            if (SpaceLeft != 0)
-            {
-                throw new InvalidOperationException("Did not write as much data as expected.");
-            }
-        }
-
-        /// <summary>
-        /// If writing to a flat array, returns the space left in the array. Otherwise,
-        /// throws an InvalidOperationException.
-        /// </summary>
-        public int SpaceLeft
-        {
-            get
-            {
-                if (output == null)
-                {
-                    return limit - position;
-                }
-                else
-                {
-                    throw new InvalidOperationException(
-                        "SpaceLeft can only be called on CodedOutputStreams that are " +
-                        "writing to a flat array.");
-                }
-            }
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/CodedOutputStream.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: e4768e92c8082c14db86e6dd81843cf7
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 379
Server/ThirdParty/Google.Protobuf/FieldCodec.cs

@@ -1,379 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections.Generic;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Factory methods for <see cref="FieldCodec{T}"/>.
-    /// </summary>
-    public static class FieldCodec
-    {
-        // TODO: Avoid the "dual hit" of lambda expressions: create open delegates instead. (At least test...)
-
-        /// <summary>
-        /// Retrieves a codec suitable for a string field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<string> ForString(uint tag)
-        {
-            return new FieldCodec<string>(input => input.ReadString(), (output, value) => output.WriteString(value), CodedOutputStream.ComputeStringSize, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a bytes field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<ByteString> ForBytes(uint tag)
-        {
-            return new FieldCodec<ByteString>(input => input.ReadBytes(), (output, value) => output.WriteBytes(value), CodedOutputStream.ComputeBytesSize, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a bool field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<bool> ForBool(uint tag)
-        {
-            return new FieldCodec<bool>(input => input.ReadBool(), (output, value) => output.WriteBool(value), CodedOutputStream.ComputeBoolSize, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an int32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<int> ForInt32(uint tag)
-        {
-            return new FieldCodec<int>(input => input.ReadInt32(), (output, value) => output.WriteInt32(value), CodedOutputStream.ComputeInt32Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an sint32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<int> ForSInt32(uint tag)
-        {
-            return new FieldCodec<int>(input => input.ReadSInt32(), (output, value) => output.WriteSInt32(value), CodedOutputStream.ComputeSInt32Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a fixed32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<uint> ForFixed32(uint tag)
-        {
-            return new FieldCodec<uint>(input => input.ReadFixed32(), (output, value) => output.WriteFixed32(value), 4, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an sfixed32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<int> ForSFixed32(uint tag)
-        {
-            return new FieldCodec<int>(input => input.ReadSFixed32(), (output, value) => output.WriteSFixed32(value), 4, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a uint32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<uint> ForUInt32(uint tag)
-        {
-            return new FieldCodec<uint>(input => input.ReadUInt32(), (output, value) => output.WriteUInt32(value), CodedOutputStream.ComputeUInt32Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an int64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<long> ForInt64(uint tag)
-        {
-            return new FieldCodec<long>(input => input.ReadInt64(), (output, value) => output.WriteInt64(value), CodedOutputStream.ComputeInt64Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an sint64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<long> ForSInt64(uint tag)
-        {
-            return new FieldCodec<long>(input => input.ReadSInt64(), (output, value) => output.WriteSInt64(value), CodedOutputStream.ComputeSInt64Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a fixed64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<ulong> ForFixed64(uint tag)
-        {
-            return new FieldCodec<ulong>(input => input.ReadFixed64(), (output, value) => output.WriteFixed64(value), 8, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an sfixed64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<long> ForSFixed64(uint tag)
-        {
-            return new FieldCodec<long>(input => input.ReadSFixed64(), (output, value) => output.WriteSFixed64(value), 8, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a uint64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<ulong> ForUInt64(uint tag)
-        {
-            return new FieldCodec<ulong>(input => input.ReadUInt64(), (output, value) => output.WriteUInt64(value), CodedOutputStream.ComputeUInt64Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a float field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<float> ForFloat(uint tag)
-        {
-            return new FieldCodec<float>(input => input.ReadFloat(), (output, value) => output.WriteFloat(value), CodedOutputStream.ComputeFloatSize, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a double field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<double> ForDouble(uint tag)
-        {
-            return new FieldCodec<double>(input => input.ReadDouble(), (output, value) => output.WriteDouble(value), CodedOutputStream.ComputeDoubleSize, tag);
-        }
-
-        // Enums are tricky. We can probably use expression trees to build these delegates automatically,
-        // but it's easy to generate the code for it.
-
-        /// <summary>
-        /// Retrieves a codec suitable for an enum field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <param name="toInt32">A conversion function from <see cref="Int32"/> to the enum type.</param>
-        /// <param name="fromInt32">A conversion function from the enum type to <see cref="Int32"/>.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<T> ForEnum<T>(uint tag, Func<T, int> toInt32, Func<int, T> fromInt32)
-        {
-            return new FieldCodec<T>(input => fromInt32(
-                input.ReadEnum()),
-                (output, value) => output.WriteEnum(toInt32(value)),
-                value => CodedOutputStream.ComputeEnumSize(toInt32(value)), tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a message field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <param name="parser">A parser to use for the message type.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<T> ForMessage<T>(uint tag, MessageParser<T> parser) where T : IMessage
-        {
-            return new FieldCodec<T>(input => { T message = parser.CreateTemplate(); input.ReadMessage(message); return message; },
-                (output, value) => output.WriteMessage(value), message => CodedOutputStream.ComputeMessageSize(message), tag);
-        }
-    }
-
-    /// <summary>
-    /// <para>
-    /// An encode/decode pair for a single field. This effectively encapsulates
-    /// all the information needed to read or write the field value from/to a coded
-    /// stream.
-    /// </para>
-    /// <para>
-    /// This class is public and has to be as it is used by generated code, but its public
-    /// API is very limited - just what the generated code needs to call directly.
-    /// </para>
-    /// </summary>
-    /// <remarks>
-    /// This never writes default values to the stream, and does not address "packedness"
-    /// in repeated fields itself, other than to know whether or not the field *should* be packed.
-    /// </remarks>
-    public sealed class FieldCodec<T>
-    {
-        private static readonly T DefaultDefault;
-        // Only non-nullable value types support packing. This is the simplest way of detecting that.
-        private static readonly bool TypeSupportsPacking = default(T) != null;
-
-        static FieldCodec()
-        {
-            if (typeof(T) == typeof(string))
-            {
-                DefaultDefault = (T)(object)"";
-            }
-            else if (typeof(T) == typeof(ByteString))
-            {
-                DefaultDefault = (T)(object)ByteString.Empty;
-            }
-            // Otherwise it's the default value of the CLR type
-        }
-
-        internal static bool IsPackedRepeatedField(uint tag)
-        {
-            return TypeSupportsPacking && WireFormat.GetTagWireType(tag) == WireFormat.WireType.LengthDelimited;
-        }
-
-        internal readonly bool PackedRepeatedField;
-
-        /// <summary>
-        /// Returns a delegate to write a value (unconditionally) to a coded output stream.
-        /// </summary>
-        internal readonly Action<CodedOutputStream, T> ValueWriter;
-
-        /// <summary>
-        /// Returns the size calculator for just a value.
-        /// </summary>
-        internal readonly Func<T, int> ValueSizeCalculator;
-
-        /// <summary>
-        /// Returns a delegate to read a value from a coded input stream. It is assumed that
-        /// the stream is already positioned on the appropriate tag.
-        /// </summary>
-        internal readonly Func<CodedInputStream, T> ValueReader;
-
-        /// <summary>
-        /// Returns the fixed size for an entry, or 0 if sizes vary.
-        /// </summary>
-        internal readonly int FixedSize;
-
-        /// <summary>
-        /// Gets the tag of the codec.
-        /// </summary>
-        /// <value>
-        /// The tag of the codec.
-        /// </value>
-        internal readonly uint Tag;
-
-        /// <summary>
-        /// Default value for this codec. Usually the same for every instance of the same type, but
-        /// for string/ByteString wrapper fields the codec's default value is null, whereas for
-        /// other string/ByteString fields it's "" or ByteString.Empty.
-        /// </summary>
-        /// <value>
-        /// The default value of the codec's type.
-        /// </value>
-        internal readonly T DefaultValue;
-
-        private readonly int tagSize;
-        
-        internal FieldCodec(
-                Func<CodedInputStream, T> reader,
-                Action<CodedOutputStream, T> writer,
-                int fixedSize,
-                uint tag) : this(reader, writer, _ => fixedSize, tag)
-        {
-            FixedSize = fixedSize;
-        }
-
-        internal FieldCodec(
-            Func<CodedInputStream, T> reader,
-            Action<CodedOutputStream, T> writer,
-            Func<T, int> sizeCalculator,
-            uint tag) : this(reader, writer, sizeCalculator, tag, DefaultDefault)
-        {
-        }
-
-        internal FieldCodec(
-            Func<CodedInputStream, T> reader,
-            Action<CodedOutputStream, T> writer,
-            Func<T, int> sizeCalculator,
-            uint tag,
-            T defaultValue)
-        {
-            ValueReader = reader;
-            ValueWriter = writer;
-            ValueSizeCalculator = sizeCalculator;
-            FixedSize = 0;
-            Tag = tag;
-            DefaultValue = defaultValue;
-            tagSize = CodedOutputStream.ComputeRawVarint32Size(tag);
-            // Detect packed-ness once, so we can check for it within RepeatedField<T>.
-            PackedRepeatedField = IsPackedRepeatedField(tag);
-        }
-
-        /// <summary>
-        /// Write a tag and the given value, *if* the value is not the default.
-        /// </summary>
-        public void WriteTagAndValue(CodedOutputStream output, T value)
-        {
-            if (!IsDefault(value))
-            {
-                output.WriteTag(Tag);
-                ValueWriter(output, value);
-            }
-        }
-
-        /// <summary>
-        /// Reads a value of the codec type from the given <see cref="CodedInputStream"/>.
-        /// </summary>
-        /// <param name="input">The input stream to read from.</param>
-        /// <returns>The value read from the stream.</returns>
-        public T Read(CodedInputStream input)
-        {
-            return ValueReader(input);
-        }
-
-        /// <summary>
-        /// Calculates the size required to write the given value, with a tag,
-        /// if the value is not the default.
-        /// </summary>
-        public int CalculateSizeWithTag(T value)
-        {
-            return IsDefault(value) ? 0 : ValueSizeCalculator(value) + tagSize;
-        }
-
-        private bool IsDefault(T value)
-        {
-            return EqualityComparer<T>.Default.Equals(value, DefaultValue);
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/FieldCodec.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: bc2f63c5dd762a74785e957e9e2ff0c9
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 69
Server/ThirdParty/Google.Protobuf/ICustomDiagnosticMessage.cs

@@ -1,69 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2016 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// A message type that has a custom string format for diagnostic purposes.
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// Calling <see cref="object.ToString"/> on a generated message type normally
-    /// returns the JSON representation. If a message type implements this interface,
-    /// then the <see cref="ToDiagnosticString"/> method will be called instead of the regular
-    /// JSON formatting code, but only when <c>ToString()</c> is called either on the message itself
-    /// or on another message which contains it. This does not affect the normal JSON formatting of
-    /// the message.
-    /// </para>
-    /// <para>
-    /// For example, if you create a proto message representing a GUID, the internal
-    /// representation may be a <c>bytes</c> field or four <c>fixed32</c> fields. However, when debugging
-    /// it may be more convenient to see a result in the same format as <see cref="System.Guid"/> provides.
-    /// </para>
-    /// <para>This interface extends <see cref="IMessage"/> to avoid it accidentally being implemented
-    /// on types other than messages, where it would not be used by anything in the framework.</para>
-    /// </remarks>
-    public interface ICustomDiagnosticMessage : IMessage
-    {
-        /// <summary>
-        /// Returns a string representation of this object, for diagnostic purposes.
-        /// </summary>
-        /// <remarks>
-        /// This method is called when a message is formatted as part of a <see cref="object.ToString"/>
-        /// call. It does not affect the JSON representation used by <see cref="JsonFormatter"/> other than
-        /// in calls to <see cref="JsonFormatter.ToDiagnosticString(IMessage)"/>. While it is recommended
-        /// that the result is valid JSON, this is never assumed by the Protobuf library.
-        /// </remarks>
-        /// <returns>A string representation of this object, for diagnostic purposes.</returns>
-        string ToDiagnosticString();
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/ICustomDiagnosticMessage.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 4e3f9f48b78790d40b93778ba6fc08aa
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 64
Server/ThirdParty/Google.Protobuf/IMessage.cs

@@ -1,64 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Interface for a Protocol Buffers message, supporting
-    /// basic operations required for serialization.
-    /// </summary>
-    public interface IMessage
-    {
-        /// <summary>
-        /// Merges the data from the specified coded input stream with the current message.
-        /// </summary>
-        /// <remarks>See the user guide for precise merge semantics.</remarks>
-        /// <param name="input"></param>
-        void MergeFrom(CodedInputStream input);
-
-        /// <summary>
-        /// Writes the data to the given coded output stream.
-        /// </summary>
-        /// <param name="output">Coded output stream to write the data to. Must not be null.</param>
-        void WriteTo(CodedOutputStream output);
-
-        /// <summary>
-        /// Calculates the size of this message in Protocol Buffer wire format, in bytes.
-        /// </summary>
-        /// <returns>The number of bytes required to write this message
-        /// to a coded output stream.</returns>
-        int CalculateSize();
-
-    }
-
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/IMessage.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 99b4394158577934492f893a057dc06f
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 129
Server/ThirdParty/Google.Protobuf/InvalidProtocolBufferException.cs

@@ -1,129 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Thrown when a protocol message being parsed is invalid in some way,
-    /// e.g. it contains a malformed varint or a negative byte length.
-    /// </summary>
-    public sealed class InvalidProtocolBufferException : IOException
-    {
-        internal InvalidProtocolBufferException(string message)
-            : base(message)
-        {
-        }
-
-        internal InvalidProtocolBufferException(string message, Exception innerException)
-            : base(message, innerException)
-        {
-        }
-
-        internal static InvalidProtocolBufferException MoreDataAvailable()
-        {
-            return new InvalidProtocolBufferException(
-                "Completed reading a message while more data was available in the stream.");
-        }
-
-        internal static InvalidProtocolBufferException TruncatedMessage()
-        {
-            return new InvalidProtocolBufferException(
-                "While parsing a protocol message, the input ended unexpectedly " +
-                "in the middle of a field.  This could mean either that the " +
-                "input has been truncated or that an embedded message " +
-                "misreported its own length.");
-        }
-
-        internal static InvalidProtocolBufferException NegativeSize()
-        {
-            return new InvalidProtocolBufferException(
-                "CodedInputStream encountered an embedded string or message " +
-                "which claimed to have negative size.");
-        }
-
-        internal static InvalidProtocolBufferException MalformedVarint()
-        {
-            return new InvalidProtocolBufferException(
-                "CodedInputStream encountered a malformed varint.");
-        }
-
-        /// <summary>
-        /// Creates an exception for an error condition of an invalid tag being encountered.
-        /// </summary>
-        internal static InvalidProtocolBufferException InvalidTag()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message contained an invalid tag (zero).");
-        }
-
-        internal static InvalidProtocolBufferException InvalidBase64(Exception innerException)
-        {
-            return new InvalidProtocolBufferException("Invalid base64 data", innerException);
-        }
-
-        internal static InvalidProtocolBufferException InvalidEndTag()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message end-group tag did not match expected tag.");
-        }
-
-        internal static InvalidProtocolBufferException RecursionLimitExceeded()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message had too many levels of nesting.  May be malicious.  " +
-                "Use CodedInputStream.SetRecursionLimit() to increase the depth limit.");
-        }
-
-        internal static InvalidProtocolBufferException JsonRecursionLimitExceeded()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message had too many levels of nesting.  May be malicious.  " +
-                "Use JsonParser.Settings to increase the depth limit.");
-        }
-
-        internal static InvalidProtocolBufferException SizeLimitExceeded()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message was too large.  May be malicious.  " +
-                "Use CodedInputStream.SetSizeLimit() to increase the size limit.");
-        }
-
-        internal static InvalidProtocolBufferException InvalidMessageStreamTag()
-        {
-            return new InvalidProtocolBufferException(
-                "Stream of protocol messages had invalid tag. Expected tag is length-delimited field 1.");
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/InvalidProtocolBufferException.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 3eb2be644ccc6fc4187e38443cc47ea5
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 110
Server/ThirdParty/Google.Protobuf/LimitedInputStream.cs

@@ -1,110 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-    
-using System;
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Stream implementation which proxies another stream, only allowing a certain amount
-    /// of data to be read. Note that this is only used to read delimited streams, so it
-    /// doesn't attempt to implement everything.
-    /// </summary>
-    internal sealed class LimitedInputStream : Stream
-    {
-        private readonly Stream proxied;
-        private int bytesLeft;
-
-        internal LimitedInputStream(Stream proxied, int size)
-        {
-            this.proxied = proxied;
-            bytesLeft = size;
-        }
-
-        public override bool CanRead
-        {
-            get { return true; }
-        }
-
-        public override bool CanSeek
-        {
-            get { return false; }
-        }
-
-        public override bool CanWrite
-        {
-            get { return false; }
-        }
-
-        public override void Flush()
-        {
-        }
-
-        public override long Length
-        {
-            get { throw new NotSupportedException(); }
-        }
-
-        public override long Position
-        {
-            get { throw new NotSupportedException(); }
-            set { throw new NotSupportedException(); }
-        }
-
-        public override int Read(byte[] buffer, int offset, int count)
-        {
-            if (bytesLeft > 0)
-            {
-                int bytesRead = proxied.Read(buffer, offset, Math.Min(bytesLeft, count));
-                bytesLeft -= bytesRead;
-                return bytesRead;
-            }
-            return 0;
-        }
-
-        public override long Seek(long offset, SeekOrigin origin)
-        {
-            throw new NotSupportedException();
-        }
-
-        public override void SetLength(long value)
-        {
-            throw new NotSupportedException();
-        }
-
-        public override void Write(byte[] buffer, int offset, int count)
-        {
-            throw new NotSupportedException();
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/LimitedInputStream.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: f02379e5cbe40714dba4d002f8980dbf
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 178
Server/ThirdParty/Google.Protobuf/MessageExtensions.cs

@@ -1,178 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Extension methods on <see cref="IMessage"/> and <see cref="IMessage{T}"/>.
-    /// </summary>
-    public static class MessageExtensions
-    {
-        public static CodedInputStream inputStream = new CodedInputStream(new byte[0]);
-        public static CodedOutputStream outputStream = new CodedOutputStream(new byte[0]);
-        
-        /// <summary>
-        /// Merges data from the given byte array into an existing message.
-        /// </summary>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="data">The data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeFrom(this IMessage message, byte[] data)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(data, "data");
-            inputStream.Reset(data, 0, data.Length);
-            CodedInputStream input = inputStream;
-            message.MergeFrom(input);
-            input.CheckReadEndOfStreamTag();
-        }
-        
-        /// <summary>
-        /// Merges data from the given byte array into an existing message.
-        /// </summary>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="data">The data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeFrom(this IMessage message, byte[] data, int offset, int length)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(data, "data");
-            inputStream.Reset(data, offset, length);
-            CodedInputStream input = inputStream;
-            //CodedInputStream input = new CodedInputStream(data, offset, length);
-            message.MergeFrom(input);
-            input.CheckReadEndOfStreamTag();
-        }
-
-        /// <summary>
-        /// Merges data from the given byte string into an existing message.
-        /// </summary>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="data">The data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeFrom(this IMessage message, ByteString data)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(data, "data");
-            CodedInputStream input = data.CreateCodedInput();
-            message.MergeFrom(input);
-            input.CheckReadEndOfStreamTag();
-        }
-
-        /// <summary>
-        /// Merges data from the given stream into an existing message.
-        /// </summary>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="input">Stream containing the data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeFrom(this IMessage message, Stream input)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(input, "input");
-            CodedInputStream codedInput = new CodedInputStream(input);
-            message.MergeFrom(codedInput);
-            codedInput.CheckReadEndOfStreamTag();
-        }
-
-        /// <summary>
-        /// Merges length-delimited data from the given stream into an existing message.
-        /// </summary>
-        /// <remarks>
-        /// The stream is expected to contain a length and then the data. Only the amount of data
-        /// specified by the length will be consumed.
-        /// </remarks>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="input">Stream containing the data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeDelimitedFrom(this IMessage message, Stream input)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(input, "input");
-            int size = (int) CodedInputStream.ReadRawVarint32(input);
-            Stream limitedStream = new LimitedInputStream(input, size);
-            message.MergeFrom(limitedStream);
-        }
-
-        /// <summary>
-        /// Converts the given message into a byte array in protobuf encoding.
-        /// </summary>
-        /// <param name="message">The message to convert.</param>
-        /// <returns>The message data as a byte array.</returns>
-        public static byte[] ToByteArray(this IMessage message)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            byte[] result = new byte[message.CalculateSize()];
-            CodedOutputStream output = new CodedOutputStream(result);
-            message.WriteTo(output);
-            output.CheckNoSpaceLeft();
-            return result;
-        }
-
-        /// <summary>
-        /// Writes the given message data to the given stream in protobuf encoding.
-        /// </summary>
-        /// <param name="message">The message to write to the stream.</param>
-        /// <param name="output">The stream to write to.</param>
-        public static void WriteTo(this IMessage message, MemoryStream output)
-        {
-            // 这里做了修改,去掉CodedOutputStream的gc
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(output, "output");
-            outputStream.Reset(output.GetBuffer(), (int)output.Length, (int)(output.Capacity - output.Length));
-            message.WriteTo(outputStream);
-            output.SetLength(outputStream.Position);
-        }
-
-        /// <summary>
-        /// Writes the length and then data of the given message to a stream.
-        /// </summary>
-        /// <param name="message">The message to write.</param>
-        /// <param name="output">The output stream to write to.</param>
-        public static void WriteDelimitedTo(this IMessage message, Stream output)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(output, "output");
-            CodedOutputStream codedOutput = new CodedOutputStream(output);
-            codedOutput.WriteRawVarint32((uint)message.CalculateSize());
-            message.WriteTo(codedOutput);
-            codedOutput.Flush();
-        }
-
-        /// <summary>
-        /// Converts the given message into a byte string in protobuf encoding.
-        /// </summary>
-        /// <param name="message">The message to convert.</param>
-        /// <returns>The message data as a byte string.</returns>
-        public static ByteString ToByteString(this IMessage message)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            return ByteString.AttachBytes(message.ToByteArray());
-        }        
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/MessageExtensions.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 23cd5cb094c72654abdb3a2a71ee5a80
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 241
Server/ThirdParty/Google.Protobuf/MessageParser.cs

@@ -1,241 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-    
-using System;
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// A general message parser, typically used by reflection-based code as all the methods
-    /// return simple <see cref="IMessage"/>.
-    /// </summary>
-    public class MessageParser
-    {
-        private Func<IMessage> factory;
-
-        internal MessageParser(Func<IMessage> factory)
-        {
-            this.factory = factory;
-        }
-
-        /// <summary>
-        /// Creates a template instance ready for population.
-        /// </summary>
-        /// <returns>An empty message.</returns>
-        internal IMessage CreateTemplate()
-        {
-            return factory();
-        }
-
-        /// <summary>
-        /// Parses a message from a byte array.
-        /// </summary>
-        /// <param name="data">The byte array containing the message. Must not be null.</param>
-        /// <returns>The newly parsed message.</returns>
-        public IMessage ParseFrom(byte[] data)
-        {
-            ProtoPreconditions.CheckNotNull(data, "data");
-            IMessage message = factory();
-            message.MergeFrom(data);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given byte string.
-        /// </summary>
-        /// <param name="data">The data to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public IMessage ParseFrom(ByteString data)
-        {
-            ProtoPreconditions.CheckNotNull(data, "data");
-            IMessage message = factory();
-            message.MergeFrom(data);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given stream.
-        /// </summary>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public IMessage ParseFrom(Stream input)
-        {
-            IMessage message = factory();
-            message.MergeFrom(input);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a length-delimited message from the given stream.
-        /// </summary>
-        /// <remarks>
-        /// The stream is expected to contain a length and then the data. Only the amount of data
-        /// specified by the length will be consumed.
-        /// </remarks>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public IMessage ParseDelimitedFrom(Stream input)
-        {
-            IMessage message = factory();
-            message.MergeDelimitedFrom(input);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given coded input stream.
-        /// </summary>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public IMessage ParseFrom(CodedInputStream input)
-        {
-            IMessage message = factory();
-            message.MergeFrom(input);
-            return message;
-        }
-
-    }
-
-    /// <summary>
-    /// A parser for a specific message type.
-    /// </summary>
-    /// <remarks>
-    /// <p>
-    /// This delegates most behavior to the
-    /// <see cref="IMessage.MergeFrom"/> implementation within the original type, but
-    /// provides convenient overloads to parse from a variety of sources.
-    /// </p>
-    /// <p>
-    /// Most applications will never need to create their own instances of this type;
-    /// instead, use the static <c>Parser</c> property of a generated message type to obtain a
-    /// parser for that type.
-    /// </p>
-    /// </remarks>
-    /// <typeparam name="T">The type of message to be parsed.</typeparam>
-    public sealed class MessageParser<T> : MessageParser where T : IMessage
-    {
-        // Implementation note: all the methods here *could* just delegate up to the base class and cast the result.
-        // The current implementation avoids a virtual method call and a cast, which *may* be significant in some cases.
-        // Benchmarking work is required to measure the significance - but it's only a few lines of code in any case.
-        // The API wouldn't change anyway - just the implementation - so this work can be deferred.
-        private readonly Func<T> factory; 
-
-        /// <summary>
-        /// Creates a new parser.
-        /// </summary>
-        /// <remarks>
-        /// The factory method is effectively an optimization over using a generic constraint
-        /// to require a parameterless constructor: delegates are significantly faster to execute.
-        /// </remarks>
-        /// <param name="factory">Function to invoke when a new, empty message is required.</param>
-        public MessageParser(Func<T> factory) : base(() => factory())
-        {
-            this.factory = factory;
-        }
-
-        /// <summary>
-        /// Creates a template instance ready for population.
-        /// </summary>
-        /// <returns>An empty message.</returns>
-        internal new T CreateTemplate()
-        {
-            return factory();
-        }
-
-        /// <summary>
-        /// Parses a message from a byte array.
-        /// </summary>
-        /// <param name="data">The byte array containing the message. Must not be null.</param>
-        /// <returns>The newly parsed message.</returns>
-        public new T ParseFrom(byte[] data)
-        {
-            ProtoPreconditions.CheckNotNull(data, "data");
-            T message = factory();
-            message.MergeFrom(data);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given byte string.
-        /// </summary>
-        /// <param name="data">The data to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public new T ParseFrom(ByteString data)
-        {
-            ProtoPreconditions.CheckNotNull(data, "data");
-            T message = factory();
-            message.MergeFrom(data);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given stream.
-        /// </summary>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public new T ParseFrom(Stream input)
-        {
-            T message = factory();
-            message.MergeFrom(input);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a length-delimited message from the given stream.
-        /// </summary>
-        /// <remarks>
-        /// The stream is expected to contain a length and then the data. Only the amount of data
-        /// specified by the length will be consumed.
-        /// </remarks>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public new T ParseDelimitedFrom(Stream input)
-        {
-            T message = factory();
-            message.MergeDelimitedFrom(input);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given coded input stream.
-        /// </summary>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public new T ParseFrom(CodedInputStream input)
-        {
-            T message = factory();
-            message.MergeFrom(input);
-            return message;
-        }
-
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/MessageParser.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 1c7045bb59482bd4ba45e875f377820b
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 64
Server/ThirdParty/Google.Protobuf/PropertyInfoExtensions.cs

@@ -1,64 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System.Reflection;
-
-namespace Google.Protobuf.Compatibility
-{
-    /// <summary>
-    /// Extension methods for <see cref="PropertyInfo"/>, effectively providing
-    /// the familiar members from previous desktop framework versions while
-    /// targeting the newer releases, .NET Core etc.
-    /// </summary>
-    internal static class PropertyInfoExtensions
-    {
-        /// <summary>
-        /// Returns the public getter of a property, or null if there is no such getter
-        /// (either because it's read-only, or the getter isn't public).
-        /// </summary>
-        internal static MethodInfo GetGetMethod(this PropertyInfo target)
-        {
-            var method = target.GetGetMethod();
-            return method != null && method.IsPublic ? method : null;
-        }
-
-        /// <summary>
-        /// Returns the public setter of a property, or null if there is no such setter
-        /// (either because it's write-only, or the setter isn't public).
-        /// </summary>
-        internal static MethodInfo GetSetMethod(this PropertyInfo target)
-        {
-            var method = target.GetSetMethod();
-            return method != null && method.IsPublic ? method : null;
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/PropertyInfoExtensions.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: a1ba303b1b8d9d943a4c0189a878a77f
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 79
Server/ThirdParty/Google.Protobuf/ProtoPreconditions.cs

@@ -1,79 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Helper methods for throwing exceptions when preconditions are not met.
-    /// </summary>
-    /// <remarks>
-    /// This class is used internally and by generated code; it is not particularly
-    /// expected to be used from application code, although nothing prevents it
-    /// from being used that way.
-    /// </remarks>
-    public static class ProtoPreconditions
-    {
-        /// <summary>
-        /// Throws an ArgumentNullException if the given value is null, otherwise
-        /// return the value to the caller.
-        /// </summary>
-        public static T CheckNotNull<T>(T value, string name) where T : class
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(name);
-            }
-            return value;
-        }
-
-        /// <summary>
-        /// Throws an ArgumentNullException if the given value is null, otherwise
-        /// return the value to the caller.
-        /// </summary>
-        /// <remarks>
-        /// This is equivalent to <see cref="CheckNotNull{T}(T, string)"/> but without the type parameter
-        /// constraint. In most cases, the constraint is useful to prevent you from calling CheckNotNull
-        /// with a value type - but it gets in the way if either you want to use it with a nullable
-        /// value type, or you want to use it with an unconstrained type parameter.
-        /// </remarks>
-        internal static T CheckNotNullUnconstrained<T>(T value, string name)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(name);
-            }
-            return value;
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/ProtoPreconditions.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: ec2d66cb17ca74d49890f00206696580
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 581
Server/ThirdParty/Google.Protobuf/RepeatedField.cs

@@ -1,581 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-
-namespace Google.Protobuf.Collections
-{
-    /// <summary>
-    /// The contents of a repeated field: essentially, a collection with some extra
-    /// restrictions (no null values) and capabilities (deep cloning).
-    /// </summary>
-    /// <remarks>
-    /// This implementation does not generally prohibit the use of types which are not
-    /// supported by Protocol Buffers but nor does it guarantee that all operations will work in such cases.
-    /// </remarks>
-    /// <typeparam name="T">The element type of the repeated field.</typeparam>
-    public sealed class RepeatedField<T> : IList<T>, IList 
-    {
-        private static readonly T[] EmptyArray = new T[0];
-        private const int MinArraySize = 8;
-
-        public T[] array = EmptyArray;
-        public int count = 0;
-
-        /// <summary>
-        /// Adds the entries from the given input stream, decoding them with the specified codec.
-        /// </summary>
-        /// <param name="input">The input stream to read from.</param>
-        /// <param name="codec">The codec to use in order to read each entry.</param>
-        public void AddEntriesFrom(CodedInputStream input, FieldCodec<T> codec)
-        {
-            // TODO: Inline some of the Add code, so we can avoid checking the size on every
-            // iteration.
-            uint tag = input.LastTag;
-            var reader = codec.ValueReader;
-            // Non-nullable value types can be packed or not.
-            if (FieldCodec<T>.IsPackedRepeatedField(tag))
-            {
-                int length = input.ReadLength();
-                if (length > 0)
-                {
-                    int oldLimit = input.PushLimit(length);
-                    while (!input.ReachedLimit)
-                    {
-                        Add(reader(input));
-                    }
-                    input.PopLimit(oldLimit);
-                }
-                // Empty packed field. Odd, but valid - just ignore.
-            }
-            else
-            {
-                // Not packed... (possibly not packable)
-                do
-                {
-                    Add(reader(input));
-                } while (input.MaybeConsumeTag(tag));
-            }
-        }
-
-        /// <summary>
-        /// Calculates the size of this collection based on the given codec.
-        /// </summary>
-        /// <param name="codec">The codec to use when encoding each field.</param>
-        /// <returns>The number of bytes that would be written to a <see cref="CodedOutputStream"/> by <see cref="WriteTo"/>,
-        /// using the same codec.</returns>
-        public int CalculateSize(FieldCodec<T> codec)
-        {
-            if (count == 0)
-            {
-                return 0;
-            }
-            uint tag = codec.Tag;
-            if (codec.PackedRepeatedField)
-            {
-                int dataSize = CalculatePackedDataSize(codec);
-                return CodedOutputStream.ComputeRawVarint32Size(tag) +
-                    CodedOutputStream.ComputeLengthSize(dataSize) +
-                    dataSize;
-            }
-            else
-            {
-                var sizeCalculator = codec.ValueSizeCalculator;
-                int size = count * CodedOutputStream.ComputeRawVarint32Size(tag);
-                for (int i = 0; i < count; i++)
-                {
-                    size += sizeCalculator(array[i]);
-                }
-                return size;
-            }
-        }
-
-        private int CalculatePackedDataSize(FieldCodec<T> codec)
-        {
-            int fixedSize = codec.FixedSize;
-            if (fixedSize == 0)
-            {
-                var calculator = codec.ValueSizeCalculator;
-                int tmp = 0;
-                for (int i = 0; i < count; i++)
-                {
-                    tmp += calculator(array[i]);
-                }
-                return tmp;
-            }
-            else
-            {
-                return fixedSize * Count;
-            }
-        }
-
-        /// <summary>
-        /// Writes the contents of this collection to the given <see cref="CodedOutputStream"/>,
-        /// encoding each value using the specified codec.
-        /// </summary>
-        /// <param name="output">The output stream to write to.</param>
-        /// <param name="codec">The codec to use when encoding each value.</param>
-        public void WriteTo(CodedOutputStream output, FieldCodec<T> codec)
-        {
-            if (count == 0)
-            {
-                return;
-            }
-            var writer = codec.ValueWriter;
-            var tag = codec.Tag;
-            if (codec.PackedRepeatedField)
-            {
-                // Packed primitive type
-                uint size = (uint)CalculatePackedDataSize(codec);
-                output.WriteTag(tag);
-                output.WriteRawVarint32(size);
-                for (int i = 0; i < count; i++)
-                {
-                    writer(output, array[i]);
-                }
-            }
-            else
-            {
-                // Not packed: a simple tag/value pair for each value.
-                // Can't use codec.WriteTagAndValue, as that omits default values.
-                for (int i = 0; i < count; i++)
-                {
-                    output.WriteTag(tag);
-                    writer(output, array[i]);
-                }
-            }
-        }
-
-        private void EnsureSize(int size)
-        {
-            if (array.Length < size)
-            {
-                size = Math.Max(size, MinArraySize);
-                int newSize = Math.Max(array.Length * 2, size);
-                var tmp = new T[newSize];
-                Array.Copy(array, 0, tmp, 0, array.Length);
-                array = tmp;
-            }
-        }
-
-        /// <summary>
-        /// Adds the specified item to the collection.
-        /// </summary>
-        /// <param name="item">The item to add.</param>
-        public void Add(T item)
-        {
-            ProtoPreconditions.CheckNotNullUnconstrained(item, "item");
-            EnsureSize(count + 1);
-            array[count++] = item;
-        }
-
-        /// <summary>
-        /// Removes all items from the collection.
-        /// </summary>
-        public void Clear()
-        {
-            // ET修改,这里不释放数组,避免gc
-            //array = EmptyArray;
-            count = 0;
-        }
-
-        /// <summary>
-        /// Determines whether this collection contains the given item.
-        /// </summary>
-        /// <param name="item">The item to find.</param>
-        /// <returns><c>true</c> if this collection contains the given item; <c>false</c> otherwise.</returns>
-        public bool Contains(T item)
-        {
-            return IndexOf(item) != -1;
-        }
-
-        /// <summary>
-        /// Copies this collection to the given array.
-        /// </summary>
-        /// <param name="array">The array to copy to.</param>
-        /// <param name="arrayIndex">The first index of the array to copy to.</param>
-        public void CopyTo(T[] array, int arrayIndex)
-        {
-            Array.Copy(this.array, 0, array, arrayIndex, count);
-        }
-
-        /// <summary>
-        /// Removes the specified item from the collection
-        /// </summary>
-        /// <param name="item">The item to remove.</param>
-        /// <returns><c>true</c> if the item was found and removed; <c>false</c> otherwise.</returns>
-        public bool Remove(T item)
-        {
-            int index = IndexOf(item);
-            if (index == -1)
-            {
-                return false;
-            }
-            Array.Copy(array, index + 1, array, index, count - index - 1);
-            count--;
-            array[count] = default(T);
-            return true;
-        }
-
-        /// <summary>
-        /// Gets the number of elements contained in the collection.
-        /// </summary>
-        public int Count
-        {
-            get
-            {
-                return count;
-            }
-        }
-
-        /// <summary>
-        /// Gets a value indicating whether the collection is read-only.
-        /// </summary>
-        public bool IsReadOnly
-        {
-            get
-            {
-                return false;
-            }
-        }
-
-        /// <summary>
-        /// Adds all of the specified values into this collection.
-        /// </summary>
-        /// <param name="values">The values to add to this collection.</param>
-        public void AddRange(IEnumerable<T> values)
-        {
-            ProtoPreconditions.CheckNotNull(values, "values");
-
-            // Optimization 1: If the collection we're adding is already a RepeatedField<T>,
-            // we know the values are valid.
-            var otherRepeatedField = values as RepeatedField<T>;
-            if (otherRepeatedField != null)
-            {
-                EnsureSize(count + otherRepeatedField.count);
-                Array.Copy(otherRepeatedField.array, 0, array, count, otherRepeatedField.count);
-                count += otherRepeatedField.count;
-                return;
-            }
-
-            // Optimization 2: The collection is an ICollection, so we can expand
-            // just once and ask the collection to copy itself into the array.
-            var collection = values as ICollection;
-            if (collection != null)
-            {
-                var extraCount = collection.Count;
-                // For reference types and nullable value types, we need to check that there are no nulls
-                // present. (This isn't a thread-safe approach, but we don't advertise this is thread-safe.)
-                // We expect the JITter to optimize this test to true/false, so it's effectively conditional
-                // specialization.
-                if (default(T) == null)
-                {
-                    // TODO: Measure whether iterating once to check and then letting the collection copy
-                    // itself is faster or slower than iterating and adding as we go. For large
-                    // collections this will not be great in terms of cache usage... but the optimized
-                    // copy may be significantly faster than doing it one at a time.
-                    foreach (var item in collection)
-                    {
-                        if (item == null)
-                        {
-                            throw new ArgumentException("Sequence contained null element", "values");
-                        }
-                    }
-                }
-                EnsureSize(count + extraCount);
-                collection.CopyTo(array, count);
-                count += extraCount;
-                return;
-            }
-
-            // We *could* check for ICollection<T> as well, but very very few collections implement
-            // ICollection<T> but not ICollection. (HashSet<T> does, for one...)
-
-            // Fall back to a slower path of adding items one at a time.
-            foreach (T item in values)
-            {
-                Add(item);
-            }
-        }
-
-        /// <summary>
-        /// Adds all of the specified values into this collection. This method is present to
-        /// allow repeated fields to be constructed from queries within collection initializers.
-        /// Within non-collection-initializer code, consider using the equivalent <see cref="AddRange"/>
-        /// method instead for clarity.
-        /// </summary>
-        /// <param name="values">The values to add to this collection.</param>
-        public void Add(IEnumerable<T> values)
-        {
-            AddRange(values);
-        }
-
-        /// <summary>
-        /// Returns an enumerator that iterates through the collection.
-        /// </summary>
-        /// <returns>
-        /// An enumerator that can be used to iterate through the collection.
-        /// </returns>
-        public IEnumerator<T> GetEnumerator()
-        {
-            for (int i = 0; i < count; i++)
-            {
-                yield return array[i];
-            }
-        }
-
-        /// <summary>
-        /// Determines whether the specified <see cref="System.Object" />, is equal to this instance.
-        /// </summary>
-        /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
-        /// <returns>
-        ///   <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.
-        /// </returns>
-        public override bool Equals(object obj)
-        {
-            return Equals(obj as RepeatedField<T>);
-        }
-
-        /// <summary>
-        /// Returns an enumerator that iterates through a collection.
-        /// </summary>
-        /// <returns>
-        /// An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.
-        /// </returns>
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
-
-        /// <summary>
-        /// Returns a hash code for this instance.
-        /// </summary>
-        /// <returns>
-        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
-        /// </returns>
-        public override int GetHashCode()
-        {
-            int hash = 0;
-            for (int i = 0; i < count; i++)
-            {
-                hash = hash * 31 + array[i].GetHashCode();
-            }
-            return hash;
-        }
-
-        /// <summary>
-        /// Compares this repeated field with another for equality.
-        /// </summary>
-        /// <param name="other">The repeated field to compare this with.</param>
-        /// <returns><c>true</c> if <paramref name="other"/> refers to an equal repeated field; <c>false</c> otherwise.</returns>
-        public bool Equals(RepeatedField<T> other)
-        {
-            if (ReferenceEquals(other, null))
-            {
-                return false;
-            }
-            if (ReferenceEquals(other, this))
-            {
-                return true;
-            }
-            if (other.Count != this.Count)
-            {
-                return false;
-            }
-            EqualityComparer<T> comparer = EqualityComparer<T>.Default;
-            for (int i = 0; i < count; i++)
-            {
-                if (!comparer.Equals(array[i], other.array[i]))
-                {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        /// <summary>
-        /// Returns the index of the given item within the collection, or -1 if the item is not
-        /// present.
-        /// </summary>
-        /// <param name="item">The item to find in the collection.</param>
-        /// <returns>The zero-based index of the item, or -1 if it is not found.</returns>
-        public int IndexOf(T item)
-        {
-            ProtoPreconditions.CheckNotNullUnconstrained(item, "item");
-            EqualityComparer<T> comparer = EqualityComparer<T>.Default;
-            for (int i = 0; i < count; i++)
-            {
-                if (comparer.Equals(array[i], item))
-                {
-                    return i;
-                }
-            }
-            return -1;
-        }
-
-        /// <summary>
-        /// Inserts the given item at the specified index.
-        /// </summary>
-        /// <param name="index">The index at which to insert the item.</param>
-        /// <param name="item">The item to insert.</param>
-        public void Insert(int index, T item)
-        {
-            ProtoPreconditions.CheckNotNullUnconstrained(item, "item");
-            if (index < 0 || index > count)
-            {
-                throw new ArgumentOutOfRangeException("index");
-            }
-            EnsureSize(count + 1);
-            Array.Copy(array, index, array, index + 1, count - index);
-            array[index] = item;
-            count++;
-        }
-
-        /// <summary>
-        /// Removes the item at the given index.
-        /// </summary>
-        /// <param name="index">The zero-based index of the item to remove.</param>
-        public void RemoveAt(int index)
-        {
-            if (index < 0 || index >= count)
-            {
-                throw new ArgumentOutOfRangeException("index");
-            }
-            Array.Copy(array, index + 1, array, index, count - index - 1);
-            count--;
-            array[count] = default(T);
-        }
-
-        /// <summary>
-        /// Gets or sets the item at the specified index.
-        /// </summary>
-        /// <value>
-        /// The element at the specified index.
-        /// </value>
-        /// <param name="index">The zero-based index of the element to get or set.</param>
-        /// <returns>The item at the specified index.</returns>
-        public T this[int index]
-        {
-            get
-            {
-                if (index < 0 || index >= count)
-                {
-                    throw new ArgumentOutOfRangeException("index");
-                }
-                return array[index];
-            }
-            set
-            {
-                if (index < 0 || index >= count)
-                {
-                    throw new ArgumentOutOfRangeException("index");
-                }
-                ProtoPreconditions.CheckNotNullUnconstrained(value, "value");
-                array[index] = value;
-            }
-        }
-
-        #region Explicit interface implementation for IList and ICollection.
-        bool IList.IsFixedSize
-        {
-            get
-            {
-                return false;
-            }
-        }
-
-        void ICollection.CopyTo(Array array, int index)
-        {
-            Array.Copy(this.array, 0, array, index, count);
-        }
-
-        bool ICollection.IsSynchronized
-        {
-            get
-            {
-                return false;
-            }
-        }
-
-        object ICollection.SyncRoot
-        {
-            get
-            {
-                return this;
-            }
-        }
-
-        object IList.this[int index]
-        {
-            get { return this[index]; }
-            set { this[index] = (T)value; }
-        }
-
-        int IList.Add(object value)
-        {
-            Add((T)value);
-            return count - 1;
-        }
-
-        bool IList.Contains(object value)
-        {
-            return (value is T && Contains((T)value));
-        }
-
-        int IList.IndexOf(object value)
-        {
-            if (!(value is T))
-            {
-                return -1;
-            }
-            return IndexOf((T)value);
-        }
-
-        void IList.Insert(int index, object value)
-        {
-            Insert(index, (T)value);
-        }
-
-        void IList.Remove(object value)
-        {
-            if (!(value is T))
-            {
-                return;
-            }
-            Remove((T)value);
-        }
-        #endregion        
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/RepeatedField.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 462fd9852b348c34094dbb0e82649335
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 64
Server/ThirdParty/Google.Protobuf/StreamExtensions.cs

@@ -1,64 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.IO;
-
-namespace Google.Protobuf.Compatibility
-{
-    /// <summary>
-    /// Extension methods for <see cref="Stream"/> in order to provide
-    /// backwards compatibility with .NET 3.5
-    /// </summary>
-    public static class StreamExtensions
-    {
-        // 81920 seems to be the default buffer size used in .NET 4.5.1
-        private const int BUFFER_SIZE = 81920;
-
-        /// <summary>
-        /// Write the contents of the current stream to the destination stream
-        /// </summary>
-        public static void CopyTo(this Stream source, Stream destination)
-        {
-            if (destination == null)
-            {
-                throw new ArgumentNullException("destination");
-            }
-
-            byte[] buffer = new byte[BUFFER_SIZE];
-            int numBytesRead;
-            while ((numBytesRead = source.Read(buffer, 0, buffer.Length)) > 0) {
-                destination.Write(buffer, 0, numBytesRead);
-            }
-        }
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/StreamExtensions.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 51467fdc5aeb0374baba8cb484d68f4c
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 104
Server/ThirdParty/Google.Protobuf/WireFormat.cs

@@ -1,104 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// This class is used internally by the Protocol Buffer Library and generated
-    /// message implementations. It is public only for the sake of those generated
-    /// messages. Others should not use this class directly.
-    /// <para>
-    /// This class contains constants and helper functions useful for dealing with
-    /// the Protocol Buffer wire format.
-    /// </para>
-    /// </summary>
-    public static class WireFormat
-    {
-        /// <summary>
-        /// Wire types within protobuf encoding.
-        /// </summary>
-        public enum WireType : uint
-        {
-            /// <summary>
-            /// Variable-length integer.
-            /// </summary>
-            Varint = 0,
-            /// <summary>
-            /// A fixed-length 64-bit value.
-            /// </summary>
-            Fixed64 = 1,
-            /// <summary>
-            /// A length-delimited value, i.e. a length followed by that many bytes of data.
-            /// </summary>
-            LengthDelimited = 2,
-            /// <summary>
-            /// A "start group" value - not supported by this implementation.
-            /// </summary>
-            StartGroup = 3,
-            /// <summary>
-            /// An "end group" value - not supported by this implementation.
-            /// </summary>
-            EndGroup = 4,
-            /// <summary>
-            /// A fixed-length 32-bit value.
-            /// </summary>
-            Fixed32 = 5
-        }
-        
-        private const int TagTypeBits = 3;
-        private const uint TagTypeMask = (1 << TagTypeBits) - 1;
-
-        /// <summary>
-        /// Given a tag value, determines the wire type (lower 3 bits).
-        /// </summary>
-        public static WireType GetTagWireType(uint tag)
-        {
-            return (WireType) (tag & TagTypeMask);
-        }
-
-        /// <summary>
-        /// Given a tag value, determines the field number (the upper 29 bits).
-        /// </summary>
-        public static int GetTagFieldNumber(uint tag)
-        {
-            return (int) tag >> TagTypeBits;
-        }
-
-        /// <summary>
-        /// Makes a tag value given a field number and wire type.
-        /// </summary>
-        public static uint MakeTag(int fieldNumber, WireType wireType)
-        {
-            return (uint) (fieldNumber << TagTypeBits) | (uint) wireType;
-        }        
-    }
-}

+ 0 - 11
Server/ThirdParty/Google.Protobuf/WireFormat.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 7bf59a3ce666cd14392ea36d61668d87
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 6 - 0
Server/ThirdParty/Server.ThirdParty.csproj

@@ -40,6 +40,12 @@
       <None Remove="Google.Protobuf\RepeatedField.cs.meta" />
       <None Remove="Google.Protobuf\StreamExtensions.cs.meta" />
       <None Remove="Google.Protobuf\WireFormat.cs.meta" />
+      <None Update="libkcp.dylib">
+        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      </None>
+      <None Update="libkcp.so">
+        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      </None>
     </ItemGroup>
 
     <ItemGroup>

+ 17 - 114
Tools/Proto2CS/Program.cs

@@ -1,12 +1,9 @@
 using System;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.IO;
-using System.Runtime.InteropServices;
 using System.Text;
-using ETModel;
 
-namespace ETTools
+namespace ET
 {
     internal class OpcodeInfo
     {
@@ -18,119 +15,17 @@ namespace ETTools
     {
         public static void Main()
         {
-            string protoc = "";
-            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
-            {
-                protoc = "protoc.exe";
-            }
-            else
-            {
-                protoc = "protoc";
-            }
-            ProcessHelper.Run(protoc, "--csharp_out=\"../Unity/Assets/Model/Module/Message/\" --proto_path=\"./\" OuterMessage.proto", waitExit: true);
-
             // InnerMessage.proto生成cs代码
-            InnerProto2CS.Proto2CS(); 
+            InnerProto2CS.Proto2CS();
 
-            Proto2CS("ETModel", "OuterMessage.proto", clientMessagePath, "OuterOpcode", 100);
-            
             Console.WriteLine("proto2cs succeed!");
         }
-
-        private const string protoPath = ".";
-        private const string clientMessagePath = "../Unity/Assets/Model/Module/Message/";
-        private static readonly char[] splitChars = { ' ', '\t' };
-        private static readonly List<OpcodeInfo> msgOpcode = new List<OpcodeInfo>();
-
-        public static void Proto2CS(string ns, string protoName, string outputPath, string opcodeClassName, int startOpcode, bool isClient = true)
-        {
-            msgOpcode.Clear();
-            string proto = Path.Combine(protoPath, protoName);
-
-            string s = File.ReadAllText(proto);
-
-            StringBuilder sb = new StringBuilder();
-            sb.Append("using ETModel;\n");
-            sb.Append($"namespace {ns}\n");
-            sb.Append("{\n");
-
-            bool isMsgStart = false;
-
-            foreach (string line in s.Split('\n'))
-            {
-                string newline = line.Trim();
-
-                if (newline == "")
-                {
-                    continue;
-                }
-
-                if (newline.StartsWith("//"))
-                {
-                    sb.Append($"{newline}\n");
-                }
-
-                if (newline.StartsWith("message"))
-                {
-                    string parentClass = "";
-                    isMsgStart = true;
-                    string msgName = newline.Split(splitChars, StringSplitOptions.RemoveEmptyEntries)[1];
-                    string[] ss = newline.Split(new[] { "//" }, StringSplitOptions.RemoveEmptyEntries);
-
-                    if (ss.Length == 2)
-                    {
-                        parentClass = ss[1].Trim();
-                    }
-                    else
-                    {
-                        parentClass = "";
-                    }
-
-                    msgOpcode.Add(new OpcodeInfo() { Name = msgName, Opcode = ++startOpcode });
-
-                    sb.Append($"\t[Message({opcodeClassName}.{msgName})]\n");
-                    sb.Append($"\tpublic partial class {msgName} ");
-                    if (parentClass != "")
-                    {
-                        sb.Append($": {parentClass} ");
-                    }
-
-                    sb.Append("{}\n\n");
-                }
-
-                if (isMsgStart && newline == "}")
-                {
-                    isMsgStart = false;
-                }
-            }
-
-            sb.Append("}\n");
-
-            GenerateOpcode(ns, opcodeClassName, outputPath, sb);
-        }
-
-        private static void GenerateOpcode(string ns, string outputFileName, string outputPath, StringBuilder sb)
-        {
-            sb.AppendLine($"namespace {ns}");
-            sb.AppendLine("{");
-            sb.AppendLine($"\tpublic static partial class {outputFileName}");
-            sb.AppendLine("\t{");
-            foreach (OpcodeInfo info in msgOpcode)
-            {
-                sb.AppendLine($"\t\t public const ushort {info.Name} = {info.Opcode};");
-            }
-
-            sb.AppendLine("\t}");
-            sb.AppendLine("}");
-
-            string csPath = Path.Combine(outputPath, outputFileName + ".cs");
-            File.WriteAllText(csPath, sb.ToString());
-        }
     }
 
     public static class InnerProto2CS
     {
         private const string protoPath = ".";
+        private const string clientMessagePath = "../Unity/Assets/Model/Module/Message/";
         private const string serverMessagePath = "../Server/Model/Module/Message/";
         private static readonly char[] splitChars = { ' ', '\t' };
         private static readonly List<OpcodeInfo> msgOpcode = new List<OpcodeInfo>();
@@ -138,8 +33,11 @@ namespace ETTools
         public static void Proto2CS()
         {
             msgOpcode.Clear();
-            Proto2CS("ETModel", "InnerMessage.proto", serverMessagePath, "InnerOpcode", 1000);
-            GenerateOpcode("ETModel", "InnerOpcode", serverMessagePath);
+            Proto2CS("ET", "InnerMessage.proto", serverMessagePath, "InnerOpcode", 10000);
+            GenerateOpcode("ET", "InnerOpcode", serverMessagePath);
+            
+            Proto2CS("ET", "OuterMessage.proto", clientMessagePath, "OuterOpcode", 20000);
+            GenerateOpcode("ET", "OuterOpcode", clientMessagePath);
         }
 
         public static void Proto2CS(string ns, string protoName, string outputPath, string opcodeClassName, int startOpcode)
@@ -151,7 +49,8 @@ namespace ETTools
             string s = File.ReadAllText(proto);
 
             StringBuilder sb = new StringBuilder();
-            sb.Append("using ETModel;\n");
+            sb.Append("using ET;\n");
+            sb.Append("using ProtoBuf;\n");
             sb.Append("using System.Collections.Generic;\n");
             sb.Append($"namespace {ns}\n");
             sb.Append("{\n");
@@ -187,9 +86,9 @@ namespace ETTools
                     msgOpcode.Add(new OpcodeInfo() { Name = msgName, Opcode = ++startOpcode });
 
                     sb.Append($"\t[Message({opcodeClassName}.{msgName})]\n");
+                    sb.Append($"\t[ProtoContract]\n");
                     sb.Append($"\tpublic partial class {msgName}");
-                    if (parentClass == "IActorMessage" || parentClass == "IActorRequest" || parentClass == "IActorResponse" ||
-                        parentClass == "IFrameMessage")
+                    if (parentClass == "IActorMessage" || parentClass == "IActorRequest" || parentClass == "IActorResponse")
                     {
                         sb.Append($": {parentClass}\n");
                     }
@@ -274,7 +173,9 @@ namespace ETTools
                 string type = ss[1];
                 type = ConvertType(type);
                 string name = ss[2];
+                int n = int.Parse(ss[4]);
 
+                sb.Append($"\t\t[ProtoMember({n})]\n");
                 sb.Append($"\t\tpublic List<{type}> {name} = new List<{type}>();\n\n");
             }
             catch (Exception e)
@@ -329,8 +230,10 @@ namespace ETTools
                 string[] ss = newline.Split(splitChars, StringSplitOptions.RemoveEmptyEntries);
                 string type = ss[0];
                 string name = ss[1];
+                int n = int.Parse(ss[3]);
                 string typeCs = ConvertType(type);
-
+                
+                sb.Append($"\t\t[ProtoMember({n})]\n");
                 sb.Append($"\t\tpublic {typeCs} {name} {{ get; set; }}\n\n");
             }
             catch (Exception e)

+ 0 - 1
Unity/Assets/Hotfix/Module/Message/NetOuterComponentSystem.cs

@@ -22,7 +22,6 @@ namespace ET
 		}
 	}
 	
-	
 	public class NetOuterComponentLoadSystem : LoadSystem<NetOuterComponent>
 	{
 		public override void Load(NetOuterComponent self)

+ 0 - 118
Unity/Assets/Model/Base/Helper/Dumper.cs

@@ -1,118 +0,0 @@
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Text;
-using Google.Protobuf;
-using UnityEngine;
-
-namespace ET
-{
-    public static class Dumper
-    {
-        private static readonly StringBuilder _text = new StringBuilder("", 1024);
-
-        private static void AppendIndent(int num)
-        {
-            _text.Append(' ', num);
-        }
-
-        private static void DoDump(object obj)
-        {
-            if (obj == null)
-            {
-                _text.Append("null");
-                _text.Append(",");
-                return;
-            }
-
-            Type t = obj.GetType();
-
-            //repeat field
-            if (obj is IList)
-            {
-                /*
-                _text.Append(t.FullName);
-                _text.Append(",");
-                AppendIndent(1);
-                */
-
-                _text.Append("[");
-                IList list = obj as IList;
-                foreach (object v in list)
-                {
-                    DoDump(v);
-                }
-
-                _text.Append("]");
-            }
-            else if (t.IsValueType)
-            {
-                _text.Append(obj);
-                _text.Append(",");
-                AppendIndent(1);
-            }
-            else if (obj is string)
-            {
-                _text.Append("\"");
-                _text.Append(obj);
-                _text.Append("\"");
-                _text.Append(",");
-                AppendIndent(1);
-            }
-            else if (obj is ByteString)
-            {
-                _text.Append("\"");
-                _text.Append(((ByteString) obj).bytes.Utf8ToStr());
-                _text.Append("\"");
-                _text.Append(",");
-                AppendIndent(1);
-            }
-            else if (t.IsArray)
-            {
-                Array a = (Array) obj;
-                _text.Append("[");
-                for (int i = 0; i < a.Length; i++)
-                {
-                    _text.Append(i);
-                    _text.Append(":");
-                    DoDump(a.GetValue(i));
-                }
-
-                _text.Append("]");
-            }
-            else if (t.IsClass)
-            {
-                _text.Append($"<{t.Name}>");
-                _text.Append("{");
-                var fields = t.GetProperties(BindingFlags.Public | BindingFlags.Instance);
-                if (fields.Length > 0)
-                {
-                    foreach (PropertyInfo info in fields)
-                    {
-                        _text.Append(info.Name);
-                        _text.Append(":");
-                        object value = info.GetGetMethod().Invoke(obj, null);
-                        DoDump(value);
-                    }
-                }
-
-                _text.Append("}");
-            }
-            else
-            {
-                Debug.LogWarning("unsupport type: " + t.FullName);
-                _text.Append(obj);
-                _text.Append(",");
-                AppendIndent(1);
-            }
-        }
-
-        public static string DumpAsString(object obj, string hint = "")
-        {
-            _text.Clear();
-            _text.Append(hint);
-            DoDump(obj);
-            return _text.ToString();
-        }
-    }
-}

+ 0 - 4
Unity/Assets/Model/Base/Helper/StringHelper.cs

@@ -61,11 +61,7 @@ namespace ET
 		
 		public static string MessageToStr(object message)
 		{
-#if SERVER
 			return MongoHelper.ToJson(message);
-#else
-			return Dumper.DumpAsString(message);
-#endif
 		}
 	}
 }

+ 1 - 1
Unity/Assets/Model/Base/Log.cs

@@ -71,7 +71,7 @@ namespace ET
 
 		public static void Msg(object msg)
 		{
-			Debug(Dumper.DumpAsString(msg));
+			Debug(MongoHelper.ToJson(msg));
 		}
 	}
 }

+ 0 - 3
Unity/Assets/Model/Module/Message/IMessagePacker.cs

@@ -5,11 +5,8 @@ namespace ET
 {
 	public interface IMessagePacker
 	{
-		byte[] SerializeTo(object obj);
 		void SerializeTo(object obj, MemoryStream stream);
 		object DeserializeFrom(Type type, byte[] bytes, int index, int count);
-		object DeserializeFrom(object instance, byte[] bytes, int index, int count);
 		object DeserializeFrom(Type type, MemoryStream stream);
-		object DeserializeFrom(object instance, MemoryStream stream);
 	}
 }

+ 0 - 16
Unity/Assets/Model/Module/Message/OpcodeTypeComponent.cs

@@ -73,21 +73,5 @@ namespace ET
 		{
 			return this.opcodeTypes.GetValueByKey(opcode);
 		}
-		
-		// 客户端为了0GC需要消息池,服务端消息需要跨协程不需要消息池
-		public object GetInstance(ushort opcode)
-		{
-#if SERVER
-			Type type = this.GetType(opcode);
-			if (type == null)
-			{
-				// 服务端因为有人探测端口,有可能会走到这一步,如果找不到opcode,抛异常
-				throw new Exception($"not found opcode: {opcode}");
-			}
-			return Activator.CreateInstance(type);
-#else
-			return this.typeMessages[opcode];
-#endif
-		}
 	}
 }

+ 410 - 2300
Unity/Assets/Model/Module/Message/OuterMessage.cs

@@ -1,2302 +1,412 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: OuterMessage.proto
-#pragma warning disable 1591, 0612, 3021
-#region Designer generated code
-
-using pb = global::Google.Protobuf;
-using pbc = global::Google.Protobuf.Collections;
-using scg = global::System.Collections.Generic;
-namespace ET {
-
-  #region Messages
-  public partial class C2M_TestRequest : pb::IMessage {
-    private static readonly pb::MessageParser<C2M_TestRequest> _parser = new pb::MessageParser<C2M_TestRequest>(() => (C2M_TestRequest)MessagePool.Instance.Fetch(typeof(C2M_TestRequest)));
-    public static pb::MessageParser<C2M_TestRequest> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private long actorId_;
-    public long ActorId {
-      get { return actorId_; }
-      set {
-        actorId_ = value;
-      }
-    }
-
-    private string request_ = "";
-    public string Request {
-      get { return request_; }
-      set {
-        request_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Request.Length != 0) {
-        output.WriteRawTag(10);
-        output.WriteString(Request);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (ActorId != 0L) {
-        output.WriteRawTag(232, 5);
-        output.WriteInt64(ActorId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (ActorId != 0L) {
-        size += 2 + pb::CodedOutputStream.ComputeInt64Size(ActorId);
-      }
-      if (Request.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Request);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      request_ = "";
-      rpcId_ = 0;
-      actorId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            Request = input.ReadString();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 744: {
-            ActorId = input.ReadInt64();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class M2C_TestResponse : pb::IMessage {
-    private static readonly pb::MessageParser<M2C_TestResponse> _parser = new pb::MessageParser<M2C_TestResponse>(() => (M2C_TestResponse)MessagePool.Instance.Fetch(typeof(M2C_TestResponse)));
-    public static pb::MessageParser<M2C_TestResponse> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private int error_;
-    public int Error {
-      get { return error_; }
-      set {
-        error_ = value;
-      }
-    }
-
-    private string message_ = "";
-    public string Message {
-      get { return message_; }
-      set {
-        message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    private string response_ = "";
-    public string Response {
-      get { return response_; }
-      set {
-        response_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Response.Length != 0) {
-        output.WriteRawTag(10);
-        output.WriteString(Response);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (Error != 0) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt32(Error);
-      }
-      if (Message.Length != 0) {
-        output.WriteRawTag(226, 5);
-        output.WriteString(Message);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Error != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(Error);
-      }
-      if (Message.Length != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeStringSize(Message);
-      }
-      if (Response.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Response);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      response_ = "";
-      rpcId_ = 0;
-      error_ = 0;
-      message_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            Response = input.ReadString();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            Error = input.ReadInt32();
-            break;
-          }
-          case 738: {
-            Message = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class Actor_TransferRequest : pb::IMessage {
-    private static readonly pb::MessageParser<Actor_TransferRequest> _parser = new pb::MessageParser<Actor_TransferRequest>(() => (Actor_TransferRequest)MessagePool.Instance.Fetch(typeof(Actor_TransferRequest)));
-    public static pb::MessageParser<Actor_TransferRequest> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private long actorId_;
-    public long ActorId {
-      get { return actorId_; }
-      set {
-        actorId_ = value;
-      }
-    }
-
-    private int mapIndex_;
-    public int MapIndex {
-      get { return mapIndex_; }
-      set {
-        mapIndex_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (MapIndex != 0) {
-        output.WriteRawTag(8);
-        output.WriteInt32(MapIndex);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (ActorId != 0L) {
-        output.WriteRawTag(232, 5);
-        output.WriteInt64(ActorId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (ActorId != 0L) {
-        size += 2 + pb::CodedOutputStream.ComputeInt64Size(ActorId);
-      }
-      if (MapIndex != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeInt32Size(MapIndex);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      mapIndex_ = 0;
-      rpcId_ = 0;
-      actorId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 8: {
-            MapIndex = input.ReadInt32();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 744: {
-            ActorId = input.ReadInt64();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class Actor_TransferResponse : pb::IMessage {
-    private static readonly pb::MessageParser<Actor_TransferResponse> _parser = new pb::MessageParser<Actor_TransferResponse>(() => (Actor_TransferResponse)MessagePool.Instance.Fetch(typeof(Actor_TransferResponse)));
-    public static pb::MessageParser<Actor_TransferResponse> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private int error_;
-    public int Error {
-      get { return error_; }
-      set {
-        error_ = value;
-      }
-    }
-
-    private string message_ = "";
-    public string Message {
-      get { return message_; }
-      set {
-        message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (Error != 0) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt32(Error);
-      }
-      if (Message.Length != 0) {
-        output.WriteRawTag(226, 5);
-        output.WriteString(Message);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Error != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(Error);
-      }
-      if (Message.Length != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeStringSize(Message);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      rpcId_ = 0;
-      error_ = 0;
-      message_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            Error = input.ReadInt32();
-            break;
-          }
-          case 738: {
-            Message = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class C2G_EnterMap : pb::IMessage {
-    private static readonly pb::MessageParser<C2G_EnterMap> _parser = new pb::MessageParser<C2G_EnterMap>(() => (C2G_EnterMap)MessagePool.Instance.Fetch(typeof(C2G_EnterMap)));
-    public static pb::MessageParser<C2G_EnterMap> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      rpcId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class G2C_EnterMap : pb::IMessage {
-    private static readonly pb::MessageParser<G2C_EnterMap> _parser = new pb::MessageParser<G2C_EnterMap>(() => (G2C_EnterMap)MessagePool.Instance.Fetch(typeof(G2C_EnterMap)));
-    public static pb::MessageParser<G2C_EnterMap> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private int error_;
-    public int Error {
-      get { return error_; }
-      set {
-        error_ = value;
-      }
-    }
-
-    private string message_ = "";
-    public string Message {
-      get { return message_; }
-      set {
-        message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    private long unitId_;
-    /// <summary>
-    /// 自己的unit id
-    /// </summary>
-    public long UnitId {
-      get { return unitId_; }
-      set {
-        unitId_ = value;
-      }
-    }
-
-    private static readonly pb::FieldCodec<global::ET.UnitInfo> _repeated_units_codec
-        = pb::FieldCodec.ForMessage(18, global::ET.UnitInfo.Parser);
-    private pbc::RepeatedField<global::ET.UnitInfo> units_ = new pbc::RepeatedField<global::ET.UnitInfo>();
-    /// <summary>
-    /// 所有的unit
-    /// </summary>
-    public pbc::RepeatedField<global::ET.UnitInfo> Units {
-      get { return units_; }
-      set { units_ = value; }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (UnitId != 0L) {
-        output.WriteRawTag(8);
-        output.WriteInt64(UnitId);
-      }
-      units_.WriteTo(output, _repeated_units_codec);
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (Error != 0) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt32(Error);
-      }
-      if (Message.Length != 0) {
-        output.WriteRawTag(226, 5);
-        output.WriteString(Message);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Error != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(Error);
-      }
-      if (Message.Length != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeStringSize(Message);
-      }
-      if (UnitId != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(UnitId);
-      }
-      size += units_.CalculateSize(_repeated_units_codec);
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      unitId_ = 0;
-      for (int i = 0; i < units_.Count; i++) { MessagePool.Instance.Recycle(units_[i]); }
-      units_.Clear();
-      rpcId_ = 0;
-      error_ = 0;
-      message_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 8: {
-            UnitId = input.ReadInt64();
-            break;
-          }
-          case 18: {
-            units_.AddEntriesFrom(input, _repeated_units_codec);
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            Error = input.ReadInt32();
-            break;
-          }
-          case 738: {
-            Message = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class UnitInfo : pb::IMessage {
-    private static readonly pb::MessageParser<UnitInfo> _parser = new pb::MessageParser<UnitInfo>(() => (UnitInfo)MessagePool.Instance.Fetch(typeof(UnitInfo)));
-    public static pb::MessageParser<UnitInfo> Parser { get { return _parser; } }
-
-    private long unitId_;
-    public long UnitId {
-      get { return unitId_; }
-      set {
-        unitId_ = value;
-      }
-    }
-
-    private float x_;
-    public float X {
-      get { return x_; }
-      set {
-        x_ = value;
-      }
-    }
-
-    private float y_;
-    public float Y {
-      get { return y_; }
-      set {
-        y_ = value;
-      }
-    }
-
-    private float z_;
-    public float Z {
-      get { return z_; }
-      set {
-        z_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (UnitId != 0L) {
-        output.WriteRawTag(8);
-        output.WriteInt64(UnitId);
-      }
-      if (X != 0F) {
-        output.WriteRawTag(21);
-        output.WriteFloat(X);
-      }
-      if (Y != 0F) {
-        output.WriteRawTag(29);
-        output.WriteFloat(Y);
-      }
-      if (Z != 0F) {
-        output.WriteRawTag(37);
-        output.WriteFloat(Z);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (UnitId != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(UnitId);
-      }
-      if (X != 0F) {
-        size += 1 + 4;
-      }
-      if (Y != 0F) {
-        size += 1 + 4;
-      }
-      if (Z != 0F) {
-        size += 1 + 4;
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      unitId_ = 0;
-      x_ = 0f;
-      y_ = 0f;
-      z_ = 0f;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 8: {
-            UnitId = input.ReadInt64();
-            break;
-          }
-          case 21: {
-            X = input.ReadFloat();
-            break;
-          }
-          case 29: {
-            Y = input.ReadFloat();
-            break;
-          }
-          case 37: {
-            Z = input.ReadFloat();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class M2C_CreateUnits : pb::IMessage {
-    private static readonly pb::MessageParser<M2C_CreateUnits> _parser = new pb::MessageParser<M2C_CreateUnits>(() => (M2C_CreateUnits)MessagePool.Instance.Fetch(typeof(M2C_CreateUnits)));
-    public static pb::MessageParser<M2C_CreateUnits> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private long actorId_;
-    public long ActorId {
-      get { return actorId_; }
-      set {
-        actorId_ = value;
-      }
-    }
-
-    private static readonly pb::FieldCodec<global::ET.UnitInfo> _repeated_units_codec
-        = pb::FieldCodec.ForMessage(10, global::ET.UnitInfo.Parser);
-    private pbc::RepeatedField<global::ET.UnitInfo> units_ = new pbc::RepeatedField<global::ET.UnitInfo>();
-    public pbc::RepeatedField<global::ET.UnitInfo> Units {
-      get { return units_; }
-      set { units_ = value; }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      units_.WriteTo(output, _repeated_units_codec);
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (ActorId != 0L) {
-        output.WriteRawTag(232, 5);
-        output.WriteInt64(ActorId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (ActorId != 0L) {
-        size += 2 + pb::CodedOutputStream.ComputeInt64Size(ActorId);
-      }
-      size += units_.CalculateSize(_repeated_units_codec);
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      for (int i = 0; i < units_.Count; i++) { MessagePool.Instance.Recycle(units_[i]); }
-      units_.Clear();
-      rpcId_ = 0;
-      actorId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            units_.AddEntriesFrom(input, _repeated_units_codec);
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 744: {
-            ActorId = input.ReadInt64();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class Frame_ClickMap : pb::IMessage {
-    private static readonly pb::MessageParser<Frame_ClickMap> _parser = new pb::MessageParser<Frame_ClickMap>(() => (Frame_ClickMap)MessagePool.Instance.Fetch(typeof(Frame_ClickMap)));
-    public static pb::MessageParser<Frame_ClickMap> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private long actorId_;
-    public long ActorId {
-      get { return actorId_; }
-      set {
-        actorId_ = value;
-      }
-    }
-
-    private long id_;
-    public long Id {
-      get { return id_; }
-      set {
-        id_ = value;
-      }
-    }
-
-    private float x_;
-    public float X {
-      get { return x_; }
-      set {
-        x_ = value;
-      }
-    }
-
-    private float y_;
-    public float Y {
-      get { return y_; }
-      set {
-        y_ = value;
-      }
-    }
-
-    private float z_;
-    public float Z {
-      get { return z_; }
-      set {
-        z_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (X != 0F) {
-        output.WriteRawTag(13);
-        output.WriteFloat(X);
-      }
-      if (Y != 0F) {
-        output.WriteRawTag(21);
-        output.WriteFloat(Y);
-      }
-      if (Z != 0F) {
-        output.WriteRawTag(29);
-        output.WriteFloat(Z);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (ActorId != 0L) {
-        output.WriteRawTag(232, 5);
-        output.WriteInt64(ActorId);
-      }
-      if (Id != 0L) {
-        output.WriteRawTag(240, 5);
-        output.WriteInt64(Id);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (ActorId != 0L) {
-        size += 2 + pb::CodedOutputStream.ComputeInt64Size(ActorId);
-      }
-      if (Id != 0L) {
-        size += 2 + pb::CodedOutputStream.ComputeInt64Size(Id);
-      }
-      if (X != 0F) {
-        size += 1 + 4;
-      }
-      if (Y != 0F) {
-        size += 1 + 4;
-      }
-      if (Z != 0F) {
-        size += 1 + 4;
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      x_ = 0f;
-      y_ = 0f;
-      z_ = 0f;
-      rpcId_ = 0;
-      actorId_ = 0;
-      id_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 13: {
-            X = input.ReadFloat();
-            break;
-          }
-          case 21: {
-            Y = input.ReadFloat();
-            break;
-          }
-          case 29: {
-            Z = input.ReadFloat();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 744: {
-            ActorId = input.ReadInt64();
-            break;
-          }
-          case 752: {
-            Id = input.ReadInt64();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class M2C_PathfindingResult : pb::IMessage {
-    private static readonly pb::MessageParser<M2C_PathfindingResult> _parser = new pb::MessageParser<M2C_PathfindingResult>(() => (M2C_PathfindingResult)MessagePool.Instance.Fetch(typeof(M2C_PathfindingResult)));
-    public static pb::MessageParser<M2C_PathfindingResult> Parser { get { return _parser; } }
-
-    private long actorId_;
-    public long ActorId {
-      get { return actorId_; }
-      set {
-        actorId_ = value;
-      }
-    }
-
-    private long id_;
-    public long Id {
-      get { return id_; }
-      set {
-        id_ = value;
-      }
-    }
-
-    private float x_;
-    public float X {
-      get { return x_; }
-      set {
-        x_ = value;
-      }
-    }
-
-    private float y_;
-    public float Y {
-      get { return y_; }
-      set {
-        y_ = value;
-      }
-    }
-
-    private float z_;
-    public float Z {
-      get { return z_; }
-      set {
-        z_ = value;
-      }
-    }
-
-    private static readonly pb::FieldCodec<float> _repeated_xs_codec
-        = pb::FieldCodec.ForFloat(42);
-    private pbc::RepeatedField<float> xs_ = new pbc::RepeatedField<float>();
-    public pbc::RepeatedField<float> Xs {
-      get { return xs_; }
-      set { xs_ = value; }
-    }
-
-    private static readonly pb::FieldCodec<float> _repeated_ys_codec
-        = pb::FieldCodec.ForFloat(50);
-    private pbc::RepeatedField<float> ys_ = new pbc::RepeatedField<float>();
-    public pbc::RepeatedField<float> Ys {
-      get { return ys_; }
-      set { ys_ = value; }
-    }
-
-    private static readonly pb::FieldCodec<float> _repeated_zs_codec
-        = pb::FieldCodec.ForFloat(58);
-    private pbc::RepeatedField<float> zs_ = new pbc::RepeatedField<float>();
-    public pbc::RepeatedField<float> Zs {
-      get { return zs_; }
-      set { zs_ = value; }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Id != 0L) {
-        output.WriteRawTag(8);
-        output.WriteInt64(Id);
-      }
-      if (X != 0F) {
-        output.WriteRawTag(21);
-        output.WriteFloat(X);
-      }
-      if (Y != 0F) {
-        output.WriteRawTag(29);
-        output.WriteFloat(Y);
-      }
-      if (Z != 0F) {
-        output.WriteRawTag(37);
-        output.WriteFloat(Z);
-      }
-      xs_.WriteTo(output, _repeated_xs_codec);
-      ys_.WriteTo(output, _repeated_ys_codec);
-      zs_.WriteTo(output, _repeated_zs_codec);
-      if (ActorId != 0L) {
-        output.WriteRawTag(232, 5);
-        output.WriteInt64(ActorId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (ActorId != 0L) {
-        size += 2 + pb::CodedOutputStream.ComputeInt64Size(ActorId);
-      }
-      if (Id != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(Id);
-      }
-      if (X != 0F) {
-        size += 1 + 4;
-      }
-      if (Y != 0F) {
-        size += 1 + 4;
-      }
-      if (Z != 0F) {
-        size += 1 + 4;
-      }
-      size += xs_.CalculateSize(_repeated_xs_codec);
-      size += ys_.CalculateSize(_repeated_ys_codec);
-      size += zs_.CalculateSize(_repeated_zs_codec);
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      id_ = 0;
-      x_ = 0f;
-      y_ = 0f;
-      z_ = 0f;
-      xs_.Clear();
-      ys_.Clear();
-      zs_.Clear();
-      actorId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 8: {
-            Id = input.ReadInt64();
-            break;
-          }
-          case 21: {
-            X = input.ReadFloat();
-            break;
-          }
-          case 29: {
-            Y = input.ReadFloat();
-            break;
-          }
-          case 37: {
-            Z = input.ReadFloat();
-            break;
-          }
-          case 42:
-          case 45: {
-            xs_.AddEntriesFrom(input, _repeated_xs_codec);
-            break;
-          }
-          case 50:
-          case 53: {
-            ys_.AddEntriesFrom(input, _repeated_ys_codec);
-            break;
-          }
-          case 58:
-          case 61: {
-            zs_.AddEntriesFrom(input, _repeated_zs_codec);
-            break;
-          }
-          case 744: {
-            ActorId = input.ReadInt64();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class C2R_Ping : pb::IMessage {
-    private static readonly pb::MessageParser<C2R_Ping> _parser = new pb::MessageParser<C2R_Ping>(() => (C2R_Ping)MessagePool.Instance.Fetch(typeof(C2R_Ping)));
-    public static pb::MessageParser<C2R_Ping> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      rpcId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class R2C_Ping : pb::IMessage {
-    private static readonly pb::MessageParser<R2C_Ping> _parser = new pb::MessageParser<R2C_Ping>(() => (R2C_Ping)MessagePool.Instance.Fetch(typeof(R2C_Ping)));
-    public static pb::MessageParser<R2C_Ping> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private int error_;
-    public int Error {
-      get { return error_; }
-      set {
-        error_ = value;
-      }
-    }
-
-    private string message_ = "";
-    public string Message {
-      get { return message_; }
-      set {
-        message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (Error != 0) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt32(Error);
-      }
-      if (Message.Length != 0) {
-        output.WriteRawTag(226, 5);
-        output.WriteString(Message);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Error != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(Error);
-      }
-      if (Message.Length != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeStringSize(Message);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      rpcId_ = 0;
-      error_ = 0;
-      message_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            Error = input.ReadInt32();
-            break;
-          }
-          case 738: {
-            Message = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class G2C_Test : pb::IMessage {
-    private static readonly pb::MessageParser<G2C_Test> _parser = new pb::MessageParser<G2C_Test>(() => (G2C_Test)MessagePool.Instance.Fetch(typeof(G2C_Test)));
-    public static pb::MessageParser<G2C_Test> Parser { get { return _parser; } }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-        }
-      }
-    }
-
-  }
-
-  public partial class C2M_Reload : pb::IMessage {
-    private static readonly pb::MessageParser<C2M_Reload> _parser = new pb::MessageParser<C2M_Reload>(() => (C2M_Reload)MessagePool.Instance.Fetch(typeof(C2M_Reload)));
-    public static pb::MessageParser<C2M_Reload> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private string account_ = "";
-    public string Account {
-      get { return account_; }
-      set {
-        account_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    private string password_ = "";
-    public string Password {
-      get { return password_; }
-      set {
-        password_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Account.Length != 0) {
-        output.WriteRawTag(10);
-        output.WriteString(Account);
-      }
-      if (Password.Length != 0) {
-        output.WriteRawTag(18);
-        output.WriteString(Password);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Account.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Account);
-      }
-      if (Password.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Password);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      account_ = "";
-      password_ = "";
-      rpcId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            Account = input.ReadString();
-            break;
-          }
-          case 18: {
-            Password = input.ReadString();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class M2C_Reload : pb::IMessage {
-    private static readonly pb::MessageParser<M2C_Reload> _parser = new pb::MessageParser<M2C_Reload>(() => (M2C_Reload)MessagePool.Instance.Fetch(typeof(M2C_Reload)));
-    public static pb::MessageParser<M2C_Reload> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private int error_;
-    public int Error {
-      get { return error_; }
-      set {
-        error_ = value;
-      }
-    }
-
-    private string message_ = "";
-    public string Message {
-      get { return message_; }
-      set {
-        message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (Error != 0) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt32(Error);
-      }
-      if (Message.Length != 0) {
-        output.WriteRawTag(226, 5);
-        output.WriteString(Message);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Error != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(Error);
-      }
-      if (Message.Length != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeStringSize(Message);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      rpcId_ = 0;
-      error_ = 0;
-      message_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            Error = input.ReadInt32();
-            break;
-          }
-          case 738: {
-            Message = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class C2R_Login : pb::IMessage {
-    private static readonly pb::MessageParser<C2R_Login> _parser = new pb::MessageParser<C2R_Login>(() => (C2R_Login)MessagePool.Instance.Fetch(typeof(C2R_Login)));
-    public static pb::MessageParser<C2R_Login> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private string account_ = "";
-    /// <summary>
-    /// 帐号
-    /// </summary>
-    public string Account {
-      get { return account_; }
-      set {
-        account_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    private string password_ = "";
-    /// <summary>
-    /// 密码
-    /// </summary>
-    public string Password {
-      get { return password_; }
-      set {
-        password_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Account.Length != 0) {
-        output.WriteRawTag(10);
-        output.WriteString(Account);
-      }
-      if (Password.Length != 0) {
-        output.WriteRawTag(18);
-        output.WriteString(Password);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Account.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Account);
-      }
-      if (Password.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Password);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      account_ = "";
-      password_ = "";
-      rpcId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            Account = input.ReadString();
-            break;
-          }
-          case 18: {
-            Password = input.ReadString();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class R2C_Login : pb::IMessage {
-    private static readonly pb::MessageParser<R2C_Login> _parser = new pb::MessageParser<R2C_Login>(() => (R2C_Login)MessagePool.Instance.Fetch(typeof(R2C_Login)));
-    public static pb::MessageParser<R2C_Login> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private int error_;
-    public int Error {
-      get { return error_; }
-      set {
-        error_ = value;
-      }
-    }
-
-    private string message_ = "";
-    public string Message {
-      get { return message_; }
-      set {
-        message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    private string address_ = "";
-    public string Address {
-      get { return address_; }
-      set {
-        address_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    private long key_;
-    public long Key {
-      get { return key_; }
-      set {
-        key_ = value;
-      }
-    }
-
-    private long gateId_;
-    public long GateId {
-      get { return gateId_; }
-      set {
-        gateId_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Address.Length != 0) {
-        output.WriteRawTag(10);
-        output.WriteString(Address);
-      }
-      if (Key != 0L) {
-        output.WriteRawTag(16);
-        output.WriteInt64(Key);
-      }
-      if (GateId != 0L) {
-        output.WriteRawTag(24);
-        output.WriteInt64(GateId);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (Error != 0) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt32(Error);
-      }
-      if (Message.Length != 0) {
-        output.WriteRawTag(226, 5);
-        output.WriteString(Message);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Error != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(Error);
-      }
-      if (Message.Length != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeStringSize(Message);
-      }
-      if (Address.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Address);
-      }
-      if (Key != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(Key);
-      }
-      if (GateId != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(GateId);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      address_ = "";
-      key_ = 0;
-      gateId_ = 0;
-      rpcId_ = 0;
-      error_ = 0;
-      message_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            Address = input.ReadString();
-            break;
-          }
-          case 16: {
-            Key = input.ReadInt64();
-            break;
-          }
-          case 24: {
-            GateId = input.ReadInt64();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            Error = input.ReadInt32();
-            break;
-          }
-          case 738: {
-            Message = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class C2G_LoginGate : pb::IMessage {
-    private static readonly pb::MessageParser<C2G_LoginGate> _parser = new pb::MessageParser<C2G_LoginGate>(() => (C2G_LoginGate)MessagePool.Instance.Fetch(typeof(C2G_LoginGate)));
-    public static pb::MessageParser<C2G_LoginGate> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private long key_;
-    /// <summary>
-    /// 帐号
-    /// </summary>
-    public long Key {
-      get { return key_; }
-      set {
-        key_ = value;
-      }
-    }
-
-    private long gateId_;
-    public long GateId {
-      get { return gateId_; }
-      set {
-        gateId_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Key != 0L) {
-        output.WriteRawTag(8);
-        output.WriteInt64(Key);
-      }
-      if (GateId != 0L) {
-        output.WriteRawTag(16);
-        output.WriteInt64(GateId);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Key != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(Key);
-      }
-      if (GateId != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(GateId);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      key_ = 0;
-      gateId_ = 0;
-      rpcId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 8: {
-            Key = input.ReadInt64();
-            break;
-          }
-          case 16: {
-            GateId = input.ReadInt64();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class G2C_LoginGate : pb::IMessage {
-    private static readonly pb::MessageParser<G2C_LoginGate> _parser = new pb::MessageParser<G2C_LoginGate>(() => (G2C_LoginGate)MessagePool.Instance.Fetch(typeof(G2C_LoginGate)));
-    public static pb::MessageParser<G2C_LoginGate> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private int error_;
-    public int Error {
-      get { return error_; }
-      set {
-        error_ = value;
-      }
-    }
-
-    private string message_ = "";
-    public string Message {
-      get { return message_; }
-      set {
-        message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    private long playerId_;
-    public long PlayerId {
-      get { return playerId_; }
-      set {
-        playerId_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (PlayerId != 0L) {
-        output.WriteRawTag(8);
-        output.WriteInt64(PlayerId);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (Error != 0) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt32(Error);
-      }
-      if (Message.Length != 0) {
-        output.WriteRawTag(226, 5);
-        output.WriteString(Message);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Error != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(Error);
-      }
-      if (Message.Length != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeStringSize(Message);
-      }
-      if (PlayerId != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(PlayerId);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      playerId_ = 0;
-      rpcId_ = 0;
-      error_ = 0;
-      message_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 8: {
-            PlayerId = input.ReadInt64();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            Error = input.ReadInt32();
-            break;
-          }
-          case 738: {
-            Message = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class G2C_TestHotfixMessage : pb::IMessage {
-    private static readonly pb::MessageParser<G2C_TestHotfixMessage> _parser = new pb::MessageParser<G2C_TestHotfixMessage>(() => (G2C_TestHotfixMessage)MessagePool.Instance.Fetch(typeof(G2C_TestHotfixMessage)));
-    public static pb::MessageParser<G2C_TestHotfixMessage> Parser { get { return _parser; } }
-
-    private string info_ = "";
-    public string Info {
-      get { return info_; }
-      set {
-        info_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Info.Length != 0) {
-        output.WriteRawTag(10);
-        output.WriteString(Info);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (Info.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Info);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      info_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            Info = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class C2M_TestActorRequest : pb::IMessage {
-    private static readonly pb::MessageParser<C2M_TestActorRequest> _parser = new pb::MessageParser<C2M_TestActorRequest>(() => (C2M_TestActorRequest)MessagePool.Instance.Fetch(typeof(C2M_TestActorRequest)));
-    public static pb::MessageParser<C2M_TestActorRequest> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private long actorId_;
-    public long ActorId {
-      get { return actorId_; }
-      set {
-        actorId_ = value;
-      }
-    }
-
-    private string info_ = "";
-    public string Info {
-      get { return info_; }
-      set {
-        info_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Info.Length != 0) {
-        output.WriteRawTag(10);
-        output.WriteString(Info);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (ActorId != 0L) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt64(ActorId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (ActorId != 0L) {
-        size += 2 + pb::CodedOutputStream.ComputeInt64Size(ActorId);
-      }
-      if (Info.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Info);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      info_ = "";
-      rpcId_ = 0;
-      actorId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            Info = input.ReadString();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            ActorId = input.ReadInt64();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class M2C_TestActorResponse : pb::IMessage {
-    private static readonly pb::MessageParser<M2C_TestActorResponse> _parser = new pb::MessageParser<M2C_TestActorResponse>(() => (M2C_TestActorResponse)MessagePool.Instance.Fetch(typeof(M2C_TestActorResponse)));
-    public static pb::MessageParser<M2C_TestActorResponse> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private int error_;
-    public int Error {
-      get { return error_; }
-      set {
-        error_ = value;
-      }
-    }
-
-    private string message_ = "";
-    public string Message {
-      get { return message_; }
-      set {
-        message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    private string info_ = "";
-    public string Info {
-      get { return info_; }
-      set {
-        info_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (Info.Length != 0) {
-        output.WriteRawTag(10);
-        output.WriteString(Info);
-      }
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (Error != 0) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt32(Error);
-      }
-      if (Message.Length != 0) {
-        output.WriteRawTag(226, 5);
-        output.WriteString(Message);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Error != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(Error);
-      }
-      if (Message.Length != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeStringSize(Message);
-      }
-      if (Info.Length != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeStringSize(Info);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      info_ = "";
-      rpcId_ = 0;
-      error_ = 0;
-      message_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            Info = input.ReadString();
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            Error = input.ReadInt32();
-            break;
-          }
-          case 738: {
-            Message = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class PlayerInfo : pb::IMessage {
-    private static readonly pb::MessageParser<PlayerInfo> _parser = new pb::MessageParser<PlayerInfo>(() => (PlayerInfo)MessagePool.Instance.Fetch(typeof(PlayerInfo)));
-    public static pb::MessageParser<PlayerInfo> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      rpcId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class C2G_PlayerInfo : pb::IMessage {
-    private static readonly pb::MessageParser<C2G_PlayerInfo> _parser = new pb::MessageParser<C2G_PlayerInfo>(() => (C2G_PlayerInfo)MessagePool.Instance.Fetch(typeof(C2G_PlayerInfo)));
-    public static pb::MessageParser<C2G_PlayerInfo> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      rpcId_ = 0;
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  public partial class G2C_PlayerInfo : pb::IMessage {
-    private static readonly pb::MessageParser<G2C_PlayerInfo> _parser = new pb::MessageParser<G2C_PlayerInfo>(() => (G2C_PlayerInfo)MessagePool.Instance.Fetch(typeof(G2C_PlayerInfo)));
-    public static pb::MessageParser<G2C_PlayerInfo> Parser { get { return _parser; } }
-
-    private int rpcId_;
-    public int RpcId {
-      get { return rpcId_; }
-      set {
-        rpcId_ = value;
-      }
-    }
-
-    private int error_;
-    public int Error {
-      get { return error_; }
-      set {
-        error_ = value;
-      }
-    }
-
-    private string message_ = "";
-    public string Message {
-      get { return message_; }
-      set {
-        message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
-      }
-    }
-
-    private global::ET.PlayerInfo playerInfo_;
-    public global::ET.PlayerInfo PlayerInfo {
-      get { return playerInfo_; }
-      set {
-        playerInfo_ = value;
-      }
-    }
-
-    private static readonly pb::FieldCodec<global::ET.PlayerInfo> _repeated_playerInfos_codec
-        = pb::FieldCodec.ForMessage(18, global::ET.PlayerInfo.Parser);
-    private pbc::RepeatedField<global::ET.PlayerInfo> playerInfos_ = new pbc::RepeatedField<global::ET.PlayerInfo>();
-    public pbc::RepeatedField<global::ET.PlayerInfo> PlayerInfos {
-      get { return playerInfos_; }
-      set { playerInfos_ = value; }
-    }
-
-    private static readonly pb::FieldCodec<string> _repeated_testRepeatedString_codec
-        = pb::FieldCodec.ForString(26);
-    private pbc::RepeatedField<string> testRepeatedString_ = new pbc::RepeatedField<string>();
-    public pbc::RepeatedField<string> TestRepeatedString {
-      get { return testRepeatedString_; }
-      set { testRepeatedString_ = value; }
-    }
-
-    private static readonly pb::FieldCodec<int> _repeated_testRepeatedInt32_codec
-        = pb::FieldCodec.ForInt32(34);
-    private pbc::RepeatedField<int> testRepeatedInt32_ = new pbc::RepeatedField<int>();
-    public pbc::RepeatedField<int> TestRepeatedInt32 {
-      get { return testRepeatedInt32_; }
-      set { testRepeatedInt32_ = value; }
-    }
-
-    private static readonly pb::FieldCodec<long> _repeated_testRepeatedInt64_codec
-        = pb::FieldCodec.ForInt64(42);
-    private pbc::RepeatedField<long> testRepeatedInt64_ = new pbc::RepeatedField<long>();
-    public pbc::RepeatedField<long> TestRepeatedInt64 {
-      get { return testRepeatedInt64_; }
-      set { testRepeatedInt64_ = value; }
-    }
-
-    public void WriteTo(pb::CodedOutputStream output) {
-      if (playerInfo_ != null) {
-        output.WriteRawTag(10);
-        output.WriteMessage(PlayerInfo);
-      }
-      playerInfos_.WriteTo(output, _repeated_playerInfos_codec);
-      testRepeatedString_.WriteTo(output, _repeated_testRepeatedString_codec);
-      testRepeatedInt32_.WriteTo(output, _repeated_testRepeatedInt32_codec);
-      testRepeatedInt64_.WriteTo(output, _repeated_testRepeatedInt64_codec);
-      if (RpcId != 0) {
-        output.WriteRawTag(208, 5);
-        output.WriteInt32(RpcId);
-      }
-      if (Error != 0) {
-        output.WriteRawTag(216, 5);
-        output.WriteInt32(Error);
-      }
-      if (Message.Length != 0) {
-        output.WriteRawTag(226, 5);
-        output.WriteString(Message);
-      }
-    }
-
-    public int CalculateSize() {
-      int size = 0;
-      if (RpcId != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(RpcId);
-      }
-      if (Error != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeInt32Size(Error);
-      }
-      if (Message.Length != 0) {
-        size += 2 + pb::CodedOutputStream.ComputeStringSize(Message);
-      }
-      if (playerInfo_ != null) {
-        size += 1 + pb::CodedOutputStream.ComputeMessageSize(PlayerInfo);
-      }
-      size += playerInfos_.CalculateSize(_repeated_playerInfos_codec);
-      size += testRepeatedString_.CalculateSize(_repeated_testRepeatedString_codec);
-      size += testRepeatedInt32_.CalculateSize(_repeated_testRepeatedInt32_codec);
-      size += testRepeatedInt64_.CalculateSize(_repeated_testRepeatedInt64_codec);
-      return size;
-    }
-
-    public void MergeFrom(pb::CodedInputStream input) {
-      if (playerInfo_ != null) MessagePool.Instance.Recycle(playerInfo_); playerInfo_ = null;
-      for (int i = 0; i < playerInfos_.Count; i++) { MessagePool.Instance.Recycle(playerInfos_[i]); }
-      playerInfos_.Clear();
-      testRepeatedString_.Clear();
-      testRepeatedInt32_.Clear();
-      testRepeatedInt64_.Clear();
-      rpcId_ = 0;
-      error_ = 0;
-      message_ = "";
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-          case 10: {
-            if (playerInfo_ == null) {
-              playerInfo_ = new global::ET.PlayerInfo();
-            }
-            input.ReadMessage(playerInfo_);
-            break;
-          }
-          case 18: {
-            playerInfos_.AddEntriesFrom(input, _repeated_playerInfos_codec);
-            break;
-          }
-          case 26: {
-            testRepeatedString_.AddEntriesFrom(input, _repeated_testRepeatedString_codec);
-            break;
-          }
-          case 34:
-          case 32: {
-            testRepeatedInt32_.AddEntriesFrom(input, _repeated_testRepeatedInt32_codec);
-            break;
-          }
-          case 42:
-          case 40: {
-            testRepeatedInt64_.AddEntriesFrom(input, _repeated_testRepeatedInt64_codec);
-            break;
-          }
-          case 720: {
-            RpcId = input.ReadInt32();
-            break;
-          }
-          case 728: {
-            Error = input.ReadInt32();
-            break;
-          }
-          case 738: {
-            Message = input.ReadString();
-            break;
-          }
-        }
-      }
-    }
-
-  }
-
-  #endregion
+using ET;
+using ProtoBuf;
+using System.Collections.Generic;
+namespace ET
+{
+	[Message(OuterOpcode.C2M_TestRequest)]
+	[ProtoContract]
+	public partial class C2M_TestRequest: IActorLocationRequest
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(93)]
+		public long ActorId { get; set; }
 
-}
+		[ProtoMember(1)]
+		public string request { get; set; }
+
+	}
+
+	[Message(OuterOpcode.M2C_TestResponse)]
+	[ProtoContract]
+	public partial class M2C_TestResponse: IActorLocationResponse
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public int Error { get; set; }
+
+		[ProtoMember(92)]
+		public string Message { get; set; }
+
+		[ProtoMember(1)]
+		public string response { get; set; }
+
+	}
+
+	[Message(OuterOpcode.Actor_TransferRequest)]
+	[ProtoContract]
+	public partial class Actor_TransferRequest: IActorLocationRequest
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(93)]
+		public long ActorId { get; set; }
+
+		[ProtoMember(1)]
+		public int MapIndex { get; set; }
+
+	}
+
+	[Message(OuterOpcode.Actor_TransferResponse)]
+	[ProtoContract]
+	public partial class Actor_TransferResponse: IActorLocationResponse
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public int Error { get; set; }
+
+		[ProtoMember(92)]
+		public string Message { get; set; }
+
+	}
+
+	[Message(OuterOpcode.C2G_EnterMap)]
+	[ProtoContract]
+	public partial class C2G_EnterMap: IRequest
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+	}
+
+	[Message(OuterOpcode.G2C_EnterMap)]
+	[ProtoContract]
+	public partial class G2C_EnterMap: IResponse
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public int Error { get; set; }
+
+		[ProtoMember(92)]
+		public string Message { get; set; }
+
+// 自己的unit id
+// 自己的unit id
+		[ProtoMember(1)]
+		public long UnitId { get; set; }
+
+// 所有的unit
+// 所有的unit
+		[ProtoMember(2)]
+		public List<UnitInfo> Units = new List<UnitInfo>();
+
+	}
+
+	[Message(OuterOpcode.UnitInfo)]
+	[ProtoContract]
+	public partial class UnitInfo
+	{
+		[ProtoMember(1)]
+		public long UnitId { get; set; }
+
+		[ProtoMember(2)]
+		public float X { get; set; }
+
+		[ProtoMember(3)]
+		public float Y { get; set; }
+
+		[ProtoMember(4)]
+		public float Z { get; set; }
+
+	}
+
+	[Message(OuterOpcode.M2C_CreateUnits)]
+	[ProtoContract]
+	public partial class M2C_CreateUnits: IActorMessage
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(93)]
+		public long ActorId { get; set; }
+
+		[ProtoMember(1)]
+		public List<UnitInfo> Units = new List<UnitInfo>();
+
+	}
+
+	[Message(OuterOpcode.Frame_ClickMap)]
+	[ProtoContract]
+	public partial class Frame_ClickMap: IActorLocationMessage
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(93)]
+		public long ActorId { get; set; }
+
+		[ProtoMember(94)]
+		public long Id { get; set; }
+
+		[ProtoMember(1)]
+		public float X { get; set; }
+
+		[ProtoMember(2)]
+		public float Y { get; set; }
+
+		[ProtoMember(3)]
+		public float Z { get; set; }
+
+	}
+
+	[Message(OuterOpcode.M2C_PathfindingResult)]
+	[ProtoContract]
+	public partial class M2C_PathfindingResult: IActorMessage
+	{
+		[ProtoMember(93)]
+		public long ActorId { get; set; }
+
+		[ProtoMember(1)]
+		public long Id { get; set; }
+
+		[ProtoMember(2)]
+		public float X { get; set; }
+
+		[ProtoMember(3)]
+		public float Y { get; set; }
+
+		[ProtoMember(4)]
+		public float Z { get; set; }
+
+		[ProtoMember(5)]
+		public List<float> Xs = new List<float>();
+
+		[ProtoMember(6)]
+		public List<float> Ys = new List<float>();
+
+		[ProtoMember(7)]
+		public List<float> Zs = new List<float>();
+
+	}
+
+	[Message(OuterOpcode.C2R_Ping)]
+	[ProtoContract]
+	public partial class C2R_Ping: IRequest
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+	}
+
+	[Message(OuterOpcode.R2C_Ping)]
+	[ProtoContract]
+	public partial class R2C_Ping: IResponse
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public int Error { get; set; }
+
+		[ProtoMember(92)]
+		public string Message { get; set; }
+
+	}
 
-#endregion Designer generated code
+	[Message(OuterOpcode.G2C_Test)]
+	[ProtoContract]
+	public partial class G2C_Test: IMessage
+	{
+	}
+
+	[Message(OuterOpcode.C2M_Reload)]
+	[ProtoContract]
+	public partial class C2M_Reload: IRequest
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(1)]
+		public string Account { get; set; }
+
+		[ProtoMember(2)]
+		public string Password { get; set; }
+
+	}
+
+	[Message(OuterOpcode.M2C_Reload)]
+	[ProtoContract]
+	public partial class M2C_Reload: IResponse
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public int Error { get; set; }
+
+		[ProtoMember(92)]
+		public string Message { get; set; }
+
+	}
+
+	[Message(OuterOpcode.C2R_Login)]
+	[ProtoContract]
+	public partial class C2R_Login: IRequest
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(1)]
+		public string Account { get; set; }
+
+		[ProtoMember(2)]
+		public string Password { get; set; }
+
+	}
+
+	[Message(OuterOpcode.R2C_Login)]
+	[ProtoContract]
+	public partial class R2C_Login: IResponse
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public int Error { get; set; }
+
+		[ProtoMember(92)]
+		public string Message { get; set; }
+
+		[ProtoMember(1)]
+		public string Address { get; set; }
+
+		[ProtoMember(2)]
+		public long Key { get; set; }
+
+		[ProtoMember(3)]
+		public long GateId { get; set; }
+
+	}
+
+	[Message(OuterOpcode.C2G_LoginGate)]
+	[ProtoContract]
+	public partial class C2G_LoginGate: IRequest
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(1)]
+		public long Key { get; set; }
+
+		[ProtoMember(2)]
+		public long GateId { get; set; }
+
+	}
+
+	[Message(OuterOpcode.G2C_LoginGate)]
+	[ProtoContract]
+	public partial class G2C_LoginGate: IResponse
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public int Error { get; set; }
+
+		[ProtoMember(92)]
+		public string Message { get; set; }
+
+		[ProtoMember(1)]
+		public long PlayerId { get; set; }
+
+	}
+
+	[Message(OuterOpcode.G2C_TestHotfixMessage)]
+	[ProtoContract]
+	public partial class G2C_TestHotfixMessage: IMessage
+	{
+		[ProtoMember(1)]
+		public string Info { get; set; }
+
+	}
+
+	[Message(OuterOpcode.C2M_TestActorRequest)]
+	[ProtoContract]
+	public partial class C2M_TestActorRequest: IActorLocationRequest
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public long ActorId { get; set; }
+
+		[ProtoMember(1)]
+		public string Info { get; set; }
+
+	}
+
+	[Message(OuterOpcode.M2C_TestActorResponse)]
+	[ProtoContract]
+	public partial class M2C_TestActorResponse: IActorLocationResponse
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public int Error { get; set; }
+
+		[ProtoMember(92)]
+		public string Message { get; set; }
+
+		[ProtoMember(1)]
+		public string Info { get; set; }
+
+	}
+
+	[Message(OuterOpcode.PlayerInfo)]
+	[ProtoContract]
+	public partial class PlayerInfo: IMessage
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+	}
+
+	[Message(OuterOpcode.C2G_PlayerInfo)]
+	[ProtoContract]
+	public partial class C2G_PlayerInfo: IRequest
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+	}
+
+	[Message(OuterOpcode.G2C_PlayerInfo)]
+	[ProtoContract]
+	public partial class G2C_PlayerInfo: IResponse
+	{
+		[ProtoMember(90)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(91)]
+		public int Error { get; set; }
+
+		[ProtoMember(92)]
+		public string Message { get; set; }
+
+		[ProtoMember(1)]
+		public PlayerInfo PlayerInfo { get; set; }
+
+		[ProtoMember(2)]
+		public List<PlayerInfo> PlayerInfos = new List<PlayerInfo>();
+
+		[ProtoMember(3)]
+		public List<string> TestRepeatedString = new List<string>();
+
+		[ProtoMember(4)]
+		public List<int> TestRepeatedInt32 = new List<int>();
+
+		[ProtoMember(5)]
+		public List<long> TestRepeatedInt64 = new List<long>();
+
+	}
+
+}

+ 25 - 106
Unity/Assets/Model/Module/Message/OuterOpcode.cs

@@ -1,112 +1,31 @@
-
-namespace ET
-{
-	[Message(OuterOpcode.C2M_TestRequest)]
-	public partial class C2M_TestRequest : IActorLocationRequest {}
-
-	[Message(OuterOpcode.M2C_TestResponse)]
-	public partial class M2C_TestResponse : IActorLocationResponse {}
-
-	[Message(OuterOpcode.Actor_TransferRequest)]
-	public partial class Actor_TransferRequest : IActorLocationRequest {}
-
-	[Message(OuterOpcode.Actor_TransferResponse)]
-	public partial class Actor_TransferResponse : IActorLocationResponse {}
-
-	[Message(OuterOpcode.C2G_EnterMap)]
-	public partial class C2G_EnterMap : IRequest {}
-
-	[Message(OuterOpcode.G2C_EnterMap)]
-	public partial class G2C_EnterMap : IResponse {}
-
-// 自己的unit id
-// 所有的unit
-	[Message(OuterOpcode.UnitInfo)]
-	public partial class UnitInfo {}
-
-	[Message(OuterOpcode.M2C_CreateUnits)]
-	public partial class M2C_CreateUnits : IActorMessage {}
-
-	[Message(OuterOpcode.Frame_ClickMap)]
-	public partial class Frame_ClickMap : IActorLocationMessage {}
-
-	[Message(OuterOpcode.M2C_PathfindingResult)]
-	public partial class M2C_PathfindingResult : IActorMessage {}
-
-	[Message(OuterOpcode.C2R_Ping)]
-	public partial class C2R_Ping : IRequest {}
-
-	[Message(OuterOpcode.R2C_Ping)]
-	public partial class R2C_Ping : IResponse {}
-
-	[Message(OuterOpcode.G2C_Test)]
-	public partial class G2C_Test : IMessage {}
-
-	[Message(OuterOpcode.C2M_Reload)]
-	public partial class C2M_Reload : IRequest {}
-
-	[Message(OuterOpcode.M2C_Reload)]
-	public partial class M2C_Reload : IResponse {}
-
-	[Message(OuterOpcode.C2R_Login)]
-	public partial class C2R_Login : IRequest {}
-
-	[Message(OuterOpcode.R2C_Login)]
-	public partial class R2C_Login : IResponse {}
-
-	[Message(OuterOpcode.C2G_LoginGate)]
-	public partial class C2G_LoginGate : IRequest {}
-
-	[Message(OuterOpcode.G2C_LoginGate)]
-	public partial class G2C_LoginGate : IResponse {}
-
-	[Message(OuterOpcode.G2C_TestHotfixMessage)]
-	public partial class G2C_TestHotfixMessage : IMessage {}
-
-	[Message(OuterOpcode.C2M_TestActorRequest)]
-	public partial class C2M_TestActorRequest : IActorLocationRequest {}
-
-	[Message(OuterOpcode.M2C_TestActorResponse)]
-	public partial class M2C_TestActorResponse : IActorLocationResponse {}
-
-	[Message(OuterOpcode.PlayerInfo)]
-	public partial class PlayerInfo : IMessage {}
-
-	[Message(OuterOpcode.C2G_PlayerInfo)]
-	public partial class C2G_PlayerInfo : IRequest {}
-
-	[Message(OuterOpcode.G2C_PlayerInfo)]
-	public partial class G2C_PlayerInfo : IResponse {}
-
-}
 namespace ET
 {
 	public static partial class OuterOpcode
 	{
-		 public const ushort C2M_TestRequest = 101;
-		 public const ushort M2C_TestResponse = 102;
-		 public const ushort Actor_TransferRequest = 103;
-		 public const ushort Actor_TransferResponse = 104;
-		 public const ushort C2G_EnterMap = 105;
-		 public const ushort G2C_EnterMap = 106;
-		 public const ushort UnitInfo = 107;
-		 public const ushort M2C_CreateUnits = 108;
-		 public const ushort Frame_ClickMap = 109;
-		 public const ushort M2C_PathfindingResult = 110;
-		 public const ushort C2R_Ping = 111;
-		 public const ushort R2C_Ping = 112;
-		 public const ushort G2C_Test = 113;
-		 public const ushort C2M_Reload = 114;
-		 public const ushort M2C_Reload = 115;
-		 public const ushort C2R_Login = 116;
-		 public const ushort R2C_Login = 117;
-		 public const ushort C2G_LoginGate = 118;
-		 public const ushort G2C_LoginGate = 119;
-		 public const ushort G2C_TestHotfixMessage = 120;
-		 public const ushort C2M_TestActorRequest = 121;
-		 public const ushort M2C_TestActorResponse = 122;
-		 public const ushort PlayerInfo = 123;
-		 public const ushort C2G_PlayerInfo = 124;
-		 public const ushort G2C_PlayerInfo = 125;
+		 public const ushort C2M_TestRequest = 20001;
+		 public const ushort M2C_TestResponse = 20002;
+		 public const ushort Actor_TransferRequest = 20003;
+		 public const ushort Actor_TransferResponse = 20004;
+		 public const ushort C2G_EnterMap = 20005;
+		 public const ushort G2C_EnterMap = 20006;
+		 public const ushort UnitInfo = 20007;
+		 public const ushort M2C_CreateUnits = 20008;
+		 public const ushort Frame_ClickMap = 20009;
+		 public const ushort M2C_PathfindingResult = 20010;
+		 public const ushort C2R_Ping = 20011;
+		 public const ushort R2C_Ping = 20012;
+		 public const ushort G2C_Test = 20013;
+		 public const ushort C2M_Reload = 20014;
+		 public const ushort M2C_Reload = 20015;
+		 public const ushort C2R_Login = 20016;
+		 public const ushort R2C_Login = 20017;
+		 public const ushort C2G_LoginGate = 20018;
+		 public const ushort G2C_LoginGate = 20019;
+		 public const ushort G2C_TestHotfixMessage = 20020;
+		 public const ushort C2M_TestActorRequest = 20021;
+		 public const ushort M2C_TestActorResponse = 20022;
+		 public const ushort PlayerInfo = 20023;
+		 public const ushort C2G_PlayerInfo = 20024;
+		 public const ushort G2C_PlayerInfo = 20025;
 	}
 }

+ 4 - 50
Unity/Assets/Model/Module/Message/ProtobufHelper.cs

@@ -1,72 +1,26 @@
 using System;
-using System.ComponentModel;
 using System.IO;
-using Google.Protobuf;
 
 namespace ET
 {
 	public static class ProtobufHelper
 	{
-		public static byte[] ToBytes(object message)
-		{
-			return ((Google.Protobuf.IMessage) message).ToByteArray();
-		}
-		
 		public static void ToStream(object message, MemoryStream stream)
 		{
-			((Google.Protobuf.IMessage) message).WriteTo(stream);
+			ProtoBuf.Serializer.Serialize(stream, message);
 		}
 		
 		public static object FromBytes(Type type, byte[] bytes, int index, int count)
 		{
-			object message = Activator.CreateInstance(type);
-			((Google.Protobuf.IMessage)message).MergeFrom(bytes, index, count);
-			ISupportInitialize iSupportInitialize = message as ISupportInitialize;
-			if (iSupportInitialize == null)
-			{
-				return message;
-			}
-			iSupportInitialize.EndInit();
-			return message;
-		}
-		
-		public static object FromBytes(object instance, byte[] bytes, int index, int count)
-		{
-			object message = instance;
-			((Google.Protobuf.IMessage)message).MergeFrom(bytes, index, count);
-			ISupportInitialize iSupportInitialize = message as ISupportInitialize;
-			if (iSupportInitialize == null)
+			using (MemoryStream ms = new MemoryStream(bytes, index, count))
 			{
-				return message;
+				return ProtoBuf.Serializer.Deserialize(type, ms);
 			}
-			iSupportInitialize.EndInit();
-			return message;
 		}
 		
 		public static object FromStream(Type type, MemoryStream stream)
 		{
-			object message = Activator.CreateInstance(type);
-			((Google.Protobuf.IMessage)message).MergeFrom(stream.GetBuffer(), (int)stream.Position, (int)stream.Length);
-			ISupportInitialize iSupportInitialize = message as ISupportInitialize;
-			if (iSupportInitialize == null)
-			{
-				return message;
-			}
-			iSupportInitialize.EndInit();
-			return message;
-		}
-		
-		public static object FromStream(object message, MemoryStream stream)
-		{
-			// 这个message可以从池中获取,减少gc
-			((Google.Protobuf.IMessage)message).MergeFrom(stream.GetBuffer(), (int)stream.Position, (int)stream.Length);
-			ISupportInitialize iSupportInitialize = message as ISupportInitialize;
-			if (iSupportInitialize == null)
-			{
-				return message;
-			}
-			iSupportInitialize.EndInit();
-			return message;
+			return ProtoBuf.Serializer.Deserialize(type, stream);
 		}
 	}
 }

+ 0 - 15
Unity/Assets/Model/Module/Message/ProtobufPacker.cs

@@ -5,11 +5,6 @@ namespace ET
 {
 	public class ProtobufPacker : IMessagePacker
 	{
-		public byte[] SerializeTo(object obj)
-		{
-			return ProtobufHelper.ToBytes(obj);
-		}
-
 		public void SerializeTo(object obj, MemoryStream stream)
 		{
 			ProtobufHelper.ToStream(obj, stream);
@@ -20,19 +15,9 @@ namespace ET
 			return ProtobufHelper.FromBytes(type, bytes, index, count);
 		}
 
-		public object DeserializeFrom(object instance, byte[] bytes, int index, int count)
-		{
-			return ProtobufHelper.FromBytes(instance, bytes, index, count);
-		}
-
 		public object DeserializeFrom(Type type, MemoryStream stream)
 		{
 			return ProtobufHelper.FromStream(type, stream);
 		}
-
-		public object DeserializeFrom(object instance, MemoryStream stream)
-		{
-			return ProtobufHelper.FromStream(instance, stream);
-		}
 	}
 }

+ 2 - 10
Unity/Assets/Model/Module/Message/Session.cs

@@ -129,19 +129,11 @@ namespace ET
 			memoryStream.Seek(Packet.MessageIndex, SeekOrigin.Begin);
 			ushort opcode = BitConverter.ToUInt16(memoryStream.GetBuffer(), Packet.OpcodeIndex);
 			
-#if !SERVER
-			if (OpcodeHelper.IsClientHotfixMessage(opcode))
-			{
-				this.GetComponent<SessionCallbackComponent>().MessageCallback.Invoke(this, opcode, memoryStream);
-				return;
-			}
-#endif
-			
 			object message;
 			try
 			{
-				object instance = OpcodeTypeComponent.Instance.GetInstance(opcode);
-				message = this.Network.MessagePacker.DeserializeFrom(instance, memoryStream);
+				Type type = OpcodeTypeComponent.Instance.GetType(opcode);
+				message = this.Network.MessagePacker.DeserializeFrom(type, memoryStream);
 
 				if (OpcodeHelper.IsNeedDebugLogMessage(opcode))
 				{

+ 8 - 0
Unity/Assets/Model/Move.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 22d6f792265e14b95ae06ccb3a11601d
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 79
Unity/Assets/ThirdParty/Google.Protobuf/ByteArray.cs

@@ -1,79 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Provides a utility routine to copy small arrays much more quickly than Buffer.BlockCopy
-    /// </summary>
-    internal static class ByteArray
-    {
-        /// <summary>
-        /// The threshold above which you should use Buffer.BlockCopy rather than ByteArray.Copy
-        /// </summary>
-        private const int CopyThreshold = 12;
-
-        /// <summary>
-        /// Determines which copy routine to use based on the number of bytes to be copied.
-        /// </summary>
-        internal static void Copy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count)
-        {
-            if (count > CopyThreshold)
-            {
-                Buffer.BlockCopy(src, srcOffset, dst, dstOffset, count);
-            }
-            else
-            {
-                int stop = srcOffset + count;
-                for (int i = srcOffset; i < stop; i++)
-                {
-                    dst[dstOffset++] = src[i];
-                }
-            }
-        }
-
-        /// <summary>
-        /// Reverses the order of bytes in the array
-        /// </summary>
-        internal static void Reverse(byte[] bytes)
-        {
-            for (int first = 0, last = bytes.Length - 1; first < last; first++, last--)
-            {
-                byte temp = bytes[first];
-                bytes[first] = bytes[last];
-                bytes[last] = temp;
-            }
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/ByteArray.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: cc6f6a4c966390c4da2d54d15368bd0d
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 378
Unity/Assets/ThirdParty/Google.Protobuf/ByteString.cs

@@ -1,378 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using Google.Protobuf.Compatibility;
-using MongoDB.Bson.Serialization.Attributes;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Immutable array of bytes.
-    /// </summary>
-    public sealed class ByteString : IEnumerable<byte>, IEquatable<ByteString>
-    {
-        private static readonly ByteString empty = new ByteString(new byte[0]);
-
-        public byte[] bytes;
-
-        /// <summary>
-        /// Unsafe operations that can cause IO Failure and/or other catestrophic side-effects.
-        /// </summary>
-        public static class Unsafe
-        {
-            /// <summary>
-            /// Constructs a new ByteString from the given byte array. The array is
-            /// *not* copied, and must not be modified after this constructor is called.
-            /// </summary>
-            public static ByteString FromBytes(byte[] bytes)
-            {
-                return new ByteString(bytes);
-            }
-
-            /// <summary>
-            /// Provides direct, unrestricted access to the bytes contained in this instance.
-            /// You must not modify or resize the byte array returned by this method.
-            /// </summary>
-            public static byte[] GetBuffer(ByteString bytes)
-            {
-                return bytes.bytes;
-            }
-        }
-
-        /// <summary>
-        /// Internal use only.  Ensure that the provided array is not mutated and belongs to this instance.
-        /// </summary>
-        internal static ByteString AttachBytes(byte[] bytes)
-        {
-            return new ByteString(bytes);
-        }
-        
-        public ByteString()
-        {}
-
-        public ByteString(List<byte> list)
-        {
-            this.bytes = list.ToArray();
-        }
-        /// <summary>
-        /// Constructs a new ByteString from the given byte array. The array is
-        /// *not* copied, and must not be modified after this constructor is called.
-        /// </summary>
-        public ByteString(byte[] bytes)
-        {
-            this.bytes = bytes;
-        }
-
-        /// <summary>
-        /// Returns an empty ByteString.
-        /// </summary>
-        public static ByteString Empty
-        {
-            get { return empty; }
-        }
-
-        /// <summary>
-        /// Returns the length of this ByteString in bytes.
-        /// </summary>
-        [BsonIgnore]
-        public int Length
-        {
-            get { return bytes.Length; }
-        }
-
-        /// <summary>
-        /// Returns <c>true</c> if this byte string is empty, <c>false</c> otherwise.
-        /// </summary>
-        [BsonIgnore]
-        public bool IsEmpty
-        {
-            get { return Length == 0; }
-        }
-
-        /// <summary>
-        /// Converts this <see cref="ByteString"/> into a byte array.
-        /// </summary>
-        /// <remarks>The data is copied - changes to the returned array will not be reflected in this <c>ByteString</c>.</remarks>
-        /// <returns>A byte array with the same data as this <c>ByteString</c>.</returns>
-        public byte[] ToByteArray()
-        {
-            return (byte[]) bytes.Clone();
-        }
-
-        /// <summary>
-        /// Converts this <see cref="ByteString"/> into a standard base64 representation.
-        /// </summary>
-        /// <returns>A base64 representation of this <c>ByteString</c>.</returns>
-        public string ToBase64()
-        {
-            return Convert.ToBase64String(bytes);
-        }
-
-        /// <summary>
-        /// Constructs a <see cref="ByteString" /> from the Base64 Encoded String.
-        /// </summary>
-        public static ByteString FromBase64(string bytes)
-        {
-            // By handling the empty string explicitly, we not only optimize but we fix a
-            // problem on CF 2.0. See issue 61 for details.
-            return bytes == "" ? Empty : new ByteString(Convert.FromBase64String(bytes));
-        }
-
-        /// <summary>
-        /// Constructs a <see cref="ByteString"/> from data in the given stream, synchronously.
-        /// </summary>
-        /// <remarks>If successful, <paramref name="stream"/> will be read completely, from the position
-        /// at the start of the call.</remarks>
-        /// <param name="stream">The stream to copy into a ByteString.</param>
-        /// <returns>A ByteString with content read from the given stream.</returns>
-        public static ByteString FromStream(Stream stream)
-        {
-            ProtoPreconditions.CheckNotNull(stream, "stream");
-            int capacity = stream.CanSeek ? checked((int) (stream.Length - stream.Position)) : 0;
-            var memoryStream = new MemoryStream(capacity);
-            stream.CopyTo(memoryStream);
-
-            // Avoid an extra copy if we can.
-            byte[] bytes = memoryStream.Length == memoryStream.Capacity ? memoryStream.GetBuffer() : memoryStream.ToArray();
-
-            return AttachBytes(bytes);
-        }
-
-        /// <summary>
-        /// Constructs a <see cref="ByteString" /> from the given array. The contents
-        /// are copied, so further modifications to the array will not
-        /// be reflected in the returned ByteString.
-        /// This method can also be invoked in <c>ByteString.CopyFrom(0xaa, 0xbb, ...)</c> form
-        /// which is primarily useful for testing.
-        /// </summary>
-        public static ByteString CopyFrom(params byte[] bytes)
-        {
-            return new ByteString((byte[]) bytes.Clone());
-        }
-
-        /// <summary>
-        /// Constructs a <see cref="ByteString" /> from a portion of a byte array.
-        /// </summary>
-        public static ByteString CopyFrom(byte[] bytes, int offset, int count)
-        {
-            byte[] portion = new byte[count];
-            ByteArray.Copy(bytes, offset, portion, 0, count);
-            return new ByteString(portion);
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="ByteString" /> by encoding the specified text with
-        /// the given encoding.
-        /// </summary>
-        public static ByteString CopyFrom(string text, Encoding encoding)
-        {
-            return new ByteString(encoding.GetBytes(text));
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="ByteString" /> by encoding the specified text in UTF-8.
-        /// </summary>
-        public static ByteString CopyFromUtf8(string text)
-        {
-            return CopyFrom(text, Encoding.UTF8);
-        }
-
-        /// <summary>
-        /// Retuns the byte at the given index.
-        /// </summary>
-        [BsonIgnore]
-        public byte this[int index]
-        {
-            get { return bytes[index]; }
-        }
-
-        /// <summary>
-        /// Converts this <see cref="ByteString"/> into a string by applying the given encoding.
-        /// </summary>
-        /// <remarks>
-        /// This method should only be used to convert binary data which was the result of encoding
-        /// text with the given encoding.
-        /// </remarks>
-        /// <param name="encoding">The encoding to use to decode the binary data into text.</param>
-        /// <returns>The result of decoding the binary data with the given decoding.</returns>
-        public string ToString(Encoding encoding)
-        {
-            return encoding.GetString(bytes, 0, bytes.Length);
-        }
-
-        /// <summary>
-        /// Converts this <see cref="ByteString"/> into a string by applying the UTF-8 encoding.
-        /// </summary>
-        /// <remarks>
-        /// This method should only be used to convert binary data which was the result of encoding
-        /// text with UTF-8.
-        /// </remarks>
-        /// <returns>The result of decoding the binary data with the given decoding.</returns>
-        public string ToStringUtf8()
-        {
-            return ToString(Encoding.UTF8);
-        }
-
-        /// <summary>
-        /// Returns an iterator over the bytes in this <see cref="ByteString"/>.
-        /// </summary>
-        /// <returns>An iterator over the bytes in this object.</returns>
-        public IEnumerator<byte> GetEnumerator()
-        {
-            return ((IEnumerable<byte>) bytes).GetEnumerator();
-        }
-
-        /// <summary>
-        /// Returns an iterator over the bytes in this <see cref="ByteString"/>.
-        /// </summary>
-        /// <returns>An iterator over the bytes in this object.</returns>
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
-
-        /// <summary>
-        /// Creates a CodedInputStream from this ByteString's data.
-        /// </summary>
-        public CodedInputStream CreateCodedInput()
-        {
-            // We trust CodedInputStream not to reveal the provided byte array or modify it
-            return new CodedInputStream(bytes);
-        }
-
-        /// <summary>
-        /// Compares two byte strings for equality.
-        /// </summary>
-        /// <param name="lhs">The first byte string to compare.</param>
-        /// <param name="rhs">The second byte string to compare.</param>
-        /// <returns><c>true</c> if the byte strings are equal; false otherwise.</returns>
-        public static bool operator ==(ByteString lhs, ByteString rhs)
-        {
-            if (ReferenceEquals(lhs, rhs))
-            {
-                return true;
-            }
-            if (ReferenceEquals(lhs, null) || ReferenceEquals(rhs, null))
-            {
-                return false;
-            }
-            if (lhs.bytes.Length != rhs.bytes.Length)
-            {
-                return false;
-            }
-            for (int i = 0; i < lhs.Length; i++)
-            {
-                if (rhs.bytes[i] != lhs.bytes[i])
-                {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        /// <summary>
-        /// Compares two byte strings for inequality.
-        /// </summary>
-        /// <param name="lhs">The first byte string to compare.</param>
-        /// <param name="rhs">The second byte string to compare.</param>
-        /// <returns><c>false</c> if the byte strings are equal; true otherwise.</returns>
-        public static bool operator !=(ByteString lhs, ByteString rhs)
-        {
-            return !(lhs == rhs);
-        }
-
-        /// <summary>
-        /// Compares this byte string with another object.
-        /// </summary>
-        /// <param name="obj">The object to compare this with.</param>
-        /// <returns><c>true</c> if <paramref name="obj"/> refers to an equal <see cref="ByteString"/>; <c>false</c> otherwise.</returns>
-        public override bool Equals(object obj)
-        {
-            return this == (obj as ByteString);
-        }
-
-        /// <summary>
-        /// Returns a hash code for this object. Two equal byte strings
-        /// will return the same hash code.
-        /// </summary>
-        /// <returns>A hash code for this object.</returns>
-        public override int GetHashCode()
-        {
-            int ret = 23;
-            foreach (byte b in bytes)
-            {
-                ret = (ret * 31) + b;
-            }
-            return ret;
-        }
-
-        /// <summary>
-        /// Compares this byte string with another.
-        /// </summary>
-        /// <param name="other">The <see cref="ByteString"/> to compare this with.</param>
-        /// <returns><c>true</c> if <paramref name="other"/> refers to an equal byte string; <c>false</c> otherwise.</returns>
-        public bool Equals(ByteString other)
-        {
-            return this == other;
-        }
-
-        /// <summary>
-        /// Used internally by CodedOutputStream to avoid creating a copy for the write
-        /// </summary>
-        internal void WriteRawBytesTo(CodedOutputStream outputStream)
-        {
-            outputStream.WriteRawBytes(bytes, 0, bytes.Length);
-        }
-
-        /// <summary>
-        /// Copies the entire byte array to the destination array provided at the offset specified.
-        /// </summary>
-        public void CopyTo(byte[] array, int position)
-        {
-            ByteArray.Copy(bytes, 0, array, position, bytes.Length);
-        }
-
-        /// <summary>
-        /// Writes the entire byte array to the provided stream
-        /// </summary>
-        public void WriteTo(Stream outputStream)
-        {
-            outputStream.Write(bytes, 0, bytes.Length);
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/ByteString.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 0495e4b3ba1ec7f498d877a234323a35
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 1293
Unity/Assets/ThirdParty/Google.Protobuf/CodedInputStream.cs

@@ -1,1293 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using Google.Protobuf.Collections;
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Reads and decodes protocol message fields.
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// This class is generally used by generated code to read appropriate
-    /// primitives from the stream. It effectively encapsulates the lowest
-    /// levels of protocol buffer format.
-    /// </para>
-    /// <para>
-    /// Repeated fields and map fields are not handled by this class; use <see cref="RepeatedField{T}"/>
-    /// and <see cref="MapField{TKey, TValue}"/> to serialize such fields.
-    /// </para>
-    /// </remarks>
-    public sealed class CodedInputStream : IDisposable
-    {
-        /// <summary>
-        /// Whether to leave the underlying stream open when disposing of this stream.
-        /// This is always true when there's no stream.
-        /// </summary>
-        private bool leaveOpen;
-
-        /// <summary>
-        /// Buffer of data read from the stream or provided at construction time.
-        /// </summary>
-        private byte[] buffer;
-
-        /// <summary>
-        /// The index of the buffer at which we need to refill from the stream (if there is one).
-        /// </summary>
-        private int bufferSize;
-
-        private int bufferSizeAfterLimit = 0;
-        /// <summary>
-        /// The position within the current buffer (i.e. the next byte to read)
-        /// </summary>
-        private int bufferPos = 0;
-
-        /// <summary>
-        /// The stream to read further input from, or null if the byte array buffer was provided
-        /// directly on construction, with no further data available.
-        /// </summary>
-        private readonly Stream input;
-
-        /// <summary>
-        /// The last tag we read. 0 indicates we've read to the end of the stream
-        /// (or haven't read anything yet).
-        /// </summary>
-        private uint lastTag = 0;
-
-        /// <summary>
-        /// The next tag, used to store the value read by PeekTag.
-        /// </summary>
-        private uint nextTag = 0;
-        private bool hasNextTag = false;
-
-        internal const int DefaultRecursionLimit = 64;
-        internal const int DefaultSizeLimit = 64 << 20; // 64MB
-        internal const int BufferSize = 4096;
-
-        /// <summary>
-        /// The total number of bytes read before the current buffer. The
-        /// total bytes read up to the current position can be computed as
-        /// totalBytesRetired + bufferPos.
-        /// </summary>
-        private int totalBytesRetired = 0;
-
-        /// <summary>
-        /// The absolute position of the end of the current message.
-        /// </summary> 
-        private int currentLimit = int.MaxValue;
-
-        private int recursionDepth = 0;
-
-        private int recursionLimit;
-        private int sizeLimit;
-
-        #region Construction
-        // Note that the checks are performed such that we don't end up checking obviously-valid things
-        // like non-null references for arrays we've just created.
-
-        /// <summary>
-        /// Creates a new CodedInputStream reading data from the given byte array.
-        /// </summary>
-        public CodedInputStream(byte[] buffer) : this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), 0, buffer.Length, true)
-        {            
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="CodedInputStream"/> that reads from the given byte array slice.
-        /// </summary>
-        public CodedInputStream(byte[] buffer, int offset, int length)
-            : this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), offset, offset + length, true)
-        {            
-            if (offset < 0 || offset > buffer.Length)
-            {
-                throw new ArgumentOutOfRangeException("offset", "Offset must be within the buffer");
-            }
-            if (length < 0 || offset + length > buffer.Length)
-            {
-                throw new ArgumentOutOfRangeException("length", "Length must be non-negative and within the buffer");
-            }
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="CodedInputStream"/> reading data from the given stream, which will be disposed
-        /// when the returned object is disposed.
-        /// </summary>
-        /// <param name="input">The stream to read from.</param>
-        public CodedInputStream(Stream input) : this(input, false)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="CodedInputStream"/> reading data from the given stream.
-        /// </summary>
-        /// <param name="input">The stream to read from.</param>
-        /// <param name="leaveOpen"><c>true</c> to leave <paramref name="input"/> open when the returned
-        /// <c cref="CodedInputStream"/> is disposed; <c>false</c> to dispose of the given stream when the
-        /// returned object is disposed.</param>
-        public CodedInputStream(Stream input, bool leaveOpen)
-            : this(ProtoPreconditions.CheckNotNull(input, "input"), new byte[BufferSize], 0, 0, leaveOpen)
-        {
-        }
-        
-        /// <summary>
-        /// Creates a new CodedInputStream reading data from the given
-        /// stream and buffer, using the default limits.
-        /// </summary>
-        internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, bool leaveOpen)
-        {
-            this.input = input;
-            this.buffer = buffer;
-            this.bufferPos = bufferPos;
-            this.bufferSize = bufferSize;
-            this.sizeLimit = DefaultSizeLimit;
-            this.recursionLimit = DefaultRecursionLimit;
-            this.leaveOpen = leaveOpen;
-        }
-        
-        public void Reset(byte[] buf, int offset, int length)
-        {
-            this.buffer = buf;
-            this.bufferPos = offset;
-            this.bufferSize = length;
-            this.sizeLimit = DefaultSizeLimit;
-            this.recursionLimit = DefaultRecursionLimit;
-            this.leaveOpen = true;
-
-            bufferSizeAfterLimit = 0;
-            lastTag = 0;
-            nextTag = 0;
-            hasNextTag = false;
-            totalBytesRetired = 0;
-            currentLimit = int.MaxValue;
-            sizeLimit = 0;
-            recursionDepth = 0;
-        }
-
-        /// <summary>
-        /// Creates a new CodedInputStream reading data from the given
-        /// stream and buffer, using the specified limits.
-        /// </summary>
-        /// <remarks>
-        /// This chains to the version with the default limits instead of vice versa to avoid
-        /// having to check that the default values are valid every time.
-        /// </remarks>
-        internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, int sizeLimit, int recursionLimit, bool leaveOpen)
-            : this(input, buffer, bufferPos, bufferSize, leaveOpen)
-        {
-            if (sizeLimit <= 0)
-            {
-                throw new ArgumentOutOfRangeException("sizeLimit", "Size limit must be positive");
-            }
-            if (recursionLimit <= 0)
-            {
-                throw new ArgumentOutOfRangeException("recursionLimit!", "Recursion limit must be positive");
-            }
-            this.sizeLimit = sizeLimit;
-            this.recursionLimit = recursionLimit;
-        }
-        #endregion
-
-        /// <summary>
-        /// Creates a <see cref="CodedInputStream"/> with the specified size and recursion limits, reading
-        /// from an input stream.
-        /// </summary>
-        /// <remarks>
-        /// This method exists separately from the constructor to reduce the number of constructor overloads.
-        /// It is likely to be used considerably less frequently than the constructors, as the default limits
-        /// are suitable for most use cases.
-        /// </remarks>
-        /// <param name="input">The input stream to read from</param>
-        /// <param name="sizeLimit">The total limit of data to read from the stream.</param>
-        /// <param name="recursionLimit">The maximum recursion depth to allow while reading.</param>
-        /// <returns>A <c>CodedInputStream</c> reading from <paramref name="input"/> with the specified size
-        /// and recursion limits.</returns>
-        public static CodedInputStream CreateWithLimits(Stream input, int sizeLimit, int recursionLimit)
-        {
-            // Note: we may want an overload accepting leaveOpen
-            return new CodedInputStream(input, new byte[BufferSize], 0, 0, sizeLimit, recursionLimit, false);
-        }
-
-        /// <summary>
-        /// Returns the current position in the input stream, or the position in the input buffer
-        /// </summary>
-        public long Position 
-        {
-            get
-            {
-                if (input != null)
-                {
-                    return input.Position - ((bufferSize + bufferSizeAfterLimit) - bufferPos);
-                }
-                return bufferPos;
-            }
-        }
-
-        /// <summary>
-        /// Returns the last tag read, or 0 if no tags have been read or we've read beyond
-        /// the end of the stream.
-        /// </summary>
-        internal uint LastTag { get { return lastTag; } }
-
-        /// <summary>
-        /// Returns the size limit for this stream.
-        /// </summary>
-        /// <remarks>
-        /// This limit is applied when reading from the underlying stream, as a sanity check. It is
-        /// not applied when reading from a byte array data source without an underlying stream.
-        /// The default value is 64MB.
-        /// </remarks>
-        /// <value>
-        /// The size limit.
-        /// </value>
-        public int SizeLimit { get { return sizeLimit; } }
-
-        /// <summary>
-        /// Returns the recursion limit for this stream. This limit is applied whilst reading messages,
-        /// to avoid maliciously-recursive data.
-        /// </summary>
-        /// <remarks>
-        /// The default limit is 64.
-        /// </remarks>
-        /// <value>
-        /// The recursion limit for this stream.
-        /// </value>
-        public int RecursionLimit { get { return recursionLimit; } }
-
-        /// <summary>
-        /// Disposes of this instance, potentially closing any underlying stream.
-        /// </summary>
-        /// <remarks>
-        /// As there is no flushing to perform here, disposing of a <see cref="CodedInputStream"/> which
-        /// was constructed with the <c>leaveOpen</c> option parameter set to <c>true</c> (or one which
-        /// was constructed to read from a byte array) has no effect.
-        /// </remarks>
-        public void Dispose()
-        {
-            if (!leaveOpen)
-            {
-                input.Dispose();
-            }
-        }
-
-        #region Validation
-        /// <summary>
-        /// Verifies that the last call to ReadTag() returned tag 0 - in other words,
-        /// we've reached the end of the stream when we expected to.
-        /// </summary>
-        /// <exception cref="InvalidProtocolBufferException">The 
-        /// tag read was not the one specified</exception>
-        internal void CheckReadEndOfStreamTag()
-        {
-            if (lastTag != 0)
-            {
-                throw InvalidProtocolBufferException.MoreDataAvailable();
-            }
-        }
-        #endregion
-
-        #region Reading of tags etc
-
-        /// <summary>
-        /// Peeks at the next field tag. This is like calling <see cref="ReadTag"/>, but the
-        /// tag is not consumed. (So a subsequent call to <see cref="ReadTag"/> will return the
-        /// same value.)
-        /// </summary>
-        public uint PeekTag()
-        {
-            if (hasNextTag)
-            {
-                return nextTag;
-            }
-
-            uint savedLast = lastTag;
-            nextTag = ReadTag();
-            hasNextTag = true;
-            lastTag = savedLast; // Undo the side effect of ReadTag
-            return nextTag;
-        }
-
-        /// <summary>
-        /// Reads a field tag, returning the tag of 0 for "end of stream".
-        /// </summary>
-        /// <remarks>
-        /// If this method returns 0, it doesn't necessarily mean the end of all
-        /// the data in this CodedInputStream; it may be the end of the logical stream
-        /// for an embedded message, for example.
-        /// </remarks>
-        /// <returns>The next field tag, or 0 for end of stream. (0 is never a valid tag.)</returns>
-        public uint ReadTag()
-        {
-            if (hasNextTag)
-            {
-                lastTag = nextTag;
-                hasNextTag = false;
-                return lastTag;
-            }
-
-            // Optimize for the incredibly common case of having at least two bytes left in the buffer,
-            // and those two bytes being enough to get the tag. This will be true for fields up to 4095.
-            if (bufferPos + 2 <= bufferSize)
-            {
-                int tmp = buffer[bufferPos++];
-                if (tmp < 128)
-                {
-                    lastTag = (uint)tmp;
-                }
-                else
-                {
-                    int result = tmp & 0x7f;
-                    if ((tmp = buffer[bufferPos++]) < 128)
-                    {
-                        result |= tmp << 7;
-                        lastTag = (uint) result;
-                    }
-                    else
-                    {
-                        // Nope, rewind and go the potentially slow route.
-                        bufferPos -= 2;
-                        lastTag = ReadRawVarint32();
-                    }
-                }
-            }
-            else
-            {
-                if (IsAtEnd)
-                {
-                    lastTag = 0;
-                    return 0; // This is the only case in which we return 0.
-                }
-
-                lastTag = ReadRawVarint32();
-            }
-            if (lastTag == 0)
-            {
-                // If we actually read zero, that's not a valid tag.
-                throw InvalidProtocolBufferException.InvalidTag();
-            }
-            return lastTag;
-        }
-
-        /// <summary>
-        /// Skips the data for the field with the tag we've just read.
-        /// This should be called directly after <see cref="ReadTag"/>, when
-        /// the caller wishes to skip an unknown field.
-        /// </summary>
-        /// <remarks>
-        /// This method throws <see cref="InvalidProtocolBufferException"/> if the last-read tag was an end-group tag.
-        /// If a caller wishes to skip a group, they should skip the whole group, by calling this method after reading the
-        /// start-group tag. This behavior allows callers to call this method on any field they don't understand, correctly
-        /// resulting in an error if an end-group tag has not been paired with an earlier start-group tag.
-        /// </remarks>
-        /// <exception cref="InvalidProtocolBufferException">The last tag was an end-group tag</exception>
-        /// <exception cref="InvalidOperationException">The last read operation read to the end of the logical stream</exception>
-        public void SkipLastField()
-        {
-            if (lastTag == 0)
-            {
-                throw new InvalidOperationException("SkipLastField cannot be called at the end of a stream");
-            }
-            switch (WireFormat.GetTagWireType(lastTag))
-            {
-                case WireFormat.WireType.StartGroup:
-                    SkipGroup(lastTag);
-                    break;
-                case WireFormat.WireType.EndGroup:
-                    throw new InvalidProtocolBufferException("SkipLastField called on an end-group tag, indicating that the corresponding start-group was missing");
-                case WireFormat.WireType.Fixed32:
-                    ReadFixed32();
-                    break;
-                case WireFormat.WireType.Fixed64:
-                    ReadFixed64();
-                    break;
-                case WireFormat.WireType.LengthDelimited:
-                    var length = ReadLength();
-                    SkipRawBytes(length);
-                    break;
-                case WireFormat.WireType.Varint:
-                    ReadRawVarint32();
-                    break;
-            }
-        }
-
-        private void SkipGroup(uint startGroupTag)
-        {
-            // Note: Currently we expect this to be the way that groups are read. We could put the recursion
-            // depth changes into the ReadTag method instead, potentially...
-            recursionDepth++;
-            if (recursionDepth >= recursionLimit)
-            {
-                throw InvalidProtocolBufferException.RecursionLimitExceeded();
-            }
-            uint tag;
-            while (true)
-            {
-                tag = ReadTag();
-                if (tag == 0)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                // Can't call SkipLastField for this case- that would throw.
-                if (WireFormat.GetTagWireType(tag) == WireFormat.WireType.EndGroup)
-                {
-                    break;
-                }
-                // This recursion will allow us to handle nested groups.
-                SkipLastField();
-            }
-            int startField = WireFormat.GetTagFieldNumber(startGroupTag);
-            int endField = WireFormat.GetTagFieldNumber(tag);
-            if (startField != endField)
-            {
-                throw new InvalidProtocolBufferException("Mismatched end-group tag. Started with field " + startField + "; ended with field " + endField);
-            }
-            recursionDepth--;
-        }
-
-        /// <summary>
-        /// Reads a double field from the stream.
-        /// </summary>
-        public double ReadDouble()
-        {
-            return BitConverter.Int64BitsToDouble((long) ReadRawLittleEndian64());
-        }
-
-        /// <summary>
-        /// Reads a float field from the stream.
-        /// </summary>
-        public float ReadFloat()
-        {
-            if (BitConverter.IsLittleEndian && 4 <= bufferSize - bufferPos)
-            {
-                float ret = BitConverter.ToSingle(buffer, bufferPos);
-                bufferPos += 4;
-                return ret;
-            }
-            else
-            {
-                byte[] rawBytes = ReadRawBytes(4);
-                if (!BitConverter.IsLittleEndian)
-                {
-                    ByteArray.Reverse(rawBytes);
-                }
-                return BitConverter.ToSingle(rawBytes, 0);
-            }
-        }
-
-        /// <summary>
-        /// Reads a uint64 field from the stream.
-        /// </summary>
-        public ulong ReadUInt64()
-        {
-            return ReadRawVarint64();
-        }
-
-        /// <summary>
-        /// Reads an int64 field from the stream.
-        /// </summary>
-        public long ReadInt64()
-        {
-            return (long) ReadRawVarint64();
-        }
-
-        /// <summary>
-        /// Reads an int32 field from the stream.
-        /// </summary>
-        public int ReadInt32()
-        {
-            return (int) ReadRawVarint32();
-        }
-
-        /// <summary>
-        /// Reads a fixed64 field from the stream.
-        /// </summary>
-        public ulong ReadFixed64()
-        {
-            return ReadRawLittleEndian64();
-        }
-
-        /// <summary>
-        /// Reads a fixed32 field from the stream.
-        /// </summary>
-        public uint ReadFixed32()
-        {
-            return ReadRawLittleEndian32();
-        }
-
-        /// <summary>
-        /// Reads a bool field from the stream.
-        /// </summary>
-        public bool ReadBool()
-        {
-            return ReadRawVarint32() != 0;
-        }
-
-        /// <summary>
-        /// Reads a string field from the stream.
-        /// </summary>
-        public string ReadString()
-        {
-            int length = ReadLength();
-            // No need to read any data for an empty string.
-            if (length == 0)
-            {
-                return "";
-            }
-            if (length <= bufferSize - bufferPos)
-            {
-                // Fast path:  We already have the bytes in a contiguous buffer, so
-                //   just copy directly from it.
-                String result = CodedOutputStream.Utf8Encoding.GetString(buffer, bufferPos, length);
-                bufferPos += length;
-                return result;
-            }
-            // Slow path: Build a byte array first then copy it.
-            return CodedOutputStream.Utf8Encoding.GetString(ReadRawBytes(length), 0, length);
-        }
-
-        /// <summary>
-        /// Reads an embedded message field value from the stream.
-        /// </summary>   
-        public void ReadMessage(IMessage builder)
-        {
-            int length = ReadLength();
-            if (recursionDepth >= recursionLimit)
-            {
-                throw InvalidProtocolBufferException.RecursionLimitExceeded();
-            }
-            int oldLimit = PushLimit(length);
-            ++recursionDepth;
-            builder.MergeFrom(this);
-            CheckReadEndOfStreamTag();
-            // Check that we've read exactly as much data as expected.
-            if (!ReachedLimit)
-            {
-                throw InvalidProtocolBufferException.TruncatedMessage();
-            }
-            --recursionDepth;
-            PopLimit(oldLimit);
-        }
-
-        /// <summary>
-        /// Reads a bytes field value from the stream.
-        /// </summary>   
-        public ByteString ReadBytes()
-        {
-            int length = ReadLength();
-            if (length <= bufferSize - bufferPos && length > 0)
-            {
-                // Fast path:  We already have the bytes in a contiguous buffer, so
-                //   just copy directly from it.
-                ByteString result = ByteString.CopyFrom(buffer, bufferPos, length);
-                bufferPos += length;
-                return result;
-            }
-            else
-            {
-                // Slow path:  Build a byte array and attach it to a new ByteString.
-                return ByteString.AttachBytes(ReadRawBytes(length));
-            }
-        }
-
-        /// <summary>
-        /// Reads a uint32 field value from the stream.
-        /// </summary>   
-        public uint ReadUInt32()
-        {
-            return ReadRawVarint32();
-        }
-
-        /// <summary>
-        /// Reads an enum field value from the stream.
-        /// </summary>   
-        public int ReadEnum()
-        {
-            // Currently just a pass-through, but it's nice to separate it logically from WriteInt32.
-            return (int) ReadRawVarint32();
-        }
-
-        /// <summary>
-        /// Reads an sfixed32 field value from the stream.
-        /// </summary>   
-        public int ReadSFixed32()
-        {
-            return (int) ReadRawLittleEndian32();
-        }
-
-        /// <summary>
-        /// Reads an sfixed64 field value from the stream.
-        /// </summary>   
-        public long ReadSFixed64()
-        {
-            return (long) ReadRawLittleEndian64();
-        }
-
-        /// <summary>
-        /// Reads an sint32 field value from the stream.
-        /// </summary>   
-        public int ReadSInt32()
-        {
-            return DecodeZigZag32(ReadRawVarint32());
-        }
-
-        /// <summary>
-        /// Reads an sint64 field value from the stream.
-        /// </summary>   
-        public long ReadSInt64()
-        {
-            return DecodeZigZag64(ReadRawVarint64());
-        }
-
-        /// <summary>
-        /// Reads a length for length-delimited data.
-        /// </summary>
-        /// <remarks>
-        /// This is internally just reading a varint, but this method exists
-        /// to make the calling code clearer.
-        /// </remarks>
-        public int ReadLength()
-        {
-            return (int) ReadRawVarint32();
-        }
-
-        /// <summary>
-        /// Peeks at the next tag in the stream. If it matches <paramref name="tag"/>,
-        /// the tag is consumed and the method returns <c>true</c>; otherwise, the
-        /// stream is left in the original position and the method returns <c>false</c>.
-        /// </summary>
-        public bool MaybeConsumeTag(uint tag)
-        {
-            if (PeekTag() == tag)
-            {
-                hasNextTag = false;
-                return true;
-            }
-            return false;
-        }
-
-        #endregion
-
-        #region Underlying reading primitives
-
-        /// <summary>
-        /// Same code as ReadRawVarint32, but read each byte individually, checking for
-        /// buffer overflow.
-        /// </summary>
-        private uint SlowReadRawVarint32()
-        {
-            int tmp = ReadRawByte();
-            if (tmp < 128)
-            {
-                return (uint) tmp;
-            }
-            int result = tmp & 0x7f;
-            if ((tmp = ReadRawByte()) < 128)
-            {
-                result |= tmp << 7;
-            }
-            else
-            {
-                result |= (tmp & 0x7f) << 7;
-                if ((tmp = ReadRawByte()) < 128)
-                {
-                    result |= tmp << 14;
-                }
-                else
-                {
-                    result |= (tmp & 0x7f) << 14;
-                    if ((tmp = ReadRawByte()) < 128)
-                    {
-                        result |= tmp << 21;
-                    }
-                    else
-                    {
-                        result |= (tmp & 0x7f) << 21;
-                        result |= (tmp = ReadRawByte()) << 28;
-                        if (tmp >= 128)
-                        {
-                            // Discard upper 32 bits.
-                            for (int i = 0; i < 5; i++)
-                            {
-                                if (ReadRawByte() < 128)
-                                {
-                                    return (uint) result;
-                                }
-                            }
-                            throw InvalidProtocolBufferException.MalformedVarint();
-                        }
-                    }
-                }
-            }
-            return (uint) result;
-        }
-
-        /// <summary>
-        /// Reads a raw Varint from the stream.  If larger than 32 bits, discard the upper bits.
-        /// This method is optimised for the case where we've got lots of data in the buffer.
-        /// That means we can check the size just once, then just read directly from the buffer
-        /// without constant rechecking of the buffer length.
-        /// </summary>
-        internal uint ReadRawVarint32()
-        {
-            if (bufferPos + 5 > bufferSize)
-            {
-                return SlowReadRawVarint32();
-            }
-
-            int tmp = buffer[bufferPos++];
-            if (tmp < 128)
-            {
-                return (uint) tmp;
-            }
-            int result = tmp & 0x7f;
-            if ((tmp = buffer[bufferPos++]) < 128)
-            {
-                result |= tmp << 7;
-            }
-            else
-            {
-                result |= (tmp & 0x7f) << 7;
-                if ((tmp = buffer[bufferPos++]) < 128)
-                {
-                    result |= tmp << 14;
-                }
-                else
-                {
-                    result |= (tmp & 0x7f) << 14;
-                    if ((tmp = buffer[bufferPos++]) < 128)
-                    {
-                        result |= tmp << 21;
-                    }
-                    else
-                    {
-                        result |= (tmp & 0x7f) << 21;
-                        result |= (tmp = buffer[bufferPos++]) << 28;
-                        if (tmp >= 128)
-                        {
-                            // Discard upper 32 bits.
-                            // Note that this has to use ReadRawByte() as we only ensure we've
-                            // got at least 5 bytes at the start of the method. This lets us
-                            // use the fast path in more cases, and we rarely hit this section of code.
-                            for (int i = 0; i < 5; i++)
-                            {
-                                if (ReadRawByte() < 128)
-                                {
-                                    return (uint) result;
-                                }
-                            }
-                            throw InvalidProtocolBufferException.MalformedVarint();
-                        }
-                    }
-                }
-            }
-            return (uint) result;
-        }
-
-        /// <summary>
-        /// Reads a varint from the input one byte at a time, so that it does not
-        /// read any bytes after the end of the varint. If you simply wrapped the
-        /// stream in a CodedInputStream and used ReadRawVarint32(Stream)
-        /// then you would probably end up reading past the end of the varint since
-        /// CodedInputStream buffers its input.
-        /// </summary>
-        /// <param name="input"></param>
-        /// <returns></returns>
-        internal static uint ReadRawVarint32(Stream input)
-        {
-            int result = 0;
-            int offset = 0;
-            for (; offset < 32; offset += 7)
-            {
-                int b = input.ReadByte();
-                if (b == -1)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                result |= (b & 0x7f) << offset;
-                if ((b & 0x80) == 0)
-                {
-                    return (uint) result;
-                }
-            }
-            // Keep reading up to 64 bits.
-            for (; offset < 64; offset += 7)
-            {
-                int b = input.ReadByte();
-                if (b == -1)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                if ((b & 0x80) == 0)
-                {
-                    return (uint) result;
-                }
-            }
-            throw InvalidProtocolBufferException.MalformedVarint();
-        }
-
-        /// <summary>
-        /// Reads a raw varint from the stream.
-        /// </summary>
-        internal ulong ReadRawVarint64()
-        {
-            int shift = 0;
-            ulong result = 0;
-            while (shift < 64)
-            {
-                byte b = ReadRawByte();
-                result |= (ulong) (b & 0x7F) << shift;
-                if ((b & 0x80) == 0)
-                {
-                    return result;
-                }
-                shift += 7;
-            }
-            throw InvalidProtocolBufferException.MalformedVarint();
-        }
-
-        /// <summary>
-        /// Reads a 32-bit little-endian integer from the stream.
-        /// </summary>
-        internal uint ReadRawLittleEndian32()
-        {
-            uint b1 = ReadRawByte();
-            uint b2 = ReadRawByte();
-            uint b3 = ReadRawByte();
-            uint b4 = ReadRawByte();
-            return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24);
-        }
-
-        /// <summary>
-        /// Reads a 64-bit little-endian integer from the stream.
-        /// </summary>
-        internal ulong ReadRawLittleEndian64()
-        {
-            ulong b1 = ReadRawByte();
-            ulong b2 = ReadRawByte();
-            ulong b3 = ReadRawByte();
-            ulong b4 = ReadRawByte();
-            ulong b5 = ReadRawByte();
-            ulong b6 = ReadRawByte();
-            ulong b7 = ReadRawByte();
-            ulong b8 = ReadRawByte();
-            return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24)
-                   | (b5 << 32) | (b6 << 40) | (b7 << 48) | (b8 << 56);
-        }
-
-        /// <summary>
-        /// Decode a 32-bit value with ZigZag encoding.
-        /// </summary>
-        /// <remarks>
-        /// ZigZag encodes signed integers into values that can be efficiently
-        /// encoded with varint.  (Otherwise, negative values must be 
-        /// sign-extended to 64 bits to be varint encoded, thus always taking
-        /// 10 bytes on the wire.)
-        /// </remarks>
-        internal static int DecodeZigZag32(uint n)
-        {
-            return (int)(n >> 1) ^ -(int)(n & 1);
-        }
-
-        /// <summary>
-        /// Decode a 32-bit value with ZigZag encoding.
-        /// </summary>
-        /// <remarks>
-        /// ZigZag encodes signed integers into values that can be efficiently
-        /// encoded with varint.  (Otherwise, negative values must be 
-        /// sign-extended to 64 bits to be varint encoded, thus always taking
-        /// 10 bytes on the wire.)
-        /// </remarks>
-        internal static long DecodeZigZag64(ulong n)
-        {
-            return (long)(n >> 1) ^ -(long)(n & 1);
-        }
-        #endregion
-
-        #region Internal reading and buffer management
-
-        /// <summary>
-        /// Sets currentLimit to (current position) + byteLimit. This is called
-        /// when descending into a length-delimited embedded message. The previous
-        /// limit is returned.
-        /// </summary>
-        /// <returns>The old limit.</returns>
-        internal int PushLimit(int byteLimit)
-        {
-            if (byteLimit < 0)
-            {
-                throw InvalidProtocolBufferException.NegativeSize();
-            }
-            byteLimit += totalBytesRetired + bufferPos;
-            int oldLimit = currentLimit;
-            if (byteLimit > oldLimit)
-            {
-                throw InvalidProtocolBufferException.TruncatedMessage();
-            }
-            currentLimit = byteLimit;
-
-            RecomputeBufferSizeAfterLimit();
-
-            return oldLimit;
-        }
-
-        private void RecomputeBufferSizeAfterLimit()
-        {
-            bufferSize += bufferSizeAfterLimit;
-            int bufferEnd = totalBytesRetired + bufferSize;
-            if (bufferEnd > currentLimit)
-            {
-                // Limit is in current buffer.
-                bufferSizeAfterLimit = bufferEnd - currentLimit;
-                bufferSize -= bufferSizeAfterLimit;
-            }
-            else
-            {
-                bufferSizeAfterLimit = 0;
-            }
-        }
-
-        /// <summary>
-        /// Discards the current limit, returning the previous limit.
-        /// </summary>
-        internal void PopLimit(int oldLimit)
-        {
-            currentLimit = oldLimit;
-            RecomputeBufferSizeAfterLimit();
-        }
-
-        /// <summary>
-        /// Returns whether or not all the data before the limit has been read.
-        /// </summary>
-        /// <returns></returns>
-        internal bool ReachedLimit
-        {
-            get
-            {
-                if (currentLimit == int.MaxValue)
-                {
-                    return false;
-                }
-                int currentAbsolutePosition = totalBytesRetired + bufferPos;
-                return currentAbsolutePosition >= currentLimit;
-            }
-        }
-
-        /// <summary>
-        /// Returns true if the stream has reached the end of the input. This is the
-        /// case if either the end of the underlying input source has been reached or
-        /// the stream has reached a limit created using PushLimit.
-        /// </summary>
-        public bool IsAtEnd
-        {
-            get { return bufferPos == bufferSize && !RefillBuffer(false); }
-        }
-
-        /// <summary>
-        /// Called when buffer is empty to read more bytes from the
-        /// input.  If <paramref name="mustSucceed"/> is true, RefillBuffer() gurantees that
-        /// either there will be at least one byte in the buffer when it returns
-        /// or it will throw an exception.  If <paramref name="mustSucceed"/> is false,
-        /// RefillBuffer() returns false if no more bytes were available.
-        /// </summary>
-        /// <param name="mustSucceed"></param>
-        /// <returns></returns>
-        private bool RefillBuffer(bool mustSucceed)
-        {
-            if (bufferPos < bufferSize)
-            {
-                throw new InvalidOperationException("RefillBuffer() called when buffer wasn't empty.");
-            }
-
-            if (totalBytesRetired + bufferSize == currentLimit)
-            {
-                // Oops, we hit a limit.
-                if (mustSucceed)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                else
-                {
-                    return false;
-                }
-            }
-
-            totalBytesRetired += bufferSize;
-
-            bufferPos = 0;
-            bufferSize = (input == null) ? 0 : input.Read(buffer, 0, buffer.Length);
-            if (bufferSize < 0)
-            {
-                throw new InvalidOperationException("Stream.Read returned a negative count");
-            }
-            if (bufferSize == 0)
-            {
-                if (mustSucceed)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-                else
-                {
-                    return false;
-                }
-            }
-            else
-            {
-                RecomputeBufferSizeAfterLimit();
-                int totalBytesRead =
-                    totalBytesRetired + bufferSize + bufferSizeAfterLimit;
-                if (totalBytesRead > sizeLimit || totalBytesRead < 0)
-                {
-                    throw InvalidProtocolBufferException.SizeLimitExceeded();
-                }
-                return true;
-            }
-        }
-
-        /// <summary>
-        /// Read one byte from the input.
-        /// </summary>
-        /// <exception cref="InvalidProtocolBufferException">
-        /// the end of the stream or the current limit was reached
-        /// </exception>
-        internal byte ReadRawByte()
-        {
-            if (bufferPos == bufferSize)
-            {
-                RefillBuffer(true);
-            }
-            return buffer[bufferPos++];
-        }
-
-        /// <summary>
-        /// Reads a fixed size of bytes from the input.
-        /// </summary>
-        /// <exception cref="InvalidProtocolBufferException">
-        /// the end of the stream or the current limit was reached
-        /// </exception>
-        internal byte[] ReadRawBytes(int size)
-        {
-            if (size < 0)
-            {
-                throw InvalidProtocolBufferException.NegativeSize();
-            }
-
-            if (totalBytesRetired + bufferPos + size > currentLimit)
-            {
-                // Read to the end of the stream (up to the current limit) anyway.
-                SkipRawBytes(currentLimit - totalBytesRetired - bufferPos);
-                // Then fail.
-                throw InvalidProtocolBufferException.TruncatedMessage();
-            }
-
-            if (size <= bufferSize - bufferPos)
-            {
-                // We have all the bytes we need already.
-                byte[] bytes = new byte[size];
-                ByteArray.Copy(buffer, bufferPos, bytes, 0, size);
-                bufferPos += size;
-                return bytes;
-            }
-            else if (size < buffer.Length)
-            {
-                // Reading more bytes than are in the buffer, but not an excessive number
-                // of bytes.  We can safely allocate the resulting array ahead of time.
-
-                // First copy what we have.
-                byte[] bytes = new byte[size];
-                int pos = bufferSize - bufferPos;
-                ByteArray.Copy(buffer, bufferPos, bytes, 0, pos);
-                bufferPos = bufferSize;
-
-                // We want to use RefillBuffer() and then copy from the buffer into our
-                // byte array rather than reading directly into our byte array because
-                // the input may be unbuffered.
-                RefillBuffer(true);
-
-                while (size - pos > bufferSize)
-                {
-                    Buffer.BlockCopy(buffer, 0, bytes, pos, bufferSize);
-                    pos += bufferSize;
-                    bufferPos = bufferSize;
-                    RefillBuffer(true);
-                }
-
-                ByteArray.Copy(buffer, 0, bytes, pos, size - pos);
-                bufferPos = size - pos;
-
-                return bytes;
-            }
-            else
-            {
-                // The size is very large.  For security reasons, we can't allocate the
-                // entire byte array yet.  The size comes directly from the input, so a
-                // maliciously-crafted message could provide a bogus very large size in
-                // order to trick the app into allocating a lot of memory.  We avoid this
-                // by allocating and reading only a small chunk at a time, so that the
-                // malicious message must actually *be* extremely large to cause
-                // problems.  Meanwhile, we limit the allowed size of a message elsewhere.
-
-                // Remember the buffer markers since we'll have to copy the bytes out of
-                // it later.
-                int originalBufferPos = bufferPos;
-                int originalBufferSize = bufferSize;
-
-                // Mark the current buffer consumed.
-                totalBytesRetired += bufferSize;
-                bufferPos = 0;
-                bufferSize = 0;
-
-                // Read all the rest of the bytes we need.
-                int sizeLeft = size - (originalBufferSize - originalBufferPos);
-                List<byte[]> chunks = new List<byte[]>();
-
-                while (sizeLeft > 0)
-                {
-                    byte[] chunk = new byte[Math.Min(sizeLeft, buffer.Length)];
-                    int pos = 0;
-                    while (pos < chunk.Length)
-                    {
-                        int n = (input == null) ? -1 : input.Read(chunk, pos, chunk.Length - pos);
-                        if (n <= 0)
-                        {
-                            throw InvalidProtocolBufferException.TruncatedMessage();
-                        }
-                        totalBytesRetired += n;
-                        pos += n;
-                    }
-                    sizeLeft -= chunk.Length;
-                    chunks.Add(chunk);
-                }
-
-                // OK, got everything.  Now concatenate it all into one buffer.
-                byte[] bytes = new byte[size];
-
-                // Start by copying the leftover bytes from this.buffer.
-                int newPos = originalBufferSize - originalBufferPos;
-                ByteArray.Copy(buffer, originalBufferPos, bytes, 0, newPos);
-
-                // And now all the chunks.
-                foreach (byte[] chunk in chunks)
-                {
-                    Buffer.BlockCopy(chunk, 0, bytes, newPos, chunk.Length);
-                    newPos += chunk.Length;
-                }
-
-                // Done.
-                return bytes;
-            }
-        }
-
-        /// <summary>
-        /// Reads and discards <paramref name="size"/> bytes.
-        /// </summary>
-        /// <exception cref="InvalidProtocolBufferException">the end of the stream
-        /// or the current limit was reached</exception>
-        private void SkipRawBytes(int size)
-        {
-            if (size < 0)
-            {
-                throw InvalidProtocolBufferException.NegativeSize();
-            }
-
-            if (totalBytesRetired + bufferPos + size > currentLimit)
-            {
-                // Read to the end of the stream anyway.
-                SkipRawBytes(currentLimit - totalBytesRetired - bufferPos);
-                // Then fail.
-                throw InvalidProtocolBufferException.TruncatedMessage();
-            }
-
-            if (size <= bufferSize - bufferPos)
-            {
-                // We have all the bytes we need already.
-                bufferPos += size;
-            }
-            else
-            {
-                // Skipping more bytes than are in the buffer.  First skip what we have.
-                int pos = bufferSize - bufferPos;
-
-                // ROK 5/7/2013 Issue #54: should retire all bytes in buffer (bufferSize)
-                // totalBytesRetired += pos;
-                totalBytesRetired += bufferSize;
-                
-                bufferPos = 0;
-                bufferSize = 0;
-
-                // Then skip directly from the InputStream for the rest.
-                if (pos < size)
-                {
-                    if (input == null)
-                    {
-                        throw InvalidProtocolBufferException.TruncatedMessage();
-                    }
-                    SkipImpl(size - pos);
-                    totalBytesRetired += size - pos;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Abstraction of skipping to cope with streams which can't really skip.
-        /// </summary>
-        private void SkipImpl(int amountToSkip)
-        {
-            if (input.CanSeek)
-            {
-                long previousPosition = input.Position;
-                input.Position += amountToSkip;
-                if (input.Position != previousPosition + amountToSkip)
-                {
-                    throw InvalidProtocolBufferException.TruncatedMessage();
-                }
-            }
-            else
-            {
-                byte[] skipBuffer = new byte[Math.Min(1024, amountToSkip)];
-                while (amountToSkip > 0)
-                {
-                    int bytesRead = input.Read(skipBuffer, 0, Math.Min(skipBuffer.Length, amountToSkip));
-                    if (bytesRead <= 0)
-                    {
-                        throw InvalidProtocolBufferException.TruncatedMessage();
-                    }
-                    amountToSkip -= bytesRead;
-                }
-            }
-        }
-
-        #endregion
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/CodedInputStream.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 1df2eb703cafa984fa2b4ea1d596b0cd
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 304
Unity/Assets/ThirdParty/Google.Protobuf/CodedOutputStream.ComputeSize.cs

@@ -1,304 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-
-namespace Google.Protobuf
-{
-    // This part of CodedOutputStream provides all the static entry points that are used
-    // by generated code and internally to compute the size of messages prior to being
-    // written to an instance of CodedOutputStream.
-    public sealed partial class CodedOutputStream
-    {
-        private const int LittleEndian64Size = 8;
-        private const int LittleEndian32Size = 4;        
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// double field, including the tag.
-        /// </summary>
-        public static int ComputeDoubleSize(double value)
-        {
-            return LittleEndian64Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// float field, including the tag.
-        /// </summary>
-        public static int ComputeFloatSize(float value)
-        {
-            return LittleEndian32Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// uint64 field, including the tag.
-        /// </summary>
-        public static int ComputeUInt64Size(ulong value)
-        {
-            return ComputeRawVarint64Size(value);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// int64 field, including the tag.
-        /// </summary>
-        public static int ComputeInt64Size(long value)
-        {
-            return ComputeRawVarint64Size((ulong) value);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// int32 field, including the tag.
-        /// </summary>
-        public static int ComputeInt32Size(int value)
-        {
-            if (value >= 0)
-            {
-                return ComputeRawVarint32Size((uint) value);
-            }
-            else
-            {
-                // Must sign-extend.
-                return 10;
-            }
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// fixed64 field, including the tag.
-        /// </summary>
-        public static int ComputeFixed64Size(ulong value)
-        {
-            return LittleEndian64Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// fixed32 field, including the tag.
-        /// </summary>
-        public static int ComputeFixed32Size(uint value)
-        {
-            return LittleEndian32Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// bool field, including the tag.
-        /// </summary>
-        public static int ComputeBoolSize(bool value)
-        {
-            return 1;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// string field, including the tag.
-        /// </summary>
-        public static int ComputeStringSize(String value)
-        {
-            int byteArraySize = Utf8Encoding.GetByteCount(value);
-            return ComputeLengthSize(byteArraySize) + byteArraySize;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// group field, including the tag.
-        /// </summary>
-        public static int ComputeGroupSize(IMessage value)
-        {
-            return value.CalculateSize();
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// embedded message field, including the tag.
-        /// </summary>
-        public static int ComputeMessageSize(IMessage value)
-        {
-            int size = value.CalculateSize();
-            return ComputeLengthSize(size) + size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// bytes field, including the tag.
-        /// </summary>
-        public static int ComputeBytesSize(ByteString value)
-        {
-            return ComputeLengthSize(value.Length) + value.Length;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// uint32 field, including the tag.
-        /// </summary>
-        public static int ComputeUInt32Size(uint value)
-        {
-            return ComputeRawVarint32Size(value);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a
-        /// enum field, including the tag. The caller is responsible for
-        /// converting the enum value to its numeric value.
-        /// </summary>
-        public static int ComputeEnumSize(int value)
-        {
-            // Currently just a pass-through, but it's nice to separate it logically.
-            return ComputeInt32Size(value);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// sfixed32 field, including the tag.
-        /// </summary>
-        public static int ComputeSFixed32Size(int value)
-        {
-            return LittleEndian32Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// sfixed64 field, including the tag.
-        /// </summary>
-        public static int ComputeSFixed64Size(long value)
-        {
-            return LittleEndian64Size;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// sint32 field, including the tag.
-        /// </summary>
-        public static int ComputeSInt32Size(int value)
-        {
-            return ComputeRawVarint32Size(EncodeZigZag32(value));
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode an
-        /// sint64 field, including the tag.
-        /// </summary>
-        public static int ComputeSInt64Size(long value)
-        {
-            return ComputeRawVarint64Size(EncodeZigZag64(value));
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a length,
-        /// as written by <see cref="WriteLength"/>.
-        /// </summary>
-        public static int ComputeLengthSize(int length)
-        {
-            return ComputeRawVarint32Size((uint) length);
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a varint.
-        /// </summary>
-        public static int ComputeRawVarint32Size(uint value)
-        {
-            if ((value & (0xffffffff << 7)) == 0)
-            {
-                return 1;
-            }
-            if ((value & (0xffffffff << 14)) == 0)
-            {
-                return 2;
-            }
-            if ((value & (0xffffffff << 21)) == 0)
-            {
-                return 3;
-            }
-            if ((value & (0xffffffff << 28)) == 0)
-            {
-                return 4;
-            }
-            return 5;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a varint.
-        /// </summary>
-        public static int ComputeRawVarint64Size(ulong value)
-        {
-            if ((value & (0xffffffffffffffffL << 7)) == 0)
-            {
-                return 1;
-            }
-            if ((value & (0xffffffffffffffffL << 14)) == 0)
-            {
-                return 2;
-            }
-            if ((value & (0xffffffffffffffffL << 21)) == 0)
-            {
-                return 3;
-            }
-            if ((value & (0xffffffffffffffffL << 28)) == 0)
-            {
-                return 4;
-            }
-            if ((value & (0xffffffffffffffffL << 35)) == 0)
-            {
-                return 5;
-            }
-            if ((value & (0xffffffffffffffffL << 42)) == 0)
-            {
-                return 6;
-            }
-            if ((value & (0xffffffffffffffffL << 49)) == 0)
-            {
-                return 7;
-            }
-            if ((value & (0xffffffffffffffffL << 56)) == 0)
-            {
-                return 8;
-            }
-            if ((value & (0xffffffffffffffffL << 63)) == 0)
-            {
-                return 9;
-            }
-            return 10;
-        }
-
-        /// <summary>
-        /// Computes the number of bytes that would be needed to encode a tag.
-        /// </summary>
-        public static int ComputeTagSize(int fieldNumber)
-        {
-            return ComputeRawVarint32Size(WireFormat.MakeTag(fieldNumber, 0));
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/CodedOutputStream.ComputeSize.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: c94acc4c66cb8e14ca00789b21ef4dde
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 770
Unity/Assets/ThirdParty/Google.Protobuf/CodedOutputStream.cs

@@ -1,770 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using Google.Protobuf.Collections;
-using System;
-using System.IO;
-using System.Text;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Encodes and writes protocol message fields.
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// This class is generally used by generated code to write appropriate
-    /// primitives to the stream. It effectively encapsulates the lowest
-    /// levels of protocol buffer format. Unlike some other implementations,
-    /// this does not include combined "write tag and value" methods. Generated
-    /// code knows the exact byte representations of the tags they're going to write,
-    /// so there's no need to re-encode them each time. Manually-written code calling
-    /// this class should just call one of the <c>WriteTag</c> overloads before each value.
-    /// </para>
-    /// <para>
-    /// Repeated fields and map fields are not handled by this class; use <c>RepeatedField&lt;T&gt;</c>
-    /// and <c>MapField&lt;TKey, TValue&gt;</c> to serialize such fields.
-    /// </para>
-    /// </remarks>
-    public sealed partial class CodedOutputStream : IDisposable
-    {
-        // "Local" copy of Encoding.UTF8, for efficiency. (Yes, it makes a difference.)
-        internal static readonly Encoding Utf8Encoding = Encoding.UTF8;
-
-        /// <summary>
-        /// The buffer size used by CreateInstance(Stream).
-        /// </summary>
-        public static readonly int DefaultBufferSize = 4096;
-
-        private bool leaveOpen;
-        private byte[] buffer;
-        private int limit;
-        private int position;
-        private Stream output;
-
-        #region Construction
-        /// <summary>
-        /// Creates a new CodedOutputStream that writes directly to the given
-        /// byte array. If more bytes are written than fit in the array,
-        /// OutOfSpaceException will be thrown.
-        /// </summary>
-        public CodedOutputStream(byte[] flatArray) : this(flatArray, 0, flatArray.Length)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new CodedOutputStream that writes directly to the given
-        /// byte array slice. If more bytes are written than fit in the array,
-        /// OutOfSpaceException will be thrown.
-        /// </summary>
-        private CodedOutputStream(byte[] buffer, int offset, int length)
-        {
-            this.output = null;
-            this.buffer = buffer;
-            this.position = offset;
-            this.limit = offset + length;
-            leaveOpen = true; // Simple way of avoiding trying to dispose of a null reference
-        }
-        
-        public void Reset(byte[] buf, int offset, int length)
-        {
-            this.output = null;
-            this.buffer = buf;
-            this.position = offset;
-            this.limit = offset + length;
-            leaveOpen = true; // Simple way of avoiding trying to dispose of a null reference
-        }
-
-        private CodedOutputStream(Stream output, byte[] buffer, bool leaveOpen)
-        {
-            this.output = ProtoPreconditions.CheckNotNull(output, "output");
-            this.buffer = buffer;
-            this.position = 0;
-            this.limit = buffer.Length;
-            this.leaveOpen = leaveOpen;
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="CodedOutputStream" /> which write to the given stream, and disposes of that
-        /// stream when the returned <c>CodedOutputStream</c> is disposed.
-        /// </summary>
-        /// <param name="output">The stream to write to. It will be disposed when the returned <c>CodedOutputStream is disposed.</c></param>
-        public CodedOutputStream(Stream output) : this(output, DefaultBufferSize, false)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new CodedOutputStream which write to the given stream and uses
-        /// the specified buffer size.
-        /// </summary>
-        /// <param name="output">The stream to write to. It will be disposed when the returned <c>CodedOutputStream is disposed.</c></param>
-        /// <param name="bufferSize">The size of buffer to use internally.</param>
-        public CodedOutputStream(Stream output, int bufferSize) : this(output, new byte[bufferSize], false)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new CodedOutputStream which write to the given stream.
-        /// </summary>
-        /// <param name="output">The stream to write to.</param>
-        /// <param name="leaveOpen">If <c>true</c>, <paramref name="output"/> is left open when the returned <c>CodedOutputStream</c> is disposed;
-        /// if <c>false</c>, the provided stream is disposed as well.</param>
-        public CodedOutputStream(Stream output, bool leaveOpen) : this(output, DefaultBufferSize, leaveOpen)
-        {
-        }
-
-        /// <summary>
-        /// Creates a new CodedOutputStream which write to the given stream and uses
-        /// the specified buffer size.
-        /// </summary>
-        /// <param name="output">The stream to write to.</param>
-        /// <param name="bufferSize">The size of buffer to use internally.</param>
-        /// <param name="leaveOpen">If <c>true</c>, <paramref name="output"/> is left open when the returned <c>CodedOutputStream</c> is disposed;
-        /// if <c>false</c>, the provided stream is disposed as well.</param>
-        public CodedOutputStream(Stream output, int bufferSize, bool leaveOpen) : this(output, new byte[bufferSize], leaveOpen)
-        {
-        }
-        #endregion
-
-        /// <summary>
-        /// Returns the current position in the stream, or the position in the output buffer
-        /// </summary>
-        public long Position
-        {
-            get
-            {
-                if (output != null)
-                {
-                    return output.Position + position;
-                }
-                return position;
-            }
-        }
-
-        #region Writing of values (not including tags)
-
-        /// <summary>
-        /// Writes a double field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteDouble(double value)
-        {
-            WriteRawLittleEndian64((ulong)BitConverter.DoubleToInt64Bits(value));
-        }
-
-        /// <summary>
-        /// Writes a float field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteFloat(float value)
-        {
-            byte[] rawBytes = BitConverter.GetBytes(value);
-            if (!BitConverter.IsLittleEndian)
-            {
-                ByteArray.Reverse(rawBytes);
-            }
-
-            if (limit - position >= 4)
-            {
-                buffer[position++] = rawBytes[0];
-                buffer[position++] = rawBytes[1];
-                buffer[position++] = rawBytes[2];
-                buffer[position++] = rawBytes[3];
-            }
-            else
-            {
-                WriteRawBytes(rawBytes, 0, 4);
-            }
-        }
-
-        /// <summary>
-        /// Writes a uint64 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteUInt64(ulong value)
-        {
-            WriteRawVarint64(value);
-        }
-
-        /// <summary>
-        /// Writes an int64 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteInt64(long value)
-        {
-            WriteRawVarint64((ulong) value);
-        }
-
-        /// <summary>
-        /// Writes an int32 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteInt32(int value)
-        {
-            if (value >= 0)
-            {
-                WriteRawVarint32((uint) value);
-            }
-            else
-            {
-                // Must sign-extend.
-                WriteRawVarint64((ulong) value);
-            }
-        }
-
-        /// <summary>
-        /// Writes a fixed64 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteFixed64(ulong value)
-        {
-            WriteRawLittleEndian64(value);
-        }
-
-        /// <summary>
-        /// Writes a fixed32 field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteFixed32(uint value)
-        {
-            WriteRawLittleEndian32(value);
-        }
-
-        /// <summary>
-        /// Writes a bool field value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteBool(bool value)
-        {
-            WriteRawByte(value ? (byte) 1 : (byte) 0);
-        }
-
-        /// <summary>
-        /// Writes a string field value, without a tag, to the stream.
-        /// The data is length-prefixed.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteString(string value)
-        {
-            // Optimise the case where we have enough space to write
-            // the string directly to the buffer, which should be common.
-            int length = Utf8Encoding.GetByteCount(value);
-            WriteLength(length);
-            if (limit - position >= length)
-            {
-                if (length == value.Length) // Must be all ASCII...
-                {
-                    for (int i = 0; i < length; i++)
-                    {
-                        buffer[position + i] = (byte)value[i];
-                    }
-                }
-                else
-                {
-                    Utf8Encoding.GetBytes(value, 0, value.Length, buffer, position);
-                }
-                position += length;
-            }
-            else
-            {
-                byte[] bytes = Utf8Encoding.GetBytes(value);
-                WriteRawBytes(bytes);
-            }
-        }
-
-        /// <summary>
-        /// Writes a message, without a tag, to the stream.
-        /// The data is length-prefixed.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteMessage(IMessage value)
-        {
-            WriteLength(value.CalculateSize());
-            value.WriteTo(this);
-        }
-
-        /// <summary>
-        /// Write a byte string, without a tag, to the stream.
-        /// The data is length-prefixed.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteBytes(ByteString value)
-        {
-            WriteLength(value.Length);
-            value.WriteRawBytesTo(this);
-        }
-
-        /// <summary>
-        /// Writes a uint32 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteUInt32(uint value)
-        {
-            WriteRawVarint32(value);
-        }
-
-        /// <summary>
-        /// Writes an enum value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteEnum(int value)
-        {
-            WriteInt32(value);
-        }
-
-        /// <summary>
-        /// Writes an sfixed32 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write.</param>
-        public void WriteSFixed32(int value)
-        {
-            WriteRawLittleEndian32((uint) value);
-        }
-
-        /// <summary>
-        /// Writes an sfixed64 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteSFixed64(long value)
-        {
-            WriteRawLittleEndian64((ulong) value);
-        }
-
-        /// <summary>
-        /// Writes an sint32 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteSInt32(int value)
-        {
-            WriteRawVarint32(EncodeZigZag32(value));
-        }
-
-        /// <summary>
-        /// Writes an sint64 value, without a tag, to the stream.
-        /// </summary>
-        /// <param name="value">The value to write</param>
-        public void WriteSInt64(long value)
-        {
-            WriteRawVarint64(EncodeZigZag64(value));
-        }
-
-        /// <summary>
-        /// Writes a length (in bytes) for length-delimited data.
-        /// </summary>
-        /// <remarks>
-        /// This method simply writes a rawint, but exists for clarity in calling code.
-        /// </remarks>
-        /// <param name="length">Length value, in bytes.</param>
-        public void WriteLength(int length)
-        {
-            WriteRawVarint32((uint) length);
-        }
-
-        #endregion
-
-        #region Raw tag writing
-        /// <summary>
-        /// Encodes and writes a tag.
-        /// </summary>
-        /// <param name="fieldNumber">The number of the field to write the tag for</param>
-        /// <param name="type">The wire format type of the tag to write</param>
-        public void WriteTag(int fieldNumber, WireFormat.WireType type)
-        {
-            WriteRawVarint32(WireFormat.MakeTag(fieldNumber, type));
-        }
-
-        /// <summary>
-        /// Writes an already-encoded tag.
-        /// </summary>
-        /// <param name="tag">The encoded tag</param>
-        public void WriteTag(uint tag)
-        {
-            WriteRawVarint32(tag);
-        }
-
-        /// <summary>
-        /// Writes the given single-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The encoded tag</param>
-        public void WriteRawTag(byte b1)
-        {
-            WriteRawByte(b1);
-        }
-
-        /// <summary>
-        /// Writes the given two-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The first byte of the encoded tag</param>
-        /// <param name="b2">The second byte of the encoded tag</param>
-        public void WriteRawTag(byte b1, byte b2)
-        {
-            WriteRawByte(b1);
-            WriteRawByte(b2);
-        }
-
-        /// <summary>
-        /// Writes the given three-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The first byte of the encoded tag</param>
-        /// <param name="b2">The second byte of the encoded tag</param>
-        /// <param name="b3">The third byte of the encoded tag</param>
-        public void WriteRawTag(byte b1, byte b2, byte b3)
-        {
-            WriteRawByte(b1);
-            WriteRawByte(b2);
-            WriteRawByte(b3);
-        }
-
-        /// <summary>
-        /// Writes the given four-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The first byte of the encoded tag</param>
-        /// <param name="b2">The second byte of the encoded tag</param>
-        /// <param name="b3">The third byte of the encoded tag</param>
-        /// <param name="b4">The fourth byte of the encoded tag</param>
-        public void WriteRawTag(byte b1, byte b2, byte b3, byte b4)
-        {
-            WriteRawByte(b1);
-            WriteRawByte(b2);
-            WriteRawByte(b3);
-            WriteRawByte(b4);
-        }
-
-        /// <summary>
-        /// Writes the given five-byte tag directly to the stream.
-        /// </summary>
-        /// <param name="b1">The first byte of the encoded tag</param>
-        /// <param name="b2">The second byte of the encoded tag</param>
-        /// <param name="b3">The third byte of the encoded tag</param>
-        /// <param name="b4">The fourth byte of the encoded tag</param>
-        /// <param name="b5">The fifth byte of the encoded tag</param>
-        public void WriteRawTag(byte b1, byte b2, byte b3, byte b4, byte b5)
-        {
-            WriteRawByte(b1);
-            WriteRawByte(b2);
-            WriteRawByte(b3);
-            WriteRawByte(b4);
-            WriteRawByte(b5);
-        }
-        #endregion
-
-        #region Underlying writing primitives
-        /// <summary>
-        /// Writes a 32 bit value as a varint. The fast route is taken when
-        /// there's enough buffer space left to whizz through without checking
-        /// for each byte; otherwise, we resort to calling WriteRawByte each time.
-        /// </summary>
-        internal void WriteRawVarint32(uint value)
-        {
-            // Optimize for the common case of a single byte value
-            if (value < 128 && position < limit)
-            {
-                buffer[position++] = (byte)value;
-                return;
-            }
-
-            while (value > 127 && position < limit)
-            {
-                buffer[position++] = (byte) ((value & 0x7F) | 0x80);
-                value >>= 7;
-            }
-            while (value > 127)
-            {
-                WriteRawByte((byte) ((value & 0x7F) | 0x80));
-                value >>= 7;
-            }
-            if (position < limit)
-            {
-                buffer[position++] = (byte) value;
-            }
-            else
-            {
-                WriteRawByte((byte) value);
-            }
-        }
-
-        internal void WriteRawVarint64(ulong value)
-        {
-            while (value > 127 && position < limit)
-            {
-                buffer[position++] = (byte) ((value & 0x7F) | 0x80);
-                value >>= 7;
-            }
-            while (value > 127)
-            {
-                WriteRawByte((byte) ((value & 0x7F) | 0x80));
-                value >>= 7;
-            }
-            if (position < limit)
-            {
-                buffer[position++] = (byte) value;
-            }
-            else
-            {
-                WriteRawByte((byte) value);
-            }
-        }
-
-        internal void WriteRawLittleEndian32(uint value)
-        {
-            if (position + 4 > limit)
-            {
-                WriteRawByte((byte) value);
-                WriteRawByte((byte) (value >> 8));
-                WriteRawByte((byte) (value >> 16));
-                WriteRawByte((byte) (value >> 24));
-            }
-            else
-            {
-                buffer[position++] = ((byte) value);
-                buffer[position++] = ((byte) (value >> 8));
-                buffer[position++] = ((byte) (value >> 16));
-                buffer[position++] = ((byte) (value >> 24));
-            }
-        }
-
-        internal void WriteRawLittleEndian64(ulong value)
-        {
-            if (position + 8 > limit)
-            {
-                WriteRawByte((byte) value);
-                WriteRawByte((byte) (value >> 8));
-                WriteRawByte((byte) (value >> 16));
-                WriteRawByte((byte) (value >> 24));
-                WriteRawByte((byte) (value >> 32));
-                WriteRawByte((byte) (value >> 40));
-                WriteRawByte((byte) (value >> 48));
-                WriteRawByte((byte) (value >> 56));
-            }
-            else
-            {
-                buffer[position++] = ((byte) value);
-                buffer[position++] = ((byte) (value >> 8));
-                buffer[position++] = ((byte) (value >> 16));
-                buffer[position++] = ((byte) (value >> 24));
-                buffer[position++] = ((byte) (value >> 32));
-                buffer[position++] = ((byte) (value >> 40));
-                buffer[position++] = ((byte) (value >> 48));
-                buffer[position++] = ((byte) (value >> 56));
-            }
-        }
-
-        internal void WriteRawByte(byte value)
-        {
-            if (position == limit)
-            {
-                RefreshBuffer();
-            }
-
-            buffer[position++] = value;
-        }
-
-        internal void WriteRawByte(uint value)
-        {
-            WriteRawByte((byte) value);
-        }
-
-        /// <summary>
-        /// Writes out an array of bytes.
-        /// </summary>
-        internal void WriteRawBytes(byte[] value)
-        {
-            WriteRawBytes(value, 0, value.Length);
-        }
-
-        /// <summary>
-        /// Writes out part of an array of bytes.
-        /// </summary>
-        internal void WriteRawBytes(byte[] value, int offset, int length)
-        {
-            if (limit - position >= length)
-            {
-                ByteArray.Copy(value, offset, buffer, position, length);
-                // We have room in the current buffer.
-                position += length;
-            }
-            else
-            {
-                // Write extends past current buffer.  Fill the rest of this buffer and
-                // flush.
-                int bytesWritten = limit - position;
-                ByteArray.Copy(value, offset, buffer, position, bytesWritten);
-                offset += bytesWritten;
-                length -= bytesWritten;
-                position = limit;
-                RefreshBuffer();
-
-                // Now deal with the rest.
-                // Since we have an output stream, this is our buffer
-                // and buffer offset == 0
-                if (length <= limit)
-                {
-                    // Fits in new buffer.
-                    ByteArray.Copy(value, offset, buffer, 0, length);
-                    position = length;
-                }
-                else
-                {
-                    // Write is very big.  Let's do it all at once.
-                    output.Write(value, offset, length);
-                }
-            }
-        }
-
-        #endregion
-
-        /// <summary>
-        /// Encode a 32-bit value with ZigZag encoding.
-        /// </summary>
-        /// <remarks>
-        /// ZigZag encodes signed integers into values that can be efficiently
-        /// encoded with varint.  (Otherwise, negative values must be 
-        /// sign-extended to 64 bits to be varint encoded, thus always taking
-        /// 10 bytes on the wire.)
-        /// </remarks>
-        internal static uint EncodeZigZag32(int n)
-        {
-            // Note:  the right-shift must be arithmetic
-            return (uint) ((n << 1) ^ (n >> 31));
-        }
-
-        /// <summary>
-        /// Encode a 64-bit value with ZigZag encoding.
-        /// </summary>
-        /// <remarks>
-        /// ZigZag encodes signed integers into values that can be efficiently
-        /// encoded with varint.  (Otherwise, negative values must be 
-        /// sign-extended to 64 bits to be varint encoded, thus always taking
-        /// 10 bytes on the wire.)
-        /// </remarks>
-        internal static ulong EncodeZigZag64(long n)
-        {
-            return (ulong) ((n << 1) ^ (n >> 63));
-        }
-
-        private void RefreshBuffer()
-        {
-            if (output == null)
-            {
-                // We're writing to a single buffer.
-                throw new OutOfSpaceException();
-            }
-
-            // Since we have an output stream, this is our buffer
-            // and buffer offset == 0
-            output.Write(buffer, 0, position);
-            position = 0;
-        }
-
-        /// <summary>
-        /// Indicates that a CodedOutputStream wrapping a flat byte array
-        /// ran out of space.
-        /// </summary>
-        public sealed class OutOfSpaceException : IOException
-        {
-            internal OutOfSpaceException()
-                : base("CodedOutputStream was writing to a flat byte array and ran out of space.")
-            {
-            }
-        }
-
-        /// <summary>
-        /// Flushes any buffered data and optionally closes the underlying stream, if any.
-        /// </summary>
-        /// <remarks>
-        /// <para>
-        /// By default, any underlying stream is closed by this method. To configure this behaviour,
-        /// use a constructor overload with a <c>leaveOpen</c> parameter. If this instance does not
-        /// have an underlying stream, this method does nothing.
-        /// </para>
-        /// <para>
-        /// For the sake of efficiency, calling this method does not prevent future write calls - but
-        /// if a later write ends up writing to a stream which has been disposed, that is likely to
-        /// fail. It is recommend that you not call any other methods after this.
-        /// </para>
-        /// </remarks>
-        public void Dispose()
-        {
-            Flush();
-            if (!leaveOpen)
-            {
-                output.Dispose();
-            }
-        }
-
-        /// <summary>
-        /// Flushes any buffered data to the underlying stream (if there is one).
-        /// </summary>
-        public void Flush()
-        {
-            if (output != null)
-            {
-                RefreshBuffer();
-            }
-        }
-
-        /// <summary>
-        /// Verifies that SpaceLeft returns zero. It's common to create a byte array
-        /// that is exactly big enough to hold a message, then write to it with
-        /// a CodedOutputStream. Calling CheckNoSpaceLeft after writing verifies that
-        /// the message was actually as big as expected, which can help bugs.
-        /// </summary>
-        public void CheckNoSpaceLeft()
-        {
-            if (SpaceLeft != 0)
-            {
-                throw new InvalidOperationException("Did not write as much data as expected.");
-            }
-        }
-
-        /// <summary>
-        /// If writing to a flat array, returns the space left in the array. Otherwise,
-        /// throws an InvalidOperationException.
-        /// </summary>
-        public int SpaceLeft
-        {
-            get
-            {
-                if (output == null)
-                {
-                    return limit - position;
-                }
-                else
-                {
-                    throw new InvalidOperationException(
-                        "SpaceLeft can only be called on CodedOutputStreams that are " +
-                        "writing to a flat array.");
-                }
-            }
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/CodedOutputStream.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: e4768e92c8082c14db86e6dd81843cf7
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 379
Unity/Assets/ThirdParty/Google.Protobuf/FieldCodec.cs

@@ -1,379 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections.Generic;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Factory methods for <see cref="FieldCodec{T}"/>.
-    /// </summary>
-    public static class FieldCodec
-    {
-        // TODO: Avoid the "dual hit" of lambda expressions: create open delegates instead. (At least test...)
-
-        /// <summary>
-        /// Retrieves a codec suitable for a string field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<string> ForString(uint tag)
-        {
-            return new FieldCodec<string>(input => input.ReadString(), (output, value) => output.WriteString(value), CodedOutputStream.ComputeStringSize, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a bytes field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<ByteString> ForBytes(uint tag)
-        {
-            return new FieldCodec<ByteString>(input => input.ReadBytes(), (output, value) => output.WriteBytes(value), CodedOutputStream.ComputeBytesSize, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a bool field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<bool> ForBool(uint tag)
-        {
-            return new FieldCodec<bool>(input => input.ReadBool(), (output, value) => output.WriteBool(value), CodedOutputStream.ComputeBoolSize, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an int32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<int> ForInt32(uint tag)
-        {
-            return new FieldCodec<int>(input => input.ReadInt32(), (output, value) => output.WriteInt32(value), CodedOutputStream.ComputeInt32Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an sint32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<int> ForSInt32(uint tag)
-        {
-            return new FieldCodec<int>(input => input.ReadSInt32(), (output, value) => output.WriteSInt32(value), CodedOutputStream.ComputeSInt32Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a fixed32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<uint> ForFixed32(uint tag)
-        {
-            return new FieldCodec<uint>(input => input.ReadFixed32(), (output, value) => output.WriteFixed32(value), 4, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an sfixed32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<int> ForSFixed32(uint tag)
-        {
-            return new FieldCodec<int>(input => input.ReadSFixed32(), (output, value) => output.WriteSFixed32(value), 4, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a uint32 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<uint> ForUInt32(uint tag)
-        {
-            return new FieldCodec<uint>(input => input.ReadUInt32(), (output, value) => output.WriteUInt32(value), CodedOutputStream.ComputeUInt32Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an int64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<long> ForInt64(uint tag)
-        {
-            return new FieldCodec<long>(input => input.ReadInt64(), (output, value) => output.WriteInt64(value), CodedOutputStream.ComputeInt64Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an sint64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<long> ForSInt64(uint tag)
-        {
-            return new FieldCodec<long>(input => input.ReadSInt64(), (output, value) => output.WriteSInt64(value), CodedOutputStream.ComputeSInt64Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a fixed64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<ulong> ForFixed64(uint tag)
-        {
-            return new FieldCodec<ulong>(input => input.ReadFixed64(), (output, value) => output.WriteFixed64(value), 8, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for an sfixed64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<long> ForSFixed64(uint tag)
-        {
-            return new FieldCodec<long>(input => input.ReadSFixed64(), (output, value) => output.WriteSFixed64(value), 8, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a uint64 field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<ulong> ForUInt64(uint tag)
-        {
-            return new FieldCodec<ulong>(input => input.ReadUInt64(), (output, value) => output.WriteUInt64(value), CodedOutputStream.ComputeUInt64Size, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a float field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<float> ForFloat(uint tag)
-        {
-            return new FieldCodec<float>(input => input.ReadFloat(), (output, value) => output.WriteFloat(value), CodedOutputStream.ComputeFloatSize, tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a double field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<double> ForDouble(uint tag)
-        {
-            return new FieldCodec<double>(input => input.ReadDouble(), (output, value) => output.WriteDouble(value), CodedOutputStream.ComputeDoubleSize, tag);
-        }
-
-        // Enums are tricky. We can probably use expression trees to build these delegates automatically,
-        // but it's easy to generate the code for it.
-
-        /// <summary>
-        /// Retrieves a codec suitable for an enum field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <param name="toInt32">A conversion function from <see cref="Int32"/> to the enum type.</param>
-        /// <param name="fromInt32">A conversion function from the enum type to <see cref="Int32"/>.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<T> ForEnum<T>(uint tag, Func<T, int> toInt32, Func<int, T> fromInt32)
-        {
-            return new FieldCodec<T>(input => fromInt32(
-                input.ReadEnum()),
-                (output, value) => output.WriteEnum(toInt32(value)),
-                value => CodedOutputStream.ComputeEnumSize(toInt32(value)), tag);
-        }
-
-        /// <summary>
-        /// Retrieves a codec suitable for a message field with the given tag.
-        /// </summary>
-        /// <param name="tag">The tag.</param>
-        /// <param name="parser">A parser to use for the message type.</param>
-        /// <returns>A codec for the given tag.</returns>
-        public static FieldCodec<T> ForMessage<T>(uint tag, MessageParser<T> parser) where T : IMessage
-        {
-            return new FieldCodec<T>(input => { T message = parser.CreateTemplate(); input.ReadMessage(message); return message; },
-                (output, value) => output.WriteMessage(value), message => CodedOutputStream.ComputeMessageSize(message), tag);
-        }
-    }
-
-    /// <summary>
-    /// <para>
-    /// An encode/decode pair for a single field. This effectively encapsulates
-    /// all the information needed to read or write the field value from/to a coded
-    /// stream.
-    /// </para>
-    /// <para>
-    /// This class is public and has to be as it is used by generated code, but its public
-    /// API is very limited - just what the generated code needs to call directly.
-    /// </para>
-    /// </summary>
-    /// <remarks>
-    /// This never writes default values to the stream, and does not address "packedness"
-    /// in repeated fields itself, other than to know whether or not the field *should* be packed.
-    /// </remarks>
-    public sealed class FieldCodec<T>
-    {
-        private static readonly T DefaultDefault;
-        // Only non-nullable value types support packing. This is the simplest way of detecting that.
-        private static readonly bool TypeSupportsPacking = default(T) != null;
-
-        static FieldCodec()
-        {
-            if (typeof(T) == typeof(string))
-            {
-                DefaultDefault = (T)(object)"";
-            }
-            else if (typeof(T) == typeof(ByteString))
-            {
-                DefaultDefault = (T)(object)ByteString.Empty;
-            }
-            // Otherwise it's the default value of the CLR type
-        }
-
-        internal static bool IsPackedRepeatedField(uint tag)
-        {
-            return TypeSupportsPacking && WireFormat.GetTagWireType(tag) == WireFormat.WireType.LengthDelimited;
-        }
-
-        internal readonly bool PackedRepeatedField;
-
-        /// <summary>
-        /// Returns a delegate to write a value (unconditionally) to a coded output stream.
-        /// </summary>
-        internal readonly Action<CodedOutputStream, T> ValueWriter;
-
-        /// <summary>
-        /// Returns the size calculator for just a value.
-        /// </summary>
-        internal readonly Func<T, int> ValueSizeCalculator;
-
-        /// <summary>
-        /// Returns a delegate to read a value from a coded input stream. It is assumed that
-        /// the stream is already positioned on the appropriate tag.
-        /// </summary>
-        internal readonly Func<CodedInputStream, T> ValueReader;
-
-        /// <summary>
-        /// Returns the fixed size for an entry, or 0 if sizes vary.
-        /// </summary>
-        internal readonly int FixedSize;
-
-        /// <summary>
-        /// Gets the tag of the codec.
-        /// </summary>
-        /// <value>
-        /// The tag of the codec.
-        /// </value>
-        internal readonly uint Tag;
-
-        /// <summary>
-        /// Default value for this codec. Usually the same for every instance of the same type, but
-        /// for string/ByteString wrapper fields the codec's default value is null, whereas for
-        /// other string/ByteString fields it's "" or ByteString.Empty.
-        /// </summary>
-        /// <value>
-        /// The default value of the codec's type.
-        /// </value>
-        internal readonly T DefaultValue;
-
-        private readonly int tagSize;
-        
-        internal FieldCodec(
-                Func<CodedInputStream, T> reader,
-                Action<CodedOutputStream, T> writer,
-                int fixedSize,
-                uint tag) : this(reader, writer, _ => fixedSize, tag)
-        {
-            FixedSize = fixedSize;
-        }
-
-        internal FieldCodec(
-            Func<CodedInputStream, T> reader,
-            Action<CodedOutputStream, T> writer,
-            Func<T, int> sizeCalculator,
-            uint tag) : this(reader, writer, sizeCalculator, tag, DefaultDefault)
-        {
-        }
-
-        internal FieldCodec(
-            Func<CodedInputStream, T> reader,
-            Action<CodedOutputStream, T> writer,
-            Func<T, int> sizeCalculator,
-            uint tag,
-            T defaultValue)
-        {
-            ValueReader = reader;
-            ValueWriter = writer;
-            ValueSizeCalculator = sizeCalculator;
-            FixedSize = 0;
-            Tag = tag;
-            DefaultValue = defaultValue;
-            tagSize = CodedOutputStream.ComputeRawVarint32Size(tag);
-            // Detect packed-ness once, so we can check for it within RepeatedField<T>.
-            PackedRepeatedField = IsPackedRepeatedField(tag);
-        }
-
-        /// <summary>
-        /// Write a tag and the given value, *if* the value is not the default.
-        /// </summary>
-        public void WriteTagAndValue(CodedOutputStream output, T value)
-        {
-            if (!IsDefault(value))
-            {
-                output.WriteTag(Tag);
-                ValueWriter(output, value);
-            }
-        }
-
-        /// <summary>
-        /// Reads a value of the codec type from the given <see cref="CodedInputStream"/>.
-        /// </summary>
-        /// <param name="input">The input stream to read from.</param>
-        /// <returns>The value read from the stream.</returns>
-        public T Read(CodedInputStream input)
-        {
-            return ValueReader(input);
-        }
-
-        /// <summary>
-        /// Calculates the size required to write the given value, with a tag,
-        /// if the value is not the default.
-        /// </summary>
-        public int CalculateSizeWithTag(T value)
-        {
-            return IsDefault(value) ? 0 : ValueSizeCalculator(value) + tagSize;
-        }
-
-        private bool IsDefault(T value)
-        {
-            return EqualityComparer<T>.Default.Equals(value, DefaultValue);
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/FieldCodec.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: bc2f63c5dd762a74785e957e9e2ff0c9
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 69
Unity/Assets/ThirdParty/Google.Protobuf/ICustomDiagnosticMessage.cs

@@ -1,69 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2016 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// A message type that has a custom string format for diagnostic purposes.
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// Calling <see cref="object.ToString"/> on a generated message type normally
-    /// returns the JSON representation. If a message type implements this interface,
-    /// then the <see cref="ToDiagnosticString"/> method will be called instead of the regular
-    /// JSON formatting code, but only when <c>ToString()</c> is called either on the message itself
-    /// or on another message which contains it. This does not affect the normal JSON formatting of
-    /// the message.
-    /// </para>
-    /// <para>
-    /// For example, if you create a proto message representing a GUID, the internal
-    /// representation may be a <c>bytes</c> field or four <c>fixed32</c> fields. However, when debugging
-    /// it may be more convenient to see a result in the same format as <see cref="System.Guid"/> provides.
-    /// </para>
-    /// <para>This interface extends <see cref="IMessage"/> to avoid it accidentally being implemented
-    /// on types other than messages, where it would not be used by anything in the framework.</para>
-    /// </remarks>
-    public interface ICustomDiagnosticMessage : IMessage
-    {
-        /// <summary>
-        /// Returns a string representation of this object, for diagnostic purposes.
-        /// </summary>
-        /// <remarks>
-        /// This method is called when a message is formatted as part of a <see cref="object.ToString"/>
-        /// call. It does not affect the JSON representation used by <see cref="JsonFormatter"/> other than
-        /// in calls to <see cref="JsonFormatter.ToDiagnosticString(IMessage)"/>. While it is recommended
-        /// that the result is valid JSON, this is never assumed by the Protobuf library.
-        /// </remarks>
-        /// <returns>A string representation of this object, for diagnostic purposes.</returns>
-        string ToDiagnosticString();
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/ICustomDiagnosticMessage.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 4e3f9f48b78790d40b93778ba6fc08aa
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 64
Unity/Assets/ThirdParty/Google.Protobuf/IMessage.cs

@@ -1,64 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Interface for a Protocol Buffers message, supporting
-    /// basic operations required for serialization.
-    /// </summary>
-    public interface IMessage
-    {
-        /// <summary>
-        /// Merges the data from the specified coded input stream with the current message.
-        /// </summary>
-        /// <remarks>See the user guide for precise merge semantics.</remarks>
-        /// <param name="input"></param>
-        void MergeFrom(CodedInputStream input);
-
-        /// <summary>
-        /// Writes the data to the given coded output stream.
-        /// </summary>
-        /// <param name="output">Coded output stream to write the data to. Must not be null.</param>
-        void WriteTo(CodedOutputStream output);
-
-        /// <summary>
-        /// Calculates the size of this message in Protocol Buffer wire format, in bytes.
-        /// </summary>
-        /// <returns>The number of bytes required to write this message
-        /// to a coded output stream.</returns>
-        int CalculateSize();
-
-    }
-
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/IMessage.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 99b4394158577934492f893a057dc06f
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 129
Unity/Assets/ThirdParty/Google.Protobuf/InvalidProtocolBufferException.cs

@@ -1,129 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Thrown when a protocol message being parsed is invalid in some way,
-    /// e.g. it contains a malformed varint or a negative byte length.
-    /// </summary>
-    public sealed class InvalidProtocolBufferException : IOException
-    {
-        internal InvalidProtocolBufferException(string message)
-            : base(message)
-        {
-        }
-
-        internal InvalidProtocolBufferException(string message, Exception innerException)
-            : base(message, innerException)
-        {
-        }
-
-        internal static InvalidProtocolBufferException MoreDataAvailable()
-        {
-            return new InvalidProtocolBufferException(
-                "Completed reading a message while more data was available in the stream.");
-        }
-
-        internal static InvalidProtocolBufferException TruncatedMessage()
-        {
-            return new InvalidProtocolBufferException(
-                "While parsing a protocol message, the input ended unexpectedly " +
-                "in the middle of a field.  This could mean either that the " +
-                "input has been truncated or that an embedded message " +
-                "misreported its own length.");
-        }
-
-        internal static InvalidProtocolBufferException NegativeSize()
-        {
-            return new InvalidProtocolBufferException(
-                "CodedInputStream encountered an embedded string or message " +
-                "which claimed to have negative size.");
-        }
-
-        internal static InvalidProtocolBufferException MalformedVarint()
-        {
-            return new InvalidProtocolBufferException(
-                "CodedInputStream encountered a malformed varint.");
-        }
-
-        /// <summary>
-        /// Creates an exception for an error condition of an invalid tag being encountered.
-        /// </summary>
-        internal static InvalidProtocolBufferException InvalidTag()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message contained an invalid tag (zero).");
-        }
-
-        internal static InvalidProtocolBufferException InvalidBase64(Exception innerException)
-        {
-            return new InvalidProtocolBufferException("Invalid base64 data", innerException);
-        }
-
-        internal static InvalidProtocolBufferException InvalidEndTag()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message end-group tag did not match expected tag.");
-        }
-
-        internal static InvalidProtocolBufferException RecursionLimitExceeded()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message had too many levels of nesting.  May be malicious.  " +
-                "Use CodedInputStream.SetRecursionLimit() to increase the depth limit.");
-        }
-
-        internal static InvalidProtocolBufferException JsonRecursionLimitExceeded()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message had too many levels of nesting.  May be malicious.  " +
-                "Use JsonParser.Settings to increase the depth limit.");
-        }
-
-        internal static InvalidProtocolBufferException SizeLimitExceeded()
-        {
-            return new InvalidProtocolBufferException(
-                "Protocol message was too large.  May be malicious.  " +
-                "Use CodedInputStream.SetSizeLimit() to increase the size limit.");
-        }
-
-        internal static InvalidProtocolBufferException InvalidMessageStreamTag()
-        {
-            return new InvalidProtocolBufferException(
-                "Stream of protocol messages had invalid tag. Expected tag is length-delimited field 1.");
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/InvalidProtocolBufferException.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 3eb2be644ccc6fc4187e38443cc47ea5
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 110
Unity/Assets/ThirdParty/Google.Protobuf/LimitedInputStream.cs

@@ -1,110 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-    
-using System;
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Stream implementation which proxies another stream, only allowing a certain amount
-    /// of data to be read. Note that this is only used to read delimited streams, so it
-    /// doesn't attempt to implement everything.
-    /// </summary>
-    internal sealed class LimitedInputStream : Stream
-    {
-        private readonly Stream proxied;
-        private int bytesLeft;
-
-        internal LimitedInputStream(Stream proxied, int size)
-        {
-            this.proxied = proxied;
-            bytesLeft = size;
-        }
-
-        public override bool CanRead
-        {
-            get { return true; }
-        }
-
-        public override bool CanSeek
-        {
-            get { return false; }
-        }
-
-        public override bool CanWrite
-        {
-            get { return false; }
-        }
-
-        public override void Flush()
-        {
-        }
-
-        public override long Length
-        {
-            get { throw new NotSupportedException(); }
-        }
-
-        public override long Position
-        {
-            get { throw new NotSupportedException(); }
-            set { throw new NotSupportedException(); }
-        }
-
-        public override int Read(byte[] buffer, int offset, int count)
-        {
-            if (bytesLeft > 0)
-            {
-                int bytesRead = proxied.Read(buffer, offset, Math.Min(bytesLeft, count));
-                bytesLeft -= bytesRead;
-                return bytesRead;
-            }
-            return 0;
-        }
-
-        public override long Seek(long offset, SeekOrigin origin)
-        {
-            throw new NotSupportedException();
-        }
-
-        public override void SetLength(long value)
-        {
-            throw new NotSupportedException();
-        }
-
-        public override void Write(byte[] buffer, int offset, int count)
-        {
-            throw new NotSupportedException();
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/LimitedInputStream.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: f02379e5cbe40714dba4d002f8980dbf
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 178
Unity/Assets/ThirdParty/Google.Protobuf/MessageExtensions.cs

@@ -1,178 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Extension methods on <see cref="IMessage"/> and <see cref="IMessage{T}"/>.
-    /// </summary>
-    public static class MessageExtensions
-    {
-        public static CodedInputStream inputStream = new CodedInputStream(new byte[0]);
-        public static CodedOutputStream outputStream = new CodedOutputStream(new byte[0]);
-        
-        /// <summary>
-        /// Merges data from the given byte array into an existing message.
-        /// </summary>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="data">The data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeFrom(this IMessage message, byte[] data)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(data, "data");
-            inputStream.Reset(data, 0, data.Length);
-            CodedInputStream input = inputStream;
-            message.MergeFrom(input);
-            input.CheckReadEndOfStreamTag();
-        }
-        
-        /// <summary>
-        /// Merges data from the given byte array into an existing message.
-        /// </summary>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="data">The data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeFrom(this IMessage message, byte[] data, int offset, int length)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(data, "data");
-            inputStream.Reset(data, offset, length);
-            CodedInputStream input = inputStream;
-            //CodedInputStream input = new CodedInputStream(data, offset, length);
-            message.MergeFrom(input);
-            input.CheckReadEndOfStreamTag();
-        }
-
-        /// <summary>
-        /// Merges data from the given byte string into an existing message.
-        /// </summary>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="data">The data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeFrom(this IMessage message, ByteString data)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(data, "data");
-            CodedInputStream input = data.CreateCodedInput();
-            message.MergeFrom(input);
-            input.CheckReadEndOfStreamTag();
-        }
-
-        /// <summary>
-        /// Merges data from the given stream into an existing message.
-        /// </summary>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="input">Stream containing the data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeFrom(this IMessage message, Stream input)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(input, "input");
-            CodedInputStream codedInput = new CodedInputStream(input);
-            message.MergeFrom(codedInput);
-            codedInput.CheckReadEndOfStreamTag();
-        }
-
-        /// <summary>
-        /// Merges length-delimited data from the given stream into an existing message.
-        /// </summary>
-        /// <remarks>
-        /// The stream is expected to contain a length and then the data. Only the amount of data
-        /// specified by the length will be consumed.
-        /// </remarks>
-        /// <param name="message">The message to merge the data into.</param>
-        /// <param name="input">Stream containing the data to merge, which must be protobuf-encoded binary data.</param>
-        public static void MergeDelimitedFrom(this IMessage message, Stream input)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(input, "input");
-            int size = (int) CodedInputStream.ReadRawVarint32(input);
-            Stream limitedStream = new LimitedInputStream(input, size);
-            message.MergeFrom(limitedStream);
-        }
-
-        /// <summary>
-        /// Converts the given message into a byte array in protobuf encoding.
-        /// </summary>
-        /// <param name="message">The message to convert.</param>
-        /// <returns>The message data as a byte array.</returns>
-        public static byte[] ToByteArray(this IMessage message)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            byte[] result = new byte[message.CalculateSize()];
-            CodedOutputStream output = new CodedOutputStream(result);
-            message.WriteTo(output);
-            output.CheckNoSpaceLeft();
-            return result;
-        }
-
-        /// <summary>
-        /// Writes the given message data to the given stream in protobuf encoding.
-        /// </summary>
-        /// <param name="message">The message to write to the stream.</param>
-        /// <param name="output">The stream to write to.</param>
-        public static void WriteTo(this IMessage message, MemoryStream output)
-        {
-            // 这里做了修改,去掉CodedOutputStream的gc
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(output, "output");
-            outputStream.Reset(output.GetBuffer(), (int)output.Length, (int)(output.Capacity - output.Length));
-            message.WriteTo(outputStream);
-            output.SetLength(outputStream.Position);
-        }
-
-        /// <summary>
-        /// Writes the length and then data of the given message to a stream.
-        /// </summary>
-        /// <param name="message">The message to write.</param>
-        /// <param name="output">The output stream to write to.</param>
-        public static void WriteDelimitedTo(this IMessage message, Stream output)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            ProtoPreconditions.CheckNotNull(output, "output");
-            CodedOutputStream codedOutput = new CodedOutputStream(output);
-            codedOutput.WriteRawVarint32((uint)message.CalculateSize());
-            message.WriteTo(codedOutput);
-            codedOutput.Flush();
-        }
-
-        /// <summary>
-        /// Converts the given message into a byte string in protobuf encoding.
-        /// </summary>
-        /// <param name="message">The message to convert.</param>
-        /// <returns>The message data as a byte string.</returns>
-        public static ByteString ToByteString(this IMessage message)
-        {
-            ProtoPreconditions.CheckNotNull(message, "message");
-            return ByteString.AttachBytes(message.ToByteArray());
-        }        
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/MessageExtensions.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 23cd5cb094c72654abdb3a2a71ee5a80
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 241
Unity/Assets/ThirdParty/Google.Protobuf/MessageParser.cs

@@ -1,241 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-    
-using System;
-using System.IO;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// A general message parser, typically used by reflection-based code as all the methods
-    /// return simple <see cref="IMessage"/>.
-    /// </summary>
-    public class MessageParser
-    {
-        private Func<IMessage> factory;
-
-        internal MessageParser(Func<IMessage> factory)
-        {
-            this.factory = factory;
-        }
-
-        /// <summary>
-        /// Creates a template instance ready for population.
-        /// </summary>
-        /// <returns>An empty message.</returns>
-        internal IMessage CreateTemplate()
-        {
-            return factory();
-        }
-
-        /// <summary>
-        /// Parses a message from a byte array.
-        /// </summary>
-        /// <param name="data">The byte array containing the message. Must not be null.</param>
-        /// <returns>The newly parsed message.</returns>
-        public IMessage ParseFrom(byte[] data)
-        {
-            ProtoPreconditions.CheckNotNull(data, "data");
-            IMessage message = factory();
-            message.MergeFrom(data);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given byte string.
-        /// </summary>
-        /// <param name="data">The data to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public IMessage ParseFrom(ByteString data)
-        {
-            ProtoPreconditions.CheckNotNull(data, "data");
-            IMessage message = factory();
-            message.MergeFrom(data);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given stream.
-        /// </summary>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public IMessage ParseFrom(Stream input)
-        {
-            IMessage message = factory();
-            message.MergeFrom(input);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a length-delimited message from the given stream.
-        /// </summary>
-        /// <remarks>
-        /// The stream is expected to contain a length and then the data. Only the amount of data
-        /// specified by the length will be consumed.
-        /// </remarks>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public IMessage ParseDelimitedFrom(Stream input)
-        {
-            IMessage message = factory();
-            message.MergeDelimitedFrom(input);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given coded input stream.
-        /// </summary>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public IMessage ParseFrom(CodedInputStream input)
-        {
-            IMessage message = factory();
-            message.MergeFrom(input);
-            return message;
-        }
-
-    }
-
-    /// <summary>
-    /// A parser for a specific message type.
-    /// </summary>
-    /// <remarks>
-    /// <p>
-    /// This delegates most behavior to the
-    /// <see cref="IMessage.MergeFrom"/> implementation within the original type, but
-    /// provides convenient overloads to parse from a variety of sources.
-    /// </p>
-    /// <p>
-    /// Most applications will never need to create their own instances of this type;
-    /// instead, use the static <c>Parser</c> property of a generated message type to obtain a
-    /// parser for that type.
-    /// </p>
-    /// </remarks>
-    /// <typeparam name="T">The type of message to be parsed.</typeparam>
-    public sealed class MessageParser<T> : MessageParser where T : IMessage
-    {
-        // Implementation note: all the methods here *could* just delegate up to the base class and cast the result.
-        // The current implementation avoids a virtual method call and a cast, which *may* be significant in some cases.
-        // Benchmarking work is required to measure the significance - but it's only a few lines of code in any case.
-        // The API wouldn't change anyway - just the implementation - so this work can be deferred.
-        private readonly Func<T> factory; 
-
-        /// <summary>
-        /// Creates a new parser.
-        /// </summary>
-        /// <remarks>
-        /// The factory method is effectively an optimization over using a generic constraint
-        /// to require a parameterless constructor: delegates are significantly faster to execute.
-        /// </remarks>
-        /// <param name="factory">Function to invoke when a new, empty message is required.</param>
-        public MessageParser(Func<T> factory) : base(() => factory())
-        {
-            this.factory = factory;
-        }
-
-        /// <summary>
-        /// Creates a template instance ready for population.
-        /// </summary>
-        /// <returns>An empty message.</returns>
-        internal new T CreateTemplate()
-        {
-            return factory();
-        }
-
-        /// <summary>
-        /// Parses a message from a byte array.
-        /// </summary>
-        /// <param name="data">The byte array containing the message. Must not be null.</param>
-        /// <returns>The newly parsed message.</returns>
-        public new T ParseFrom(byte[] data)
-        {
-            ProtoPreconditions.CheckNotNull(data, "data");
-            T message = factory();
-            message.MergeFrom(data);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given byte string.
-        /// </summary>
-        /// <param name="data">The data to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public new T ParseFrom(ByteString data)
-        {
-            ProtoPreconditions.CheckNotNull(data, "data");
-            T message = factory();
-            message.MergeFrom(data);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given stream.
-        /// </summary>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public new T ParseFrom(Stream input)
-        {
-            T message = factory();
-            message.MergeFrom(input);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a length-delimited message from the given stream.
-        /// </summary>
-        /// <remarks>
-        /// The stream is expected to contain a length and then the data. Only the amount of data
-        /// specified by the length will be consumed.
-        /// </remarks>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public new T ParseDelimitedFrom(Stream input)
-        {
-            T message = factory();
-            message.MergeDelimitedFrom(input);
-            return message;
-        }
-
-        /// <summary>
-        /// Parses a message from the given coded input stream.
-        /// </summary>
-        /// <param name="input">The stream to parse.</param>
-        /// <returns>The parsed message.</returns>
-        public new T ParseFrom(CodedInputStream input)
-        {
-            T message = factory();
-            message.MergeFrom(input);
-            return message;
-        }
-
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/MessageParser.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 1c7045bb59482bd4ba45e875f377820b
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 64
Unity/Assets/ThirdParty/Google.Protobuf/PropertyInfoExtensions.cs

@@ -1,64 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System.Reflection;
-
-namespace Google.Protobuf.Compatibility
-{
-    /// <summary>
-    /// Extension methods for <see cref="PropertyInfo"/>, effectively providing
-    /// the familiar members from previous desktop framework versions while
-    /// targeting the newer releases, .NET Core etc.
-    /// </summary>
-    internal static class PropertyInfoExtensions
-    {
-        /// <summary>
-        /// Returns the public getter of a property, or null if there is no such getter
-        /// (either because it's read-only, or the getter isn't public).
-        /// </summary>
-        internal static MethodInfo GetGetMethod(this PropertyInfo target)
-        {
-            var method = target.GetGetMethod();
-            return method != null && method.IsPublic ? method : null;
-        }
-
-        /// <summary>
-        /// Returns the public setter of a property, or null if there is no such setter
-        /// (either because it's write-only, or the setter isn't public).
-        /// </summary>
-        internal static MethodInfo GetSetMethod(this PropertyInfo target)
-        {
-            var method = target.GetSetMethod();
-            return method != null && method.IsPublic ? method : null;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/PropertyInfoExtensions.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: a1ba303b1b8d9d943a4c0189a878a77f
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 79
Unity/Assets/ThirdParty/Google.Protobuf/ProtoPreconditions.cs

@@ -1,79 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// Helper methods for throwing exceptions when preconditions are not met.
-    /// </summary>
-    /// <remarks>
-    /// This class is used internally and by generated code; it is not particularly
-    /// expected to be used from application code, although nothing prevents it
-    /// from being used that way.
-    /// </remarks>
-    public static class ProtoPreconditions
-    {
-        /// <summary>
-        /// Throws an ArgumentNullException if the given value is null, otherwise
-        /// return the value to the caller.
-        /// </summary>
-        public static T CheckNotNull<T>(T value, string name) where T : class
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(name);
-            }
-            return value;
-        }
-
-        /// <summary>
-        /// Throws an ArgumentNullException if the given value is null, otherwise
-        /// return the value to the caller.
-        /// </summary>
-        /// <remarks>
-        /// This is equivalent to <see cref="CheckNotNull{T}(T, string)"/> but without the type parameter
-        /// constraint. In most cases, the constraint is useful to prevent you from calling CheckNotNull
-        /// with a value type - but it gets in the way if either you want to use it with a nullable
-        /// value type, or you want to use it with an unconstrained type parameter.
-        /// </remarks>
-        internal static T CheckNotNullUnconstrained<T>(T value, string name)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(name);
-            }
-            return value;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/ProtoPreconditions.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: ec2d66cb17ca74d49890f00206696580
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 581
Unity/Assets/ThirdParty/Google.Protobuf/RepeatedField.cs

@@ -1,581 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-
-namespace Google.Protobuf.Collections
-{
-    /// <summary>
-    /// The contents of a repeated field: essentially, a collection with some extra
-    /// restrictions (no null values) and capabilities (deep cloning).
-    /// </summary>
-    /// <remarks>
-    /// This implementation does not generally prohibit the use of types which are not
-    /// supported by Protocol Buffers but nor does it guarantee that all operations will work in such cases.
-    /// </remarks>
-    /// <typeparam name="T">The element type of the repeated field.</typeparam>
-    public sealed class RepeatedField<T> : IList<T>, IList 
-    {
-        private static readonly T[] EmptyArray = new T[0];
-        private const int MinArraySize = 8;
-
-        public T[] array = EmptyArray;
-        public int count = 0;
-
-        /// <summary>
-        /// Adds the entries from the given input stream, decoding them with the specified codec.
-        /// </summary>
-        /// <param name="input">The input stream to read from.</param>
-        /// <param name="codec">The codec to use in order to read each entry.</param>
-        public void AddEntriesFrom(CodedInputStream input, FieldCodec<T> codec)
-        {
-            // TODO: Inline some of the Add code, so we can avoid checking the size on every
-            // iteration.
-            uint tag = input.LastTag;
-            var reader = codec.ValueReader;
-            // Non-nullable value types can be packed or not.
-            if (FieldCodec<T>.IsPackedRepeatedField(tag))
-            {
-                int length = input.ReadLength();
-                if (length > 0)
-                {
-                    int oldLimit = input.PushLimit(length);
-                    while (!input.ReachedLimit)
-                    {
-                        Add(reader(input));
-                    }
-                    input.PopLimit(oldLimit);
-                }
-                // Empty packed field. Odd, but valid - just ignore.
-            }
-            else
-            {
-                // Not packed... (possibly not packable)
-                do
-                {
-                    Add(reader(input));
-                } while (input.MaybeConsumeTag(tag));
-            }
-        }
-
-        /// <summary>
-        /// Calculates the size of this collection based on the given codec.
-        /// </summary>
-        /// <param name="codec">The codec to use when encoding each field.</param>
-        /// <returns>The number of bytes that would be written to a <see cref="CodedOutputStream"/> by <see cref="WriteTo"/>,
-        /// using the same codec.</returns>
-        public int CalculateSize(FieldCodec<T> codec)
-        {
-            if (count == 0)
-            {
-                return 0;
-            }
-            uint tag = codec.Tag;
-            if (codec.PackedRepeatedField)
-            {
-                int dataSize = CalculatePackedDataSize(codec);
-                return CodedOutputStream.ComputeRawVarint32Size(tag) +
-                    CodedOutputStream.ComputeLengthSize(dataSize) +
-                    dataSize;
-            }
-            else
-            {
-                var sizeCalculator = codec.ValueSizeCalculator;
-                int size = count * CodedOutputStream.ComputeRawVarint32Size(tag);
-                for (int i = 0; i < count; i++)
-                {
-                    size += sizeCalculator(array[i]);
-                }
-                return size;
-            }
-        }
-
-        private int CalculatePackedDataSize(FieldCodec<T> codec)
-        {
-            int fixedSize = codec.FixedSize;
-            if (fixedSize == 0)
-            {
-                var calculator = codec.ValueSizeCalculator;
-                int tmp = 0;
-                for (int i = 0; i < count; i++)
-                {
-                    tmp += calculator(array[i]);
-                }
-                return tmp;
-            }
-            else
-            {
-                return fixedSize * Count;
-            }
-        }
-
-        /// <summary>
-        /// Writes the contents of this collection to the given <see cref="CodedOutputStream"/>,
-        /// encoding each value using the specified codec.
-        /// </summary>
-        /// <param name="output">The output stream to write to.</param>
-        /// <param name="codec">The codec to use when encoding each value.</param>
-        public void WriteTo(CodedOutputStream output, FieldCodec<T> codec)
-        {
-            if (count == 0)
-            {
-                return;
-            }
-            var writer = codec.ValueWriter;
-            var tag = codec.Tag;
-            if (codec.PackedRepeatedField)
-            {
-                // Packed primitive type
-                uint size = (uint)CalculatePackedDataSize(codec);
-                output.WriteTag(tag);
-                output.WriteRawVarint32(size);
-                for (int i = 0; i < count; i++)
-                {
-                    writer(output, array[i]);
-                }
-            }
-            else
-            {
-                // Not packed: a simple tag/value pair for each value.
-                // Can't use codec.WriteTagAndValue, as that omits default values.
-                for (int i = 0; i < count; i++)
-                {
-                    output.WriteTag(tag);
-                    writer(output, array[i]);
-                }
-            }
-        }
-
-        private void EnsureSize(int size)
-        {
-            if (array.Length < size)
-            {
-                size = Math.Max(size, MinArraySize);
-                int newSize = Math.Max(array.Length * 2, size);
-                var tmp = new T[newSize];
-                Array.Copy(array, 0, tmp, 0, array.Length);
-                array = tmp;
-            }
-        }
-
-        /// <summary>
-        /// Adds the specified item to the collection.
-        /// </summary>
-        /// <param name="item">The item to add.</param>
-        public void Add(T item)
-        {
-            ProtoPreconditions.CheckNotNullUnconstrained(item, "item");
-            EnsureSize(count + 1);
-            array[count++] = item;
-        }
-
-        /// <summary>
-        /// Removes all items from the collection.
-        /// </summary>
-        public void Clear()
-        {
-            // ET修改,这里不释放数组,避免gc
-            //array = EmptyArray;
-            count = 0;
-        }
-
-        /// <summary>
-        /// Determines whether this collection contains the given item.
-        /// </summary>
-        /// <param name="item">The item to find.</param>
-        /// <returns><c>true</c> if this collection contains the given item; <c>false</c> otherwise.</returns>
-        public bool Contains(T item)
-        {
-            return IndexOf(item) != -1;
-        }
-
-        /// <summary>
-        /// Copies this collection to the given array.
-        /// </summary>
-        /// <param name="array">The array to copy to.</param>
-        /// <param name="arrayIndex">The first index of the array to copy to.</param>
-        public void CopyTo(T[] array, int arrayIndex)
-        {
-            Array.Copy(this.array, 0, array, arrayIndex, count);
-        }
-
-        /// <summary>
-        /// Removes the specified item from the collection
-        /// </summary>
-        /// <param name="item">The item to remove.</param>
-        /// <returns><c>true</c> if the item was found and removed; <c>false</c> otherwise.</returns>
-        public bool Remove(T item)
-        {
-            int index = IndexOf(item);
-            if (index == -1)
-            {
-                return false;
-            }
-            Array.Copy(array, index + 1, array, index, count - index - 1);
-            count--;
-            array[count] = default(T);
-            return true;
-        }
-
-        /// <summary>
-        /// Gets the number of elements contained in the collection.
-        /// </summary>
-        public int Count
-        {
-            get
-            {
-                return count;
-            }
-        }
-
-        /// <summary>
-        /// Gets a value indicating whether the collection is read-only.
-        /// </summary>
-        public bool IsReadOnly
-        {
-            get
-            {
-                return false;
-            }
-        }
-
-        /// <summary>
-        /// Adds all of the specified values into this collection.
-        /// </summary>
-        /// <param name="values">The values to add to this collection.</param>
-        public void AddRange(IEnumerable<T> values)
-        {
-            ProtoPreconditions.CheckNotNull(values, "values");
-
-            // Optimization 1: If the collection we're adding is already a RepeatedField<T>,
-            // we know the values are valid.
-            var otherRepeatedField = values as RepeatedField<T>;
-            if (otherRepeatedField != null)
-            {
-                EnsureSize(count + otherRepeatedField.count);
-                Array.Copy(otherRepeatedField.array, 0, array, count, otherRepeatedField.count);
-                count += otherRepeatedField.count;
-                return;
-            }
-
-            // Optimization 2: The collection is an ICollection, so we can expand
-            // just once and ask the collection to copy itself into the array.
-            var collection = values as ICollection;
-            if (collection != null)
-            {
-                var extraCount = collection.Count;
-                // For reference types and nullable value types, we need to check that there are no nulls
-                // present. (This isn't a thread-safe approach, but we don't advertise this is thread-safe.)
-                // We expect the JITter to optimize this test to true/false, so it's effectively conditional
-                // specialization.
-                if (default(T) == null)
-                {
-                    // TODO: Measure whether iterating once to check and then letting the collection copy
-                    // itself is faster or slower than iterating and adding as we go. For large
-                    // collections this will not be great in terms of cache usage... but the optimized
-                    // copy may be significantly faster than doing it one at a time.
-                    foreach (var item in collection)
-                    {
-                        if (item == null)
-                        {
-                            throw new ArgumentException("Sequence contained null element", "values");
-                        }
-                    }
-                }
-                EnsureSize(count + extraCount);
-                collection.CopyTo(array, count);
-                count += extraCount;
-                return;
-            }
-
-            // We *could* check for ICollection<T> as well, but very very few collections implement
-            // ICollection<T> but not ICollection. (HashSet<T> does, for one...)
-
-            // Fall back to a slower path of adding items one at a time.
-            foreach (T item in values)
-            {
-                Add(item);
-            }
-        }
-
-        /// <summary>
-        /// Adds all of the specified values into this collection. This method is present to
-        /// allow repeated fields to be constructed from queries within collection initializers.
-        /// Within non-collection-initializer code, consider using the equivalent <see cref="AddRange"/>
-        /// method instead for clarity.
-        /// </summary>
-        /// <param name="values">The values to add to this collection.</param>
-        public void Add(IEnumerable<T> values)
-        {
-            AddRange(values);
-        }
-
-        /// <summary>
-        /// Returns an enumerator that iterates through the collection.
-        /// </summary>
-        /// <returns>
-        /// An enumerator that can be used to iterate through the collection.
-        /// </returns>
-        public IEnumerator<T> GetEnumerator()
-        {
-            for (int i = 0; i < count; i++)
-            {
-                yield return array[i];
-            }
-        }
-
-        /// <summary>
-        /// Determines whether the specified <see cref="System.Object" />, is equal to this instance.
-        /// </summary>
-        /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
-        /// <returns>
-        ///   <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.
-        /// </returns>
-        public override bool Equals(object obj)
-        {
-            return Equals(obj as RepeatedField<T>);
-        }
-
-        /// <summary>
-        /// Returns an enumerator that iterates through a collection.
-        /// </summary>
-        /// <returns>
-        /// An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.
-        /// </returns>
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
-
-        /// <summary>
-        /// Returns a hash code for this instance.
-        /// </summary>
-        /// <returns>
-        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
-        /// </returns>
-        public override int GetHashCode()
-        {
-            int hash = 0;
-            for (int i = 0; i < count; i++)
-            {
-                hash = hash * 31 + array[i].GetHashCode();
-            }
-            return hash;
-        }
-
-        /// <summary>
-        /// Compares this repeated field with another for equality.
-        /// </summary>
-        /// <param name="other">The repeated field to compare this with.</param>
-        /// <returns><c>true</c> if <paramref name="other"/> refers to an equal repeated field; <c>false</c> otherwise.</returns>
-        public bool Equals(RepeatedField<T> other)
-        {
-            if (ReferenceEquals(other, null))
-            {
-                return false;
-            }
-            if (ReferenceEquals(other, this))
-            {
-                return true;
-            }
-            if (other.Count != this.Count)
-            {
-                return false;
-            }
-            EqualityComparer<T> comparer = EqualityComparer<T>.Default;
-            for (int i = 0; i < count; i++)
-            {
-                if (!comparer.Equals(array[i], other.array[i]))
-                {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        /// <summary>
-        /// Returns the index of the given item within the collection, or -1 if the item is not
-        /// present.
-        /// </summary>
-        /// <param name="item">The item to find in the collection.</param>
-        /// <returns>The zero-based index of the item, or -1 if it is not found.</returns>
-        public int IndexOf(T item)
-        {
-            ProtoPreconditions.CheckNotNullUnconstrained(item, "item");
-            EqualityComparer<T> comparer = EqualityComparer<T>.Default;
-            for (int i = 0; i < count; i++)
-            {
-                if (comparer.Equals(array[i], item))
-                {
-                    return i;
-                }
-            }
-            return -1;
-        }
-
-        /// <summary>
-        /// Inserts the given item at the specified index.
-        /// </summary>
-        /// <param name="index">The index at which to insert the item.</param>
-        /// <param name="item">The item to insert.</param>
-        public void Insert(int index, T item)
-        {
-            ProtoPreconditions.CheckNotNullUnconstrained(item, "item");
-            if (index < 0 || index > count)
-            {
-                throw new ArgumentOutOfRangeException("index");
-            }
-            EnsureSize(count + 1);
-            Array.Copy(array, index, array, index + 1, count - index);
-            array[index] = item;
-            count++;
-        }
-
-        /// <summary>
-        /// Removes the item at the given index.
-        /// </summary>
-        /// <param name="index">The zero-based index of the item to remove.</param>
-        public void RemoveAt(int index)
-        {
-            if (index < 0 || index >= count)
-            {
-                throw new ArgumentOutOfRangeException("index");
-            }
-            Array.Copy(array, index + 1, array, index, count - index - 1);
-            count--;
-            array[count] = default(T);
-        }
-
-        /// <summary>
-        /// Gets or sets the item at the specified index.
-        /// </summary>
-        /// <value>
-        /// The element at the specified index.
-        /// </value>
-        /// <param name="index">The zero-based index of the element to get or set.</param>
-        /// <returns>The item at the specified index.</returns>
-        public T this[int index]
-        {
-            get
-            {
-                if (index < 0 || index >= count)
-                {
-                    throw new ArgumentOutOfRangeException("index");
-                }
-                return array[index];
-            }
-            set
-            {
-                if (index < 0 || index >= count)
-                {
-                    throw new ArgumentOutOfRangeException("index");
-                }
-                ProtoPreconditions.CheckNotNullUnconstrained(value, "value");
-                array[index] = value;
-            }
-        }
-
-        #region Explicit interface implementation for IList and ICollection.
-        bool IList.IsFixedSize
-        {
-            get
-            {
-                return false;
-            }
-        }
-
-        void ICollection.CopyTo(Array array, int index)
-        {
-            Array.Copy(this.array, 0, array, index, count);
-        }
-
-        bool ICollection.IsSynchronized
-        {
-            get
-            {
-                return false;
-            }
-        }
-
-        object ICollection.SyncRoot
-        {
-            get
-            {
-                return this;
-            }
-        }
-
-        object IList.this[int index]
-        {
-            get { return this[index]; }
-            set { this[index] = (T)value; }
-        }
-
-        int IList.Add(object value)
-        {
-            Add((T)value);
-            return count - 1;
-        }
-
-        bool IList.Contains(object value)
-        {
-            return (value is T && Contains((T)value));
-        }
-
-        int IList.IndexOf(object value)
-        {
-            if (!(value is T))
-            {
-                return -1;
-            }
-            return IndexOf((T)value);
-        }
-
-        void IList.Insert(int index, object value)
-        {
-            Insert(index, (T)value);
-        }
-
-        void IList.Remove(object value)
-        {
-            if (!(value is T))
-            {
-                return;
-            }
-            Remove((T)value);
-        }
-        #endregion        
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/RepeatedField.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 462fd9852b348c34094dbb0e82649335
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 64
Unity/Assets/ThirdParty/Google.Protobuf/StreamExtensions.cs

@@ -1,64 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using System;
-using System.IO;
-
-namespace Google.Protobuf.Compatibility
-{
-    /// <summary>
-    /// Extension methods for <see cref="Stream"/> in order to provide
-    /// backwards compatibility with .NET 3.5
-    /// </summary>
-    public static class StreamExtensions
-    {
-        // 81920 seems to be the default buffer size used in .NET 4.5.1
-        private const int BUFFER_SIZE = 81920;
-
-        /// <summary>
-        /// Write the contents of the current stream to the destination stream
-        /// </summary>
-        public static void CopyTo(this Stream source, Stream destination)
-        {
-            if (destination == null)
-            {
-                throw new ArgumentNullException("destination");
-            }
-
-            byte[] buffer = new byte[BUFFER_SIZE];
-            int numBytesRead;
-            while ((numBytesRead = source.Read(buffer, 0, buffer.Length)) > 0) {
-                destination.Write(buffer, 0, numBytesRead);
-            }
-        }
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/StreamExtensions.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 51467fdc5aeb0374baba8cb484d68f4c
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 104
Unity/Assets/ThirdParty/Google.Protobuf/WireFormat.cs

@@ -1,104 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-namespace Google.Protobuf
-{
-    /// <summary>
-    /// This class is used internally by the Protocol Buffer Library and generated
-    /// message implementations. It is public only for the sake of those generated
-    /// messages. Others should not use this class directly.
-    /// <para>
-    /// This class contains constants and helper functions useful for dealing with
-    /// the Protocol Buffer wire format.
-    /// </para>
-    /// </summary>
-    public static class WireFormat
-    {
-        /// <summary>
-        /// Wire types within protobuf encoding.
-        /// </summary>
-        public enum WireType : uint
-        {
-            /// <summary>
-            /// Variable-length integer.
-            /// </summary>
-            Varint = 0,
-            /// <summary>
-            /// A fixed-length 64-bit value.
-            /// </summary>
-            Fixed64 = 1,
-            /// <summary>
-            /// A length-delimited value, i.e. a length followed by that many bytes of data.
-            /// </summary>
-            LengthDelimited = 2,
-            /// <summary>
-            /// A "start group" value - not supported by this implementation.
-            /// </summary>
-            StartGroup = 3,
-            /// <summary>
-            /// An "end group" value - not supported by this implementation.
-            /// </summary>
-            EndGroup = 4,
-            /// <summary>
-            /// A fixed-length 32-bit value.
-            /// </summary>
-            Fixed32 = 5
-        }
-        
-        private const int TagTypeBits = 3;
-        private const uint TagTypeMask = (1 << TagTypeBits) - 1;
-
-        /// <summary>
-        /// Given a tag value, determines the wire type (lower 3 bits).
-        /// </summary>
-        public static WireType GetTagWireType(uint tag)
-        {
-            return (WireType) (tag & TagTypeMask);
-        }
-
-        /// <summary>
-        /// Given a tag value, determines the field number (the upper 29 bits).
-        /// </summary>
-        public static int GetTagFieldNumber(uint tag)
-        {
-            return (int) tag >> TagTypeBits;
-        }
-
-        /// <summary>
-        /// Makes a tag value given a field number and wire type.
-        /// </summary>
-        public static uint MakeTag(int fieldNumber, WireType wireType)
-        {
-            return (uint) (fieldNumber << TagTypeBits) | (uint) wireType;
-        }        
-    }
-}

+ 0 - 11
Unity/Assets/ThirdParty/Google.Protobuf/WireFormat.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 7bf59a3ce666cd14392ea36d61668d87
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 18 - 16
Unity/Packages/packages-lock.json

@@ -19,7 +19,7 @@
       "dependencies": {
         "com.unity.ugui": "1.0.0"
       },
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.analytics": {
       "version": "3.3.5",
@@ -28,44 +28,44 @@
       "dependencies": {
         "com.unity.ugui": "1.0.0"
       },
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.assetbundlebrowser": {
       "version": "1.7.0",
       "depth": 0,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.collab-proxy": {
       "version": "1.2.16",
       "depth": 0,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.ext.nunit": {
       "version": "1.0.0",
       "depth": 1,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.ide.rider": {
       "version": "1.1.4",
       "depth": 0,
       "source": "registry",
       "dependencies": {
-        "com.unity.test-framework": "1.1.1"
+        "com.unity.test-framework": "1.1.3"
       },
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.ide.vscode": {
       "version": "1.2.1",
       "depth": 0,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.multiplayer-hlapi": {
       "version": "1.0.6",
@@ -74,14 +74,16 @@
       "dependencies": {
         "nuget.mono-cecil": "0.1.6-preview"
       },
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.purchasing": {
       "version": "2.1.0",
       "depth": 0,
       "source": "registry",
-      "dependencies": {},
-      "url": "https://packages.unity.com"
+      "dependencies": {
+        "com.unity.ugui": "1.0.0"
+      },
+      "url": "https://packages.unity.cn"
     },
     "com.unity.test-framework": {
       "version": "1.1.16",
@@ -92,7 +94,7 @@
         "com.unity.modules.imgui": "1.0.0",
         "com.unity.modules.jsonserialize": "1.0.0"
       },
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.textmeshpro": {
       "version": "2.0.1",
@@ -101,14 +103,14 @@
       "dependencies": {
         "com.unity.ugui": "1.0.0"
       },
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.timeline": {
       "version": "1.2.10",
       "depth": 0,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.ugui": {
       "version": "1.0.0",
@@ -124,14 +126,14 @@
       "depth": 0,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "nuget.mono-cecil": {
       "version": "0.1.6-preview",
       "depth": 1,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.com"
+      "url": "https://packages.unity.cn"
     },
     "com.unity.modules.ai": {
       "version": "1.0.0",

ファイルの差分が大きいため隠しています
+ 3 - 0
Unity/Unity.Editor.csproj


ファイルの差分が大きいため隠しています
+ 3 - 0
Unity/Unity.Hotfix.csproj


ファイルの差分が大きいため隠しています
+ 3 - 0
Unity/Unity.HotfixView.csproj


ファイルの差分が大きいため隠しています
+ 3 - 0
Unity/Unity.Model.csproj


ファイルの差分が大きいため隠しています
+ 3 - 0
Unity/Unity.ModelView.csproj


ファイルの差分が大きいため隠しています
+ 3 - 0
Unity/Unity.ThirdParty.csproj


+ 2 - 2
Unity/Unity.sln

@@ -1,6 +1,6 @@
 
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.ThirdParty", "Unity.ThirdParty.csproj", "{E15BADD2-3A26-309A-AB0F-DC5B08044350}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.HotfixView", "Unity.HotfixView.csproj", "{D31345DE-9B88-525C-8E9C-744C99AE7509}"

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません