Page 2 of 4

Re: [HELP] Olympiad.properties

Posted: Wed Aug 18, 2010 11:55 am
by SolidSnake
Many revisions change the navicat tables...so you must change them, too

Re: [HELP] Olympiad.properties

Posted: Wed Aug 18, 2010 3:29 pm
by giligan11
Well I don't have the incompatibility issues anymore. I took a screenshot of my gameserver console on the Olympiad status part. I attached it to this post. I have successfully done implemented your idea but it says in the picture Olympiad System: 19483 minutes until period ends. Computing that, that would give me 13 days meaning at the end of the month, the heroes will be declared. I set it to 7 days (or one week) using the same method that you said. I do not think it is working.

Re: [HELP] Olympiad.properties

Posted: Wed Aug 18, 2010 4:49 pm
by SolidSnake
I don't understand what's the problem..

Re: [HELP] Olympiad.properties

Posted: Wed Aug 18, 2010 5:31 pm
by giligan11
Hmm... If it worked, would it have shown it there on the gameserver console? 19k minutes = 13 days. I set it to 1000 * 60 * 60 * 24 * 7 = meaning 1 week right? I hope I got it right.

Re: [HELP] Olympiad.properties

Posted: Wed Aug 18, 2010 6:07 pm
by SolidSnake
Have you restarted the server after the modification?

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 7:09 am
by giligan11
Yes, I have restarted numerous time already after doing the alterations. Is there another way to change the Olympiad Period?

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 10:50 am
by SolidSnake
Ok let's try this one, I have found it searching in old topics:
janiii wrote:a little try on this.. not tested, just an idea.

Code: Select all

Index: java/com/l2jserver/Config.java===================================================================--- java/com/l2jserver/Config.java	(revision 3799)+++ java/com/l2jserver/Config.java	(working copy)@@ -469,6 +469,8 @@ 	public static long ALT_OLY_BATTLE; 	public static long ALT_OLY_WPERIOD; 	public static long ALT_OLY_VPERIOD;+	public static int[] ALT_OLY_END_DATE;+	public static int[] ALT_OLY_END_HOUR = new int[3]; 	public static int ALT_OLY_CLASSED; 	public static int ALT_OLY_NONCLASSED; 	public static int ALT_OLY_REG_DISPLAY;@@ -2197,6 +2199,17 @@ 					ALT_OLY_BATTLE = Long.parseLong(olympiad.getProperty("AltOlyBattle","360000")); 					ALT_OLY_WPERIOD = Long.parseLong(olympiad.getProperty("AltOlyWPeriod","604800000")); 					ALT_OLY_VPERIOD = Long.parseLong(olympiad.getProperty("AltOlyVPeriod","86400000"));+					String[] propertySplit = olympiad.getProperty("AltOlyEndDate","1").split(",");+					ALT_OLY_END_DATE = new int[propertySplit.length];+					for (int i = 0; i < propertySplit.length; i++)+					{+						ALT_OLY_END_DATE[i] = Integer.parseInt(propertySplit[i]);+					}+					propertySplit = olympiad.getProperty("AltOlyEndHour","12:00:00").split(":");+					for (int i = 0; i < 3; i++)+					{+						ALT_OLY_END_HOUR[i] = Integer.parseInt(propertySplit[i]);+					} 					ALT_OLY_CLASSED = Integer.parseInt(olympiad.getProperty("AltOlyClassedParticipants","5")); 					ALT_OLY_NONCLASSED = Integer.parseInt(olympiad.getProperty("AltOlyNonClassedParticipants","9")); 					ALT_OLY_REG_DISPLAY = Integer.parseInt(olympiad.getProperty("AltOlyRegistrationDisplayNumber","100"));Index: java/com/l2jserver/gameserver/model/olympiad/Olympiad.java===================================================================--- java/com/l2jserver/gameserver/model/olympiad/Olympiad.java	(revision 3799)+++ java/com/l2jserver/gameserver/model/olympiad/Olympiad.java	(working copy)@@ -872,14 +872,25 @@ 		Announcements.getInstance().announceToAll(sm);  		Calendar currentTime = Calendar.getInstance();-		currentTime.add(Calendar.MONTH, 1);-		currentTime.set(Calendar.DAY_OF_MONTH, 1);-		currentTime.set(Calendar.AM_PM, Calendar.AM);-		currentTime.set(Calendar.HOUR, 12);-		currentTime.set(Calendar.MINUTE, 0);-		currentTime.set(Calendar.SECOND, 0);-		_olympiadEnd = currentTime.getTimeInMillis();+		int nearest = 0; +		Calendar[] cals = new Calendar[Config.ALT_OLY_END_DATE.length];+		for (int i = 0; i < cals.length; i++)+		{+			cals[i] = Calendar.getInstance();+			cals[i].set(Calendar.DAY_OF_MONTH, Config.ALT_OLY_END_DATE[i]);+			if (cals[i].before(currentTime))+				cals[i].add(Calendar.MONTH, 1);+			+			if (cals[i].before(cals[nearest]))+				nearest = i;+		}+		+		cals[nearest].set(Calendar.HOUR_OF_DAY, Config.ALT_OLY_END_HOUR[0]);+		cals[nearest].set(Calendar.MINUTE, Config.ALT_OLY_END_HOUR[1]);+		cals[nearest].set(Calendar.SECOND, Config.ALT_OLY_END_HOUR[2]);+		_olympiadEnd = cals[nearest].getTimeInMillis();+		 		Calendar nextChange = Calendar.getInstance(); 		_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD; 		scheduleWeeklyChange();Index: java/config/olympiad.properties===================================================================--- java/config/olympiad.properties	(revision 3799)+++ java/config/olympiad.properties	(working copy)@@ -33,6 +33,17 @@ # Default: 86400000 AltOlyVPeriod = 86400000 +# Olympiad End Period Date - day(s) of month+# (e.g. 1 would mean oly period ends every 1st day of month)+# (e.g. 1,15 would mean oly period ends every 1st and 15th day of month)+# <b><font color=red>CAUTION: You should set the AltOlyWPeriod and AltOlyVPeriod according to the changes done here!</font></b>+# Default: 1+AltOlyEndDate = 1          <------------- // Sakretsu - So there you should write 1,15 (days of every month)++# Olympiad End Period Time - in format hh:mm:ss (24 hours format)+# Default: 12:00:00+AltOlyEndHour = 12:00:00+ # Required number of participants for Classed and Non-Classed matches, Default 5 & 9 # Default: 5 AltOlyClassedParticipants = 5
I installed it and there aren't errors..


