[Interval time]

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
xAddytzu
Posts: 36
Joined: Sat Oct 11, 2008 9:57 am

[Interval time]

Post by xAddytzu »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:

What is wrong ? no error at build but no effect in game.
i want something like EventInterval = 21:00,22:00,1:00

Code: Select all

 	private AZStartTask _task;	class AZStartTask implements Runnable	{		private long _startTime;		public ScheduledFuture<?> nextRun; 		public AZStartTask(long startTime)		{			_startTime = startTime;		}		public void setStartTime(long startTime)		{			_startTime = startTime;		}		public void run()		{		startEvent();		}	} 	public void scheduleEventStart()	{		try		{			Calendar currentTime = Calendar.getInstance();			Calendar nextStartTime = null;			Calendar testStartTime = null;			for (String timeOfDay : Config.EVENT_INTERVAL)			{				// Creating a Calendar object from the specified interval value				testStartTime = Calendar.getInstance();				testStartTime.setLenient(true);				String[] splitTimeOfDay = timeOfDay.split(":");				testStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(splitTimeOfDay[0]));				testStartTime.set(Calendar.MINUTE, Integer.parseInt(splitTimeOfDay[1]));				// If the date is in the past, make it the next day (Example: Checking for "1:00", when the time is 23:57.)				if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis())				{					testStartTime.add(Calendar.DAY_OF_MONTH, 1);				}				// Check for the test date to be the minimum (smallest in the specified list)				if (nextStartTime == null || testStartTime.getTimeInMillis() < nextStartTime.getTimeInMillis())				{					nextStartTime = testStartTime;				}			}			_task = new AZStartTask(nextStartTime.getTimeInMillis());			ThreadPoolManager.getInstance().executeTask(_task);		}		catch (Exception e)		{ }	} 
Last edited by xAddytzu on Mon Nov 16, 2009 8:42 am, edited 1 time in total.
xAddytzu
Posts: 36
Joined: Sat Oct 11, 2008 9:57 am

Re: [Fixed interval time]

Post by xAddytzu »

1 day and nobody ..... :(
xAddytzu
Posts: 36
Joined: Sat Oct 11, 2008 9:57 am

Re: [Fixed interval time]

Post by xAddytzu »

bump
xAddytzu
Posts: 36
Joined: Sat Oct 11, 2008 9:57 am

Re: [Fixed interval time]

Post by xAddytzu »

xAddytzu wrote:bump
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: [Interval time]

Post by janiii »

the code seems somehow incomplete. where is startEvent() method? what is nextRun property in AZStartTask needed for?
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
xAddytzu
Posts: 36
Joined: Sat Oct 11, 2008 9:57 am

Re: [Interval time]

Post by xAddytzu »

janiii wrote:the code seems somehow incomplete. where is startEvent() method? what is nextRun property in AZStartTask needed for?
I was inspired by TVT, well, i will try to complete code.. ok thanks
Post Reply