Example #1
0
		private int ServerWarsReminders(ServerWarsAES ServerWars, out int Reminders)
		{
			int iChecked = 0;
			Reminders = 0;
			try
			{
				// loop through the accouints looking for current users
				ArrayList results = new ArrayList();
				/*foreach (Account acct in Accounts.Table.Values)
				{
					iChecked++;
					if (acct.DoNotSendEmail == false)
						if (EmailHelpers.RecentLogin(acct, 120) == true)
						{
							Reminders++;
							results.Add(acct.EmailAddress);
						}
				}*/

				// Adam: lets keep the above code around for future needs, but for now lets use our mailing list
				//	NOTE: If you change this make sure to remove the password from the subject line
				string password = Environment.GetEnvironmentVariable("DISTLIST_PASSWORD");
				if (password == null || password.Length == 0)
					throw new ApplicationException("the password for distribution list access is not set.");
				Reminders = 1;
				iChecked = 1;
				results.Clear();
				results.Add("*****@*****.**");

				if (Reminders > 0)
				{
					Server.Engines.CronScheduler.ServerWarsMsg er = new Server.Engines.CronScheduler.ServerWarsMsg();

					// from Ransome AES
					DateTime EventStartTime = ServerWars.EventStartTime;		// DateTime.Now.AddDays(1.0);		// 24 hours from now
					DateTime EventEndTime = ServerWars.EventEndTime;			// EventStartTime.AddHours(3.0);	// 3 hour event
					DateTime EventStartTimeEastern = EventStartTime + TimeSpan.FromHours(3);

					// Sunday, November 20th
					string subject = String.Format(password + er.m_subject,
						EventStartTime);				// Sunday, November 20th

					string body = String.Format(er.m_body,

						// "Angel Island will be hosting another Cross Shard Challenge this {0:D} from {0:t} - {1:t} PM Pacific Time."
						EventStartTime,					// Sunday, November 20th / 3:00 PM
						EventEndTime,					// 6:00 PM End

						// "({0:t} PM Pacific Time is {2:t} Eastern)"
						EventStartTimeEastern,			// 6:00 PM Eastern Start

						// "Server Wars are actually scheduled for {0:t} PM, but sometimes start from 3-5 minutes later. If you login at {3:t}, you should be safe.\n" +
						EventStartTime + TimeSpan.FromMinutes(15)	// 3:15 PM Start
						
						// "If you want to be there from the moment it begins, login at {0:t} and simply wait for the \"Server Wars have begun!\" global announcement.\n" +
						);

					// okay, now hand the list of users off to our mailer daemon
					new Emailer().SendEmail(results, subject, body, false);
				}

			}
			catch (Exception e)
			{
				LogHelper.LogException(e);
				System.Console.WriteLine("Exception Caught in Ransome Quest Donation Reminder code: " + e.Message);
				System.Console.WriteLine(e.StackTrace);
			}
			return iChecked;
		}
Example #2
0
		public void ServerWarsAES()
		{	// 1st Sunday of the month. However, we schedule it 24 hours prior!!
			System.Console.Write("AES Server Wars initiated ... ");
			Utility.TimeCheck tc = new Utility.TimeCheck();
			tc.Start();
			ServerWarsAES ServerWars = new ServerWarsAES();
			int Reminders = 0;
			if (TestCenter.Enabled == false && ServerWars != null)
				ServerWarsReminders(ServerWars, out Reminders);
			tc.End();
			System.Console.WriteLine("AES Server Wars scheduled.");
		}