本文整理汇总了C#中eRealm类的典型用法代码示例。如果您正苦于以下问题:C# eRealm类的具体用法?C# eRealm怎么用?C# eRealm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
eRealm类属于命名空间,在下文中一共展示了eRealm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: FindNPCGuildScriptClass
/// <summary>
/// searches for a npc guild script
/// </summary>
/// <param name="guild"></param>
/// <param name="realm"></param>
/// <returns>type of class for searched npc guild or null</returns>
public static Type FindNPCGuildScriptClass(string guild, eRealm realm)
{
if (string.IsNullOrEmpty(guild)) return null;
Type type = null;
if (m_script_guilds[(int)realm] == null)
{
Hashtable allScriptGuilds = new Hashtable();
ArrayList asms = new ArrayList(Scripts);
asms.Add(typeof(GameServer).Assembly);
foreach (Assembly asm in asms)
{
Hashtable scriptGuilds = FindAllNPCGuildScriptClasses(realm, asm);
if (scriptGuilds == null) continue;
foreach (DictionaryEntry entry in scriptGuilds)
{
if (allScriptGuilds.ContainsKey(entry.Key)) continue; // guild is already found
allScriptGuilds.Add(entry.Key, entry.Value);
}
}
m_script_guilds[(int)realm] = allScriptGuilds;
}
//SmallHorse: First test if no realm-guild hashmap is null, then test further
//Also ... you can not use "nullobject as anytype" ... this crashes!
//You have to test against NULL result before casting it... read msdn doku
if (m_script_guilds[(int)realm] != null && m_script_guilds[(int)realm][guild] != null)
type = m_script_guilds[(int)realm][guild] as Type;
if (type == null)
{
if (m_gs_guilds[(int)realm] == null)
{
Assembly gasm = Assembly.GetAssembly(typeof(GameServer));
m_gs_guilds[(int)realm] = FindAllNPCGuildScriptClasses(realm, gasm);
}
}
//SmallHorse: First test if no realm-guild hashmap is null, then test further
//Also ... you can not use "nullobject as anytype" ... this crashes!
//You have to test against NULL result before casting it... read msdn doku
if (m_gs_guilds[(int)realm] != null && m_gs_guilds[(int)realm][guild] != null)
type = m_gs_guilds[(int)realm][guild] as Type;
return type;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:52,代码来源:ScriptMgr.cs
示例17: FindAllNPCGuildScriptClasses
/// <summary>
/// Searches for NPC guild scripts
/// </summary>
/// <param name="realm">Realm for searching handlers</param>
/// <param name="asm">The assembly to search through</param>
/// <returns>
/// all handlers that were found, guildname(string) => classtype(Type)
/// </returns>
protected static Hashtable FindAllNPCGuildScriptClasses(eRealm realm, Assembly asm)
{
Hashtable ht = new Hashtable();
if (asm != null)
{
foreach (Type type in asm.GetTypes())
{
// Pick up a class
if (type.IsClass != true) continue;
if (!type.IsSubclassOf(typeof(GameNPC))) continue;
try
{
object[] objs = type.GetCustomAttributes(typeof(NPCGuildScriptAttribute), false);
if (objs.Length == 0) continue;
foreach (NPCGuildScriptAttribute attrib in objs)
{
if (attrib.Realm == eRealm.None || attrib.Realm == realm)
{
ht[attrib.GuildName] = type;
}
}
}
catch (Exception e)
{
if (log.IsErrorEnabled)
log.Error("FindAllNPCGuildScriptClasses", e);
}
}
}
return ht;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:42,代码来源:ScriptMgr.cs
示例18: GetKeepCountByRealm
/// <summary>
/// get keep count by realm
/// </summary>
/// <param name="realm"></param>
/// <returns></returns>
public static int GetKeepCountByRealm(eRealm realm)
{
int index = 0;
lock (m_keeps.SyncRoot)
{
foreach (AbstractGameKeep keep in m_keeps.Values)
{
if (keep.Region != NEW_FRONTIERS) continue;
if (((eRealm)keep.Realm == realm) && (keep is GameKeep))
index++;
}
}
return index;
}
开发者ID:boscorillium,项目名称:dol,代码行数:19,代码来源:KeepManager.cs
示例19: GetArtifactVersions
/// <summary>
/// Get a list of all versions for this artifact.
/// </summary>
/// <param name="artifactID"></param>
/// <param name="realm"></param>
/// <returns></returns>
private static List<ArtifactXItem> GetArtifactVersions(String artifactID, eRealm realm)
{
List<ArtifactXItem> versions = new List<ArtifactXItem>();
if (artifactID != null)
{
lock (m_artifactVersions)
{
if (m_artifactVersions.ContainsKey(artifactID))
{
List<ArtifactXItem> allVersions = m_artifactVersions[artifactID];
foreach (ArtifactXItem version in allVersions)
if (version.Realm == 0 || version.Realm == (int)realm)
versions.Add(version);
}
}
}
return versions;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:25,代码来源:ArtifactMgr.cs
示例20: GetRelicCount
/// <summary>
/// get relic count by realm and relictype
/// </summary>
/// <param name="realm"></param>
/// <param name="type"></param>
/// <returns></returns>
public static int GetRelicCount(eRealm realm, eRelicType type)
{
int index = 0;
lock (m_relics.SyncRoot)
{
foreach (GameRelic relic in m_relics.Values)
{
if ((relic.Realm == realm) && (relic.RelicType == type) && (relic is GameRelic))
index++;
}
}
return index;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:20,代码来源:RelicMgr.cs
注:本文中的eRealm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论