當前位置: 首頁>>代碼示例>>C#>>正文


C# Character.Send方法代碼示例

本文整理匯總了C#中WCell.RealmServer.Entities.Character.Send方法的典型用法代碼示例。如果您正苦於以下問題:C# Character.Send方法的具體用法?C# Character.Send怎麽用?C# Character.Send使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WCell.RealmServer.Entities.Character的用法示例。


在下文中一共展示了Character.Send方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SendInBounds

		public static void SendInBounds(Character duelist)
		{
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_INBOUNDS,4))
            {
                duelist.Send(packet);
            }
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:7,代碼來源:DuelHandler.cs

示例2: Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA

        public static void Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA(Character chr)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0))
            {
				chr.Send(packet);
            }
        }
開發者ID:Jeroz,項目名稱:WCell,代碼行數:7,代碼來源:VehicleHandler.cs

示例3: SendTitleEarned

 public static void SendTitleEarned(Character character, CharacterTitleEntry titleEntry, bool lost)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_TITLE_EARNED, 4 + 4))
     {
         packet.WriteUInt((uint) titleEntry.BitIndex);
         packet.WriteUInt(lost ? 0 : 1);
         character.Send(packet);
     }
 }
開發者ID:remixod,項目名稱:netServer,代碼行數:9,代碼來源:TitleHandler.cs

示例4: SendCountdown

		public static void SendCountdown(Character duelist, uint millis)
		{
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_COUNTDOWN, 4))
            {
                packet.Write(millis);

                duelist.Send(packet);
            }
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:9,代碼來源:DuelHandler.cs

示例5: SendOutOfBounds

		public static void SendOutOfBounds(Character duelist, uint cancelDelayMillis)
		{
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_OUTOFBOUNDS, 4))
            {
                packet.Write(cancelDelayMillis);

                duelist.Send(packet);
            }
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:9,代碼來源:DuelHandler.cs

示例6: SendQuestUpdateFailedTimer

        /// <summary>
        /// Sends the quest update failed timer.
        /// </summary>
        /// <param name="qst">The QST.</param>
        /// <param name="chr">The character</param>
        public static void SendQuestUpdateFailedTimer(Character chr, Quest qst)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_QUESTUPDATE_FAILEDTIMER))
            {
                packet.Write(qst.Template.Id);

                chr.Send(packet);
            }
        }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:14,代碼來源:QuestHandler.cs

示例7: SendQuestUpdateComplete

        /// <summary>
        /// Sends the quest update complete.
        /// </summary>
        /// <param name="chr">The character.</param>
        public static void SendQuestUpdateComplete(Character chr, uint questId)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_QUESTUPDATE_COMPLETE))
            {
                packet.Write(questId);

                chr.Send(packet);
            }
        }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:13,代碼來源:QuestHandler.cs

示例8: SendQuestInvalid

        /// <summary>
        /// Sends the quest invalid.
        /// </summary>
        /// <param name="chr">The character.</param>
        /// <param name="reason">The reason.</param>
        public static void SendQuestInvalid(Character chr, QuestInvalidReason reason)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_QUESTGIVER_QUEST_INVALID, 4))
            {
                packet.Write((int)reason);

                chr.Send(packet);
            }
        }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:14,代碼來源:QuestHandler.cs

