diff --git a/communication/Proto/Message.cs b/communication/Proto/Message.cs index f24afb78..97f5ebc8 100644 --- a/communication/Proto/Message.cs +++ b/communication/Proto/Message.cs @@ -4,17 +4,25 @@ namespace Communication.Proto { + /// + /// 游戏信息类型。此处的类型完全根据proto文件的信息决定,实际上可以自行删减——把所有的"MessageToxx"类的名称都列举在这里就可以了 + /// public enum PacketType { - MessageToClient = 0, // 全局信息 + MessageToServer = 0, MessageToOneClient = 1, // 单人信息 - MessageToServer = 2, + // 以下的枚举全部由原来的(指THUAI4和THUAI5的上一个版本)的MessageToClient拆分而来,一方面降低了广播带来的信息耦合程度,另一方面也增强了代码的可读性 + MessageToInitialize = 2, + MessageToOperate = 3, + MessageToRefresh = 4, } - + /// + /// 信息的通用接口,包含信息类型和内容 + /// public interface IGameMessage { PacketType PacketType { get; set; } - IMessage Content { get; set; } // Protobuf的通用接口 + IMessage Content { get; set; } } /// @@ -39,18 +47,8 @@ public void Deserialize(byte[] bytes) type = (PacketType)br.ReadInt32(); string typename = null; - switch (type) - { - case PacketType.MessageToClient: - typename = "Communication.Proto.MessageToClient"; - break; - case PacketType.MessageToOneClient: - typename = "Communication.Proto.MessageToOneClient"; - break; - case PacketType.MessageToServer: - typename = "Communication.Proto.MessageToServer"; - break; - } + // 由于枚举值增多,这里将“枚举转类型名称”改写成一种更加简洁的方式 + typename = "Communication.Proto." + Enum.GetName(typeof(PacketType), type); try { diff --git a/communication/Proto/Message2Clients.cs b/communication/Proto/Message2Clients.cs index 7c096e66..37d0f8f2 100644 --- a/communication/Proto/Message2Clients.cs +++ b/communication/Proto/Message2Clients.cs @@ -25,144 +25,70 @@ static Message2ClientsReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChVNZXNzYWdlMkNsaWVudHMucHJvdG8SCFByb3RvYnVmGhFNZXNzYWdlVHlw", - "ZS5wcm90byLkBAoLR2FtZU9iakluZm8SKgoLZ2FtZU9ialR5cGUYASABKA4y", - "FS5Qcm90b2J1Zi5HYW1lT2JqVHlwZRIMCgRndWlkGAIgASgDEgkKAXgYAyAB", - "KAUSCQoBeRgEIAEoBRIXCg9mYWNpbmdEaXJlY3Rpb24YBSABKAESEQoJbW92", - "ZVNwZWVkGAYgASgFEg8KB2Nhbk1vdmUYByABKAgSEAoIaXNNb3ZpbmcYCCAB", - "KAgSJgoJc2hhcGVUeXBlGAkgASgOMhMuUHJvdG9idWYuU2hhcGVUeXBlEg4K", - "BnJhZGl1cxgKIAEoBRIOCgZ0ZWFtSUQYCyABKAMSCwoDYmFwGAwgASgFEhEK", - "CWJvb21SYW5nZRgNIAEoBRIkCghwcm9wVHlwZRgOIAEoDjISLlByb3RvYnVm", - "LlByb3BUeXBlEg4KBmlzTGFpZBgPIAEoCBIPCgdpc0R5aW5nGBAgASgIEgoK", - "AkNEGBEgASgFEhQKDG1heEJ1bGxldE51bRgSIAEoBRIRCglidWxsZXROdW0Y", - "EyABKAUSDQoFbWF4SHAYFCABKAUSCgoCaHAYFSABKAUSDwoHbGlmZU51bRgW", - "IAEoBRIqCgZwU2tpbGwYFyABKA4yGi5Qcm90b2J1Zi5QYXNzaXZlU2tpbGxU", - "eXBlEioKB2FTa2lsbDEYGCABKA4yGS5Qcm90b2J1Zi5BY3RpdmVTa2lsbFR5", - "cGUSKgoHYVNraWxsMhgZIAEoDjIZLlByb3RvYnVmLkFjdGl2ZVNraWxsVHlw", - "ZRIiCgVwbGFjZRgaIAEoDjITLlByb3RvYnVmLlBsYWNlVHlwZSKBAQoSTWVz", - "c2FnZVRvT25lQ2xpZW50EhAKCHBsYXllcklEGAEgASgDEg4KBnRlYW1JRBgC", - "IAEoAxIqCgttZXNzYWdlVHlwZRgDIAEoDjIVLlByb3RvYnVmLk1lc3NhZ2VU", - "eXBlEgwKBGd1aWQYBCABKAMSDwoHbWVzc2FnZRgFIAEoCSKoAgoPTWVzc2Fn", - "ZVRvQ2xpZW50EhAKCHBsYXllcklEGAEgASgDEg4KBnRlYW1JRBgCIAEoAxIq", - "CgttZXNzYWdlVHlwZRgDIAEoDjIVLlByb3RvYnVmLk1lc3NhZ2VUeXBlEicK", - "CHNlbGZJbmZvGAQgASgLMhUuUHJvdG9idWYuR2FtZU9iakluZm8SEQoJdGVh", - "bVNjb3JlGAUgASgFEicKCGdhbWVPYmpzGAYgAygLMhUuUHJvdG9idWYuR2Ft", - "ZU9iakluZm8SOwoLUGxheWVyR1VJRHMYByADKAsyJi5Qcm90b2J1Zi5NZXNz", - "YWdlVG9DbGllbnQuT25lVGVhbUdVSURzGiUKDE9uZVRlYW1HVUlEcxIVCg10", - "ZWFtbWF0ZUdVSURzGAEgAygDKmwKC0dhbWVPYmpUeXBlEg0KCUNoYXJhY3Rl", - "chAAEggKBFdhbGwQARIICgRQcm9wEAISCgoGQnVsbGV0EAMSDgoKQmlydGhQ", - "b2ludBAEEhMKD091dE9mQm91bmRCbG9jaxAFEgkKBUdyYXNzEAYqSgoJUGxh", - "Y2VUeXBlEgoKBkdyb3VuZBAAEgoKBkdyYXNzMRABEgoKBkdyYXNzMhACEgoK", - "BkdyYXNzMxADEg0KCUludmlzaWJsZRAEKpQBCghQcm9wVHlwZRIICgROdWxs", - "EAASDgoKQWNjZWxlcmF0ZRABEgoKBnBsdXNBUBACEgsKB21pbnVzQ0QQAxIJ", - "CgVhZGRIUBAEEgoKBlNoaWVsZBAFEgsKB2FkZExJRkUQBhIJCgVTcGVhchAH", - "Eg4KCkRlY2VsZXJhdGUQCBILCgdtaW51c0FQEAkSCQoFYWRkQ0QQCiojCglT", - "aGFwZVR5cGUSCgoGQ2lyY2xlEAASCgoGU3F1YXJlEAEqYAoQUGFzc2l2ZVNr", - "aWxsVHlwZRILCgdQU2tpbGwwEAASCwoHUFNraWxsMRABEgsKB1BTa2lsbDIQ", - "AhILCgdQU2tpbGwzEAMSCwoHUFNraWxsNBAEEgsKB1BTa2lsbDUQBSpfCg9B", - "Y3RpdmVTa2lsbFR5cGUSCwoHQVNraWxsMBAAEgsKB0FTa2lsbDEQARILCgdB", - "U2tpbGwyEAISCwoHQVNraWxsMxADEgsKB0FTa2lsbDQQBBILCgdBU2tpbGw1", - "EAUqJgoKQnVsbGV0VHlwZRILCgdCdWxsZXQwEAASCwoHQnVsbGV0MRABQhaq", - "AhNDb21tdW5pY2F0aW9uLlByb3RvYgZwcm90bzM=")); + "ZS5wcm90byLAAgobQ2hhbmdlYWJsZUNoYXJhY3RlclByb3BlcnR5EgkKAXgY", + "ASABKAUSCQoBeRgCIAEoBRITCgthdHRhY2tSYW5nZRgDIAEoBRIRCglidWxs", + "ZXROdW0YBCABKAUSDQoFc3BlZWQYBSABKAUSDAoEbGlmZRgGIAEoBRIlCh10", + "aW1lVW50aWxDb21tb25Ta2lsbEF2YWlsYWJsZRgHIAEoARInCh90aW1lVW50", + "aWxVbHRpbWF0ZVNraWxsQXZhaWxhYmxlGAggASgBEg4KBmdlbU51bRgJIAEo", + "BRIgCgRidWZmGAogASgOMhIuUHJvdG9idWYuQnVmZlR5cGUSIAoEcHJvcBgL", + "IAEoDjISLlByb3RvYnVmLlByb3BUeXBlEiIKBXBsYWNlGAwgASgOMhMuUHJv", + "dG9idWYuUGxhY2VUeXBlIlsKGEJhc2ljYWxDaGFyYWN0ZXJQcm9wZXJ0eRIM", + "CgRndWlkGAEgASgFEhgKEFBhc3NpdmVTa2lsbFR5cGUYAiABKAUSFwoPQWN0", + "aXZlU2tpbGxUeXBlGAMgASgFIkcKDU1lc3NhZ2VPZlByb3ASIAoEdHlwZRgB", + "IAEoDjISLlByb3RvYnVmLlByb3BUeXBlEgkKAXgYAiABKAUSCQoBeRgDIAEo", + "BSJaCg9NZXNzYWdlT2ZCdWxsZXQSIgoEdHlwZRgBIAEoDjIULlByb3RvYnVm", + "LkJ1bGxldFR5cGUSEAoIYnVsbGV0QVAYAiABKAUSEQoJYm9vbVJhbmdlGAMg", + "ASgFInsKE01lc3NhZ2VUb0luaXRpYWxpemUSEQoJTWFwU2VyaWFsGAEgASgF", + "EhsKE051bWJlck9mVmFsaWRQbGF5ZXIYAiABKAUSNAoIcHJvcGVydHkYAyAD", + "KAsyIi5Qcm90b2J1Zi5CYXNpY2FsQ2hhcmFjdGVyUHJvcGVydHkizgEKFE1l", + "c3NhZ2VUb0FkZEluc3RhbmNlEisKDGluc3RhbmNlVHlwZRgBIAEoDjIVLlBy", + "b3RvYnVmLkdhbWVPYmpUeXBlEgwKBGd1aWQYAiABKAUSMAoNbWVzc2FnZU9m", + "UHJvcBgDIAEoCzIXLlByb3RvYnVmLk1lc3NhZ2VPZlByb3BIABI0Cg9tZXNz", + "YWdlT2ZCdWxsZXQYBCABKAsyGS5Qcm90b2J1Zi5NZXNzYWdlT2ZCdWxsZXRI", + "AEITChFtZXNzYWdlT2ZJbnN0YW5jZSIoChhNZXNzYWdlVG9EZXN0cm95SW5z", + "dGFuY2USDAoEZ3VpZBgBIAEoBSLFAQoQTWVzc2FnZVRvT3BlcmF0ZRITCgtv", + "cGVyYXRlS2luZBgBIAEoCBI+ChRtZXNzYWdlVG9BZGRJbnN0YW5jZRgCIAEo", + "CzIeLlByb3RvYnVmLk1lc3NhZ2VUb0FkZEluc3RhbmNlSAASRgoYbWVzc2Fn", + "ZVRvRGVzdHJveUluc3RhbmNlGAMgASgLMiIuUHJvdG9idWYuTWVzc2FnZVRv", + "RGVzdHJveUluc3RhbmNlSABCFAoSbWVzc2FnZU9mT3BlcmF0aW9uIssBChBN", + "ZXNzYWdlVG9SZWZyZXNoEioKC2dhbWVPYmpUeXBlGAEgASgOMhUuUHJvdG9i", + "dWYuR2FtZU9ialR5cGUSNAoPbWVzc2FnZU9mQnVsbGV0GAIgASgLMhkuUHJv", + "dG9idWYuTWVzc2FnZU9mQnVsbGV0SAASQwoSbWVzc2FnZU9mQ2hhcmFjdGVy", + "GAMgASgLMiUuUHJvdG9idWYuQ2hhbmdlYWJsZUNoYXJhY3RlclByb3BlcnR5", + "SABCEAoOZ2FtZU9iak1lc3NhZ2UigQEKEk1lc3NhZ2VUb09uZUNsaWVudBIQ", + "CghwbGF5ZXJJRBgBIAEoBRIOCgZ0ZWFtSUQYAiABKAUSKgoLbWVzc2FnZVR5", + "cGUYAyABKA4yFS5Qcm90b2J1Zi5NZXNzYWdlVHlwZRIMCgRndWlkGAQgASgF", + "Eg8KB21lc3NhZ2UYBSABKAlCFqoCE0NvbW11bmljYXRpb24uUHJvdG9iBnBy", + "b3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Communication.Proto.MessageTypeReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Communication.Proto.GameObjType), typeof(global::Communication.Proto.PlaceType), typeof(global::Communication.Proto.PropType), typeof(global::Communication.Proto.ShapeType), typeof(global::Communication.Proto.PassiveSkillType), typeof(global::Communication.Proto.ActiveSkillType), typeof(global::Communication.Proto.BulletType), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.GameObjInfo), global::Communication.Proto.GameObjInfo.Parser, new[]{ "GameObjType", "Guid", "X", "Y", "FacingDirection", "MoveSpeed", "CanMove", "IsMoving", "ShapeType", "Radius", "TeamID", "Bap", "BoomRange", "PropType", "IsLaid", "IsDying", "CD", "MaxBulletNum", "BulletNum", "MaxHp", "Hp", "LifeNum", "PSkill", "ASkill1", "ASkill2", "Place" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToOneClient), global::Communication.Proto.MessageToOneClient.Parser, new[]{ "PlayerID", "TeamID", "MessageType", "Guid", "Message" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToClient), global::Communication.Proto.MessageToClient.Parser, new[]{ "PlayerID", "TeamID", "MessageType", "SelfInfo", "TeamScore", "GameObjs", "PlayerGUIDs" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToClient.Types.OneTeamGUIDs), global::Communication.Proto.MessageToClient.Types.OneTeamGUIDs.Parser, new[]{ "TeammateGUIDs" }, null, null, null, null)}) + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.ChangeableCharacterProperty), global::Communication.Proto.ChangeableCharacterProperty.Parser, new[]{ "X", "Y", "AttackRange", "BulletNum", "Speed", "Life", "TimeUntilCommonSkillAvailable", "TimeUntilUltimateSkillAvailable", "GemNum", "Buff", "Prop", "Place" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.BasicalCharacterProperty), global::Communication.Proto.BasicalCharacterProperty.Parser, new[]{ "Guid", "PassiveSkillType", "ActiveSkillType" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageOfProp), global::Communication.Proto.MessageOfProp.Parser, new[]{ "Type", "X", "Y" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageOfBullet), global::Communication.Proto.MessageOfBullet.Parser, new[]{ "Type", "BulletAP", "BoomRange" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToInitialize), global::Communication.Proto.MessageToInitialize.Parser, new[]{ "MapSerial", "NumberOfValidPlayer", "Property" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToAddInstance), global::Communication.Proto.MessageToAddInstance.Parser, new[]{ "InstanceType", "Guid", "MessageOfProp", "MessageOfBullet" }, new[]{ "MessageOfInstance" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToDestroyInstance), global::Communication.Proto.MessageToDestroyInstance.Parser, new[]{ "Guid" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToOperate), global::Communication.Proto.MessageToOperate.Parser, new[]{ "OperateKind", "MessageToAddInstance", "MessageToDestroyInstance" }, new[]{ "MessageOfOperation" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToRefresh), global::Communication.Proto.MessageToRefresh.Parser, new[]{ "GameObjType", "MessageOfBullet", "MessageOfCharacter" }, new[]{ "GameObjMessage" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToOneClient), global::Communication.Proto.MessageToOneClient.Parser, new[]{ "PlayerID", "TeamID", "MessageType", "Guid", "Message" }, null, null, null, null) })); } #endregion } - #region Enums - public enum GameObjType { - [pbr::OriginalName("Character")] Character = 0, - [pbr::OriginalName("Wall")] Wall = 1, - [pbr::OriginalName("Prop")] Prop = 2, - [pbr::OriginalName("Bullet")] Bullet = 3, - [pbr::OriginalName("BirthPoint")] BirthPoint = 4, - [pbr::OriginalName("OutOfBoundBlock")] OutOfBoundBlock = 5, - [pbr::OriginalName("Grass")] Grass = 6, - } - - /// - ///角色可见属性的枚举,包括:Ground(外围)0,Grass1、2、3,以及角色技能带来的隐身4 - /// - public enum PlaceType { - [pbr::OriginalName("Ground")] Ground = 0, - [pbr::OriginalName("Grass1")] Grass1 = 1, - [pbr::OriginalName("Grass2")] Grass2 = 2, - [pbr::OriginalName("Grass3")] Grass3 = 3, - [pbr::OriginalName("Invisible")] Invisible = 4, - } - - /// - ///道具类型,此为编写时的临时名称,具体道具名称可以待主题确定后更改 - /// - public enum PropType { - [pbr::OriginalName("Null")] Null = 0, - [pbr::OriginalName("Accelerate")] Accelerate = 1, - [pbr::OriginalName("plusAP")] PlusAp = 2, - [pbr::OriginalName("minusCD")] MinusCd = 3, - [pbr::OriginalName("addHP")] AddHp = 4, - [pbr::OriginalName("Shield")] Shield = 5, - [pbr::OriginalName("addLIFE")] AddLife = 6, - [pbr::OriginalName("Spear")] Spear = 7, - [pbr::OriginalName("Decelerate")] Decelerate = 8, - [pbr::OriginalName("minusAP")] MinusAp = 9, - [pbr::OriginalName("addCD")] AddCd = 10, - } - - public enum ShapeType { - /// - ///仍然,子弹和人物为圆形,格子为方形 - /// - [pbr::OriginalName("Circle")] Circle = 0, - [pbr::OriginalName("Square")] Square = 1, - } - - public enum PassiveSkillType { - [pbr::OriginalName("PSkill0")] Pskill0 = 0, - [pbr::OriginalName("PSkill1")] Pskill1 = 1, - [pbr::OriginalName("PSkill2")] Pskill2 = 2, - [pbr::OriginalName("PSkill3")] Pskill3 = 3, - [pbr::OriginalName("PSkill4")] Pskill4 = 4, - [pbr::OriginalName("PSkill5")] Pskill5 = 5, - } - - public enum ActiveSkillType { - [pbr::OriginalName("ASkill0")] Askill0 = 0, - [pbr::OriginalName("ASkill1")] Askill1 = 1, - [pbr::OriginalName("ASkill2")] Askill2 = 2, - [pbr::OriginalName("ASkill3")] Askill3 = 3, - [pbr::OriginalName("ASkill4")] Askill4 = 4, - [pbr::OriginalName("ASkill5")] Askill5 = 5, - } - - public enum BulletType { - /// - ///普通子弹 - /// - [pbr::OriginalName("Bullet0")] Bullet0 = 0, - /// - ///爆弾 - /// - [pbr::OriginalName("Bullet1")] Bullet1 = 1, - } - - #endregion - #region Messages - public sealed partial class GameObjInfo : pb::IMessage + public sealed partial class ChangeableCharacterProperty : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GameObjInfo()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChangeableCharacterProperty()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -178,7 +104,7 @@ public sealed partial class GameObjInfo : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GameObjInfo() { + public ChangeableCharacterProperty() { OnConstruction(); } @@ -186,72 +112,34 @@ public GameObjInfo() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GameObjInfo(GameObjInfo other) : this() { - gameObjType_ = other.gameObjType_; - guid_ = other.guid_; + public ChangeableCharacterProperty(ChangeableCharacterProperty other) : this() { x_ = other.x_; y_ = other.y_; - facingDirection_ = other.facingDirection_; - moveSpeed_ = other.moveSpeed_; - canMove_ = other.canMove_; - isMoving_ = other.isMoving_; - shapeType_ = other.shapeType_; - radius_ = other.radius_; - teamID_ = other.teamID_; - bap_ = other.bap_; - boomRange_ = other.boomRange_; - propType_ = other.propType_; - isLaid_ = other.isLaid_; - isDying_ = other.isDying_; - cD_ = other.cD_; - maxBulletNum_ = other.maxBulletNum_; + attackRange_ = other.attackRange_; bulletNum_ = other.bulletNum_; - maxHp_ = other.maxHp_; - hp_ = other.hp_; - lifeNum_ = other.lifeNum_; - pSkill_ = other.pSkill_; - aSkill1_ = other.aSkill1_; - aSkill2_ = other.aSkill2_; + speed_ = other.speed_; + life_ = other.life_; + timeUntilCommonSkillAvailable_ = other.timeUntilCommonSkillAvailable_; + timeUntilUltimateSkillAvailable_ = other.timeUntilUltimateSkillAvailable_; + gemNum_ = other.gemNum_; + buff_ = other.buff_; + prop_ = other.prop_; place_ = other.place_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GameObjInfo Clone() { - return new GameObjInfo(this); - } - - /// Field number for the "gameObjType" field. - public const int GameObjTypeFieldNumber = 1; - private global::Communication.Proto.GameObjType gameObjType_ = global::Communication.Proto.GameObjType.Character; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Communication.Proto.GameObjType GameObjType { - get { return gameObjType_; } - set { - gameObjType_ = value; - } - } - - /// Field number for the "guid" field. - public const int GuidFieldNumber = 2; - private long guid_; - /// - ///以下当gameObjType为任意值时均时有效 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long Guid { - get { return guid_; } - set { - guid_ = value; - } + public ChangeableCharacterProperty Clone() { + return new ChangeableCharacterProperty(this); } /// Field number for the "x" field. - public const int XFieldNumber = 3; + public const int XFieldNumber = 1; private int x_; + /// + ///可见 + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int X { @@ -262,8 +150,11 @@ public int X { } /// Field number for the "y" field. - public const int YFieldNumber = 4; + public const int YFieldNumber = 2; private int y_; + /// + ///可见 + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Y { @@ -273,302 +164,143 @@ public int Y { } } - /// Field number for the "facingDirection" field. - public const int FacingDirectionFieldNumber = 5; - private double facingDirection_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double FacingDirection { - get { return facingDirection_; } - set { - facingDirection_ = value; - } - } - - /// Field number for the "moveSpeed" field. - public const int MoveSpeedFieldNumber = 6; - private int moveSpeed_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int MoveSpeed { - get { return moveSpeed_; } - set { - moveSpeed_ = value; - } - } - - /// Field number for the "canMove" field. - public const int CanMoveFieldNumber = 7; - private bool canMove_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool CanMove { - get { return canMove_; } - set { - canMove_ = value; - } - } - - /// Field number for the "isMoving" field. - public const int IsMovingFieldNumber = 8; - private bool isMoving_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsMoving { - get { return isMoving_; } - set { - isMoving_ = value; - } - } - - /// Field number for the "shapeType" field. - public const int ShapeTypeFieldNumber = 9; - private global::Communication.Proto.ShapeType shapeType_ = global::Communication.Proto.ShapeType.Circle; - /// - ///形状 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Communication.Proto.ShapeType ShapeType { - get { return shapeType_; } - set { - shapeType_ = value; - } - } - - /// Field number for the "radius" field. - public const int RadiusFieldNumber = 10; - private int radius_; - /// - ///圆形物体的半径或正方形内切圆半径 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Radius { - get { return radius_; } - set { - radius_ = value; - } - } - - /// Field number for the "teamID" field. - public const int TeamIDFieldNumber = 11; - private long teamID_; - /// - ///以下当gameObjType为Character、Prop和Bullet时才有效 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long TeamID { - get { return teamID_; } - set { - teamID_ = value; - } - } - - /// Field number for the "bap" field. - public const int BapFieldNumber = 12; - private int bap_; - /// - ///以下当gameObjType为Bullet时才有效 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Bap { - get { return bap_; } - set { - bap_ = value; - } - } - - /// Field number for the "boomRange" field. - public const int BoomRangeFieldNumber = 13; - private int boomRange_; + /// Field number for the "attackRange" field. + public const int AttackRangeFieldNumber = 3; + private int attackRange_; /// - ///子弹爆炸范围 + ///可见 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int BoomRange { - get { return boomRange_; } + public int AttackRange { + get { return attackRange_; } set { - boomRange_ = value; + attackRange_ = value; } } - /// Field number for the "propType" field. - public const int PropTypeFieldNumber = 14; - private global::Communication.Proto.PropType propType_ = global::Communication.Proto.PropType.Null; - /// - ///以下当gameObjType为Character和Prop时有效 - /// + /// Field number for the "bulletNum" field. + public const int BulletNumFieldNumber = 4; + private int bulletNum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Communication.Proto.PropType PropType { - get { return propType_; } + public int BulletNum { + get { return bulletNum_; } set { - propType_ = value; + bulletNum_ = value; } } - /// Field number for the "isLaid" field. - public const int IsLaidFieldNumber = 15; - private bool isLaid_; + /// Field number for the "speed" field. + public const int SpeedFieldNumber = 5; + private int speed_; /// - ///以下仅当gameObjType为Prop时有效 + ///可见 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsLaid { - get { return isLaid_; } + public int Speed { + get { return speed_; } set { - isLaid_ = value; + speed_ = value; } } - /// Field number for the "isDying" field. - public const int IsDyingFieldNumber = 16; - private bool isDying_; + /// Field number for the "life" field. + public const int LifeFieldNumber = 6; + private int life_; /// - ///以下仅当gameObjType为Character时有效 + ///可见 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsDying { - get { return isDying_; } + public int Life { + get { return life_; } set { - isDying_ = value; + life_ = value; } } - /// Field number for the "CD" field. - public const int CDFieldNumber = 17; - private int cD_; + /// Field number for the "timeUntilCommonSkillAvailable" field. + public const int TimeUntilCommonSkillAvailableFieldNumber = 7; + private double timeUntilCommonSkillAvailable_; /// - ///回复子弹速度,并非技能CD + ///可见 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CD { - get { return cD_; } + public double TimeUntilCommonSkillAvailable { + get { return timeUntilCommonSkillAvailable_; } set { - cD_ = value; + timeUntilCommonSkillAvailable_ = value; } } - /// Field number for the "maxBulletNum" field. - public const int MaxBulletNumFieldNumber = 18; - private int maxBulletNum_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int MaxBulletNum { - get { return maxBulletNum_; } - set { - maxBulletNum_ = value; - } - } - - /// Field number for the "bulletNum" field. - public const int BulletNumFieldNumber = 19; - private int bulletNum_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int BulletNum { - get { return bulletNum_; } - set { - bulletNum_ = value; - } - } - - /// Field number for the "maxHp" field. - public const int MaxHpFieldNumber = 20; - private int maxHp_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int MaxHp { - get { return maxHp_; } - set { - maxHp_ = value; - } - } - - /// Field number for the "hp" field. - public const int HpFieldNumber = 21; - private int hp_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Hp { - get { return hp_; } - set { - hp_ = value; - } - } - - /// Field number for the "lifeNum" field. - public const int LifeNumFieldNumber = 22; - private int lifeNum_; + /// Field number for the "timeUntilUltimateSkillAvailable" field. + public const int TimeUntilUltimateSkillAvailableFieldNumber = 8; + private double timeUntilUltimateSkillAvailable_; /// - ///第几条命 + ///底层未实现 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int LifeNum { - get { return lifeNum_; } + public double TimeUntilUltimateSkillAvailable { + get { return timeUntilUltimateSkillAvailable_; } set { - lifeNum_ = value; + timeUntilUltimateSkillAvailable_ = value; } } - /// Field number for the "pSkill" field. - public const int PSkillFieldNumber = 23; - private global::Communication.Proto.PassiveSkillType pSkill_ = global::Communication.Proto.PassiveSkillType.Pskill0; + /// Field number for the "gemNum" field. + public const int GemNumFieldNumber = 9; + private int gemNum_; /// - ///被动技能池 + ///可见 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Communication.Proto.PassiveSkillType PSkill { - get { return pSkill_; } + public int GemNum { + get { return gemNum_; } set { - pSkill_ = value; + gemNum_ = value; } } - /// Field number for the "aSkill1" field. - public const int ASkill1FieldNumber = 24; - private global::Communication.Proto.ActiveSkillType aSkill1_ = global::Communication.Proto.ActiveSkillType.Askill0; + /// Field number for the "buff" field. + public const int BuffFieldNumber = 10; + private global::Communication.Proto.BuffType buff_ = global::Communication.Proto.BuffType.NullBuffType; /// - ///主动1 + ///可见 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Communication.Proto.ActiveSkillType ASkill1 { - get { return aSkill1_; } + public global::Communication.Proto.BuffType Buff { + get { return buff_; } set { - aSkill1_ = value; + buff_ = value; } } - /// Field number for the "aSkill2" field. - public const int ASkill2FieldNumber = 25; - private global::Communication.Proto.ActiveSkillType aSkill2_ = global::Communication.Proto.ActiveSkillType.Askill0; + /// Field number for the "prop" field. + public const int PropFieldNumber = 11; + private global::Communication.Proto.PropType prop_ = global::Communication.Proto.PropType.NullPropType; /// - ///主动2 + ///可见 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Communication.Proto.ActiveSkillType ASkill2 { - get { return aSkill2_; } + public global::Communication.Proto.PropType Prop { + get { return prop_; } set { - aSkill2_ = value; + prop_ = value; } } /// Field number for the "place" field. - public const int PlaceFieldNumber = 26; - private global::Communication.Proto.PlaceType place_ = global::Communication.Proto.PlaceType.Ground; + public const int PlaceFieldNumber = 12; + private global::Communication.Proto.PlaceType place_ = global::Communication.Proto.PlaceType.NullPlaceType; /// - ///角色位置状态,是否可见 + ///人物背景框颜色 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -582,43 +314,29 @@ public int LifeNum { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { - return Equals(other as GameObjInfo); + return Equals(other as ChangeableCharacterProperty); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(GameObjInfo other) { + public bool Equals(ChangeableCharacterProperty other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (GameObjType != other.GameObjType) return false; - if (Guid != other.Guid) return false; if (X != other.X) return false; if (Y != other.Y) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FacingDirection, other.FacingDirection)) return false; - if (MoveSpeed != other.MoveSpeed) return false; - if (CanMove != other.CanMove) return false; - if (IsMoving != other.IsMoving) return false; - if (ShapeType != other.ShapeType) return false; - if (Radius != other.Radius) return false; - if (TeamID != other.TeamID) return false; - if (Bap != other.Bap) return false; - if (BoomRange != other.BoomRange) return false; - if (PropType != other.PropType) return false; - if (IsLaid != other.IsLaid) return false; - if (IsDying != other.IsDying) return false; - if (CD != other.CD) return false; - if (MaxBulletNum != other.MaxBulletNum) return false; + if (AttackRange != other.AttackRange) return false; if (BulletNum != other.BulletNum) return false; - if (MaxHp != other.MaxHp) return false; - if (Hp != other.Hp) return false; - if (LifeNum != other.LifeNum) return false; - if (PSkill != other.PSkill) return false; - if (ASkill1 != other.ASkill1) return false; - if (ASkill2 != other.ASkill2) return false; + if (Speed != other.Speed) return false; + if (Life != other.Life) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TimeUntilCommonSkillAvailable, other.TimeUntilCommonSkillAvailable)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TimeUntilUltimateSkillAvailable, other.TimeUntilUltimateSkillAvailable)) return false; + if (GemNum != other.GemNum) return false; + if (Buff != other.Buff) return false; + if (Prop != other.Prop) return false; if (Place != other.Place) return false; return Equals(_unknownFields, other._unknownFields); } @@ -627,32 +345,18 @@ public bool Equals(GameObjInfo other) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (GameObjType != global::Communication.Proto.GameObjType.Character) hash ^= GameObjType.GetHashCode(); - if (Guid != 0L) hash ^= Guid.GetHashCode(); if (X != 0) hash ^= X.GetHashCode(); if (Y != 0) hash ^= Y.GetHashCode(); - if (FacingDirection != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FacingDirection); - if (MoveSpeed != 0) hash ^= MoveSpeed.GetHashCode(); - if (CanMove != false) hash ^= CanMove.GetHashCode(); - if (IsMoving != false) hash ^= IsMoving.GetHashCode(); - if (ShapeType != global::Communication.Proto.ShapeType.Circle) hash ^= ShapeType.GetHashCode(); - if (Radius != 0) hash ^= Radius.GetHashCode(); - if (TeamID != 0L) hash ^= TeamID.GetHashCode(); - if (Bap != 0) hash ^= Bap.GetHashCode(); - if (BoomRange != 0) hash ^= BoomRange.GetHashCode(); - if (PropType != global::Communication.Proto.PropType.Null) hash ^= PropType.GetHashCode(); - if (IsLaid != false) hash ^= IsLaid.GetHashCode(); - if (IsDying != false) hash ^= IsDying.GetHashCode(); - if (CD != 0) hash ^= CD.GetHashCode(); - if (MaxBulletNum != 0) hash ^= MaxBulletNum.GetHashCode(); + if (AttackRange != 0) hash ^= AttackRange.GetHashCode(); if (BulletNum != 0) hash ^= BulletNum.GetHashCode(); - if (MaxHp != 0) hash ^= MaxHp.GetHashCode(); - if (Hp != 0) hash ^= Hp.GetHashCode(); - if (LifeNum != 0) hash ^= LifeNum.GetHashCode(); - if (PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) hash ^= PSkill.GetHashCode(); - if (ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) hash ^= ASkill1.GetHashCode(); - if (ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) hash ^= ASkill2.GetHashCode(); - if (Place != global::Communication.Proto.PlaceType.Ground) hash ^= Place.GetHashCode(); + if (Speed != 0) hash ^= Speed.GetHashCode(); + if (Life != 0) hash ^= Life.GetHashCode(); + if (TimeUntilCommonSkillAvailable != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TimeUntilCommonSkillAvailable); + if (TimeUntilUltimateSkillAvailable != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TimeUntilUltimateSkillAvailable); + if (GemNum != 0) hash ^= GemNum.GetHashCode(); + if (Buff != global::Communication.Proto.BuffType.NullBuffType) hash ^= Buff.GetHashCode(); + if (Prop != global::Communication.Proto.PropType.NullPropType) hash ^= Prop.GetHashCode(); + if (Place != global::Communication.Proto.PlaceType.NullPlaceType) hash ^= Place.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -671,108 +375,52 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (GameObjType != global::Communication.Proto.GameObjType.Character) { + if (X != 0) { output.WriteRawTag(8); - output.WriteEnum((int) GameObjType); + output.WriteInt32(X); } - if (Guid != 0L) { + if (Y != 0) { output.WriteRawTag(16); - output.WriteInt64(Guid); + output.WriteInt32(Y); } - if (X != 0) { + if (AttackRange != 0) { output.WriteRawTag(24); - output.WriteInt32(X); + output.WriteInt32(AttackRange); } - if (Y != 0) { + if (BulletNum != 0) { output.WriteRawTag(32); - output.WriteInt32(Y); + output.WriteInt32(BulletNum); } - if (FacingDirection != 0D) { - output.WriteRawTag(41); - output.WriteDouble(FacingDirection); + if (Speed != 0) { + output.WriteRawTag(40); + output.WriteInt32(Speed); } - if (MoveSpeed != 0) { + if (Life != 0) { output.WriteRawTag(48); - output.WriteInt32(MoveSpeed); + output.WriteInt32(Life); } - if (CanMove != false) { - output.WriteRawTag(56); - output.WriteBool(CanMove); + if (TimeUntilCommonSkillAvailable != 0D) { + output.WriteRawTag(57); + output.WriteDouble(TimeUntilCommonSkillAvailable); } - if (IsMoving != false) { - output.WriteRawTag(64); - output.WriteBool(IsMoving); + if (TimeUntilUltimateSkillAvailable != 0D) { + output.WriteRawTag(65); + output.WriteDouble(TimeUntilUltimateSkillAvailable); } - if (ShapeType != global::Communication.Proto.ShapeType.Circle) { + if (GemNum != 0) { output.WriteRawTag(72); - output.WriteEnum((int) ShapeType); + output.WriteInt32(GemNum); } - if (Radius != 0) { + if (Buff != global::Communication.Proto.BuffType.NullBuffType) { output.WriteRawTag(80); - output.WriteInt32(Radius); + output.WriteEnum((int) Buff); } - if (TeamID != 0L) { + if (Prop != global::Communication.Proto.PropType.NullPropType) { output.WriteRawTag(88); - output.WriteInt64(TeamID); + output.WriteEnum((int) Prop); } - if (Bap != 0) { + if (Place != global::Communication.Proto.PlaceType.NullPlaceType) { output.WriteRawTag(96); - output.WriteInt32(Bap); - } - if (BoomRange != 0) { - output.WriteRawTag(104); - output.WriteInt32(BoomRange); - } - if (PropType != global::Communication.Proto.PropType.Null) { - output.WriteRawTag(112); - output.WriteEnum((int) PropType); - } - if (IsLaid != false) { - output.WriteRawTag(120); - output.WriteBool(IsLaid); - } - if (IsDying != false) { - output.WriteRawTag(128, 1); - output.WriteBool(IsDying); - } - if (CD != 0) { - output.WriteRawTag(136, 1); - output.WriteInt32(CD); - } - if (MaxBulletNum != 0) { - output.WriteRawTag(144, 1); - output.WriteInt32(MaxBulletNum); - } - if (BulletNum != 0) { - output.WriteRawTag(152, 1); - output.WriteInt32(BulletNum); - } - if (MaxHp != 0) { - output.WriteRawTag(160, 1); - output.WriteInt32(MaxHp); - } - if (Hp != 0) { - output.WriteRawTag(168, 1); - output.WriteInt32(Hp); - } - if (LifeNum != 0) { - output.WriteRawTag(176, 1); - output.WriteInt32(LifeNum); - } - if (PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) { - output.WriteRawTag(184, 1); - output.WriteEnum((int) PSkill); - } - if (ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) { - output.WriteRawTag(192, 1); - output.WriteEnum((int) ASkill1); - } - if (ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) { - output.WriteRawTag(200, 1); - output.WriteEnum((int) ASkill2); - } - if (Place != global::Communication.Proto.PlaceType.Ground) { - output.WriteRawTag(208, 1); output.WriteEnum((int) Place); } if (_unknownFields != null) { @@ -785,108 +433,52 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (GameObjType != global::Communication.Proto.GameObjType.Character) { + if (X != 0) { output.WriteRawTag(8); - output.WriteEnum((int) GameObjType); + output.WriteInt32(X); } - if (Guid != 0L) { + if (Y != 0) { output.WriteRawTag(16); - output.WriteInt64(Guid); + output.WriteInt32(Y); } - if (X != 0) { + if (AttackRange != 0) { output.WriteRawTag(24); - output.WriteInt32(X); + output.WriteInt32(AttackRange); } - if (Y != 0) { + if (BulletNum != 0) { output.WriteRawTag(32); - output.WriteInt32(Y); + output.WriteInt32(BulletNum); } - if (FacingDirection != 0D) { - output.WriteRawTag(41); - output.WriteDouble(FacingDirection); + if (Speed != 0) { + output.WriteRawTag(40); + output.WriteInt32(Speed); } - if (MoveSpeed != 0) { + if (Life != 0) { output.WriteRawTag(48); - output.WriteInt32(MoveSpeed); + output.WriteInt32(Life); } - if (CanMove != false) { - output.WriteRawTag(56); - output.WriteBool(CanMove); + if (TimeUntilCommonSkillAvailable != 0D) { + output.WriteRawTag(57); + output.WriteDouble(TimeUntilCommonSkillAvailable); } - if (IsMoving != false) { - output.WriteRawTag(64); - output.WriteBool(IsMoving); + if (TimeUntilUltimateSkillAvailable != 0D) { + output.WriteRawTag(65); + output.WriteDouble(TimeUntilUltimateSkillAvailable); } - if (ShapeType != global::Communication.Proto.ShapeType.Circle) { + if (GemNum != 0) { output.WriteRawTag(72); - output.WriteEnum((int) ShapeType); + output.WriteInt32(GemNum); } - if (Radius != 0) { + if (Buff != global::Communication.Proto.BuffType.NullBuffType) { output.WriteRawTag(80); - output.WriteInt32(Radius); + output.WriteEnum((int) Buff); } - if (TeamID != 0L) { + if (Prop != global::Communication.Proto.PropType.NullPropType) { output.WriteRawTag(88); - output.WriteInt64(TeamID); + output.WriteEnum((int) Prop); } - if (Bap != 0) { + if (Place != global::Communication.Proto.PlaceType.NullPlaceType) { output.WriteRawTag(96); - output.WriteInt32(Bap); - } - if (BoomRange != 0) { - output.WriteRawTag(104); - output.WriteInt32(BoomRange); - } - if (PropType != global::Communication.Proto.PropType.Null) { - output.WriteRawTag(112); - output.WriteEnum((int) PropType); - } - if (IsLaid != false) { - output.WriteRawTag(120); - output.WriteBool(IsLaid); - } - if (IsDying != false) { - output.WriteRawTag(128, 1); - output.WriteBool(IsDying); - } - if (CD != 0) { - output.WriteRawTag(136, 1); - output.WriteInt32(CD); - } - if (MaxBulletNum != 0) { - output.WriteRawTag(144, 1); - output.WriteInt32(MaxBulletNum); - } - if (BulletNum != 0) { - output.WriteRawTag(152, 1); - output.WriteInt32(BulletNum); - } - if (MaxHp != 0) { - output.WriteRawTag(160, 1); - output.WriteInt32(MaxHp); - } - if (Hp != 0) { - output.WriteRawTag(168, 1); - output.WriteInt32(Hp); - } - if (LifeNum != 0) { - output.WriteRawTag(176, 1); - output.WriteInt32(LifeNum); - } - if (PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) { - output.WriteRawTag(184, 1); - output.WriteEnum((int) PSkill); - } - if (ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) { - output.WriteRawTag(192, 1); - output.WriteEnum((int) ASkill1); - } - if (ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) { - output.WriteRawTag(200, 1); - output.WriteEnum((int) ASkill2); - } - if (Place != global::Communication.Proto.PlaceType.Ground) { - output.WriteRawTag(208, 1); output.WriteEnum((int) Place); } if (_unknownFields != null) { @@ -899,83 +491,41 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (GameObjType != global::Communication.Proto.GameObjType.Character) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) GameObjType); - } - if (Guid != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Guid); - } if (X != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(X); } if (Y != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(Y); } - if (FacingDirection != 0D) { - size += 1 + 8; - } - if (MoveSpeed != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MoveSpeed); - } - if (CanMove != false) { - size += 1 + 1; - } - if (IsMoving != false) { - size += 1 + 1; - } - if (ShapeType != global::Communication.Proto.ShapeType.Circle) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ShapeType); - } - if (Radius != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Radius); - } - if (TeamID != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(TeamID); - } - if (Bap != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Bap); - } - if (BoomRange != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoomRange); - } - if (PropType != global::Communication.Proto.PropType.Null) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PropType); - } - if (IsLaid != false) { - size += 1 + 1; - } - if (IsDying != false) { - size += 2 + 1; - } - if (CD != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(CD); - } - if (MaxBulletNum != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxBulletNum); + if (AttackRange != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(AttackRange); } if (BulletNum != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(BulletNum); + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BulletNum); } - if (MaxHp != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxHp); + if (Speed != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Speed); } - if (Hp != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(Hp); + if (Life != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Life); } - if (LifeNum != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(LifeNum); + if (TimeUntilCommonSkillAvailable != 0D) { + size += 1 + 8; + } + if (TimeUntilUltimateSkillAvailable != 0D) { + size += 1 + 8; } - if (PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) PSkill); + if (GemNum != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(GemNum); } - if (ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) ASkill1); + if (Buff != global::Communication.Proto.BuffType.NullBuffType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Buff); } - if (ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) ASkill2); + if (Prop != global::Communication.Proto.PropType.NullPropType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Prop); } - if (Place != global::Communication.Proto.PlaceType.Ground) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) Place); + if (Place != global::Communication.Proto.PlaceType.NullPlaceType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Place); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -985,86 +535,44 @@ public int CalculateSize() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(GameObjInfo other) { + public void MergeFrom(ChangeableCharacterProperty other) { if (other == null) { return; } - if (other.GameObjType != global::Communication.Proto.GameObjType.Character) { - GameObjType = other.GameObjType; - } - if (other.Guid != 0L) { - Guid = other.Guid; - } if (other.X != 0) { X = other.X; } if (other.Y != 0) { Y = other.Y; } - if (other.FacingDirection != 0D) { - FacingDirection = other.FacingDirection; + if (other.AttackRange != 0) { + AttackRange = other.AttackRange; } - if (other.MoveSpeed != 0) { - MoveSpeed = other.MoveSpeed; + if (other.BulletNum != 0) { + BulletNum = other.BulletNum; } - if (other.CanMove != false) { - CanMove = other.CanMove; + if (other.Speed != 0) { + Speed = other.Speed; } - if (other.IsMoving != false) { - IsMoving = other.IsMoving; + if (other.Life != 0) { + Life = other.Life; } - if (other.ShapeType != global::Communication.Proto.ShapeType.Circle) { - ShapeType = other.ShapeType; + if (other.TimeUntilCommonSkillAvailable != 0D) { + TimeUntilCommonSkillAvailable = other.TimeUntilCommonSkillAvailable; } - if (other.Radius != 0) { - Radius = other.Radius; + if (other.TimeUntilUltimateSkillAvailable != 0D) { + TimeUntilUltimateSkillAvailable = other.TimeUntilUltimateSkillAvailable; } - if (other.TeamID != 0L) { - TeamID = other.TeamID; + if (other.GemNum != 0) { + GemNum = other.GemNum; } - if (other.Bap != 0) { - Bap = other.Bap; + if (other.Buff != global::Communication.Proto.BuffType.NullBuffType) { + Buff = other.Buff; } - if (other.BoomRange != 0) { - BoomRange = other.BoomRange; + if (other.Prop != global::Communication.Proto.PropType.NullPropType) { + Prop = other.Prop; } - if (other.PropType != global::Communication.Proto.PropType.Null) { - PropType = other.PropType; - } - if (other.IsLaid != false) { - IsLaid = other.IsLaid; - } - if (other.IsDying != false) { - IsDying = other.IsDying; - } - if (other.CD != 0) { - CD = other.CD; - } - if (other.MaxBulletNum != 0) { - MaxBulletNum = other.MaxBulletNum; - } - if (other.BulletNum != 0) { - BulletNum = other.BulletNum; - } - if (other.MaxHp != 0) { - MaxHp = other.MaxHp; - } - if (other.Hp != 0) { - Hp = other.Hp; - } - if (other.LifeNum != 0) { - LifeNum = other.LifeNum; - } - if (other.PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) { - PSkill = other.PSkill; - } - if (other.ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) { - ASkill1 = other.ASkill1; - } - if (other.ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) { - ASkill2 = other.ASkill2; - } - if (other.Place != global::Communication.Proto.PlaceType.Ground) { + if (other.Place != global::Communication.Proto.PlaceType.NullPlaceType) { Place = other.Place; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); @@ -1083,106 +591,50 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { - GameObjType = (global::Communication.Proto.GameObjType) input.ReadEnum(); + X = input.ReadInt32(); break; } case 16: { - Guid = input.ReadInt64(); + Y = input.ReadInt32(); break; } case 24: { - X = input.ReadInt32(); + AttackRange = input.ReadInt32(); break; } case 32: { - Y = input.ReadInt32(); + BulletNum = input.ReadInt32(); break; } - case 41: { - FacingDirection = input.ReadDouble(); + case 40: { + Speed = input.ReadInt32(); break; } case 48: { - MoveSpeed = input.ReadInt32(); + Life = input.ReadInt32(); break; } - case 56: { - CanMove = input.ReadBool(); + case 57: { + TimeUntilCommonSkillAvailable = input.ReadDouble(); break; } - case 64: { - IsMoving = input.ReadBool(); + case 65: { + TimeUntilUltimateSkillAvailable = input.ReadDouble(); break; } case 72: { - ShapeType = (global::Communication.Proto.ShapeType) input.ReadEnum(); + GemNum = input.ReadInt32(); break; } case 80: { - Radius = input.ReadInt32(); + Buff = (global::Communication.Proto.BuffType) input.ReadEnum(); break; } case 88: { - TeamID = input.ReadInt64(); + Prop = (global::Communication.Proto.PropType) input.ReadEnum(); break; } case 96: { - Bap = input.ReadInt32(); - break; - } - case 104: { - BoomRange = input.ReadInt32(); - break; - } - case 112: { - PropType = (global::Communication.Proto.PropType) input.ReadEnum(); - break; - } - case 120: { - IsLaid = input.ReadBool(); - break; - } - case 128: { - IsDying = input.ReadBool(); - break; - } - case 136: { - CD = input.ReadInt32(); - break; - } - case 144: { - MaxBulletNum = input.ReadInt32(); - break; - } - case 152: { - BulletNum = input.ReadInt32(); - break; - } - case 160: { - MaxHp = input.ReadInt32(); - break; - } - case 168: { - Hp = input.ReadInt32(); - break; - } - case 176: { - LifeNum = input.ReadInt32(); - break; - } - case 184: { - PSkill = (global::Communication.Proto.PassiveSkillType) input.ReadEnum(); - break; - } - case 192: { - ASkill1 = (global::Communication.Proto.ActiveSkillType) input.ReadEnum(); - break; - } - case 200: { - ASkill2 = (global::Communication.Proto.ActiveSkillType) input.ReadEnum(); - break; - } - case 208: { Place = (global::Communication.Proto.PlaceType) input.ReadEnum(); break; } @@ -1202,106 +654,50 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { - GameObjType = (global::Communication.Proto.GameObjType) input.ReadEnum(); + X = input.ReadInt32(); break; } case 16: { - Guid = input.ReadInt64(); + Y = input.ReadInt32(); break; } case 24: { - X = input.ReadInt32(); + AttackRange = input.ReadInt32(); break; } case 32: { - Y = input.ReadInt32(); + BulletNum = input.ReadInt32(); break; } - case 41: { - FacingDirection = input.ReadDouble(); + case 40: { + Speed = input.ReadInt32(); break; } case 48: { - MoveSpeed = input.ReadInt32(); + Life = input.ReadInt32(); break; } - case 56: { - CanMove = input.ReadBool(); + case 57: { + TimeUntilCommonSkillAvailable = input.ReadDouble(); break; } - case 64: { - IsMoving = input.ReadBool(); + case 65: { + TimeUntilUltimateSkillAvailable = input.ReadDouble(); break; } case 72: { - ShapeType = (global::Communication.Proto.ShapeType) input.ReadEnum(); + GemNum = input.ReadInt32(); break; } case 80: { - Radius = input.ReadInt32(); + Buff = (global::Communication.Proto.BuffType) input.ReadEnum(); break; } case 88: { - TeamID = input.ReadInt64(); + Prop = (global::Communication.Proto.PropType) input.ReadEnum(); break; } case 96: { - Bap = input.ReadInt32(); - break; - } - case 104: { - BoomRange = input.ReadInt32(); - break; - } - case 112: { - PropType = (global::Communication.Proto.PropType) input.ReadEnum(); - break; - } - case 120: { - IsLaid = input.ReadBool(); - break; - } - case 128: { - IsDying = input.ReadBool(); - break; - } - case 136: { - CD = input.ReadInt32(); - break; - } - case 144: { - MaxBulletNum = input.ReadInt32(); - break; - } - case 152: { - BulletNum = input.ReadInt32(); - break; - } - case 160: { - MaxHp = input.ReadInt32(); - break; - } - case 168: { - Hp = input.ReadInt32(); - break; - } - case 176: { - LifeNum = input.ReadInt32(); - break; - } - case 184: { - PSkill = (global::Communication.Proto.PassiveSkillType) input.ReadEnum(); - break; - } - case 192: { - ASkill1 = (global::Communication.Proto.ActiveSkillType) input.ReadEnum(); - break; - } - case 200: { - ASkill2 = (global::Communication.Proto.ActiveSkillType) input.ReadEnum(); - break; - } - case 208: { Place = (global::Communication.Proto.PlaceType) input.ReadEnum(); break; } @@ -1312,19 +708,16 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - ///发送单个信息时 - /// - public sealed partial class MessageToOneClient : pb::IMessage + public sealed partial class BasicalCharacterProperty : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageToOneClient()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BasicalCharacterProperty()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -1340,7 +733,7 @@ public sealed partial class MessageToOneClient : pb::IMessageField number for the "guid" field. + public const int GuidFieldNumber = 1; + private int guid_; + /// + ///操作方法:Client和Server互相约定guid。非负整数中,1-8这8个guid预留给8个人物,其余在子弹或道具被创造/破坏时分发和回收。Client端用向量[guid]储存物体信息和对应的控件实例。 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Guid { + get { return guid_; } + set { + guid_ = value; + } + } + + /// Field number for the "PassiveSkillType" field. + public const int PassiveSkillTypeFieldNumber = 2; + private int passiveSkillType_; + /// + ///0号guid存储单播模式中每人Client对应的GUID。 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int PassiveSkillType { + get { return passiveSkillType_; } + set { + passiveSkillType_ = value; + } + } + + /// Field number for the "ActiveSkillType" field. + public const int ActiveSkillTypeFieldNumber = 3; + private int activeSkillType_; + /// + ///可见(职2) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ActiveSkillType { + get { return activeSkillType_; } + set { + activeSkillType_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BasicalCharacterProperty); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BasicalCharacterProperty other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Guid != other.Guid) return false; + if (PassiveSkillType != other.PassiveSkillType) return false; + if (ActiveSkillType != other.ActiveSkillType) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Guid != 0) hash ^= Guid.GetHashCode(); + if (PassiveSkillType != 0) hash ^= PassiveSkillType.GetHashCode(); + if (ActiveSkillType != 0) hash ^= ActiveSkillType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Guid != 0) { + output.WriteRawTag(8); + output.WriteInt32(Guid); + } + if (PassiveSkillType != 0) { + output.WriteRawTag(16); + output.WriteInt32(PassiveSkillType); + } + if (ActiveSkillType != 0) { + output.WriteRawTag(24); + output.WriteInt32(ActiveSkillType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Guid != 0) { + output.WriteRawTag(8); + output.WriteInt32(Guid); + } + if (PassiveSkillType != 0) { + output.WriteRawTag(16); + output.WriteInt32(PassiveSkillType); + } + if (ActiveSkillType != 0) { + output.WriteRawTag(24); + output.WriteInt32(ActiveSkillType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Guid != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Guid); + } + if (PassiveSkillType != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PassiveSkillType); + } + if (ActiveSkillType != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ActiveSkillType); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BasicalCharacterProperty other) { + if (other == null) { + return; + } + if (other.Guid != 0) { + Guid = other.Guid; + } + if (other.PassiveSkillType != 0) { + PassiveSkillType = other.PassiveSkillType; + } + if (other.ActiveSkillType != 0) { + ActiveSkillType = other.ActiveSkillType; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Guid = input.ReadInt32(); + break; + } + case 16: { + PassiveSkillType = input.ReadInt32(); + break; + } + case 24: { + ActiveSkillType = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Guid = input.ReadInt32(); + break; + } + case 16: { + PassiveSkillType = input.ReadInt32(); + break; + } + case 24: { + ActiveSkillType = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class MessageOfProp : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageOfProp()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Communication.Proto.Message2ClientsReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageOfProp() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageOfProp(MessageOfProp other) : this() { + type_ = other.type_; + x_ = other.x_; + y_ = other.y_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageOfProp Clone() { + return new MessageOfProp(this); + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 1; + private global::Communication.Proto.PropType type_ = global::Communication.Proto.PropType.NullPropType; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Communication.Proto.PropType Type { + get { return type_; } + set { + type_ = value; + } + } + + /// Field number for the "x" field. + public const int XFieldNumber = 2; + private int x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int X { + get { return x_; } + set { + x_ = value; + } + } + + /// Field number for the "y" field. + public const int YFieldNumber = 3; + private int y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Y { + get { return y_; } + set { + y_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MessageOfProp); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MessageOfProp other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Type != other.Type) return false; + if (X != other.X) return false; + if (Y != other.Y) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Type != global::Communication.Proto.PropType.NullPropType) hash ^= Type.GetHashCode(); + if (X != 0) hash ^= X.GetHashCode(); + if (Y != 0) hash ^= Y.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Type != global::Communication.Proto.PropType.NullPropType) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); + } + if (X != 0) { + output.WriteRawTag(16); + output.WriteInt32(X); + } + if (Y != 0) { + output.WriteRawTag(24); + output.WriteInt32(Y); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Type != global::Communication.Proto.PropType.NullPropType) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); + } + if (X != 0) { + output.WriteRawTag(16); + output.WriteInt32(X); + } + if (Y != 0) { + output.WriteRawTag(24); + output.WriteInt32(Y); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Type != global::Communication.Proto.PropType.NullPropType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); + } + if (X != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(X); + } + if (Y != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Y); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MessageOfProp other) { + if (other == null) { + return; + } + if (other.Type != global::Communication.Proto.PropType.NullPropType) { + Type = other.Type; + } + if (other.X != 0) { + X = other.X; + } + if (other.Y != 0) { + Y = other.Y; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Type = (global::Communication.Proto.PropType) input.ReadEnum(); + break; + } + case 16: { + X = input.ReadInt32(); + break; + } + case 24: { + Y = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Type = (global::Communication.Proto.PropType) input.ReadEnum(); + break; + } + case 16: { + X = input.ReadInt32(); + break; + } + case 24: { + Y = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class MessageOfBullet : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageOfBullet()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Communication.Proto.Message2ClientsReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageOfBullet() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageOfBullet(MessageOfBullet other) : this() { + type_ = other.type_; + bulletAP_ = other.bulletAP_; + boomRange_ = other.boomRange_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageOfBullet Clone() { + return new MessageOfBullet(this); + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 1; + private global::Communication.Proto.BulletType type_ = global::Communication.Proto.BulletType.NullBulletType; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Communication.Proto.BulletType Type { + get { return type_; } + set { + type_ = value; + } + } + + /// Field number for the "bulletAP" field. + public const int BulletAPFieldNumber = 2; + private int bulletAP_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int BulletAP { + get { return bulletAP_; } + set { + bulletAP_ = value; + } + } + + /// Field number for the "boomRange" field. + public const int BoomRangeFieldNumber = 3; + private int boomRange_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int BoomRange { + get { return boomRange_; } + set { + boomRange_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MessageOfBullet); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MessageOfBullet other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Type != other.Type) return false; + if (BulletAP != other.BulletAP) return false; + if (BoomRange != other.BoomRange) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Type != global::Communication.Proto.BulletType.NullBulletType) hash ^= Type.GetHashCode(); + if (BulletAP != 0) hash ^= BulletAP.GetHashCode(); + if (BoomRange != 0) hash ^= BoomRange.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Type != global::Communication.Proto.BulletType.NullBulletType) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); + } + if (BulletAP != 0) { + output.WriteRawTag(16); + output.WriteInt32(BulletAP); + } + if (BoomRange != 0) { + output.WriteRawTag(24); + output.WriteInt32(BoomRange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Type != global::Communication.Proto.BulletType.NullBulletType) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); + } + if (BulletAP != 0) { + output.WriteRawTag(16); + output.WriteInt32(BulletAP); + } + if (BoomRange != 0) { + output.WriteRawTag(24); + output.WriteInt32(BoomRange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Type != global::Communication.Proto.BulletType.NullBulletType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); + } + if (BulletAP != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BulletAP); + } + if (BoomRange != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoomRange); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MessageOfBullet other) { + if (other == null) { + return; + } + if (other.Type != global::Communication.Proto.BulletType.NullBulletType) { + Type = other.Type; + } + if (other.BulletAP != 0) { + BulletAP = other.BulletAP; + } + if (other.BoomRange != 0) { + BoomRange = other.BoomRange; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Type = (global::Communication.Proto.BulletType) input.ReadEnum(); + break; + } + case 16: { + BulletAP = input.ReadInt32(); + break; + } + case 24: { + BoomRange = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Type = (global::Communication.Proto.BulletType) input.ReadEnum(); + break; + } + case 16: { + BulletAP = input.ReadInt32(); + break; + } + case 24: { + BoomRange = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class MessageToInitialize : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageToInitialize()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Communication.Proto.Message2ClientsReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToInitialize() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToInitialize(MessageToInitialize other) : this() { + mapSerial_ = other.mapSerial_; + numberOfValidPlayer_ = other.numberOfValidPlayer_; + property_ = other.property_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToInitialize Clone() { + return new MessageToInitialize(this); + } + + /// Field number for the "MapSerial" field. + public const int MapSerialFieldNumber = 1; + private int mapSerial_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MapSerial { + get { return mapSerial_; } + set { + mapSerial_ = value; + } + } + + /// Field number for the "NumberOfValidPlayer" field. + public const int NumberOfValidPlayerFieldNumber = 2; + private int numberOfValidPlayer_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumberOfValidPlayer { + get { return numberOfValidPlayer_; } + set { + numberOfValidPlayer_ = value; + } + } + + /// Field number for the "property" field. + public const int PropertyFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_property_codec + = pb::FieldCodec.ForMessage(26, global::Communication.Proto.BasicalCharacterProperty.Parser); + private readonly pbc::RepeatedField property_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Property { + get { return property_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MessageToInitialize); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MessageToInitialize other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MapSerial != other.MapSerial) return false; + if (NumberOfValidPlayer != other.NumberOfValidPlayer) return false; + if(!property_.Equals(other.property_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (MapSerial != 0) hash ^= MapSerial.GetHashCode(); + if (NumberOfValidPlayer != 0) hash ^= NumberOfValidPlayer.GetHashCode(); + hash ^= property_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (MapSerial != 0) { + output.WriteRawTag(8); + output.WriteInt32(MapSerial); + } + if (NumberOfValidPlayer != 0) { + output.WriteRawTag(16); + output.WriteInt32(NumberOfValidPlayer); + } + property_.WriteTo(output, _repeated_property_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (MapSerial != 0) { + output.WriteRawTag(8); + output.WriteInt32(MapSerial); + } + if (NumberOfValidPlayer != 0) { + output.WriteRawTag(16); + output.WriteInt32(NumberOfValidPlayer); + } + property_.WriteTo(ref output, _repeated_property_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (MapSerial != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MapSerial); + } + if (NumberOfValidPlayer != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumberOfValidPlayer); + } + size += property_.CalculateSize(_repeated_property_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MessageToInitialize other) { + if (other == null) { + return; + } + if (other.MapSerial != 0) { + MapSerial = other.MapSerial; + } + if (other.NumberOfValidPlayer != 0) { + NumberOfValidPlayer = other.NumberOfValidPlayer; + } + property_.Add(other.property_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + MapSerial = input.ReadInt32(); + break; + } + case 16: { + NumberOfValidPlayer = input.ReadInt32(); + break; + } + case 26: { + property_.AddEntriesFrom(input, _repeated_property_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + MapSerial = input.ReadInt32(); + break; + } + case 16: { + NumberOfValidPlayer = input.ReadInt32(); + break; + } + case 26: { + property_.AddEntriesFrom(ref input, _repeated_property_codec); + break; + } + } + } + } + #endif + + } + + /// + ///全设成int32了,麻烦逻辑组其他二位指正 + /// + public sealed partial class MessageToAddInstance : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageToAddInstance()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Communication.Proto.Message2ClientsReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToAddInstance() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToAddInstance(MessageToAddInstance other) : this() { + instanceType_ = other.instanceType_; + guid_ = other.guid_; + switch (other.MessageOfInstanceCase) { + case MessageOfInstanceOneofCase.MessageOfProp: + MessageOfProp = other.MessageOfProp.Clone(); + break; + case MessageOfInstanceOneofCase.MessageOfBullet: + MessageOfBullet = other.MessageOfBullet.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToAddInstance Clone() { + return new MessageToAddInstance(this); + } + + /// Field number for the "instanceType" field. + public const int InstanceTypeFieldNumber = 1; + private global::Communication.Proto.GameObjType instanceType_ = global::Communication.Proto.GameObjType.NullGameObjType; + /// + ///这里逻辑上只能写道具和子弹,Client也只准备了这两个实例的创建函数。 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Communication.Proto.GameObjType InstanceType { + get { return instanceType_; } + set { + instanceType_ = value; + } + } + + /// Field number for the "guid" field. + public const int GuidFieldNumber = 2; + private int guid_; + /// + ///人物在开始时通过BasicalCharacterProperty中的信息添加,无法手动添加。如果需要有添加草丛的操作,请联系我。 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Guid { + get { return guid_; } + set { + guid_ = value; + } + } + + /// Field number for the "messageOfProp" field. + public const int MessageOfPropFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Communication.Proto.MessageOfProp MessageOfProp { + get { return messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfProp ? (global::Communication.Proto.MessageOfProp) messageOfInstance_ : null; } + set { + messageOfInstance_ = value; + messageOfInstanceCase_ = value == null ? MessageOfInstanceOneofCase.None : MessageOfInstanceOneofCase.MessageOfProp; + } + } + + /// Field number for the "messageOfBullet" field. + public const int MessageOfBulletFieldNumber = 4; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Communication.Proto.MessageOfBullet MessageOfBullet { + get { return messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfBullet ? (global::Communication.Proto.MessageOfBullet) messageOfInstance_ : null; } + set { + messageOfInstance_ = value; + messageOfInstanceCase_ = value == null ? MessageOfInstanceOneofCase.None : MessageOfInstanceOneofCase.MessageOfBullet; + } + } + + private object messageOfInstance_; + /// Enum of possible cases for the "messageOfInstance" oneof. + public enum MessageOfInstanceOneofCase { + None = 0, + MessageOfProp = 3, + MessageOfBullet = 4, + } + private MessageOfInstanceOneofCase messageOfInstanceCase_ = MessageOfInstanceOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageOfInstanceOneofCase MessageOfInstanceCase { + get { return messageOfInstanceCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMessageOfInstance() { + messageOfInstanceCase_ = MessageOfInstanceOneofCase.None; + messageOfInstance_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MessageToAddInstance); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MessageToAddInstance other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (InstanceType != other.InstanceType) return false; + if (Guid != other.Guid) return false; + if (!object.Equals(MessageOfProp, other.MessageOfProp)) return false; + if (!object.Equals(MessageOfBullet, other.MessageOfBullet)) return false; + if (MessageOfInstanceCase != other.MessageOfInstanceCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (InstanceType != global::Communication.Proto.GameObjType.NullGameObjType) hash ^= InstanceType.GetHashCode(); + if (Guid != 0) hash ^= Guid.GetHashCode(); + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfProp) hash ^= MessageOfProp.GetHashCode(); + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfBullet) hash ^= MessageOfBullet.GetHashCode(); + hash ^= (int) messageOfInstanceCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (InstanceType != global::Communication.Proto.GameObjType.NullGameObjType) { + output.WriteRawTag(8); + output.WriteEnum((int) InstanceType); + } + if (Guid != 0) { + output.WriteRawTag(16); + output.WriteInt32(Guid); + } + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfProp) { + output.WriteRawTag(26); + output.WriteMessage(MessageOfProp); + } + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfBullet) { + output.WriteRawTag(34); + output.WriteMessage(MessageOfBullet); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (InstanceType != global::Communication.Proto.GameObjType.NullGameObjType) { + output.WriteRawTag(8); + output.WriteEnum((int) InstanceType); + } + if (Guid != 0) { + output.WriteRawTag(16); + output.WriteInt32(Guid); + } + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfProp) { + output.WriteRawTag(26); + output.WriteMessage(MessageOfProp); + } + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfBullet) { + output.WriteRawTag(34); + output.WriteMessage(MessageOfBullet); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (InstanceType != global::Communication.Proto.GameObjType.NullGameObjType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) InstanceType); + } + if (Guid != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Guid); + } + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfProp) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageOfProp); + } + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfBullet) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageOfBullet); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MessageToAddInstance other) { + if (other == null) { + return; + } + if (other.InstanceType != global::Communication.Proto.GameObjType.NullGameObjType) { + InstanceType = other.InstanceType; + } + if (other.Guid != 0) { + Guid = other.Guid; + } + switch (other.MessageOfInstanceCase) { + case MessageOfInstanceOneofCase.MessageOfProp: + if (MessageOfProp == null) { + MessageOfProp = new global::Communication.Proto.MessageOfProp(); + } + MessageOfProp.MergeFrom(other.MessageOfProp); + break; + case MessageOfInstanceOneofCase.MessageOfBullet: + if (MessageOfBullet == null) { + MessageOfBullet = new global::Communication.Proto.MessageOfBullet(); + } + MessageOfBullet.MergeFrom(other.MessageOfBullet); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + InstanceType = (global::Communication.Proto.GameObjType) input.ReadEnum(); + break; + } + case 16: { + Guid = input.ReadInt32(); + break; + } + case 26: { + global::Communication.Proto.MessageOfProp subBuilder = new global::Communication.Proto.MessageOfProp(); + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfProp) { + subBuilder.MergeFrom(MessageOfProp); + } + input.ReadMessage(subBuilder); + MessageOfProp = subBuilder; + break; + } + case 34: { + global::Communication.Proto.MessageOfBullet subBuilder = new global::Communication.Proto.MessageOfBullet(); + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfBullet) { + subBuilder.MergeFrom(MessageOfBullet); + } + input.ReadMessage(subBuilder); + MessageOfBullet = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + InstanceType = (global::Communication.Proto.GameObjType) input.ReadEnum(); + break; + } + case 16: { + Guid = input.ReadInt32(); + break; + } + case 26: { + global::Communication.Proto.MessageOfProp subBuilder = new global::Communication.Proto.MessageOfProp(); + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfProp) { + subBuilder.MergeFrom(MessageOfProp); + } + input.ReadMessage(subBuilder); + MessageOfProp = subBuilder; + break; + } + case 34: { + global::Communication.Proto.MessageOfBullet subBuilder = new global::Communication.Proto.MessageOfBullet(); + if (messageOfInstanceCase_ == MessageOfInstanceOneofCase.MessageOfBullet) { + subBuilder.MergeFrom(MessageOfBullet); + } + input.ReadMessage(subBuilder); + MessageOfBullet = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class MessageToDestroyInstance : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageToDestroyInstance()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Communication.Proto.Message2ClientsReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToDestroyInstance() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToDestroyInstance(MessageToDestroyInstance other) : this() { + guid_ = other.guid_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToDestroyInstance Clone() { + return new MessageToDestroyInstance(this); + } + + /// Field number for the "guid" field. + public const int GuidFieldNumber = 1; + private int guid_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Guid { + get { return guid_; } + set { + guid_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MessageToDestroyInstance); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MessageToDestroyInstance other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Guid != other.Guid) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Guid != 0) hash ^= Guid.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Guid != 0) { + output.WriteRawTag(8); + output.WriteInt32(Guid); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Guid != 0) { + output.WriteRawTag(8); + output.WriteInt32(Guid); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Guid != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Guid); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MessageToDestroyInstance other) { + if (other == null) { + return; + } + if (other.Guid != 0) { + Guid = other.Guid; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Guid = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Guid = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class MessageToOperate : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageToOperate()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Communication.Proto.Message2ClientsReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToOperate() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToOperate(MessageToOperate other) : this() { + operateKind_ = other.operateKind_; + switch (other.MessageOfOperationCase) { + case MessageOfOperationOneofCase.MessageToAddInstance: + MessageToAddInstance = other.MessageToAddInstance.Clone(); + break; + case MessageOfOperationOneofCase.MessageToDestroyInstance: + MessageToDestroyInstance = other.MessageToDestroyInstance.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToOperate Clone() { + return new MessageToOperate(this); + } + + /// Field number for the "operateKind" field. + public const int OperateKindFieldNumber = 1; + private bool operateKind_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OperateKind { + get { return operateKind_; } + set { + operateKind_ = value; + } + } + + /// Field number for the "messageToAddInstance" field. + public const int MessageToAddInstanceFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Communication.Proto.MessageToAddInstance MessageToAddInstance { + get { return messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToAddInstance ? (global::Communication.Proto.MessageToAddInstance) messageOfOperation_ : null; } + set { + messageOfOperation_ = value; + messageOfOperationCase_ = value == null ? MessageOfOperationOneofCase.None : MessageOfOperationOneofCase.MessageToAddInstance; + } + } + + /// Field number for the "messageToDestroyInstance" field. + public const int MessageToDestroyInstanceFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Communication.Proto.MessageToDestroyInstance MessageToDestroyInstance { + get { return messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToDestroyInstance ? (global::Communication.Proto.MessageToDestroyInstance) messageOfOperation_ : null; } + set { + messageOfOperation_ = value; + messageOfOperationCase_ = value == null ? MessageOfOperationOneofCase.None : MessageOfOperationOneofCase.MessageToDestroyInstance; + } + } + + private object messageOfOperation_; + /// Enum of possible cases for the "messageOfOperation" oneof. + public enum MessageOfOperationOneofCase { + None = 0, + MessageToAddInstance = 2, + MessageToDestroyInstance = 3, + } + private MessageOfOperationOneofCase messageOfOperationCase_ = MessageOfOperationOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageOfOperationOneofCase MessageOfOperationCase { + get { return messageOfOperationCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMessageOfOperation() { + messageOfOperationCase_ = MessageOfOperationOneofCase.None; + messageOfOperation_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MessageToOperate); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MessageToOperate other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OperateKind != other.OperateKind) return false; + if (!object.Equals(MessageToAddInstance, other.MessageToAddInstance)) return false; + if (!object.Equals(MessageToDestroyInstance, other.MessageToDestroyInstance)) return false; + if (MessageOfOperationCase != other.MessageOfOperationCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (OperateKind != false) hash ^= OperateKind.GetHashCode(); + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToAddInstance) hash ^= MessageToAddInstance.GetHashCode(); + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToDestroyInstance) hash ^= MessageToDestroyInstance.GetHashCode(); + hash ^= (int) messageOfOperationCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (OperateKind != false) { + output.WriteRawTag(8); + output.WriteBool(OperateKind); + } + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToAddInstance) { + output.WriteRawTag(18); + output.WriteMessage(MessageToAddInstance); + } + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToDestroyInstance) { + output.WriteRawTag(26); + output.WriteMessage(MessageToDestroyInstance); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (OperateKind != false) { + output.WriteRawTag(8); + output.WriteBool(OperateKind); + } + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToAddInstance) { + output.WriteRawTag(18); + output.WriteMessage(MessageToAddInstance); + } + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToDestroyInstance) { + output.WriteRawTag(26); + output.WriteMessage(MessageToDestroyInstance); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (OperateKind != false) { + size += 1 + 1; + } + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToAddInstance) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageToAddInstance); + } + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToDestroyInstance) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageToDestroyInstance); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MessageToOperate other) { + if (other == null) { + return; + } + if (other.OperateKind != false) { + OperateKind = other.OperateKind; + } + switch (other.MessageOfOperationCase) { + case MessageOfOperationOneofCase.MessageToAddInstance: + if (MessageToAddInstance == null) { + MessageToAddInstance = new global::Communication.Proto.MessageToAddInstance(); + } + MessageToAddInstance.MergeFrom(other.MessageToAddInstance); + break; + case MessageOfOperationOneofCase.MessageToDestroyInstance: + if (MessageToDestroyInstance == null) { + MessageToDestroyInstance = new global::Communication.Proto.MessageToDestroyInstance(); + } + MessageToDestroyInstance.MergeFrom(other.MessageToDestroyInstance); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OperateKind = input.ReadBool(); + break; + } + case 18: { + global::Communication.Proto.MessageToAddInstance subBuilder = new global::Communication.Proto.MessageToAddInstance(); + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToAddInstance) { + subBuilder.MergeFrom(MessageToAddInstance); + } + input.ReadMessage(subBuilder); + MessageToAddInstance = subBuilder; + break; + } + case 26: { + global::Communication.Proto.MessageToDestroyInstance subBuilder = new global::Communication.Proto.MessageToDestroyInstance(); + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToDestroyInstance) { + subBuilder.MergeFrom(MessageToDestroyInstance); + } + input.ReadMessage(subBuilder); + MessageToDestroyInstance = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OperateKind = input.ReadBool(); + break; + } + case 18: { + global::Communication.Proto.MessageToAddInstance subBuilder = new global::Communication.Proto.MessageToAddInstance(); + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToAddInstance) { + subBuilder.MergeFrom(MessageToAddInstance); + } + input.ReadMessage(subBuilder); + MessageToAddInstance = subBuilder; + break; + } + case 26: { + global::Communication.Proto.MessageToDestroyInstance subBuilder = new global::Communication.Proto.MessageToDestroyInstance(); + if (messageOfOperationCase_ == MessageOfOperationOneofCase.MessageToDestroyInstance) { + subBuilder.MergeFrom(MessageToDestroyInstance); + } + input.ReadMessage(subBuilder); + MessageToDestroyInstance = subBuilder; + break; + } + } + } + } + #endif + + } + + /// + ///操作指令 + /// + public sealed partial class MessageToRefresh : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageToRefresh()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Communication.Proto.Message2ClientsReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToRefresh() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToRefresh(MessageToRefresh other) : this() { + gameObjType_ = other.gameObjType_; + switch (other.GameObjMessageCase) { + case GameObjMessageOneofCase.MessageOfBullet: + MessageOfBullet = other.MessageOfBullet.Clone(); + break; + case GameObjMessageOneofCase.MessageOfCharacter: + MessageOfCharacter = other.MessageOfCharacter.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MessageToRefresh Clone() { + return new MessageToRefresh(this); } - /// Field number for the "playerID" field. - public const int PlayerIDFieldNumber = 1; - private long playerID_; - /// - ///指明发送给谁 - /// + /// Field number for the "gameObjType" field. + public const int GameObjTypeFieldNumber = 1; + private global::Communication.Proto.GameObjType gameObjType_ = global::Communication.Proto.GameObjType.NullGameObjType; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long PlayerID { - get { return playerID_; } + public global::Communication.Proto.GameObjType GameObjType { + get { return gameObjType_; } set { - playerID_ = value; + gameObjType_ = value; } } - /// Field number for the "teamID" field. - public const int TeamIDFieldNumber = 2; - private long teamID_; - /// - ///指明发送给谁 - /// + /// Field number for the "messageOfBullet" field. + public const int MessageOfBulletFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long TeamID { - get { return teamID_; } + public global::Communication.Proto.MessageOfBullet MessageOfBullet { + get { return gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfBullet ? (global::Communication.Proto.MessageOfBullet) gameObjMessage_ : null; } set { - teamID_ = value; + gameObjMessage_ = value; + gameObjMessageCase_ = value == null ? GameObjMessageOneofCase.None : GameObjMessageOneofCase.MessageOfBullet; } } - /// Field number for the "messageType" field. - public const int MessageTypeFieldNumber = 3; - private global::Communication.Proto.MessageType messageType_ = global::Communication.Proto.MessageType.AddPlayer; + /// Field number for the "messageOfCharacter" field. + public const int MessageOfCharacterFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Communication.Proto.MessageType MessageType { - get { return messageType_; } + public global::Communication.Proto.ChangeableCharacterProperty MessageOfCharacter { + get { return gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfCharacter ? (global::Communication.Proto.ChangeableCharacterProperty) gameObjMessage_ : null; } set { - messageType_ = value; + gameObjMessage_ = value; + gameObjMessageCase_ = value == null ? GameObjMessageOneofCase.None : GameObjMessageOneofCase.MessageOfCharacter; } } - /// Field number for the "guid" field. - public const int GuidFieldNumber = 4; - private long guid_; - /// - ///自己的guid - /// + private object gameObjMessage_; + /// Enum of possible cases for the "gameObjMessage" oneof. + public enum GameObjMessageOneofCase { + None = 0, + MessageOfBullet = 2, + MessageOfCharacter = 3, + } + private GameObjMessageOneofCase gameObjMessageCase_ = GameObjMessageOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long Guid { - get { return guid_; } - set { - guid_ = value; - } + public GameObjMessageOneofCase GameObjMessageCase { + get { return gameObjMessageCase_; } } - /// Field number for the "message" field. - public const int MessageFieldNumber = 5; - private string message_ = ""; - /// - ///如果 messageType 为 Send,则为要发送的消息 - /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Message { - get { return message_; } - set { - message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } + public void ClearGameObjMessage() { + gameObjMessageCase_ = GameObjMessageOneofCase.None; + gameObjMessage_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { - return Equals(other as MessageToOneClient); + return Equals(other as MessageToRefresh); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MessageToOneClient other) { + public bool Equals(MessageToRefresh other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (PlayerID != other.PlayerID) return false; - if (TeamID != other.TeamID) return false; - if (MessageType != other.MessageType) return false; - if (Guid != other.Guid) return false; - if (Message != other.Message) return false; + if (GameObjType != other.GameObjType) return false; + if (!object.Equals(MessageOfBullet, other.MessageOfBullet)) return false; + if (!object.Equals(MessageOfCharacter, other.MessageOfCharacter)) return false; + if (GameObjMessageCase != other.GameObjMessageCase) return false; return Equals(_unknownFields, other._unknownFields); } @@ -1462,11 +2776,10 @@ public bool Equals(MessageToOneClient other) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (PlayerID != 0L) hash ^= PlayerID.GetHashCode(); - if (TeamID != 0L) hash ^= TeamID.GetHashCode(); - if (MessageType != global::Communication.Proto.MessageType.AddPlayer) hash ^= MessageType.GetHashCode(); - if (Guid != 0L) hash ^= Guid.GetHashCode(); - if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (GameObjType != global::Communication.Proto.GameObjType.NullGameObjType) hash ^= GameObjType.GetHashCode(); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfBullet) hash ^= MessageOfBullet.GetHashCode(); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfCharacter) hash ^= MessageOfCharacter.GetHashCode(); + hash ^= (int) gameObjMessageCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1485,25 +2798,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (PlayerID != 0L) { + if (GameObjType != global::Communication.Proto.GameObjType.NullGameObjType) { output.WriteRawTag(8); - output.WriteInt64(PlayerID); - } - if (TeamID != 0L) { - output.WriteRawTag(16); - output.WriteInt64(TeamID); - } - if (MessageType != global::Communication.Proto.MessageType.AddPlayer) { - output.WriteRawTag(24); - output.WriteEnum((int) MessageType); + output.WriteEnum((int) GameObjType); } - if (Guid != 0L) { - output.WriteRawTag(32); - output.WriteInt64(Guid); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfBullet) { + output.WriteRawTag(18); + output.WriteMessage(MessageOfBullet); } - if (Message.Length != 0) { - output.WriteRawTag(42); - output.WriteString(Message); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfCharacter) { + output.WriteRawTag(26); + output.WriteMessage(MessageOfCharacter); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1515,25 +2820,17 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (PlayerID != 0L) { + if (GameObjType != global::Communication.Proto.GameObjType.NullGameObjType) { output.WriteRawTag(8); - output.WriteInt64(PlayerID); - } - if (TeamID != 0L) { - output.WriteRawTag(16); - output.WriteInt64(TeamID); - } - if (MessageType != global::Communication.Proto.MessageType.AddPlayer) { - output.WriteRawTag(24); - output.WriteEnum((int) MessageType); + output.WriteEnum((int) GameObjType); } - if (Guid != 0L) { - output.WriteRawTag(32); - output.WriteInt64(Guid); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfBullet) { + output.WriteRawTag(18); + output.WriteMessage(MessageOfBullet); } - if (Message.Length != 0) { - output.WriteRawTag(42); - output.WriteString(Message); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfCharacter) { + output.WriteRawTag(26); + output.WriteMessage(MessageOfCharacter); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1545,20 +2842,14 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (PlayerID != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(PlayerID); - } - if (TeamID != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(TeamID); - } - if (MessageType != global::Communication.Proto.MessageType.AddPlayer) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MessageType); + if (GameObjType != global::Communication.Proto.GameObjType.NullGameObjType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) GameObjType); } - if (Guid != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Guid); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfBullet) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageOfBullet); } - if (Message.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfCharacter) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageOfCharacter); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1568,25 +2859,28 @@ public int CalculateSize() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MessageToOneClient other) { + public void MergeFrom(MessageToRefresh other) { if (other == null) { return; } - if (other.PlayerID != 0L) { - PlayerID = other.PlayerID; - } - if (other.TeamID != 0L) { - TeamID = other.TeamID; - } - if (other.MessageType != global::Communication.Proto.MessageType.AddPlayer) { - MessageType = other.MessageType; - } - if (other.Guid != 0L) { - Guid = other.Guid; + if (other.GameObjType != global::Communication.Proto.GameObjType.NullGameObjType) { + GameObjType = other.GameObjType; } - if (other.Message.Length != 0) { - Message = other.Message; + switch (other.GameObjMessageCase) { + case GameObjMessageOneofCase.MessageOfBullet: + if (MessageOfBullet == null) { + MessageOfBullet = new global::Communication.Proto.MessageOfBullet(); + } + MessageOfBullet.MergeFrom(other.MessageOfBullet); + break; + case GameObjMessageOneofCase.MessageOfCharacter: + if (MessageOfCharacter == null) { + MessageOfCharacter = new global::Communication.Proto.ChangeableCharacterProperty(); + } + MessageOfCharacter.MergeFrom(other.MessageOfCharacter); + break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1603,23 +2897,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { - PlayerID = input.ReadInt64(); - break; - } - case 16: { - TeamID = input.ReadInt64(); - break; - } - case 24: { - MessageType = (global::Communication.Proto.MessageType) input.ReadEnum(); + GameObjType = (global::Communication.Proto.GameObjType) input.ReadEnum(); break; } - case 32: { - Guid = input.ReadInt64(); + case 18: { + global::Communication.Proto.MessageOfBullet subBuilder = new global::Communication.Proto.MessageOfBullet(); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfBullet) { + subBuilder.MergeFrom(MessageOfBullet); + } + input.ReadMessage(subBuilder); + MessageOfBullet = subBuilder; break; } - case 42: { - Message = input.ReadString(); + case 26: { + global::Communication.Proto.ChangeableCharacterProperty subBuilder = new global::Communication.Proto.ChangeableCharacterProperty(); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfCharacter) { + subBuilder.MergeFrom(MessageOfCharacter); + } + input.ReadMessage(subBuilder); + MessageOfCharacter = subBuilder; break; } } @@ -1638,23 +2934,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { - PlayerID = input.ReadInt64(); - break; - } - case 16: { - TeamID = input.ReadInt64(); - break; - } - case 24: { - MessageType = (global::Communication.Proto.MessageType) input.ReadEnum(); + GameObjType = (global::Communication.Proto.GameObjType) input.ReadEnum(); break; } - case 32: { - Guid = input.ReadInt64(); + case 18: { + global::Communication.Proto.MessageOfBullet subBuilder = new global::Communication.Proto.MessageOfBullet(); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfBullet) { + subBuilder.MergeFrom(MessageOfBullet); + } + input.ReadMessage(subBuilder); + MessageOfBullet = subBuilder; break; } - case 42: { - Message = input.ReadString(); + case 26: { + global::Communication.Proto.ChangeableCharacterProperty subBuilder = new global::Communication.Proto.ChangeableCharacterProperty(); + if (gameObjMessageCase_ == GameObjMessageOneofCase.MessageOfCharacter) { + subBuilder.MergeFrom(MessageOfCharacter); + } + input.ReadMessage(subBuilder); + MessageOfCharacter = subBuilder; break; } } @@ -1664,24 +2962,21 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - ///发送全局信息时 - /// - public sealed partial class MessageToClient : pb::IMessage + public sealed partial class MessageToOneClient : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageToClient()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageToOneClient()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Communication.Proto.Message2ClientsReflection.Descriptor.MessageTypes[2]; } + get { return global::Communication.Proto.Message2ClientsReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1692,7 +2987,7 @@ public sealed partial class MessageToClient : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageToClient() { + public MessageToOneClient() { OnConstruction(); } @@ -1700,32 +2995,30 @@ public MessageToClient() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageToClient(MessageToClient other) : this() { + public MessageToOneClient(MessageToOneClient other) : this() { playerID_ = other.playerID_; teamID_ = other.teamID_; messageType_ = other.messageType_; - selfInfo_ = other.selfInfo_ != null ? other.selfInfo_.Clone() : null; - teamScore_ = other.teamScore_; - gameObjs_ = other.gameObjs_.Clone(); - playerGUIDs_ = other.playerGUIDs_.Clone(); + guid_ = other.guid_; + message_ = other.message_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageToClient Clone() { - return new MessageToClient(this); + public MessageToOneClient Clone() { + return new MessageToOneClient(this); } /// Field number for the "playerID" field. public const int PlayerIDFieldNumber = 1; - private long playerID_; + private int playerID_; /// ///指明发送给谁 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long PlayerID { + public int PlayerID { get { return playerID_; } set { playerID_ = value; @@ -1734,13 +3027,13 @@ public long PlayerID { /// Field number for the "teamID" field. public const int TeamIDFieldNumber = 2; - private long teamID_; + private int teamID_; /// - ///指明发送给谁 + ///指明发送给谁 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long TeamID { + public int TeamID { get { return teamID_; } set { teamID_ = value; @@ -1759,73 +3052,45 @@ public long TeamID { } } - /// Field number for the "selfInfo" field. - public const int SelfInfoFieldNumber = 4; - private global::Communication.Proto.GameObjInfo selfInfo_; + /// Field number for the "guid" field. + public const int GuidFieldNumber = 4; + private int guid_; /// - ///自己的个人信息 + ///自己的guid /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Communication.Proto.GameObjInfo SelfInfo { - get { return selfInfo_; } + public int Guid { + get { return guid_; } set { - selfInfo_ = value; + guid_ = value; } } - /// Field number for the "teamScore" field. - public const int TeamScoreFieldNumber = 5; - private int teamScore_; + /// Field number for the "message" field. + public const int MessageFieldNumber = 5; + private string message_ = ""; /// - ///本队伍的分数 + ///如果 messageType 为 Send,则为要发送的消息 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int TeamScore { - get { return teamScore_; } + public string Message { + get { return message_; } set { - teamScore_ = value; + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "gameObjs" field. - public const int GameObjsFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_gameObjs_codec - = pb::FieldCodec.ForMessage(50, global::Communication.Proto.GameObjInfo.Parser); - private readonly pbc::RepeatedField gameObjs_ = new pbc::RepeatedField(); - /// - ///当前地图上的所有对象 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField GameObjs { - get { return gameObjs_; } - } - - /// Field number for the "PlayerGUIDs" field. - public const int PlayerGUIDsFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_playerGUIDs_codec - = pb::FieldCodec.ForMessage(58, global::Communication.Proto.MessageToClient.Types.OneTeamGUIDs.Parser); - private readonly pbc::RepeatedField playerGUIDs_ = new pbc::RepeatedField(); - /// - ///所有玩家的GUID,第一维的 0、1、2…… 分别为队伍编号,每个队伍的0、1、2、……元素分别为playerID为0、1、2、……的玩家的GUID,若不存在该玩家,则为Constant::Constant::InvalidGUID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField PlayerGUIDs { - get { return playerGUIDs_; } - } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { - return Equals(other as MessageToClient); + return Equals(other as MessageToOneClient); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MessageToClient other) { + public bool Equals(MessageToOneClient other) { if (ReferenceEquals(other, null)) { return false; } @@ -1835,10 +3100,8 @@ public bool Equals(MessageToClient other) { if (PlayerID != other.PlayerID) return false; if (TeamID != other.TeamID) return false; if (MessageType != other.MessageType) return false; - if (!object.Equals(SelfInfo, other.SelfInfo)) return false; - if (TeamScore != other.TeamScore) return false; - if(!gameObjs_.Equals(other.gameObjs_)) return false; - if(!playerGUIDs_.Equals(other.playerGUIDs_)) return false; + if (Guid != other.Guid) return false; + if (Message != other.Message) return false; return Equals(_unknownFields, other._unknownFields); } @@ -1846,13 +3109,11 @@ public bool Equals(MessageToClient other) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (PlayerID != 0L) hash ^= PlayerID.GetHashCode(); - if (TeamID != 0L) hash ^= TeamID.GetHashCode(); + if (PlayerID != 0) hash ^= PlayerID.GetHashCode(); + if (TeamID != 0) hash ^= TeamID.GetHashCode(); if (MessageType != global::Communication.Proto.MessageType.AddPlayer) hash ^= MessageType.GetHashCode(); - if (selfInfo_ != null) hash ^= SelfInfo.GetHashCode(); - if (TeamScore != 0) hash ^= TeamScore.GetHashCode(); - hash ^= gameObjs_.GetHashCode(); - hash ^= playerGUIDs_.GetHashCode(); + if (Guid != 0) hash ^= Guid.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1871,28 +3132,26 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (PlayerID != 0L) { + if (PlayerID != 0) { output.WriteRawTag(8); - output.WriteInt64(PlayerID); + output.WriteInt32(PlayerID); } - if (TeamID != 0L) { + if (TeamID != 0) { output.WriteRawTag(16); - output.WriteInt64(TeamID); + output.WriteInt32(TeamID); } if (MessageType != global::Communication.Proto.MessageType.AddPlayer) { output.WriteRawTag(24); output.WriteEnum((int) MessageType); } - if (selfInfo_ != null) { - output.WriteRawTag(34); - output.WriteMessage(SelfInfo); + if (Guid != 0) { + output.WriteRawTag(32); + output.WriteInt32(Guid); } - if (TeamScore != 0) { - output.WriteRawTag(40); - output.WriteInt32(TeamScore); + if (Message.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Message); } - gameObjs_.WriteTo(output, _repeated_gameObjs_codec); - playerGUIDs_.WriteTo(output, _repeated_playerGUIDs_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -1903,28 +3162,26 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (PlayerID != 0L) { + if (PlayerID != 0) { output.WriteRawTag(8); - output.WriteInt64(PlayerID); + output.WriteInt32(PlayerID); } - if (TeamID != 0L) { + if (TeamID != 0) { output.WriteRawTag(16); - output.WriteInt64(TeamID); + output.WriteInt32(TeamID); } if (MessageType != global::Communication.Proto.MessageType.AddPlayer) { output.WriteRawTag(24); output.WriteEnum((int) MessageType); } - if (selfInfo_ != null) { - output.WriteRawTag(34); - output.WriteMessage(SelfInfo); + if (Guid != 0) { + output.WriteRawTag(32); + output.WriteInt32(Guid); } - if (TeamScore != 0) { - output.WriteRawTag(40); - output.WriteInt32(TeamScore); + if (Message.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Message); } - gameObjs_.WriteTo(ref output, _repeated_gameObjs_codec); - playerGUIDs_.WriteTo(ref output, _repeated_playerGUIDs_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -1935,23 +3192,21 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (PlayerID != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(PlayerID); + if (PlayerID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlayerID); } - if (TeamID != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(TeamID); + if (TeamID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TeamID); } if (MessageType != global::Communication.Proto.MessageType.AddPlayer) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MessageType); } - if (selfInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(SelfInfo); + if (Guid != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Guid); } - if (TeamScore != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(TeamScore); + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); } - size += gameObjs_.CalculateSize(_repeated_gameObjs_codec); - size += playerGUIDs_.CalculateSize(_repeated_playerGUIDs_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1960,30 +3215,25 @@ public int CalculateSize() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MessageToClient other) { + public void MergeFrom(MessageToOneClient other) { if (other == null) { return; } - if (other.PlayerID != 0L) { + if (other.PlayerID != 0) { PlayerID = other.PlayerID; } - if (other.TeamID != 0L) { + if (other.TeamID != 0) { TeamID = other.TeamID; } if (other.MessageType != global::Communication.Proto.MessageType.AddPlayer) { MessageType = other.MessageType; } - if (other.selfInfo_ != null) { - if (selfInfo_ == null) { - SelfInfo = new global::Communication.Proto.GameObjInfo(); - } - SelfInfo.MergeFrom(other.SelfInfo); + if (other.Guid != 0) { + Guid = other.Guid; } - if (other.TeamScore != 0) { - TeamScore = other.TeamScore; + if (other.Message.Length != 0) { + Message = other.Message; } - gameObjs_.Add(other.gameObjs_); - playerGUIDs_.Add(other.playerGUIDs_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2000,34 +3250,23 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { - PlayerID = input.ReadInt64(); + PlayerID = input.ReadInt32(); break; } case 16: { - TeamID = input.ReadInt64(); + TeamID = input.ReadInt32(); break; } case 24: { MessageType = (global::Communication.Proto.MessageType) input.ReadEnum(); break; } - case 34: { - if (selfInfo_ == null) { - SelfInfo = new global::Communication.Proto.GameObjInfo(); - } - input.ReadMessage(SelfInfo); - break; - } - case 40: { - TeamScore = input.ReadInt32(); - break; - } - case 50: { - gameObjs_.AddEntriesFrom(input, _repeated_gameObjs_codec); + case 32: { + Guid = input.ReadInt32(); break; } - case 58: { - playerGUIDs_.AddEntriesFrom(input, _repeated_playerGUIDs_codec); + case 42: { + Message = input.ReadString(); break; } } @@ -2046,34 +3285,23 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { - PlayerID = input.ReadInt64(); + PlayerID = input.ReadInt32(); break; } case 16: { - TeamID = input.ReadInt64(); + TeamID = input.ReadInt32(); break; } case 24: { MessageType = (global::Communication.Proto.MessageType) input.ReadEnum(); break; } - case 34: { - if (selfInfo_ == null) { - SelfInfo = new global::Communication.Proto.GameObjInfo(); - } - input.ReadMessage(SelfInfo); - break; - } - case 40: { - TeamScore = input.ReadInt32(); - break; - } - case 50: { - gameObjs_.AddEntriesFrom(ref input, _repeated_gameObjs_codec); + case 32: { + Guid = input.ReadInt32(); break; } - case 58: { - playerGUIDs_.AddEntriesFrom(ref input, _repeated_playerGUIDs_codec); + case 42: { + Message = input.ReadString(); break; } } @@ -2081,194 +3309,6 @@ public void MergeFrom(pb::CodedInputStream input) { } #endif - #region Nested types - /// Container for nested types declared in the MessageToClient message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public sealed partial class OneTeamGUIDs : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneTeamGUIDs()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Communication.Proto.MessageToClient.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneTeamGUIDs() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneTeamGUIDs(OneTeamGUIDs other) : this() { - teammateGUIDs_ = other.teammateGUIDs_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneTeamGUIDs Clone() { - return new OneTeamGUIDs(this); - } - - /// Field number for the "teammateGUIDs" field. - public const int TeammateGUIDsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_teammateGUIDs_codec - = pb::FieldCodec.ForInt64(10); - private readonly pbc::RepeatedField teammateGUIDs_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField TeammateGUIDs { - get { return teammateGUIDs_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OneTeamGUIDs); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OneTeamGUIDs other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!teammateGUIDs_.Equals(other.teammateGUIDs_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= teammateGUIDs_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - teammateGUIDs_.WriteTo(output, _repeated_teammateGUIDs_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - teammateGUIDs_.WriteTo(ref output, _repeated_teammateGUIDs_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += teammateGUIDs_.CalculateSize(_repeated_teammateGUIDs_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OneTeamGUIDs other) { - if (other == null) { - return; - } - teammateGUIDs_.Add(other.teammateGUIDs_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: - case 8: { - teammateGUIDs_.AddEntriesFrom(input, _repeated_teammateGUIDs_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: - case 8: { - teammateGUIDs_.AddEntriesFrom(ref input, _repeated_teammateGUIDs_codec); - break; - } - } - } - } - #endif - - } - - } - #endregion - } #endregion diff --git a/communication/Proto/Message2Server.cs b/communication/Proto/Message2Server.cs index ed792aef..28fb10ef 100644 --- a/communication/Proto/Message2Server.cs +++ b/communication/Proto/Message2Server.cs @@ -25,20 +25,19 @@ static Message2ServerReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChRNZXNzYWdlMlNlcnZlci5wcm90bxIIUHJvdG9idWYaEU1lc3NhZ2VUeXBl", - "LnByb3RvGhVNZXNzYWdlMkNsaWVudHMucHJvdG8i2QIKD01lc3NhZ2VUb1Nl", + "LnByb3RvGhVNZXNzYWdlMkNsaWVudHMucHJvdG8irQIKD01lc3NhZ2VUb1Nl", "cnZlchIqCgttZXNzYWdlVHlwZRgBIAEoDjIVLlByb3RvYnVmLk1lc3NhZ2VU", "eXBlEhAKCHBsYXllcklEGAIgASgDEg4KBnRlYW1JRBgDIAEoAxIkCghwcm9w", "VHlwZRgEIAEoDjISLlByb3RvYnVmLlByb3BUeXBlEhoKEnRpbWVJbk1pbGxp", "c2Vjb25kcxgFIAEoBRINCgVhbmdsZRgGIAEoARISCgpUb1BsYXllcklEGAcg", "ASgDEg8KB21lc3NhZ2UYCCABKAkSKgoGcFNraWxsGAkgASgOMhouUHJvdG9i", "dWYuUGFzc2l2ZVNraWxsVHlwZRIqCgdhU2tpbGwxGAogASgOMhkuUHJvdG9i", - "dWYuQWN0aXZlU2tpbGxUeXBlEioKB2FTa2lsbDIYCyABKA4yGS5Qcm90b2J1", - "Zi5BY3RpdmVTa2lsbFR5cGVCFqoCE0NvbW11bmljYXRpb24uUHJvdG9iBnBy", - "b3RvMw==")); + "dWYuQWN0aXZlU2tpbGxUeXBlQhaqAhNDb21tdW5pY2F0aW9uLlByb3RvYgZw", + "cm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Communication.Proto.MessageTypeReflection.Descriptor, global::Communication.Proto.Message2ClientsReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToServer), global::Communication.Proto.MessageToServer.Parser, new[]{ "MessageType", "PlayerID", "TeamID", "PropType", "TimeInMilliseconds", "Angle", "ToPlayerID", "Message", "PSkill", "ASkill1", "ASkill2" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Communication.Proto.MessageToServer), global::Communication.Proto.MessageToServer.Parser, new[]{ "MessageType", "PlayerID", "TeamID", "PropType", "TimeInMilliseconds", "Angle", "ToPlayerID", "Message", "PSkill", "ASkill1" }, null, null, null, null) })); } #endregion @@ -89,7 +88,6 @@ public MessageToServer(MessageToServer other) : this() { message_ = other.message_; pSkill_ = other.pSkill_; aSkill1_ = other.aSkill1_; - aSkill2_ = other.aSkill2_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -143,7 +141,7 @@ public long TeamID { /// Field number for the "propType" field. public const int PropTypeFieldNumber = 4; - private global::Communication.Proto.PropType propType_ = global::Communication.Proto.PropType.Null; + private global::Communication.Proto.PropType propType_ = global::Communication.Proto.PropType.NullPropType; /// ///messageType为Pick时要捡起的道具类型 /// @@ -218,9 +216,9 @@ public string Message { /// Field number for the "pSkill" field. public const int PSkillFieldNumber = 9; - private global::Communication.Proto.PassiveSkillType pSkill_ = global::Communication.Proto.PassiveSkillType.Pskill0; + private global::Communication.Proto.PassiveSkillType pSkill_ = global::Communication.Proto.PassiveSkillType.NullPassiveSkillType; /// - ///AddPlayer时添加的被动技能,下面是添加的两个主动技能。 + ///AddPlayer时添加的被动技能,下面是添加的一个主动技能。 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -233,7 +231,7 @@ public string Message { /// Field number for the "aSkill1" field. public const int ASkill1FieldNumber = 10; - private global::Communication.Proto.ActiveSkillType aSkill1_ = global::Communication.Proto.ActiveSkillType.Askill0; + private global::Communication.Proto.ActiveSkillType aSkill1_ = global::Communication.Proto.ActiveSkillType.NullActiveSkillType; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Communication.Proto.ActiveSkillType ASkill1 { @@ -243,18 +241,6 @@ public string Message { } } - /// Field number for the "aSkill2" field. - public const int ASkill2FieldNumber = 11; - private global::Communication.Proto.ActiveSkillType aSkill2_ = global::Communication.Proto.ActiveSkillType.Askill0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Communication.Proto.ActiveSkillType ASkill2 { - get { return aSkill2_; } - set { - aSkill2_ = value; - } - } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -280,7 +266,6 @@ public bool Equals(MessageToServer other) { if (Message != other.Message) return false; if (PSkill != other.PSkill) return false; if (ASkill1 != other.ASkill1) return false; - if (ASkill2 != other.ASkill2) return false; return Equals(_unknownFields, other._unknownFields); } @@ -291,14 +276,13 @@ public override int GetHashCode() { if (MessageType != global::Communication.Proto.MessageType.AddPlayer) hash ^= MessageType.GetHashCode(); if (PlayerID != 0L) hash ^= PlayerID.GetHashCode(); if (TeamID != 0L) hash ^= TeamID.GetHashCode(); - if (PropType != global::Communication.Proto.PropType.Null) hash ^= PropType.GetHashCode(); + if (PropType != global::Communication.Proto.PropType.NullPropType) hash ^= PropType.GetHashCode(); if (TimeInMilliseconds != 0) hash ^= TimeInMilliseconds.GetHashCode(); if (Angle != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Angle); if (ToPlayerID != 0L) hash ^= ToPlayerID.GetHashCode(); if (Message.Length != 0) hash ^= Message.GetHashCode(); - if (PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) hash ^= PSkill.GetHashCode(); - if (ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) hash ^= ASkill1.GetHashCode(); - if (ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) hash ^= ASkill2.GetHashCode(); + if (PSkill != global::Communication.Proto.PassiveSkillType.NullPassiveSkillType) hash ^= PSkill.GetHashCode(); + if (ASkill1 != global::Communication.Proto.ActiveSkillType.NullActiveSkillType) hash ^= ASkill1.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -329,7 +313,7 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(24); output.WriteInt64(TeamID); } - if (PropType != global::Communication.Proto.PropType.Null) { + if (PropType != global::Communication.Proto.PropType.NullPropType) { output.WriteRawTag(32); output.WriteEnum((int) PropType); } @@ -349,18 +333,14 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(66); output.WriteString(Message); } - if (PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) { + if (PSkill != global::Communication.Proto.PassiveSkillType.NullPassiveSkillType) { output.WriteRawTag(72); output.WriteEnum((int) PSkill); } - if (ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) { + if (ASkill1 != global::Communication.Proto.ActiveSkillType.NullActiveSkillType) { output.WriteRawTag(80); output.WriteEnum((int) ASkill1); } - if (ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) { - output.WriteRawTag(88); - output.WriteEnum((int) ASkill2); - } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -383,7 +363,7 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(24); output.WriteInt64(TeamID); } - if (PropType != global::Communication.Proto.PropType.Null) { + if (PropType != global::Communication.Proto.PropType.NullPropType) { output.WriteRawTag(32); output.WriteEnum((int) PropType); } @@ -403,18 +383,14 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(66); output.WriteString(Message); } - if (PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) { + if (PSkill != global::Communication.Proto.PassiveSkillType.NullPassiveSkillType) { output.WriteRawTag(72); output.WriteEnum((int) PSkill); } - if (ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) { + if (ASkill1 != global::Communication.Proto.ActiveSkillType.NullActiveSkillType) { output.WriteRawTag(80); output.WriteEnum((int) ASkill1); } - if (ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) { - output.WriteRawTag(88); - output.WriteEnum((int) ASkill2); - } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -434,7 +410,7 @@ public int CalculateSize() { if (TeamID != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(TeamID); } - if (PropType != global::Communication.Proto.PropType.Null) { + if (PropType != global::Communication.Proto.PropType.NullPropType) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PropType); } if (TimeInMilliseconds != 0) { @@ -449,15 +425,12 @@ public int CalculateSize() { if (Message.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); } - if (PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) { + if (PSkill != global::Communication.Proto.PassiveSkillType.NullPassiveSkillType) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PSkill); } - if (ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) { + if (ASkill1 != global::Communication.Proto.ActiveSkillType.NullActiveSkillType) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ASkill1); } - if (ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ASkill2); - } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -479,7 +452,7 @@ public void MergeFrom(MessageToServer other) { if (other.TeamID != 0L) { TeamID = other.TeamID; } - if (other.PropType != global::Communication.Proto.PropType.Null) { + if (other.PropType != global::Communication.Proto.PropType.NullPropType) { PropType = other.PropType; } if (other.TimeInMilliseconds != 0) { @@ -494,15 +467,12 @@ public void MergeFrom(MessageToServer other) { if (other.Message.Length != 0) { Message = other.Message; } - if (other.PSkill != global::Communication.Proto.PassiveSkillType.Pskill0) { + if (other.PSkill != global::Communication.Proto.PassiveSkillType.NullPassiveSkillType) { PSkill = other.PSkill; } - if (other.ASkill1 != global::Communication.Proto.ActiveSkillType.Askill0) { + if (other.ASkill1 != global::Communication.Proto.ActiveSkillType.NullActiveSkillType) { ASkill1 = other.ASkill1; } - if (other.ASkill2 != global::Communication.Proto.ActiveSkillType.Askill0) { - ASkill2 = other.ASkill2; - } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -558,10 +528,6 @@ public void MergeFrom(pb::CodedInputStream input) { ASkill1 = (global::Communication.Proto.ActiveSkillType) input.ReadEnum(); break; } - case 88: { - ASkill2 = (global::Communication.Proto.ActiveSkillType) input.ReadEnum(); - break; - } } } #endif @@ -617,10 +583,6 @@ public void MergeFrom(pb::CodedInputStream input) { ASkill1 = (global::Communication.Proto.ActiveSkillType) input.ReadEnum(); break; } - case 88: { - ASkill2 = (global::Communication.Proto.ActiveSkillType) input.ReadEnum(); - break; - } } } } diff --git a/communication/Proto/MessageType.cs b/communication/Proto/MessageType.cs index 3b9e68f0..420176f1 100644 --- a/communication/Proto/MessageType.cs +++ b/communication/Proto/MessageType.cs @@ -24,15 +24,36 @@ public static partial class MessageTypeReflection { static MessageTypeReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChFNZXNzYWdlVHlwZS5wcm90bxIIUHJvdG9idWYqxAEKC01lc3NhZ2VUeXBl", + "ChFNZXNzYWdlVHlwZS5wcm90bxIIUHJvdG9idWYq4gEKC01lc3NhZ2VUeXBl", "Eg0KCUFkZFBsYXllchAAEggKBE1vdmUQARIKCgZBdHRhY2sQAhIICgRQaWNr", "EAMSBwoDVXNlEAQSCQoFVGhyb3cQBRIICgRTZW5kEAYSEQoNSW52YWxpZFBs", "YXllchAHEg8KC1ZhbGlkUGxheWVyEAgSDQoJU3RhcnRHYW1lEAkSCgoGR2Ft", - "aW5nEAoSCwoHRW5kR2FtZRALEg0KCVVzZVNraWxsMRAMEg0KCVVzZVNraWxs", - "MhANQhaqAhNDb21tdW5pY2F0aW9uLlByb3RvYgZwcm90bzM=")); + "aW5nEAoSCwoHRW5kR2FtZRALEhIKDlVzZUNvbW1vblNraWxsEAwSFAoQVXNl", + "VWx0aW1hdGVTa2lsbBANEhAKDEluaXRpYWxMaXplZBAOKoEBCgtHYW1lT2Jq", + "VHlwZRITCg9OdWxsR2FtZU9ialR5cGUQABINCglDaGFyYWN0ZXIQARIICgRX", + "YWxsEAISCAoEUHJvcBADEgoKBkJ1bGxldBAEEg4KCkJpcnRoUG9pbnQQBRIT", + "Cg9PdXRPZkJvdW5kQmxvY2sQBhIJCgVHcmFzcxAHKjYKCVNoYXBlVHlwZRIR", + "Cg1OdWxsU2hhcGVUeXBlEAASCgoGQ2lyY2xlEAESCgoGU3F1YXJlEAIqWwoJ", + "UGxhY2VUeXBlEhEKDU51bGxQbGFjZVR5cGUQABIICgRMYW5kEAESCgoGR3Jh", + "c3MxEAISCgoGR3Jhc3MyEAMSCgoGR3Jhc3MzEAQSDQoJSW52aXNpYmxlEAUq", + "ogEKCFByb3BUeXBlEhAKDE51bGxQcm9wVHlwZRAAEgkKBWFkZEhQEAESCQoF", + "YWRkQVAQAhIMCghhZGRTcGVlZBADEgsKB2FkZExJRkUQBBILCgdtaW51c0NE", + "EAUSBwoDR2VtEAYSCgoGU2hpZWxkEAcSCQoFU3BlYXIQCBIOCgptaW51c1Nw", + "ZWVkEAkSCwoHbWludXNBUBAKEgkKBWFkZENEEAsqlQEKEFBhc3NpdmVTa2ls", + "bFR5cGUSGAoUTnVsbFBhc3NpdmVTa2lsbFR5cGUQABIWChJSZWNvdmVyQWZ0", + "ZXJCYXR0bGUQARIbChdTcGVlZFVwV2hlbkxlYXZpbmdHcmFzcxACEgsKB1Zh", + "bXBpcmUQAxILCgdQU2tpbGwzEAQSCwoHUFNraWxsNBAFEgsKB1BTa2lsbDUQ", + "BiqNAQoPQWN0aXZlU2tpbGxUeXBlEhcKE051bGxBY3RpdmVTa2lsbFR5cGUQ", + "ABIRCg1CZWNvbWVWYW1waXJlEAESEgoOQmVjb21lQXNzYXNzaW4QAhIRCg1O", + "dWNsZWFyV2VhcG9uEAMSDQoJU3VwZXJGYXN0EAQSCwoHQVNraWxsNBAFEgsK", + "B0FTa2lsbDUQBipnCghCdWZmVHlwZRIQCgxOdWxsQnVmZlR5cGUQABINCglN", + "b3ZlU3BlZWQQARIGCgJBUBACEgYKAkNEEAMSCwoHQWRkTElGRRAEEg4KClNo", + "aWVsZEJ1ZmYQBRINCglTcGVhckJ1ZmYQBiouCgpCdWxsZXRUeXBlEhIKDk51", + "bGxCdWxsZXRUeXBlEAASDAoIQXRvbUJvbWIQAUIWqgITQ29tbXVuaWNhdGlv", + "bi5Qcm90b2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Communication.Proto.MessageType), }, null, null)); + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Communication.Proto.MessageType), typeof(global::Communication.Proto.GameObjType), typeof(global::Communication.Proto.ShapeType), typeof(global::Communication.Proto.PlaceType), typeof(global::Communication.Proto.PropType), typeof(global::Communication.Proto.PassiveSkillType), typeof(global::Communication.Proto.ActiveSkillType), typeof(global::Communication.Proto.BuffType), typeof(global::Communication.Proto.BulletType), }, null, null)); } #endregion @@ -42,7 +63,7 @@ public enum MessageType { [pbr::OriginalName("AddPlayer")] AddPlayer = 0, [pbr::OriginalName("Move")] Move = 1, /// - ///注:编者设想“除携带被动技能‘命中’的人物外,其余人物均不以子弹攻击” + ///注:所有人物都用子弹攻击 /// [pbr::OriginalName("Attack")] Attack = 2, [pbr::OriginalName("Pick")] Pick = 3, @@ -55,13 +76,104 @@ public enum MessageType { [pbr::OriginalName("Gaming")] Gaming = 10, [pbr::OriginalName("EndGame")] EndGame = 11, /// - ///新增信息类型:使用主动技能1 + ///使用CommonSkill /// - [pbr::OriginalName("UseSkill1")] UseSkill1 = 12, + [pbr::OriginalName("UseCommonSkill")] UseCommonSkill = 12, /// - ///使用主动技能2 + ///使用UltimateSkill。UltimateSkill极有可能不会有,即人物极有可能只有PassiveSkill和CommonSkill。 /// - [pbr::OriginalName("UseSkill2")] UseSkill2 = 13, + [pbr::OriginalName("UseUltimateSkill")] UseUltimateSkill = 13, + /// + ///Server给Client发送初始化消息十分关键,因此这里用StartGame-MessageToInitialize-InitialLized三次握手确认该操作的成功。 + /// + [pbr::OriginalName("InitialLized")] InitialLized = 14, + } + + public enum GameObjType { + [pbr::OriginalName("NullGameObjType")] NullGameObjType = 0, + [pbr::OriginalName("Character")] Character = 1, + [pbr::OriginalName("Wall")] Wall = 2, + [pbr::OriginalName("Prop")] Prop = 3, + [pbr::OriginalName("Bullet")] Bullet = 4, + [pbr::OriginalName("BirthPoint")] BirthPoint = 5, + [pbr::OriginalName("OutOfBoundBlock")] OutOfBoundBlock = 6, + [pbr::OriginalName("Grass")] Grass = 7, + } + + public enum ShapeType { + [pbr::OriginalName("NullShapeType")] NullShapeType = 0, + /// + ///仍然,子弹和人物为圆形,格子为方形 + /// + [pbr::OriginalName("Circle")] Circle = 1, + [pbr::OriginalName("Square")] Square = 2, + } + + public enum PlaceType { + [pbr::OriginalName("NullPlaceType")] NullPlaceType = 0, + [pbr::OriginalName("Land")] Land = 1, + [pbr::OriginalName("Grass1")] Grass1 = 2, + [pbr::OriginalName("Grass2")] Grass2 = 3, + [pbr::OriginalName("Grass3")] Grass3 = 4, + [pbr::OriginalName("Invisible")] Invisible = 5, + } + + public enum PropType { + [pbr::OriginalName("NullPropType")] NullPropType = 0, + [pbr::OriginalName("addHP")] AddHp = 1, + [pbr::OriginalName("addAP")] AddAp = 2, + [pbr::OriginalName("addSpeed")] AddSpeed = 3, + [pbr::OriginalName("addLIFE")] AddLife = 4, + [pbr::OriginalName("minusCD")] MinusCd = 5, + /// + /// 新增:宝石 + /// + [pbr::OriginalName("Gem")] Gem = 6, + [pbr::OriginalName("Shield")] Shield = 7, + [pbr::OriginalName("Spear")] Spear = 8, + [pbr::OriginalName("minusSpeed")] MinusSpeed = 9, + [pbr::OriginalName("minusAP")] MinusAp = 10, + [pbr::OriginalName("addCD")] AddCd = 11, + } + + public enum PassiveSkillType { + [pbr::OriginalName("NullPassiveSkillType")] NullPassiveSkillType = 0, + [pbr::OriginalName("RecoverAfterBattle")] RecoverAfterBattle = 1, + [pbr::OriginalName("SpeedUpWhenLeavingGrass")] SpeedUpWhenLeavingGrass = 2, + [pbr::OriginalName("Vampire")] Vampire = 3, + [pbr::OriginalName("PSkill3")] Pskill3 = 4, + [pbr::OriginalName("PSkill4")] Pskill4 = 5, + [pbr::OriginalName("PSkill5")] Pskill5 = 6, + } + + public enum ActiveSkillType { + [pbr::OriginalName("NullActiveSkillType")] NullActiveSkillType = 0, + [pbr::OriginalName("BecomeVampire")] BecomeVampire = 1, + [pbr::OriginalName("BecomeAssassin")] BecomeAssassin = 2, + [pbr::OriginalName("NuclearWeapon")] NuclearWeapon = 3, + [pbr::OriginalName("SuperFast")] SuperFast = 4, + [pbr::OriginalName("ASkill4")] Askill4 = 5, + [pbr::OriginalName("ASkill5")] Askill5 = 6, + } + + public enum BuffType { + [pbr::OriginalName("NullBuffType")] NullBuffType = 0, + [pbr::OriginalName("MoveSpeed")] MoveSpeed = 1, + [pbr::OriginalName("AP")] Ap = 2, + [pbr::OriginalName("CD")] Cd = 3, + [pbr::OriginalName("AddLIFE")] AddLife = 4, + [pbr::OriginalName("ShieldBuff")] ShieldBuff = 5, + [pbr::OriginalName("SpearBuff")] SpearBuff = 6, + } + + public enum BulletType { + [pbr::OriginalName("NullBulletType")] NullBulletType = 0, + /// + /// ... + /// ... + /// ... + /// + [pbr::OriginalName("AtomBomb")] AtomBomb = 1, } #endregion diff --git a/communication/README.md b/communication/README.md index 1f59343d..dadb0bde 100644 --- a/communication/README.md +++ b/communication/README.md @@ -33,22 +33,18 @@ C# 通信组件 ## 一些想法 -* 既然决意要去掉Agent,暂时应该做以下调整: +1. 命令行参数的问题基本已经解决,即使有,到时候只要与逻辑组稍加协商后就可改动,问题应该不大。 - 1. Agent的绝大多数功能都要迁移到Server中。在THUAI4中,endpoint和port都需要在Agent中指定,而现在需要将这一功能迁移到Server中。因此需要在Server中添加对命令行参数的处理。 +2. 关于ServerCommunication:现在可以发送的类有:MessageToInitialize,MessageToOperate,MessageToRefresh,MessageToOneClient。MessageToAddInstance和MessageToDestroyInstance已经嵌套在了MessageToOperate中,故不需要单独发送(而这两个类又嵌套了MessageOfProp和MessageOfBullet,更不需要单独发送了)。 - 但这就又涉及到了一个问题:需不需要做Commandline Tool。在THUAI4的Agent中,由于Agent.cs是一个Program,可以直接用`CommandLineUtils`做一个命令行工具,但THUAI5的ServerCommunication是一个dll,不能直接按Commandline Tool的思路去做。 +3. 关于ServerTest:本来我想写得更细化一些,模拟一次完整的游戏过程,但考虑到我不太懂游戏逻辑,部分细节不明确,只好作罢( - 但其实也不怎么影响使用,只不过用户体验感会差一些。 - - 2. 使用Server时,命令行参数(包括端口号和IP)应该如何指定?难道在Server test里加吗? - - 3. 如何实现所有client全部关闭时server也自动关闭? - -* 再次梳理以下THUAI4和THUAI5中的端口分配 +4. 关于“如何降低proto文件和server的耦合关系”,我想做以下几点说明: - 1. THUAI4:Client不需要手动指定端口,直连`"127.0.0.1", 7777`即可。因为Client直连Agent,Agent一定在本机上,而Agent默认的侦听端口是7777。虽然THUAI4中可以在命令行中设置侦听端口,但改成7777以外的值会出现“Agent start unsuccessfully”。Agent需要指定`-s -p`,`-s`除了指定IP地址外,还需要指定目标机的侦听端口(默认是8888)。而Server也是默认侦听8888。`-p`则是Agent的侦听端口。 - 2. THUAI5:从THUAI4的设计上看,似乎没有解决端口占用的问题??(也可能是我太菜没看出来),因此THUAI5暂时..放过这个问题。但远程IP地址的指定还是必须的。所以client的命令行参数还要再多一个IP地址... + * Message.cs中的枚举值PacketType是必须要根据protobuf文件改动的,这个确实没有更好的解决办法。 + * ServerCommunication.cs中的若干个重载函数,理论上可以都可以用一个IMessage接口实现,但考虑到发送的信息本身与逻辑息息相关,需要在终端输出不同的success、warning、error等提示信息,所以只好多一个类就多写一个重载。 + + proto和server不能完全解耦,但改动思路还是比较简单的。 ## 开发人员 diff --git a/communication/ServerCommunication/ServerCommunication.cs b/communication/ServerCommunication/ServerCommunication.cs index 46a37366..b24b0037 100644 --- a/communication/ServerCommunication/ServerCommunication.cs +++ b/communication/ServerCommunication/ServerCommunication.cs @@ -13,7 +13,8 @@ namespace Communication.ServerCommunication public sealed class ServerCommunication:IDisposable // 提供释放资源的接口 { - private static readonly ConcurrentDictionary dict = new ConcurrentDictionary(); // 储存当前所有玩家的信息 + private static readonly ConcurrentDictionary playerDict = new ConcurrentDictionary(); // 储存当前所有玩家的id + private static readonly ConcurrentDictionary instanceDict = new ConcurrentDictionary(); // 储存所有的子弹和道具信息 private static AutoResetEvent allConnectionClosed = new AutoResetEvent(false); // 是否所有玩家都已经断开了连接 private BlockingCollection msgQueue; // 储存信息的线程安全队列 @@ -47,12 +48,12 @@ public ServerCommunication(string endpoint = "127.0.0.1") MessageToServer m2s = message.Content as MessageToServer; ulong key = ((ulong)m2s.PlayerID | (ulong)m2s.TeamID << 32); - if (dict.ContainsKey(key)) + if (playerDict.ContainsKey(key)) { Console.WriteLine($"More than one client claims to have the same ID {m2s.TeamID} {m2s.PlayerID}. And this client won't be able to receive message from server."); // 这种情况可以强制退出游戏吗... return HandleResult.Error; } - dict.TryAdd(key, connId); // 此处有多次发送的问题 + playerDict.TryAdd(key, connId); // 此处有多次发送的问题 try { msgQueue.Add(message); @@ -68,11 +69,11 @@ public ServerCommunication(string endpoint = "127.0.0.1") // 有玩家退出时的操作(不知道这个原先在Agent中的功能迁移到Server中是否还有必要) server.OnClose += delegate (IServer sender, IntPtr connId, SocketOperation socketOperation, int errorCode) { - foreach(ulong id in dict.Keys) + foreach(ulong id in playerDict.Keys) { - if (dict[id] == connId) + if (playerDict[id] == connId) { - if (!dict.TryRemove(id, out IntPtr temp)) + if (!playerDict.TryRemove(id, out IntPtr temp)) { return HandleResult.Error; } @@ -83,7 +84,7 @@ public ServerCommunication(string endpoint = "127.0.0.1") } // 虽然有着重复队伍名称和玩家编号的client确实收不到信息,但还是会连在server上,这里的ConnectionCount也有谜之bug... Console.WriteLine($"Now the connect number is { server.ConnectionCount }"); - if (dict.IsEmpty) + if (playerDict.IsEmpty) { allConnectionClosed.Set(); } @@ -109,25 +110,15 @@ public bool Listen(ushort port = 7777) return isListenning; } - /// - /// 发送全局信息 - /// - public void SendToClient(MessageToClient m2c) - { - // 构造信息 - Message message = new Message(); - message.Content = m2c; - message.PacketType = PacketType.MessageToClient; - - byte[] bytes; - message.Serialize(out bytes); // 生成字节流 - SendOperation(bytes); - } + // 以下提供了"向client发送信息"的多个重载函数,针对性更强,可根据逻辑需求任意使用 + // 当然,以下代码可能有一些不精简的地方,以后可能会稍作改动 + // 我的见解是这样的:server中的SendToClient应该不需要指定oneof中的内容(应该是在游戏逻辑中指定,指定完毕以后就没有另一种选项的存储空间了),实际上server只需要做两件事情:1.发送信息 2.视情况适时报出警告或错误 + // 此处需要说明一下protobuf中的oneof语法在C#中的使用:proto编译生成的cs文件会自动生成一个枚举值(除了oneof中的不同类型还有一个None),以供使用者随时判断 /// /// 发送单人信息 /// - /// + /// 要发送的单播信息 /// public void SendToClient(MessageToOneClient m21c) { @@ -136,10 +127,13 @@ public void SendToClient(MessageToOneClient m21c) message.PacketType = PacketType.MessageToOneClient; // 判断对应的玩家编号是否存在,不存在就报错 + // 关于这里为什么要使用ulong? ulong key = ((ulong)m21c.PlayerID | ((ulong)m21c.TeamID << 32)); - if (!dict.ContainsKey(key)) + if (!playerDict.ContainsKey(key)) { Console.WriteLine($"Error: No such player corresponding to ID {m21c.TeamID} {m21c.PlayerID}"); + // 这里需不需要return?? + return; } byte[] bytes; message.Serialize(out bytes); // 生成字节流 @@ -147,9 +141,115 @@ public void SendToClient(MessageToOneClient m21c) } /// - /// 上面那两个函数只是给用户调用发送的接口,这里才是真正的发送操作 + /// 需要发送的初始化信息 + /// + /// 初始化信息 + public void SendToClient(MessageToInitialize m2i) + { + Message message = new Message(); + message.Content = m2i; + message.PacketType = PacketType.MessageToInitialize; + + // 初始化应该不需要加太多判断的信息,即使加也应该在逻辑内容中加,所以我就直接发送了... + byte[] bytes; + message.Serialize(out bytes); + SendOperation(bytes); + } + + /// + /// 当MessageToOperate被指定为"AddInstance"时,server所需要进行的判断和终端显示操作(注意这是个private函数,没有必要暴露给玩家) /// - /// + /// 操作信息 + private void OperationOfAddInstance(ref MessageToOperate m2o) + { + var m2a = m2o.MessageToAddInstance; + int key = m2a.Guid; + if (instanceDict.ContainsKey(key)) + { + Console.WriteLine($"Repeated construction with guid:{key} and type:{m2a.MessageOfInstanceCase}"); + return; + } + switch (m2a.MessageOfInstanceCase) + { + case MessageToAddInstance.MessageOfInstanceOneofCase.MessageOfBullet: + instanceDict.TryAdd(m2a.Guid, GameObjType.Bullet); + break; + case MessageToAddInstance.MessageOfInstanceOneofCase.MessageOfProp: + instanceDict.TryAdd(m2a.Guid, GameObjType.Prop); + break; + default: // 此时的枚举类型为MessageToAddInstance.MessageOfInstanceOneofCase.None,也就是说,此时的oneof信息没有被成功指定 + Console.WriteLine("Instance type hasn't been assigned"); + return; + } + } + + /// + /// 当MessageToOperate被指定为"DestroyInstance"时,server所需要进行的判断和终端显示操作(注意这是个private函数,没有必要暴露给玩家) + /// + /// 操作信息 + private void OperationOfDestroyInstance(ref MessageToOperate m2o) + { + var m2d = m2o.MessageToDestroyInstance; + foreach (int id in instanceDict.Keys) + { + if (id == m2d.Guid) + { + instanceDict.TryRemove(id, out GameObjType tmp); + Console.WriteLine($"Instance with guid:{id} and type:{tmp} has been destroyed."); + return; + } + } + Console.WriteLine($"No instance with guid:{m2d.Guid}"); + } + + /// + /// 需要发送的操作信息(需要调用前述的两个private函数进行信息的进一步判断与显示) + /// + /// 操作信息 + public void SendToClient(MessageToOperate m2o) + { + Message message = new Message(); + message.Content = m2o; + message.PacketType = PacketType.MessageToOperate; + + switch (m2o.MessageOfOperationCase) + { + case MessageToOperate.MessageOfOperationOneofCase.MessageToAddInstance: + OperationOfAddInstance(ref m2o); + break; + case MessageToOperate.MessageOfOperationOneofCase.MessageToDestroyInstance: + OperationOfDestroyInstance(ref m2o); + break; + default: + Console.WriteLine("Operation type hasn't been assigned"); + return; + } + + byte[] bytes; + message.Serialize(out bytes); + SendOperation(bytes); + } + + /// + /// 需要发送的更新信息 + /// + /// 更新信息 + public void SendToClient(MessageToRefresh m2r) + { + Message message = new Message(); + message.Content = m2r; + message.PacketType = PacketType.MessageToRefresh; + + byte[] bytes; + message.Serialize(out bytes); + SendOperation(bytes); + } + + + /// + /// 上面的多个函数只是给用户调用发送的接口,这里才是真正的发送操作 + /// + /// 由对象信息转化而来的字节流 private void SendOperation(byte[] bytes) { List IDs = server.GetAllConnectionIds(); @@ -166,8 +266,8 @@ private void SendOperation(byte[] bytes) /// /// 以引用形式返回信息 /// - /// - /// + /// 需要使用的单条信息 + /// 是否提取成功 public bool TryTake(out IGameMessage msg) { try @@ -185,7 +285,7 @@ public bool TryTake(out IGameMessage msg) /// /// 以返回值形式返回信息 /// - /// + /// 返回的信息 public IGameMessage Take() { try diff --git a/communication/ServerTest/Program.cs b/communication/ServerTest/Program.cs index 87efc188..1994490a 100644 --- a/communication/ServerTest/Program.cs +++ b/communication/ServerTest/Program.cs @@ -60,15 +60,69 @@ static void Main(string[] args) Console.ReadLine(); // 一般游戏指令 - server.SendToClient(BasicMessage(0, MessageType.StartGame)); + // 1.初始化信息,包括:地图形状、玩家数和每个玩家的属性 + MessageToInitialize m2i = new MessageToInitialize(); + m2i.MapSerial = 2; + m2i.NumberOfValidPlayer = 2; + // 比较麻烦的一个操作:构造每一个人物的属性 + BasicalCharacterProperty p1 = new BasicalCharacterProperty(); + BasicalCharacterProperty p2 = new BasicalCharacterProperty(); + p1.Guid = 1; + p1.ActiveSkillType = 1; + p1.PassiveSkillType = 1; + + p2.Guid = 2; + p2.ActiveSkillType = 2; + p2.PassiveSkillType = 2; + + m2i.Property.Add(p1); + m2i.Property.Add(p2); + server.SendToClient(m2i); Console.WriteLine("StartGame"); Console.ReadLine(); - server.SendToClient(BasicMessage(0, MessageType.Gaming)); - Console.WriteLine("Gaming"); + // 2.操作指令 + // 添加子弹属性 + MessageToOperate m2o = new MessageToOperate(); + // ??不太理解operateKind是做什么的 + m2o.OperateKind = true; + m2o.MessageToAddInstance = new MessageToAddInstance(); + m2o.MessageToAddInstance.InstanceType = GameObjType.Bullet; + m2o.MessageToAddInstance.Guid = 200; // 这个是我随便写的,后续GUID的协议还是要交给逻辑组决定吧 + m2o.MessageToAddInstance.MessageOfBullet = new MessageOfBullet(); + m2o.MessageToAddInstance.MessageOfBullet.Type = BulletType.AtomBomb; + m2o.MessageToAddInstance.MessageOfBullet.BulletAP = 200; + m2o.MessageToAddInstance.MessageOfBullet.BoomRange = 20; + server.SendToClient(m2o); + Console.WriteLine("Add a bullet"); + Console.ReadLine(); + + // 3.刷新指令 + // 更新人物属性 + MessageToRefresh m2r0 = new MessageToRefresh(); + m2r0.GameObjType = GameObjType.Character; + m2r0.MessageOfCharacter = new ChangeableCharacterProperty(); + m2r0.MessageOfCharacter.AttackRange = 1; + m2r0.MessageOfCharacter.Buff = BuffType.AddLife; + m2r0.MessageOfCharacter.BulletNum = 10; + m2r0.MessageOfCharacter.GemNum = 5; + m2r0.MessageOfCharacter.Life = 2; + m2r0.MessageOfCharacter.X = 500; + m2r0.MessageOfCharacter.Y = 500; + server.SendToClient(m2r0); + Console.WriteLine("Set changeable character property"); + Console.ReadLine(); + // 更新子弹属性 + MessageToRefresh m2r = new MessageToRefresh(); + m2r.GameObjType = GameObjType.Bullet; + m2r.MessageOfBullet = new MessageOfBullet(); + m2r.MessageOfBullet.BulletAP = 100; + m2r.MessageOfBullet.BoomRange = 10; + server.SendToClient(m2r); + Console.WriteLine("Change a bullet"); Console.ReadLine(); - // 单播测试 + // 4.单播测试 m21c = new MessageToOneClient(); m21c.Guid = 100; m21c.PlayerID = 0; @@ -77,66 +131,71 @@ static void Main(string[] args) m21c.Message = "Hey! this is a message from server!"; server.SendToClient(m21c); Console.WriteLine("send a message to one client."); + Console.ReadLine(); - // 结束游戏 - server.SendToClient(BasicMessage(666, MessageType.EndGame)); + // 5.结束游戏 + m21c.Guid = 1; + m21c.PlayerID = 0; + m21c.TeamID = 0; + m21c.MessageType = MessageType.EndGame; + server.SendToClient(m21c); Console.WriteLine("GameOver"); Console.ReadLine(); server.Dispose(); server.Stop(); } - static private MessageToClient BasicMessage(long guid, MessageType msgType) - { - // 地图信息记录(这里暂时没有好的测试对象) + //static private MessageToClient BasicMessage(long guid, MessageType msgType) + //{ + // // 地图信息记录(这里暂时没有好的测试对象) - // GUID信息记录(注意是以“组”加入GUID的) - // 把RepeatedField看成STL中的vector即可 - RepeatedField playerGUIDs = new RepeatedField(); - for(int x = 0; x < 2; x++) - { - playerGUIDs.Add(new MessageToClient.Types.OneTeamGUIDs()); - for(int y = 0; y < 4; y++) - { - playerGUIDs[x].TeammateGUIDs.Add(x * 100 + y); - } - } + // // GUID信息记录(注意是以“组”加入GUID的) + // // 把RepeatedField看成STL中的vector即可 + // RepeatedField playerGUIDs = new RepeatedField(); + // for(int x = 0; x < 2; x++) + // { + // playerGUIDs.Add(new MessageToClient.Types.OneTeamGUIDs()); + // for(int y = 0; y < 4; y++) + // { + // playerGUIDs[x].TeammateGUIDs.Add(x * 100 + y); + // } + // } - // 玩家初始属性构造 - MessageToClient msg = new MessageToClient(); - msg.PlayerID = 0; - msg.TeamID = 0; - msg.MessageType = msgType; - msg.SelfInfo = new GameObjInfo(); - msg.SelfInfo.ASkill1 = ActiveSkillType.Askill0; - msg.SelfInfo.ASkill2 = ActiveSkillType.Askill1; - msg.SelfInfo.Bap = 100; - msg.SelfInfo.BoomRange = 20; - msg.SelfInfo.BulletNum = 12; - msg.SelfInfo.CanMove = true; - msg.SelfInfo.CD = 5; - msg.SelfInfo.FacingDirection = 0.0; - msg.SelfInfo.GameObjType = GameObjType.Character; - msg.SelfInfo.Hp = 1000; - msg.SelfInfo.Guid = guid; - msg.SelfInfo.IsDying = false; - msg.SelfInfo.IsMoving = true; - msg.SelfInfo.LifeNum = 10; - msg.SelfInfo.MaxBulletNum = 50; - msg.SelfInfo.MaxHp = 2500; - msg.SelfInfo.MoveSpeed = 10; - msg.SelfInfo.PropType = PropType.Null; - msg.SelfInfo.Radius = 250; - msg.SelfInfo.ShapeType = ShapeType.Circle; - msg.SelfInfo.TeamID = 0; - msg.SelfInfo.X = 5000; - msg.SelfInfo.Y = 5000; - - msg.SelfInfo.IsLaid = true; - msg.SelfInfo.Place = PlaceType.Ground; - msg.SelfInfo.PSkill = PassiveSkillType.Pskill0; - - return msg; - } + // // 玩家初始属性构造 + // MessageToClient msg = new MessageToClient(); + // msg.PlayerID = 0; + // msg.TeamID = 0; + // msg.MessageType = msgType; + // msg.SelfInfo = new GameObjInfo(); + // msg.SelfInfo.ASkill1 = ActiveSkillType.Askill0; + // msg.SelfInfo.ASkill2 = ActiveSkillType.Askill1; + // msg.SelfInfo.Bap = 100; + // msg.SelfInfo.BoomRange = 20; + // msg.SelfInfo.BulletNum = 12; + // msg.SelfInfo.CanMove = true; + // msg.SelfInfo.CD = 5; + // msg.SelfInfo.FacingDirection = 0.0; + // msg.SelfInfo.GameObjType = GameObjType.Character; + // msg.SelfInfo.Hp = 1000; + // msg.SelfInfo.Guid = guid; + // msg.SelfInfo.IsDying = false; + // msg.SelfInfo.IsMoving = true; + // msg.SelfInfo.LifeNum = 10; + // msg.SelfInfo.MaxBulletNum = 50; + // msg.SelfInfo.MaxHp = 2500; + // msg.SelfInfo.MoveSpeed = 10; + // msg.SelfInfo.PropType = PropType.Null; + // msg.SelfInfo.Radius = 250; + // msg.SelfInfo.ShapeType = ShapeType.Circle; + // msg.SelfInfo.TeamID = 0; + // msg.SelfInfo.X = 5000; + // msg.SelfInfo.Y = 5000; + + // msg.SelfInfo.IsLaid = true; + // msg.SelfInfo.Place = PlaceType.Ground; + // msg.SelfInfo.PSkill = PassiveSkillType.Pskill0; + + // return msg; + //} } } diff --git a/dependency/proto/README.md b/dependency/proto/README.md index 7fe6ffbf..659a872d 100644 --- a/dependency/proto/README.md +++ b/dependency/proto/README.md @@ -2,3 +2,8 @@ Protobuf 源代码文件 +## 简要说明 + +我不清楚这是否是逻辑组原本的意思,但为了我能在开发时不会被绕晕,我还是简单总结一下改动吧。 +1. Message2Clients中原本有一些关于GameObj的枚举,现在全部移到了MessageType中。 +2. MessageToClient类被取消,取而代之的是更加具体的,代表各种GameObj的Message。 \ No newline at end of file diff --git a/dependency/proto/generate_cs.cmd b/dependency/proto/generate_cs.cmd new file mode 100644 index 00000000..83c50c6a --- /dev/null +++ b/dependency/proto/generate_cs.cmd @@ -0,0 +1,3 @@ +protoc --csharp_out=. Message2Clients.proto +protoc --csharp_out=. Message2Server.proto +protoc --csharp_out=. MessageType.proto