From ea0e0377709592ecb51d99ec4a2889d5085b69ca Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 31 Oct 2008 09:58:37 +0000 Subject: [PATCH] --- Scripts/Engines/Factions/Gumps/LeaveFactionGump.cs | 8 ++++---- Scripts/Items/Skill Items/Magical/Misc/Moongate.cs | 6 ++++-- Scripts/Misc/Email.cs | 11 +++++++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Scripts/Engines/Factions/Gumps/LeaveFactionGump.cs b/Scripts/Engines/Factions/Gumps/LeaveFactionGump.cs index 4da7d3110..40bf32b93 100644 --- a/Scripts/Engines/Factions/Gumps/LeaveFactionGump.cs +++ b/Scripts/Engines/Factions/Gumps/LeaveFactionGump.cs @@ -48,8 +48,8 @@ namespace Server.Factions { pl.Leaving = DateTime.Now; - if ( Faction.LeavePeriod == TimeSpan.FromDays( 7.0 ) ) - m_From.SendLocalizedMessage( 1005065 ); // You will be removed from the faction in 7 days + if ( Faction.LeavePeriod == TimeSpan.FromDays( 3.0 ) ) + m_From.SendLocalizedMessage( 1005065 ); // You will be removed from the faction in 3 days else m_From.SendMessage( "You will be removed from the faction in {0} days.", Faction.LeavePeriod.TotalDays ); } @@ -71,8 +71,8 @@ namespace Server.Factions { pl.Leaving = DateTime.Now; - if ( Faction.LeavePeriod == TimeSpan.FromDays( 7.0 ) ) - mob.SendLocalizedMessage( 1005060 ); // Your guild will quit the faction in 7 days + if ( Faction.LeavePeriod == TimeSpan.FromDays( 3.0 ) ) + mob.SendLocalizedMessage( 1005060 ); // Your guild will quit the faction in 3 days else mob.SendMessage( "Your guild will quit the faction in {0} days.", Faction.LeavePeriod.TotalDays ); } diff --git a/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs b/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs index 9a1d1834e..0e1170313 100644 --- a/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs +++ b/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs @@ -136,7 +136,8 @@ namespace Server.Items m.MoveToWorld( m_Target, m_TargetMap ); - m.PlaySound( 0x1FE ); + if ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) + m.PlaySound( 0x1FE ); OnGateUsed( m ); } @@ -192,7 +193,8 @@ namespace Server.Items { if ( IsInTown( from.Location, from.Map ) && !IsInTown( m_Target, m_TargetMap ) || (from.Map != Map.Felucca && TargetMap == Map.Felucca && ShowFeluccaWarning) ) { - from.Send( new PlaySound( 0x20E, from.Location ) ); + if ( from.AccessLevel == AccessLevel.Player || !from.Hidden ) + from.Send( new PlaySound( 0x20E, from.Location ) ); from.CloseGump( typeof( MoongateConfirmGump ) ); from.SendGump( new MoongateConfirmGump( from, this ) ); } diff --git a/Scripts/Misc/Email.cs b/Scripts/Misc/Email.cs index 1e55a77e8..891b98e03 100644 --- a/Scripts/Misc/Email.cs +++ b/Scripts/Misc/Email.cs @@ -1,5 +1,6 @@ using System; using System.Net.Mail; +using System.Text.RegularExpressions; using System.Threading; using Server; @@ -25,6 +26,16 @@ namespace Server.Misc public static readonly string CrashAddresses = null; public static readonly string SpeechLogPageAddresses = null; + private static Regex _pattern = new Regex( @"^[a-z0-9.+_-]+@([a-z0-9-]+.)+[a-z]+$", RegexOptions.IgnoreCase ); + + public static bool IsValid( string address ) + { + if ( address == null || address.Length > 320 ) + return false; + + return _pattern.IsMatch( address ); + } + public static SmtpClient Client; public static void Configure()