Exemplo n.º 1
0
		static AutoPvP()
		{
			CMOptions = new AutoPvPOptions();

			Scenarios = new PvPScenario[0];
			BattleTypes = typeof(PvPBattle).GetConstructableChildren();

			SeasonSchedule = new Schedule(CMOptions.ModuleName + " Seasons", false, DefaultSeasonSchedule);

			Seasons = new BinaryDataStore<int, PvPSeason>(VitaNexCore.SavesDirectory + "/AutoPvP", "Seasons")
			{
				OnSerialize = SerializeSeasons,
				OnDeserialize = DeserializeSeasons
			};

			Battles = new BinaryDirectoryDataStore<PvPSerial, PvPBattle>(
				VitaNexCore.SavesDirectory + "/AutoPvP", "Battles", "pvp")
			{
				OnSerialize = SerializeBattle,
				OnDeserialize = DeserializeBattle
			};

			Profiles = new BinaryDataStore<PlayerMobile, PvPProfile>(VitaNexCore.SavesDirectory + "/AutoPvP", "Profiles")
			{
				Async = true,
				OnSerialize = SerializeProfiles,
				OnDeserialize = DeserializeProfiles
			};
		}
Exemplo n.º 2
0
		private void OnScheduleTick(Schedule s)
		{
			Sandbox.SafeInvoke(
				() =>
				{
					if (_Schedule == null || _Schedule.CurrentGlobalTick == null)
					{
						return;
					}

					DateTime dt = _Schedule.CurrentGlobalTick.Value;
					Sandbox.CSOptions.ToConsole("{0} Current Tick: {1}", _Schedule.Name, dt.ToSimpleString());

					if (_Schedule.NextGlobalTick == null)
					{
						return;
					}

					dt = _Schedule.NextGlobalTick.Value;
					Sandbox.CSOptions.ToConsole("{0} Next Tick: {1}", _Schedule.Name, dt.ToSimpleString());

					if (++_Ticks >= 5)
					{
						_Schedule.Enabled = false;
						Sandbox.CSOptions.ToConsole("{0} Disabled.", _Schedule.Name);
					}
				},
				this);
		}
Exemplo n.º 3
0
		public UpdateServiceOptions()
			: base(typeof(UpdateService))
		{
			Schedule = new Schedule("UpdateService", true, ScheduleMonths.All, ScheduleDays.All, ScheduleTimes.EveryHour);

			Timeout = TimeSpan.FromSeconds(10.0);
			NotifyAccess = AccessLevel.Administrator;
			NotifyStaff = true;
		}
Exemplo n.º 4
0
		public ScheduleDaysMenuGump(
			PlayerMobile user, Schedule schedule, Gump parent = null, GumpButton clicked = null, bool useConfirm = true)
			: base(user, parent, clicked: clicked)
		{
			Schedule = schedule;
			UseConfirmDialog = useConfirm;

			CanMove = false;
			CanResize = false;
		}
Exemplo n.º 5
0
		public void EntryPoint()
		{
			if (!VitaNexCore.FirstBoot)
			{
				return;
			}

			_Schedule = Schedules.Schedules.CreateSchedule(
				"Sandbox Schedule", true, true, ScheduleMonths.All, ScheduleDays.All, ScheduleTimes.EveryMinute, OnScheduleTick);
		}
Exemplo n.º 6
0
		public ScheduleTimeListEntryGump(
			PlayerMobile user,
			Schedule schedule,
			Gump parent = null,
			GumpButton clicked = null,
			TimeSpan? time = null,
			bool useConfirm = true)
			: base(user, parent, clicked: clicked)
		{
			Schedule = schedule;
			Time = time ?? TimeSpan.Zero;
			UseConfirmDialog = useConfirm;

			CanMove = false;
			CanResize = false;
		}
Exemplo n.º 7
0
		private static void OnScheduleTick(Schedule s)
		{
			RequestVersion();
		}
Exemplo n.º 8
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			var version = reader.GetVersion();

			switch (version)
			{
				case 0:
				{
					Schedule = new Schedule(reader);

					Timeout = reader.ReadTimeSpan();
					NotifyAccess = reader.ReadFlag<AccessLevel>();
					NotifyStaff = reader.ReadBool();
				}
					break;
			}
		}