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


C# eRealm类代码示例

本文整理汇总了C#中eRealm的典型用法代码示例。如果您正苦于以下问题:C# eRealm类的具体用法?C# eRealm怎么用?C# eRealm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CreateNews

		public static void CreateNews(string message, eRealm realm, eNewsType type, bool sendMessage)
		{
			if (sendMessage)
			{
				foreach (GameClient client in WorldMgr.GetAllClients())
				{
					if (client.Player == null)
						continue;
					if ((client.Account.PrivLevel != 1 || realm == eRealm.None) || client.Player.Realm == realm)
					{
						client.Out.SendMessage(message, eChatType.CT_System, eChatLoc.CL_SystemWindow);
					}
				}
			}

			if (ServerProperties.Properties.RECORD_NEWS)
			{
				DBNews news = new DBNews();
				news.Type = (byte)type;
				news.Realm = (byte)realm;
				news.Text = message;
				GameServer.Database.AddObject(news);
				GameEventMgr.Notify(DatabaseEvent.NewsCreated, new NewsEventArgs(news));
			}
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:25,代码来源:NewsMgr.cs

示例2: getRealmString

 public string getRealmString(eRealm Realm)
 {
     switch (Realm)
     {
         case eRealm.Albion: return " ALB";
         case eRealm.Midgard: return " MID";
         case eRealm.Hibernia: return " HIB";
         default: return " NONE";
     }
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:10,代码来源:advice.cs

示例3: CheckGuild

		/// <summary>
		/// This method checks if a guild exists
		/// if not, the guild is created with default values
		/// </summary>
		/// <param name="guildName">The guild name that is being checked</param>
		private static void CheckGuild(eRealm currentRealm, string guildName)
		{
			if (!GuildMgr.DoesGuildExist(guildName))
			{
				Guild newguild = GuildMgr.CreateGuild(currentRealm, guildName);
				newguild.Ranks[8].OcHear = true;
				newguild.Motd = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE,"Guild.StartupGuild.Motd");
				newguild.Omotd = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE,"Guild.StartupGuild.Omotd");
				newguild.Ranks[8].Title =  LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE,"Guild.StartupGuild.Title");
			}
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:16,代码来源:StartupGuilds.cs

示例4: OnKeepTaken

 /// <summary>
 /// when  keep is taken it check if the realm which take gain the control of DF
 /// </summary>
 /// <param name="e"></param>
 /// <param name="sender"></param>
 /// <param name="arguments"></param>
 public static void OnKeepTaken(DOLEvent e, object sender, EventArgs arguments)
 {
     KeepEventArgs args = arguments as KeepEventArgs;
     eRealm realm = (eRealm) args.Keep.Realm ;
     if (realm != DarknessFallOwner )
     {
         int currentDFOwnerTowerCount = GameServer.KeepManager.GetTowerCountByRealm(DarknessFallOwner);
         int challengerOwnerTowerCount = GameServer.KeepManager.GetTowerCountByRealm(realm);
         if (currentDFOwnerTowerCount < challengerOwnerTowerCount)
             DarknessFallOwner = realm;
     }
 }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:18,代码来源:DFEnterJumpPoint.cs

