当前位置: 首页>>代码示例>>C#>>正文


C# Reader.ReadInt32方法代码示例

本文整理汇总了C#中Reader.ReadInt32方法的典型用法代码示例。如果您正苦于以下问题:C# Reader.ReadInt32方法的具体用法?C# Reader.ReadInt32怎么用?C# Reader.ReadInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reader的用法示例。


在下文中一共展示了Reader.ReadInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			SessionId = reader.ReadInt32();
			Protocol = reader.ReadInt32();
			EncKey = reader.ReadBytes(128);

			//got the encoded key in enckey
			// step 4 : xor last 0x40 bytes with  first 0x40 bytes
			for (int i = 0; i < 0x40; i++)
				EncKey[0x40 + i] = (byte)(EncKey[0x40 + i] ^ EncKey[i]);

			// step 3 : xor bytes 0x0d-0x10 with bytes 0x34-0x38
			for (int i = 0; i < 4; i++)
				EncKey[0x0d + i] = (byte)(EncKey[0x0d + i] ^ EncKey[0x34 + i]);

			// step 2 : xor first 0x40 bytes with  last 0x40 bytes 
			for (int i = 0; i < 0x40; i++)
				EncKey[i] = (byte)(EncKey[i] ^ EncKey[0x40 + i]);

			// step 1 : 0x4d-0x50 <-> 0x00-0x04
			for (int i = 0; i < 4; i++)
			{
				byte temp = EncKey[i];
				EncKey[i] = EncKey[0x4d + i];
				EncKey[0x4d + i] = temp;
			}
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:30,代码来源:Init.cs

示例2: Deserialise

        public void Deserialise(Reader In)
        {
            Bookings = new List<Booking>(In.ReadInt32());
            for (int x = 0; x < Bookings.Capacity; x++)
                Bookings.Add(DataModel.DeserialiseExternal<Booking>(In));

            Departments = new List<Department>(In.ReadInt32());
            for (int x = 0; x < Departments.Capacity; x++)
                Departments.Add(DataModel.DeserialiseExternal<Department>(In));

            Periods = new List<TimeSlot>(In.ReadInt32());
            for (int x = 0; x < Periods.Capacity; x++)
                Periods.Add(DataModel.DeserialiseExternal<TimeSlot>(In));

            Rooms = new List<Room>(In.ReadInt32());
            for (int x = 0; x < Rooms.Capacity; x++)
                Rooms.Add(DataModel.DeserialiseExternal<Room>(In));

            Users = new List<User>(In.ReadInt32());
            for (int x = 0; x < Users.Capacity; x++)
                Users.Add(DataModel.DeserialiseExternal<User>(In));

            Subjects = new List<Subject>(In.ReadInt32());
            for (int x = 0; x < Subjects.Capacity; x++)
                Subjects.Add(DataModel.DeserialiseExternal<Subject>(In));

            Classes = new List<Class>(In.ReadInt32());
            for (int x = 0; x < Classes.Capacity; x++)
                Classes.Add(DataModel.DeserialiseExternal<Class>(In));
        }
开发者ID:hnefatl,项目名称:Prototype1,代码行数:30,代码来源:DataSnapshot.cs

示例3: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ObjectId = reader.ReadInt32();
			reader.ReadInt32();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:8,代码来源:DeleteObject.cs

示例4: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ObjectId = reader.ReadInt32();
			Action = (Lineage.SocialAction)reader.ReadInt32();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:8,代码来源:SocialAction.cs

示例5: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			CrestId = reader.ReadInt32();
			Content = reader.ReadBytes(reader.ReadInt32());
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:8,代码来源:AllyCrest.cs

示例6: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ObjectId = reader.ReadInt32();
			Type = (Lineage.Channel)reader.ReadInt32();
			Author = reader.ReadString(Encoding.Unicode);
			Message = reader.ReadString(Encoding.Unicode);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:10,代码来源:CreatureSay.cs

示例7: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ObjectId = reader.ReadInt32();
			Position = new Library.Point(
				reader.ReadInt32(),
				reader.ReadInt32(),
				reader.ReadInt32()
			);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:12,代码来源:TeleportToLocation.cs

示例8: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			ObjectId = reader.ReadInt32();
			Attributes = new KeyValuePair<Int32, Int32>[reader.ReadInt32()];
			for (int i = 0; i < Attributes.Length; i++)
				Attributes[i] = new KeyValuePair<Int32, Int32>(
					reader.ReadInt32(),	
					reader.ReadInt32()
				);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:13,代码来源:StatusUpdate.cs

