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


C# Character.IsIgnoring方法代碼示例

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


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

示例1: MayProposeTrade

		/// <summary>
		/// Checks requirements for trading between two characters
		/// </summary>
		/// <param name="initChr">possible initiator of trading</param>
		/// <param name="targetChr">possible target of trading</param>
		public static bool MayProposeTrade(Character initChr, Character targetChr)
		{
			TradeStatus tradeStatus;

			if (targetChr == null || !targetChr.IsInContext)
			{
				tradeStatus = TradeStatus.PlayerNotFound;
				return false;
			}
			else if (initChr.IsLoggingOut || targetChr.IsLoggingOut)
			{
				tradeStatus = TradeStatus.LoggingOut;
			}
			else if (!initChr.IsAlive)
			{
				tradeStatus = TradeStatus.PlayerDead;
			}
			else if (!targetChr.IsInRadius(initChr, MaxTradeRadius))
			{
				tradeStatus = TradeStatus.TooFarAway;
			}
			else if (!targetChr.IsAlive)
			{
				tradeStatus = TradeStatus.TargetDead;
			}
			else if (targetChr.IsStunned)
			{
				tradeStatus = TradeStatus.TargetStunned;
			}
			else if (targetChr.IsIgnoring(initChr))
			{
				tradeStatus = TradeStatus.PlayerIgnored;
			}
			else if (targetChr.TradeWindow != null)
			{
				tradeStatus = TradeStatus.AlreadyTrading;
			}
			else if (targetChr.Faction.Group != initChr.Faction.Group && !initChr.Role.IsStaff)
			{
				tradeStatus = TradeStatus.WrongFaction;
			}
			else if (targetChr.IsLoggingOut)
			{
				tradeStatus = TradeStatus.TargetLoggingOut;
			}
			else
			{
				tradeStatus = TradeStatus.Proposed;
				return true;
			}

			TradeHandler.SendTradeStatus(initChr, tradeStatus);
			return false;
		}
開發者ID:remixod,項目名稱:netServer,代碼行數:59,代碼來源:TradeMgr.cs

示例2: CheckInvite

		/// <summary>
		/// Check whether the given inviter may invite the given target
		/// </summary>
		public static GroupResult CheckInvite(Character inviter, out Character target, string targetName)
		{
			GroupResult err;
			var inviterMember = inviter.GroupMember;
			var group = inviterMember != null ? inviterMember.Group : null;

			if (group != null && group.IsFull)
			{
				// your group is full
				err = GroupResult.GroupIsFull;
				target = null;
				targetName = string.Empty;
			}
			else if ((inviterMember != null && !inviterMember.IsAtLeastAssistant))
			{
				target = null;
				err = GroupResult.DontHavePermission;
			}
			else
			{
				target = World.GetCharacter(targetName, false);
				if (target == null || inviter == target ||
					(target.Role.IsStaff && !inviter.Role.IsStaff))	// cannot invite staff members without authorization
				{
					// Character is offline or doesn't exist
					err = GroupResult.OfflineOrDoesntExist;
				}
				else if (inviter.Faction.Group != target.Faction.Group)
				{
					// you can't invite anyone from another faction
					err = GroupResult.TargetIsUnfriendly;
				}
				else if (target.Group != null || target.IsInvitedToGroup)
				{
					err = GroupResult.AlreadyInGroup;
				}
				else if (target.IsIgnoring(inviter) && !inviter.Role.IsStaff)
				{
					err = GroupResult.TargetIsIgnoringYou;
				}
				else
				{
					return GroupResult.NoError;
				}
			}

			SendResult(inviter.Client, err, 0, targetName);
			return err;
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:52,代碼來源:Group.cs


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