示例9: SendSpells

		/// <summary>
		/// Sends any kind of extra command-bar to control other entities, such as NPCs, vehicles etc
		/// </summary>
		/// <param name="owner"></param>
		//public static void SendSpells(Character owner, NPC npc, uint duration,
		//    PetAttackMode attackMode, PetAction action, PetFlags flags,
		//    PetActionEntry[] petActions,
		//    PetSpell[] spells)

		public static void SendSpells(Character owner, NPC pet, PetAction currentAction)
		{
			// TODO: Cooldowns
			var record = pet.PetRecord;
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PET_SPELLS, 20 + (PetConstants.PetActionCount * 4) + 1 + (pet.Spells.Count) + 1 + (0)))
			{
				packet.Write(pet.EntityId);
				packet.Write((ushort)pet.Entry.FamilyId);
				//packet.Write((ushort)0);
				packet.Write(pet.RemainingDecayDelayMillis);			// duration
				packet.Write((byte)record.AttackMode);
				packet.Write((byte)currentAction);
				packet.Write((ushort)record.Flags);

				var actions = record.ActionButtons;
				for (var i = 0; i < PetConstants.PetActionCount; i++)
				{
					var action = actions[i];
					packet.Write(action);
				}

				var spellPos = packet.Position;
				++packet.Position;
				var spellCount = 0;
				foreach (var spell in pet.Spells)
				{
					if (!spell.IsPassive)
					{
						packet.Write(spell.Id | ((uint)PetSpellState.Enabled << 24));
						++spellCount;
					}
				}

				packet.Write((byte)0);		// TODO: Cooldowns

				packet.Position = spellPos;
				packet.Write((byte)spellCount);

				owner.Send(packet);
			}
		}
開發者ID:MeaNone,項目名稱:WCell,代碼行數:50,代碼來源:PetHandler.cs

示例10: SendStatusActive

        public static void SendStatusActive(Character chr, Battleground bg, int queueIndex)
        {
            var status = BattlegroundStatus.Active;
            var side = chr.FactionGroup.GetBattlegroundSide();

            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_BATTLEFIELD_STATUS))
            {
				packet.Write(queueIndex);

                var bgId = bg.Template.Id;

                // 64-bit guid start
                packet.Write((byte)ArenaType.None);
                packet.Write((byte)1); // affects level range calculation?
                packet.Write((uint)bgId);
                packet.Write((ushort)8080);
                // 64-bit guid stop

				packet.Write((byte)0);				// since 3.3
				packet.Write((byte)0);				// since 3.3
                packet.Write(bg.InstanceId); // instance id
                packet.Write((byte)0); // bool isRatedMatch
                packet.Write((int)status);

                packet.Write((int)bg.Id);

                // the number of milliseconds before the Battlefield will close after a battle is finished.
                // This is 0 before the battle is finished
                packet.Write(bg.RemainingShutdownDelay);

                // start time, in ms. clientGetTickCount - this = instance runtime
                packet.Write(bg.RuntimeMillis);
                packet.Write((byte)side); // arena faction - 0 or 1
                chr.Send(packet);
            }
        }
開發者ID:ray2006,項目名稱:WCell,代碼行數:36,代碼來源:BattlegroundHandler.cs

示例11: SendStatusEnqueued

        public static void SendStatusEnqueued(Character chr,
			int index,
            BattlegroundRelation relation,
			BattlegroundQueue queue)
        {
            var status = BattlegroundStatus.Enqueued;

            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_BATTLEFIELD_STATUS))
            {
				packet.Write(index);

                var bgId = queue.Template.Id;

                // 64-bit guid start
                packet.Write((byte)ArenaType.None);
                packet.Write((byte)1);              // affects level range calculation?
                packet.Write((uint)bgId);
                packet.Write((ushort)8080);
                // 64-bit guid stop

				packet.Write((byte)0);				// since 3.3
				packet.Write((byte)0);				// since 3.3
                packet.Write(queue.InstanceId);     // instance id
                packet.Write(false);                // bool isRatedMatch
                packet.Write((int)status);

                packet.Write(queue.AverageWaitTime);					// avg wait time for queue, in ms
                packet.Write((int)relation.QueueTime.TotalMilliseconds); // time in the queue, also in ms

                chr.Send(packet);
            }
        }
開發者ID:ray2006,項目名稱:WCell,代碼行數:32,代碼來源:BattlegroundHandler.cs

示例12: SendDungeonDifficulty

        public static void SendDungeonDifficulty(Character chr)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_SET_DUNGEON_DIFFICULTY, 12))
            {
                var group = chr.Group;
                if (group != null && !group.Flags.HasFlag(GroupFlags.Raid))
                {
                    packet.Write(group.DungeonDifficulty);
                    packet.Write(1); // val
                    packet.Write(1); // isingroup
                }
                else // this is wrong? one packet def should be enough
                {
                    packet.Write((int)chr.Record.DungeonDifficulty);
                    packet.Write(1);
                    packet.Write(0);
                }

                chr.Send(packet);
            }
        }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:21,代碼來源:InstanceHandler.cs