示例9: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			MessageId = reader.ReadInt32();

			int count = reader.ReadInt32();
			Arguments = new KeyValuePair<type, object>[count];
			for (int i = 0; i < count; i++)
			{
				var key = (type)reader.ReadInt32();
				object value = null;
				switch (key)
				{
					case type.Text:
						value = reader.ReadString(Encoding.Unicode);
						break;
					case type.Number:
						value = reader.ReadInt32();
						break;
					case type.NpcName:
						value = reader.ReadInt32();
						break;
					case type.ItemName:
						value = reader.ReadInt32();
						break;
					case type.SkillName:
						value = reader.ReadInt32();
						reader.ReadInt32(); //there are 4 more bytes after this... the skill level by chance?
						break;
				}
				Arguments[i] = new KeyValuePair<type, object>(key, value);
			}
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:35,代码来源:SystemMessage.cs

示例10: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));
			
			reader.ReadByte(); // Id
			AttackerId = reader.ReadInt32();

			Hit hit = new Hit()
			{
				TargetId = reader.ReadInt32(),
				Damage = reader.ReadInt32(),
				Flags = reader.ReadByte()
			};

			Position = new Library.Point(
				reader.ReadInt32(),
				reader.ReadInt32(),
				reader.ReadInt32()
			);

			int count = reader.ReadInt16();
			Hits = new Hit[count + 1];
			Hits[0] = hit;
			for (int i = 1; i < Hits.Length; i++)
				Hits[i] = new Hit()
				{
					TargetId = reader.ReadInt32(),
					Damage = reader.ReadInt32(),
					Flags = reader.ReadByte()
				};
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:31,代码来源:Attack.cs

示例11: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id

			int Count = reader.ReadInt32();
			List = new List<SkillItem>(Count);
			for (int i = 0; i < Count; i++)
				List.Add(new SkillItem()
				{
					Active = !(reader.ReadInt32() != 0),
					Level = reader.ReadInt32(),
					Id = reader.ReadInt32()
				});
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:16,代码来源:SkillList.cs

示例12: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			int Count = reader.ReadByte();
			reader.ReadByte(); // ?

			List = new List<Model.GameServer>(Count);
			for (int i = 0; i < Count; i++)
				List.Add(new Model.GameServer()
				{
					Id = reader.ReadByte(),
					Address = string.Format("{0}.{1}.{2}.{3}", // ToDo: replace to native
						reader.ReadByte().ToString(),
						reader.ReadByte().ToString(),
						reader.ReadByte().ToString(),
						reader.ReadByte().ToString()),
					Port = reader.ReadInt32(),
					Age = reader.ReadByte(),
					PvP = reader.ReadByte() != 0,
					Online = reader.ReadInt16(),
					Maximum = reader.ReadInt16(),
					State = reader.ReadByte() != 0,
					Poop = string.Format("{0}-{1}-{2}-{3}-{4}", // ToDo: What is?
						reader.ReadByte().ToString("X2"),
						reader.ReadByte().ToString("X2"),
						reader.ReadByte().ToString("X2"),
						reader.ReadByte().ToString("X2"),
						reader.ReadByte().ToString("X2"))
				});
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:32,代码来源:GameServerList.cs

示例13: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			LeaderName = reader.ReadString(Encoding.Unicode);
			PartyLoot = (Lineage.PartyLoot)reader.ReadInt32();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:8,代码来源:AskJoinParty.cs

示例14: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			Members = new Member[reader.ReadInt32()];
			for (int i = 0; i < Members.Length; i++)
				Members[i] = new Member()
				{
					ObjectId = reader.ReadInt32(),
					Position = new Library.Point(
						reader.ReadInt32(),
						reader.ReadInt32(),
						reader.ReadInt32()
					)
				};
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:17,代码来源:PartyMemberPosition.cs

示例15: Parse

		public override void Parse(byte[] buffer)
		{
			Reader reader = new Reader(new MemoryStream(buffer));

			reader.ReadByte(); // Id
			MessageId = reader.ReadInt32();
			Content = reader.ReadString(Encoding.Unicode);
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:8,代码来源:NpcHtmlMessage.cs


注:本文中的Reader.ReadInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。