P.S. Anyway you can use my method too. Try to wait 18.00 to see the new olympiad period end. But I think janiii' patch is better. Test it ! :D

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 11:29 am
by giligan11
Hi! I really appreciate you helping me with this. Well, I am desperate about it so I will try this. By the way, what am I supposed to do with this? just follow the codes you posted here by Janii? :D

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 11:42 am
by giligan11
In those codes you posted "+" means to add the script and "-" means to delete the script?

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 11:46 am
by SolidSnake
Yes, - delete the line + add the new code

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 12:15 pm
by giligan11
Well, I'm done adding adding the necessary revisions to it. Wish me luck!!! :D

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 12:59 pm
by giligan11
Still not working. Says in the gameserver console 18k minutes = 12 days. Are the changes seen in an instant upon changing the codes or should the prior olympiad period finish first before I see those changes?

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 1:02 pm
by SolidSnake
The Olympiad system should update their database values (on Navicat) at 18.00

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 1:41 pm
by giligan11
on Navicat:
Olympiad End: 1283306400524
Validation End : 1280725203518
Next weekly change : 1282237208983

Are these the usual values or have the values changed?

Re: [HELP] Olympiad.properties

Posted: Thu Aug 19, 2010 2:33 pm
by SolidSnake
That values are changed by Olympiad engine with an update made at 18.00

You can also change this configuration:

Code: Select all

# Olympiad Start Time in Military hours Default 6pm (18) # Default: 18AltOlyStartTime = 18 # Olympiad Start Time for Min's, Default 00 so at the start of the hour.# Default: 00AltOlyMin = 00
And restart server to start olympiad games before 18.00