示例5: RealmHasBonus

        /// <summary>
        /// does a realm have the amount of keeps required for a certain bonus
        /// </summary>
        /// <param name="type">the type of bonus</param>
        /// <param name="realm">the realm</param>
        /// <returns>true if the realm has the required amount of keeps</returns>
        public static bool RealmHasBonus(eKeepBonusType type, eRealm realm)
        {
            if (!ServerProperties.Properties.USE_LIVE_KEEP_BONUSES)
                return false;

            if (realm == eRealm.None)
                return false;

            int count = 0;
            switch (realm)
            {
                case eRealm.Albion: count = albCount; break;
                case eRealm.Midgard: count = midCount; break;
                case eRealm.Hibernia: count = hibCount; break;
            }

            return count >= (int)type;
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:24,代码来源:KeepBonusManager.cs

示例6: CheckDFOwner

        /// <summary>
        /// check if a realm have more keep at start
        /// to know the DF owner
        /// </summary>

        private static void CheckDFOwner()
        {
            int albcount = GameServer.KeepManager.GetTowerCountByRealm(eRealm.Albion);
            int midcount = GameServer.KeepManager.GetTowerCountByRealm(eRealm.Midgard);
            int hibcount = GameServer.KeepManager.GetTowerCountByRealm(eRealm.Hibernia);

            if (albcount > midcount && albcount > hibcount)
            {
                DarknessFallOwner = eRealm.Albion;
            }
            if (midcount > albcount && midcount > hibcount)
            {
                DarknessFallOwner = eRealm.Midgard;
            }
            if (hibcount > midcount && hibcount > albcount)
            {
                DarknessFallOwner = eRealm.Hibernia;
            }
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:24,代码来源:DFEnterJumpPoint.cs

示例7: getRelics

		/// <summary>
		/// Returns an enumeration with all mounted Relics of an realm
		/// </summary>
		/// <param name="Realm"></param>
		/// <returns></returns>
		public static IEnumerable getRelics(eRealm Realm)
		{
			ArrayList realmRelics = new ArrayList();
			lock (m_relics)
			{
				foreach (GameRelic relic in m_relics.Values)
				{
					if (relic.Realm == Realm && relic.IsMounted)
						realmRelics.Add(relic);
				}
			}
			return realmRelics;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:18,代码来源:RelicMgr.cs

示例8: BroadcastMessage

		/// <summary>
		/// Method to broadcast messages, if eRealm.None all can see,
		/// else only the right realm can see
		/// </summary>
		/// <param name="message">The message</param>
		/// <param name="realm">The realm</param>
		public static void BroadcastMessage(string message, eRealm realm)
		{
			foreach (GameClient client in WorldMgr.GetAllClients())
			{
				if (client.Player == null)
					continue;
				if ((client.Account.PrivLevel != 1 || realm == eRealm.None) || client.Player.Realm == realm)
				{
					client.Out.SendMessage(message, eChatType.CT_Important, eChatLoc.CL_SystemWindow);
				}
			}
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:18,代码来源:Player+Manager.cs

示例9: BroadcastRaize

		/// <summary>
		/// Sends a message to all players to notify them of the raize
		/// </summary>
		/// <param name="keep">The keep object</param>
		/// <param name="realm">The raizing realm</param>
		public static void BroadcastRaize(AbstractGameKeep keep, eRealm realm)
		{
			string message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastRaize.Razed", keep.Name, GlobalConstants.RealmToName(realm)));
			BroadcastMessage(message, eRealm.None);
			NewsMgr.CreateNews(message, keep.Realm, eNewsType.RvRGlobal, false);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:11,代码来源:Player+Manager.cs

示例10: Reset

		/// <summary>
		/// reset the realm when the lord have been killed
		/// </summary>
		/// <param name="realm"></param>
		public virtual void Reset(eRealm realm)
		{
			LastAttackedByEnemyTick = 0;
			StartCombatTick = 0;

			Realm = realm;

			PlayerMgr.BroadcastCapture(this);

            Level = (byte)ServerProperties.Properties.STARTING_KEEP_LEVEL;

			//if a guild holds the keep, we release it
			if (Guild != null)
			{
				Release();
			}
			//we repair all keep components, but not if it is a tower and is raised
			foreach (GameKeepComponent component in this.KeepComponents)
			{
				if (!component.IsRaized)
					component.Repair(component.MaxHealth - component.Health);
				foreach (GameKeepHookPoint hp in component.KeepHookPoints.Values)
				{
					if (hp.Object != null)
						hp.Object.Die(null);
				}
			}
			//change realm
			foreach (GameClient client in WorldMgr.GetClientsOfRegion(this.CurrentRegion.ID))
			{
				client.Out.SendKeepComponentUpdate(this, false);
			}
			//we reset all doors
			foreach(GameKeepDoor door in Doors.Values)
			{
				door.Reset(realm);
			}

			//we make sure all players are not in the air
			ResetPlayersOfKeep();

			//we reset the guards
			foreach (GameKeepGuard guard in Guards.Values)
			{
				if (guard is GuardLord && guard.IsAlive )
				{
					this.TemplateManager.GetMethod("RefreshTemplate").Invoke(null, new object[] { guard });
				}
				else if (guard is GuardLord == false)
				{
					guard.Die(guard);
				}
			}

			//we reset the banners
			foreach (GameKeepBanner banner in Banners.Values)
			{
				banner.ChangeRealm();
			}

			//update guard level for every keep
			if (!IsPortalKeep && ServerProperties.Properties.USE_KEEP_BALANCING)
				GameServer.KeepManager.UpdateBaseLevels();

			//update the counts of keeps for the bonuses
			if (ServerProperties.Properties.USE_LIVE_KEEP_BONUSES)
				KeepBonusMgr.UpdateCounts();

			SaveIntoDatabase();

			GameEventMgr.Notify(KeepEvent.KeepTaken, new KeepEventArgs(this));

		}
开发者ID:mynew4,项目名称:DAoC,代码行数:77,代码来源:AbstractGameKeep.cs

示例11: GetRandomNPC

 /// <summary>
 /// Get a random npc from zone with given realms
 /// </summary>
 /// <param name="realms">The realms to get the NPC from</param>
 /// <param name="maxLevel">The minimal level of the NPC</param>
 /// <param name="minLevel">The maximum level of the NPC</param>
 /// <returns>The NPC</returns>
 public GameNPC GetRandomNPC(eRealm[] realms, int minLevel, int maxLevel)
 {
     List<GameNPC> npcs = GetNPCsOfZone(realms, minLevel, maxLevel, 0, 0, true);
     GameNPC randomNPC = (npcs.Count == 0 ? null : npcs[0]);
     return randomNPC;
 }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:13,代码来源:Zone.cs

示例12: GetRealmTowerBonusLevel

		public virtual int GetRealmTowerBonusLevel(eRealm realm)
		{
			int tower = 28 - GetTowerCountByRealm(realm);
			return (int)(tower * ServerProperties.Properties.TOWER_BALANCE_MULTIPLIER);
		}
开发者ID:dol-leodagan,项目名称:DOLSharp,代码行数:5,代码来源:KeepManager.cs

示例13: GetRelicBonusModifier

		/// <summary>
		/// Gets the bonus modifier for a realm/relictype.
		/// </summary>
		/// <param name="realm"></param>
		/// <param name="type"></param>
		/// <returns></returns>
		public static double GetRelicBonusModifier(eRealm realm, eRelicType type)
		{
			double bonus = 0.0;
			bool owningSelf = false;
			//only playerrealms can get bonus
			foreach (GameRelic rel in getRelics(realm, type))
			{
				if (rel.Realm == rel.OriginalRealm)
				{
					owningSelf = true;
				}
				else
				{
					bonus += ServerProperties.Properties.RELIC_OWNING_BONUS*0.01;
				}
			}
			
			// Bonus apply only if owning original relic
			if (owningSelf)
				return bonus;
			
			return 0.0;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:29,代码来源:RelicMgr.cs

示例14: GetKeepCountByRealm

		/// <summary>
		/// get keep count by realm
		/// </summary>
		/// <param name="realm"></param>
		/// <returns></returns>
		public virtual int GetKeepCountByRealm(eRealm realm)
		{
			int index = 0;
			lock (m_keepList.SyncRoot)
			{
				foreach (AbstractGameKeep keep in m_keepList.Values)
				{
					if (m_frontierRegionsList.Contains(keep.Region) == false) continue;
					if (((eRealm)keep.Realm == realm) && (keep is GameKeep))
						index++;
				}
			}
			return index;
		}
开发者ID:dol-leodagan,项目名称:DOLSharp,代码行数:19,代码来源:KeepManager.cs

示例15: GetRealmKeepBonusLevel

		public virtual int GetRealmKeepBonusLevel(eRealm realm)
		{
			int keep = 7 - GetKeepCountByRealm(realm);
			return (int)(keep * ServerProperties.Properties.KEEP_BALANCE_MULTIPLIER);
		}
开发者ID:dol-leodagan,项目名称:DOLSharp,代码行数:5,代码来源:KeepManager.cs


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