Jump to content
  • 0

Olympiad bug


Question

Posted

Ok here's the deal, I was testing some stuff inside olys for the first time on my server (last h5 files) and i did 10 matches.

 

After like 2 hours i went back online and did /olympiadstat on my char and it only had 3 matches done. Any1 clue on what's going on?

 

Thanks in advance

Recommended Posts

  • 0
Posted

Ok here's the deal, I was testing some stuff inside olys for the first time on my server (last h5 files) and i did 10 matches.

 

After like 2 hours i went back online and did /olympiadstat on my char and it only had 3 matches done. Any1 clue on what's going on?

 

Thanks in advance

Did you add any custom patch related with olympiads? Did u try to report it in l2jserver forum?

U should test it again btw. I guess there isn't a config to setup a maximum number of combats per day, isn't it?

  • 0
Posted

Verify if the different values are correctly setuped on /olympiadstat usercommand. It probably showed you losses or winning instead of total, etc. The position of parameters in a SystemMessage is important. And in few cases, you can have s2 s1 instead of regular s1 s2.

  • 0
Posted

It says i have 3matches, 2 won, 1 lost.

The thing is, when i open navicat, inside olympiad_data i see all the matches there... and yesterday when i did /olympaidstat it showed all the 10 matches, it only changed after a while for some weird reason.

And yeah i was trying to change the period from 1 month to 2 weeks, and i believe i failed... >.<

 

Btw, talkin' about it, can any of u redirect me to a post on "how to change it to 2 weeks", cuz all the ones i saw i dont believe that they are for h5, atleast the files they ask to change i dont even have them, i mean the lines...

 

  • 0
Posted

Ye...

 

Olympiad.java

Calendar currentTime = Calendar.getInstance();
+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();		
-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();

Calendar nextChange = Calendar.getInstance();
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
scheduleWeeklyChange();

 

Config.java

 

public static int[] ALT_OLY_END_DATE;

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]);
}

 

olympiad.properties

# 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)
# CAUTION: You should set the AltOlyWPeriod and AltOlyVPeriod according to the changes done here!</font></b>
# Default: 1
AltOlyEndDate = 1

I guess it's all there, I don't find the patch.

Credits:Zoey76

  • 0
Posted

Just one thing, where do I add the lines in config.java

 

ty very much anyway and I hope it works :)

the "public static int[] ALT_OLY_END_DATE;" just... CNTRL + F "ALT_OLY_ENCHANT_LIMIT" for example...

and the rest just...CNTRL + F "ALT_OLY_ENCHANT_LIMIT" again and put it there...

  • 0
Posted

    [javac] L2J Server\workspace\L2J_Server\java\com\l2jserver\Config.java:2877: error: variable propertySplit is already defined in method load()

    [javac] String[] propertySplit = Olympiad.getProperty("AltOlyEndDate","1").split(",");

    [javac]         ^

    [javac] L2J Server\workspace\L2J_Server\java\com\l2jserver\gameserver\model\olympiad\Olympiad.java:608: error: cannot find symbol

    [javac] cals[nearest].set(Calendar.HOUR_OF_DAY, Config.ALT_OLY_END_HOUR[0]);

    [javac]                                               ^

    [javac]  symbol:  variable ALT_OLY_END_HOUR

    [javac]  location: class Config

    [javac] L2J Server\workspace\L2J_Server\java\com\l2jserver\gameserver\model\olympiad\Olympiad.java:609: error: cannot find symbol

    [javac] cals[nearest].set(Calendar.MINUTE, Config.ALT_OLY_END_HOUR[1]);

    [javac]                                         ^

    [javac]  symbol:  variable ALT_OLY_END_HOUR

    [javac]  location: class Config

    [javac] L2J Server\workspace\L2J_Server\java\com\l2jserver\gameserver\model\olympiad\Olympiad.java:610: error: cannot find symbol

    [javac] cals[nearest].set(Calendar.SECOND, Config.ALT_OLY_END_HOUR[2]);

    [javac]                                         ^

    [javac]  symbol:  variable ALT_OLY_END_HOUR

    [javac]  location: class Config

    [javac] 4 errors

 

BUILD FAILED

  • 0
Posted

change

String[] propertySplit = Olympiad.getProperty("AltOlyEndDate","1").split(",");

for

propertySplit = Olympiad.getProperty("AltOlyEndDate","1").split(",");

 

and from Olympiad.java your void should look like this:

 

protected void setNewOlympiadEnd()
{
	SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.OLYMPIAD_PERIOD_S1_HAS_STARTED);
	sm.addNumber(_currentCycle);		
	Announcements.getInstance().announceToAll(sm);		
	Calendar currentTime = Calendar.getInstance();

	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();
}

  • 0
Posted

