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


C# RealmPacketIn.SkipBytes方法代码示例

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


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

示例1: 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

示例2: HandleTextEmote

        public static void HandleTextEmote(IRealmClient client, RealmPacketIn packet)
        {
            var chr = client.ActiveCharacter;
            if (!chr.CanMove || !chr.CanInteract) return;

            var emote = (TextEmote)packet.ReadUInt32();
            packet.SkipBytes(4);
            var targetId = packet.ReadEntityId();
            var target = chr.Map.GetObject(targetId) as INamed;
            if (target != null)
            {
                SendTextEmote(chr, emote, target);
            }

            EmoteType animation;
            EmoteDBC.EmoteRelationReader.Entries.TryGetValue((int)emote, out animation);

            switch (animation)
            {
                //The client seems to handle these on its own.
                case EmoteType.StateSleep:
                case EmoteType.StateSit:
                case EmoteType.StateKneel:
                case EmoteType.StateDance:
                    chr.EmoteState = animation;
                    break;
                default:
                    chr.Emote(animation);
                    break;
            }

            //todo: Achievement and scripting hooks/events.
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:33,代码来源:EmoteHandler.cs

示例3: HandleGuildBankSwapItems

		public static void HandleGuildBankSwapItems(IRealmClient client, RealmPacketIn packet)
		{
			var bankEntityId = packet.ReadEntityId();
			var isBankToBank = packet.ReadBoolean();

			var toBankTab = (byte)1;
			var toTabSlot = (byte)1;
			var isAutoStore = false;
			var autoStoreCount = (byte)0;
			var bagSlot = (byte)0;
			var slot = (byte)0;
			var unknown1 = (uint)1;
			var fromBankTab = (byte)0;
			var fromTabSlot = (byte)0;
			var itemEntryId = (uint)0;
			var unknown2 = (byte)1;
			var isBankToChar = true;
			var amount = (byte)0;

			if (isBankToBank)
			{
				toBankTab = packet.ReadByte();
				toTabSlot = packet.ReadByte();
				unknown1 = packet.ReadUInt32();
				fromBankTab = packet.ReadByte();
				fromTabSlot = packet.ReadByte();
				itemEntryId = packet.ReadUInt32();
				unknown2 = packet.ReadByte();
				amount = packet.ReadByte();

				if (toTabSlot >= GuildMgr.MAX_BANK_TAB_SLOTS) return;
				if ((toBankTab == fromBankTab) && (toTabSlot == fromTabSlot)) return;
			}
			else
			{
				fromBankTab = packet.ReadByte();
				fromTabSlot = packet.ReadByte();
				itemEntryId = packet.ReadUInt32();
				isAutoStore = packet.ReadBoolean();
				autoStoreCount = (byte)0;
				if (isAutoStore)
				{
					autoStoreCount = packet.ReadByte();
					packet.SkipBytes(5);
				}
				else
				{
					bagSlot = packet.ReadByte();
					slot = packet.ReadByte();
				}
				isBankToChar = packet.ReadBoolean();
				amount = packet.ReadByte();

				if ((fromTabSlot >= GuildMgr.MAX_BANK_TAB_SLOTS) && fromTabSlot != 0xFF) return;
			}

			var chr = client.ActiveCharacter;
			var bank = chr.Map.GetObject(bankEntityId) as GameObject;
			var guild = chr.Guild;

			if (isBankToBank)
			{
				guild.Bank.SwapItemsManualBankToBank(chr, bank, fromBankTab, fromTabSlot, toBankTab,
															 toTabSlot, itemEntryId, amount);
			}
			else if (isBankToChar)
			{
				if (isAutoStore)
				{
					guild.Bank.SwapItemsAutoStoreBankToChar(chr, bank, fromBankTab, fromTabSlot, itemEntryId,
																autoStoreCount);
				}
				else
				{
					guild.Bank.SwapItemsManualBankToChar(chr, bank, fromBankTab, fromTabSlot, bagSlot, slot,
															 itemEntryId, amount);
				}
			}
			else
			{
				if (isAutoStore)
				{
					guild.Bank.SwapItemsAutoStoreCharToBank(chr, bank, fromBankTab, bagSlot, slot, itemEntryId, autoStoreCount);
				}
				else
				{
					guild.Bank.SwapItemsManualCharToBank(chr, bank, bagSlot, slot, itemEntryId, fromBankTab,
															 fromTabSlot, amount);
				}
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:91,代码来源:GuildHandler.cs


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