- Comment updates for DataPath, MapDefinitions and Email.

- Added a FromAddress to Email for MailMessage construction, using "RunUO" as done before throws an exception because it's not an email address.
- Fixed the regular expression in Email to check for valid email addresses.
This commit is contained in:
eos 2012-04-29 20:12:24 +00:00
parent 31185a874f
commit fd6d28d56b
5 changed files with 17 additions and 14 deletions

View file

@ -345,7 +345,7 @@ namespace Server.Engines.Help
if ( !isStaffOnline )
entry.Sender.SendMessage( "We are sorry, but no staff members are currently available to assist you. Your page will remain in the queue until one becomes available, or until you cancel it manually." );
if ( Email.SpeechLogPageAddresses != null && entry.SpeechLog != null )
if ( Email.FromAddress != null && Email.SpeechLogPageAddresses != null && entry.SpeechLog != null )
SendEmail( entry );
}
@ -354,7 +354,7 @@ namespace Server.Engines.Help
Mobile sender = entry.Sender;
DateTime time = DateTime.Now;
MailMessage mail = new MailMessage( "RunUO", Email.SpeechLogPageAddresses );
MailMessage mail = new MailMessage( Email.FromAddress, Email.SpeechLogPageAddresses );
mail.Subject = "RunUO Speech Log Page Forwarding";

View file

@ -44,7 +44,7 @@ namespace Server.Misc
{
Console.Write( "Crash: Sending email..." );
MailMessage message = new MailMessage( "RunUO", Email.CrashAddresses );
MailMessage message = new MailMessage( Email.FromAddress, Email.CrashAddresses );
message.Subject = "Automated RunUO Crash Report";
@ -237,7 +237,7 @@ namespace Server.Misc
Console.WriteLine( "done" );
if ( Email.CrashAddresses != null )
if ( Email.FromAddress != null && Email.CrashAddresses != null )
SendEmail( filePath );
}
catch

View file

@ -9,9 +9,9 @@ namespace Server.Misc
{
/* If you have not installed Ultima Online,
* or wish the server to use a separate set of datafiles,
* change the 'CustomPath' value, example:
*
* private const string CustomPath = @"C:\Program Files\Ultima Online";
* change the 'CustomPath' value.
* Example:
* private static string CustomPath = @"C:\Program Files\Ultima Online";
*/
private static string CustomPath = null;
@ -21,7 +21,7 @@ namespace Server.Misc
* Multi.mul
* VerData.mul
* TileData.mul
* Map*.mul
* Map*.mul or Map*LegacyMUL.uop
* StaIdx*.mul
* Statics*.mul
* MapDif*.mul

View file

@ -8,25 +8,27 @@ namespace Server.Misc
{
public class Email
{
/* In order to support emailing, fill in EmailServer:
/* In order to support emailing, fill in EmailServer and FromAddress:
* Example:
* public static readonly string EmailServer = "mail.domain.com";
* public static readonly string FromAddress = "runuo@domain.com";
*
* If you want to add crash reporting emailing, fill in CrashAddresses:
* Example:
* public static readonly string CrashAddresses = "first@email.here;second@email.here;third@email.here";
* public static readonly string CrashAddresses = "first@email.here,second@email.here,third@email.here";
*
* If you want to add speech log page emailing, fill in SpeechLogPageAddresses:
* Example:
* public static readonly string SpeechLogPageAddresses = "first@email.here;second@email.here;third@email.here";
* public static readonly string SpeechLogPageAddresses = "first@email.here,second@email.here,third@email.here";
*/
public static readonly string EmailServer = null;
public static readonly string FromAddress = null;
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 );
private static Regex _pattern = new Regex( @"^[a-z0-9.+_-]+@([a-z0-9-]+\.)+[a-z]+$", RegexOptions.Compiled | RegexOptions.IgnoreCase );
public static bool IsValid( string address )
{

View file

@ -30,9 +30,10 @@ namespace Server.Misc
* Defined:
* RegisterMap( <index>, <mapID>, <fileIndex>, <width>, <height>, <season>, <name>, <rules> );
* - <index> : An unreserved unique index for this map
* - <mapID> : An identification number used in client communications. For any visible maps, this value must be from 0-3
* - <fileIndex> : A file identification number. For any visible maps, this value must be 0, 2, 3, or 4
* - <mapID> : An identification number used in client communications. For any visible maps, this value must be from 0-5
* - <fileIndex> : A file identification number. For any visible maps, this value must be from 0-5
* - <width>, <height> : Size of the map (in tiles)
* - <season> : Season of the map. 0 = Spring, 1 = Summer, 2 = Fall, 3 = Winter, 4 = Desolation
* - <name> : Reference name for the map, used in props gump, get/set commands, region loading, etc
* - <rules> : Rules and restrictions associated with the map. See documentation for details
*/