compile:

    [javac] Compiling 1662 source files to C:\Users\Paps\Desktop\L2J Server\workspace\L2J_Server\build\bin

    [javac] L2J Server\workspace\L2J_Server\java\com\l2jserver\Config.java:2878: error: cannot assign a value to final variable propertySplit

    [javac] propertySplit = Olympiad.getProperty("AltOlyEndDate","1").split(",");

    [javac] ^

    [javac] L2J Server\workspace\L2J_Server\java\com\l2jserver\gameserver\model\olympiad\Olympiad.java:608: error: cannot find symbol

    [javac] cals[nearest].set(Calendar.HOUR_OF_DAY, Config.ALT_OLY_END_HOUR[0]);

    [javac]                                               ^

    [javac]  symbol:  variable ALT_OLY_END_HOUR

    [javac]  location: class Config

    [javac] L2J Server\workspace\L2J_Server\java\com\l2jserver\gameserver\model\olympiad\Olympiad.java:609: error: cannot find symbol

    [javac] cals[nearest].set(Calendar.MINUTE, Config.ALT_OLY_END_HOUR[1]);

    [javac]                                         ^

    [javac]  symbol:  variable ALT_OLY_END_HOUR

    [javac]  location: class Config

    [javac] L2J Server\workspace\L2J_Server\java\com\l2jserver\gameserver\model\olympiad\Olympiad.java:610: error: cannot find symbol

    [javac] cals[nearest].set(Calendar.SECOND, Config.ALT_OLY_END_HOUR[2]);

    [javac]                                         ^

    [javac]  symbol:  variable ALT_OLY_END_HOUR

    [javac]  location: class Config

    [javac] 4 errors

 

BUILD FAILED

 

Still having these 4 errors :s

  • 0
Posted

Well dunno what the hack are u doing but i think that i gave you all to add it ok. I'm sleeping now, hope u can find out whats wrong in ur workspace.

  • 0
Posted

Ok, Config.java is wrong, use this

 

### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/model/olympiad/Olympiad.java
===================================================================
--- java/com/l2jserver/gameserver/model/olympiad/Olympiad.java	(revision 6193)
+++ java/com/l2jserver/gameserver/model/olympiad/Olympiad.java	(working copy)
@@ -586,18 +586,30 @@
	{
		SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.OLYMPIAD_PERIOD_S1_HAS_STARTED);
		sm.addNumber(_currentCycle);
-		
		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/com/l2jserver/Config.java
===================================================================
--- java/com/l2jserver/Config.java	(revision 6193)
+++ java/com/l2jserver/Config.java	(working copy)
@@ -563,6 +563,8 @@
	public static String CHAT_FILTER_CHARS;
	public static int[] BAN_CHAT_CHANNELS;
	public static int ALT_OLY_START_TIME;
+	public static int[] ALT_OLY_END_DATE;
+	public static int[] ALT_OLY_END_HOUR = new int[3];
	public static int ALT_OLY_MIN;
	public static long ALT_OLY_CPERIOD;
	public static long ALT_OLY_BATTLE;
@@ -2832,6 +2834,17 @@
			}

			ALT_OLY_START_TIME = Integer.parseInt(Olympiad.getProperty("AltOlyStartTime", "18"));
+			String[] Split = Olympiad.getProperty("AltOlyEndDate", "1").split(",");
+			ALT_OLY_END_DATE = new int[split.length];
+			for (int i = 0; i < Split.length; i++)
+			{
+				ALT_OLY_END_DATE[i] = Integer.parseInt(Split[i]);
+			}
+			Split = Olympiad.getProperty("AltOlyEndHour", "12:00:00").split(":");
+			for (int i = 0; i < 3; i++)
+			{
+				ALT_OLY_END_HOUR[i] = Integer.parseInt(Split[i]);
+			}
			ALT_OLY_MIN = Integer.parseInt(Olympiad.getProperty("AltOlyMin", "00"));
			ALT_OLY_CPERIOD = Long.parseLong(Olympiad.getProperty("AltOlyCPeriod", "21600000"));
			ALT_OLY_BATTLE = Long.parseLong(Olympiad.getProperty("AltOlyBattle", "300000"));

 

and olympiad.properties:

 

# 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)
# CAUTION: You should set the AltOlyWPeriod and AltOlyVPeriod according to the changes done here!</font></b>
# Default: 1
AltOlyEndDate = 1

# Olympiad End Period Time - in format hh:mm:ss (24 hours format)
# Default: 12:00:00
AltOlyEndHour = 12:00:00

  • 0
Posted

BUILD SUCCESSFULL

 

atleast no errors doing that :P

 

Btw, it's suppose to get new heros every 1st and 15th of the month now, right?

  • 0
Posted

BUILD SUCCESSFULL

 

atleast no errors doing that :P

 

Btw, it's suppose to get new heros every 1st and 15th of the month now, right?

Depends, if you set the config = 1,15      yes

Guest
This topic is now closed to further replies.
×
×
  • Create New...