Exemple #1
0
		private int RansomQuestReminders(KinRansomAES KinRansom, 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.RansomQuestReminderMsg er = new Server.Engines.CronScheduler.RansomQuestReminderMsg();

					// from Ransome AES
					DateTime EventStartTime = KinRansom.EventStartTime;		// DateTime.Now.AddDays(1.0);		// 24 hours from now
					DateTime EventEndTime = KinRansom.EventEndTime;			// EventStartTime.AddHours(3.0);	// 3 hour event
					//DateTime ChestOpenTime = KinRansom.ChestOpenTime;		// EventEndTime.AddMinutes(-15.0);	// at 2hrs and 45 min, open the chest

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

					string body = String.Format(er.m_body,
						EventStartTime					// Sunday, November 20th
						);

					// 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;
		}
Exemple #2
0
		public void KinRansomAES()
		{	// 4nd Sunday of the month. However, we schedule it 24 hours prior!!
			System.Console.Write("AES Kin Ransom Quest initiated ... ");
			Utility.TimeCheck tc = new Utility.TimeCheck();
			tc.Start();
			KinRansomAES KinRansom = new KinRansomAES();
			int Reminders = 0;
			if (TestCenter.Enabled == false && KinRansom != null)
				RansomQuestReminders(KinRansom, out Reminders);
			tc.End();
			System.Console.WriteLine("AES Kin Ransom Quest scheduled with {0} reminders sent.", Reminders);
		}