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


C# RealmPacketIn.ReadUInt32方法代码示例

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


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

示例1: HandleCreateTicketPacket

		public static void HandleCreateTicketPacket(IRealmClient client, RealmPacketIn packet)
		{
			var chr = client.ActiveCharacter;
			if (chr.Ticket == null)
			{
				var map = (MapId)packet.ReadUInt32();
				var x = packet.ReadFloat();
				var y = packet.ReadFloat();
				var z = packet.ReadFloat();
				var msg = packet.ReadCString();
				var type = (TicketType)packet.ReadUInt32(); // prev. unk0

				var unk1 = packet.ReadByte(); // unk1, 1
				var unk2 = packet.ReadUInt32(); // unk2, 0
				var unk3 = packet.ReadUInt32(); // unk3, 0

				var ticket = new Ticket(chr, msg, type);

				TicketMgr.Instance.AddTicket(ticket);
				chr.Ticket = ticket;
				SendCreateResponse(client, TicketInfoResponse.Saved);
			}
			else
			{
				SendCreateResponse(client, TicketInfoResponse.Fail);
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:27,代码来源:TicketHandler.cs

示例2: HandleGossipSelectOption

		public static void HandleGossipSelectOption(IRealmClient client, RealmPacketIn packet)
		{
			var targetEntityId = packet.ReadEntityId();
			var unknown = packet.ReadUInt32();				// usually Zero, sometimes in the thousands for quest givers, Same as the first int sent in SMSG_GOSSIP_MESSAGE
			var selectedOption = packet.ReadUInt32();

		    string extra = string.Empty;
			if (packet.Position < packet.Length)
			{
				extra = packet.ReadCString();
			}

			var chr = client.ActiveCharacter;
			var worldObject = chr.Region.GetObject(targetEntityId);

			if (worldObject == null)
				return;

			var conversation = chr.GossipConversation;

			if (conversation == null || conversation.Speaker != worldObject)
				return;

			conversation.HandleSelectedItem(selectedOption, extra);
		}
开发者ID:pallmall,项目名称:WCell,代码行数:25,代码来源:GossipHandler.cs

示例3: HandleJoin

		public static void HandleJoin(IRealmClient client, RealmPacketIn packet)
		{
			var roles = packet.ReadUInt32();
			packet.SkipBytes(2);

			var dungeonsCount = packet.ReadByte();
			if (dungeonsCount == 0)
				return;

			for (byte i = 0; i < dungeonsCount; ++i)
			{
				// dungeons id/type
				var packedDungeon = packet.ReadUInt32(); 
				var id = packedDungeon & 0x00FFFFFF;
				var type = packedDungeon & 0xFF000000;
			}

			byte counter2 = packet.ReadByte();
			packet.SkipBytes(counter2); // lua: GetLFGInfoLocal

			string comment = packet.ReadCString();

			//SendLfgJoinResult();
			//SendLfgUpdate();
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:25,代码来源:LFGHandler.cs

示例4: HandleReportLagTicket

		public static void HandleReportLagTicket(IRealmClient client, RealmPacketIn packet)
		{
			var type = (TicketReportLagType)packet.ReadUInt32();
			var unk0 = packet.ReadUInt32(); // Seems to be always 0
			var posX = packet.ReadFloat();
			var posY = packet.ReadFloat();
			var posZ = packet.ReadFloat();
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:TicketHandler.cs

示例5: HandleQuestPOIQuery

 public static void HandleQuestPOIQuery(IRealmClient client, RealmPacketIn packet)
 {
     uint count = packet.ReadUInt32();
     var questIds = new List<uint>();
     for (var i = 0; i < count; i++)
         questIds.Add(packet.ReadUInt32());
     SendQuestPOIResponse(client, count, questIds);
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:8,代码来源:QuestHandler.cs

示例6: HandleAuctionPlaceBid

		public static void HandleAuctionPlaceBid(IRealmClient client, RealmPacketIn packet)
		{
			var chr = client.ActiveCharacter;
			var auctioneerId = packet.ReadEntityId();
			var auctionId = packet.ReadUInt32();
			var bid = packet.ReadUInt32();

			var auctioneer = chr.Map.GetObject(auctioneerId) as NPC;
			AuctionMgr.Instance.AuctionPlaceBid(chr, auctioneer, auctionId, bid);
		}
开发者ID:Zerant,项目名称:WCell,代码行数:10,代码来源:AuctionHandler.cs

示例7: HandleAuctionSellItem

		public static void HandleAuctionSellItem(IRealmClient client, RealmPacketIn packet)
		{
			var chr = client.ActiveCharacter;
			var auctioneerId = packet.ReadEntityId();
			var itemId = packet.ReadEntityId();
			var bid = packet.ReadUInt32();
			var buyout = packet.ReadUInt32();
			var time = packet.ReadUInt32();

			var auctioneer = chr.Region.GetObject(auctioneerId) as NPC;
			AuctionMgr.Instance.AuctionSellItem(chr, auctioneer, itemId, bid, buyout, time);
		}
开发者ID:pallmall,项目名称:WCell,代码行数:12,代码来源:AuctionHandler.cs

示例8: HandleTaxiActivate

		public static void HandleTaxiActivate(IRealmClient client, RealmPacketIn packet)
		{
			var vendorId = packet.ReadEntityId();
			var from = packet.ReadUInt32();
			var to = packet.ReadUInt32();

			var vendor = client.ActiveCharacter.Region.GetObject(vendorId) as NPC;

			var destinations = new PathNode[2];
			destinations[0] = TaxiMgr.PathNodesById.Get(from);
			destinations[1] = TaxiMgr.PathNodesById.Get(to);
			TaxiMgr.TryFly(client.ActiveCharacter, vendor, destinations);
		}
开发者ID:pallmall,项目名称:WCell,代码行数:13,代码来源:TaxiHandler.cs

示例9: HandleWorldTeleport

        public static void HandleWorldTeleport(IRealmClient client, RealmPacketIn packet)
        {
            uint time = packet.ReadUInt32();
			MapId mapId = (MapId)packet.ReadUInt32();

			var pos = packet.ReadVector3();
            float orientation = packet.ReadFloat(); // in client specified as degrees

			var region = World.GetRegion(mapId);
			if (region != null)
			{
				client.ActiveCharacter.TeleportTo(region, ref pos);
			}
        }
开发者ID:pallmall,项目名称:WCell,代码行数:14,代码来源:ClientConsoleCommands.cs

示例10: HandleBattlemasterJoin

        public static void HandleBattlemasterJoin(IRealmClient client, RealmPacketIn packet)
        {
            var battlemasterGuid = packet.ReadEntityId();
			var bgId = (BattlegroundId)packet.ReadUInt32();
            var instanceId = packet.ReadUInt32();
            var asGroup = packet.ReadBoolean();

			// check to make sure bg id was valid
			if (bgId <= BattlegroundId.None || bgId >= BattlegroundId.End)
				return;

            var chr = client.ActiveCharacter;

			BattlegroundMgr.EnqueuePlayers(chr, bgId, instanceId, asGroup);
        }
开发者ID:ray2006,项目名称:WCell,代码行数:15,代码来源:BattlegroundHandler.cs

示例11: HandleTaxiActivateFar

        public static void HandleTaxiActivateFar(IRealmClient client, RealmPacketIn packet)
        {
            var vendorId = packet.ReadEntityId();
            //var totalCost = packet.ReadUInt32(); // removed, 3.2.2
            var numNodes = packet.ReadUInt32();

            var destinations = new PathNode[numNodes];
            for (int i = 0; i < numNodes; ++i)
            {
                destinations[i] = TaxiMgr.PathNodesById.Get(packet.ReadUInt32());
            }

            var vendor = client.ActiveCharacter.Map.GetObject(vendorId) as NPC;
            TaxiMgr.TryFly(client.ActiveCharacter, vendor, destinations);
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:15,代码来源:TaxiHandler.cs

示例12: HandleSendMail

        public static void HandleSendMail(IRealmClient client, RealmPacketIn packet)
        {
            var chr = client.ActiveCharacter;

            var mailboxId = packet.ReadEntityId();

            if (!CheckMailBox(chr, chr.Map.GetObject(mailboxId) as GameObject))
            {
                return;
            }

            var recipientName = packet.ReadCString();
            var subject = packet.ReadCString();
            var msg = packet.ReadCString();

            var stationary = (MailStationary)Enum.ToObject(typeof(MailStationary), packet.ReadUInt32());
            var unkowwn1 = packet.ReadUInt32();			// 4 unknown bytes

            var itemCount = packet.ReadByte();
            if (itemCount > MailMgr.MaxItemsPerMail)
                return;

            var items = new List<Item>(itemCount);
            for (var i = 0; i < itemCount; i++)
            {
                var slot = packet.ReadByte();
                var itemId = packet.ReadEntityId();
                var item = chr.MailAccount.GetItemToMail(itemId);

                if (item != null)
                {
                    items.Add(item);
                }
                else
                {
                    // invalid item
                    return;
                }
            }

            var money = packet.ReadUInt32();
            var cod = packet.ReadUInt32();

            var unknown2 = packet.ReadUInt64();
            var unknown4 = packet.ReadByte();

            chr.MailAccount.SendMail(recipientName, subject, msg, stationary, items, money, cod);
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:48,代码来源:MailHandler.cs

示例13: HandleRemoveGlyph

 public static void HandleRemoveGlyph(IRealmClient client, RealmPacketIn packet)
 {
     var slot = packet.ReadUInt32();
     var chr = client.ActiveCharacter;
     chr.RemoveGlyph((byte)slot);
     SendTalentGroupList(chr.Talents);
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:7,代码来源:TalentHandler.cs

示例14: HandleDungeonDifficulty

        public static void HandleDungeonDifficulty(IRealmClient client, RealmPacketIn packet)
        {
            var chr = client.ActiveCharacter;

            if (chr.Map.IsInstance)
            {
                // Cannot change difficulty while in instance
                return;
            }

            var difficultyIndex = packet.ReadUInt32();

            var group = chr.Group;
            if (group != null)
            {
                if (group.Leader.Character != chr)
                {
                    // Only leader can change difficulty
                    return;
                }
            }

            var instances = chr.Instances;
            if (instances.TryResetInstances())
            {
                if (group != null)
                {
                    group.DungeonDifficulty = difficultyIndex;
                }
                else
                {
                    chr.DungeonDifficulty = (DungeonDifficulty)difficultyIndex;
                }
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:35,代码来源:InstanceHandler.cs

示例15: HandleAction

		public static void HandleAction(IRealmClient client, RealmPacketIn packet)
		{
			var entityId = packet.ReadEntityId();

			var chr = client.ActiveCharacter;
			var pet = chr.Map.GetObject(entityId) as NPC;

			if (pet != null && pet == chr.ActivePet && pet.IsAlive)
			{
				var record = pet.PetRecord;
				if (record != null)
				{
					var data = (PetActionEntry)packet.ReadUInt32();

					switch (data.Type)
					{
						case PetActionType.SetMode:
							// mode
							pet.SetPetAttackMode(data.AttackMode);
							break;
						case PetActionType.SetAction:
							// action
							var targetAction = data.Action;
							pet.SetPetAction(targetAction);
							break;
						default:
							// spell cast
							var target = chr.Map.GetObject(packet.ReadEntityId());
							pet.CastPetSpell(data.SpellId, target);
							break;
					}
				}
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:34,代码来源:PetHandler.cs


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