示例13: SendPetGUIDs

		public static void SendPetGUIDs(Character chr)
		{
			if (chr.ActivePet == null)
			{
				using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PET_GUIDS, 12))
				{
					packet.Write(0); // list count
					chr.Send(packet);
				}
			}
			else
			{
				using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PET_GUIDS, 12))
				{
					packet.Write(1); // list count
					packet.Write(chr.ActivePet.EntityId);
					chr.Send(packet);
				}
			}
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:20,代碼來源:PetHandler.cs

示例14: WhisperParser

		/// <summary>
		/// Parses any incoming whispers.
		/// </summary>
		/// <param name="type">the type of chat message indicated by the client</param>
		/// <param name="language">the chat language indicated by the client</param>
		/// <param name="packet">the actual chat message packet</param>
		private static void WhisperParser(Character sender, ChatMsgType type, ChatLanguage language, RealmPacketIn packet)
		{
			var recipient = packet.ReadCString();
			var msg = ReadMessage(packet);

			if (msg.Length == 0)
				return;

			if (RealmCommandHandler.HandleCommand(sender, msg, sender.Target as Character))
				return;

			var targetChr = World.GetCharacter(recipient, false);
			if (targetChr == null)
			{
				SendChatPlayerNotFoundReply(sender.Client, recipient);
				return;
			}

			if (targetChr.Faction.Group != sender.Faction.Group)
			{
				SendChatPlayerWrongTeamReply(sender.Client);
				return;
			}

			if (targetChr.IsIgnoring(sender))
			{
				using (var packetOut = CreateCharChatMessage(ChatMsgType.Ignored, ChatLanguage.Universal, targetChr, sender, null, msg))
				{
					sender.Send(packetOut);
				}
			}
			else
			{
				using (var packetOut = CreateCharChatMessage(ChatMsgType.Whisper, ChatLanguage.Universal, sender, targetChr, null, msg))
				{
					targetChr.Send(packetOut);
				}
			}

			using (var packetOut = CreateCharChatMessage(ChatMsgType.MsgReply, ChatLanguage.Universal, targetChr, targetChr, null, msg, sender.ChatTag))
			{
				sender.Send(packetOut);
			}

			// handle afk/dnd situations
			if (targetChr.IsAFK)
			{
				using (var packetOut = CreateCharChatMessage(ChatMsgType.AFK, ChatLanguage.Universal, targetChr, sender, null, targetChr.AFKReason, targetChr.ChatTag))
				{
					sender.Send(packetOut);
				}
			}

			if (targetChr.IsDND)
			{
				using (var packetOut = CreateCharChatMessage(ChatMsgType.DND, ChatLanguage.Universal, targetChr, sender, null, string.Empty, targetChr.ChatTag))
				{
					sender.Send(packetOut);
				}
			}
		}
開發者ID:remixod,項目名稱:netServer,代碼行數:67,代碼來源:ChatMgr.cs

示例15: SendSpellModifier

		/// <summary>
		/// Sends spell modifier update
		/// </summary>
		public static void SendSpellModifier(Character chr, byte groupBitNumber, SpellModifierType type, int amount, bool isPercent)
		{
			var opcode = isPercent ? RealmServerOpCode.SMSG_SET_PCT_SPELL_MODIFIER :
				RealmServerOpCode.SMSG_SET_FLAT_SPELL_MODIFIER;
			using (var packet = new RealmPacketOut(opcode, 6))
			{
				packet.Write(groupBitNumber);
				packet.Write((byte) type);
				packet.Write(amount);

				chr.Send(packet);
			}
		}
開發者ID:pallmall,項目名稱:WCell,代碼行數:16,代碼來源:SpellHandler.cs


注:本文中的WCell.RealmServer.Entities.Character.Send方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。