Page 1 of 1

Olympiad_end a mistery

Posted: Mon Oct 11, 2010 8:48 am
by repxl
yo im trying to make a olympiad period week .
and i tryed to set olympiad_end in the oly data table
1286786880 = Monday, October 11, 2010 10:48:00 AM
period : 0
i started it and it said in console 8217 minutes when olympiad end . lol ? it should saay in 2 minutes olympiad end becuase i have run it Monday, October 11, 2010 10:46:00 AM

its a big mistery .

also i changed this but no know what it do and what its make . i just need a recipe for 1 week oly ..... a setup . dont have someone it ?
and i need end oly today and the next time it will end at Sunday , 24:00

Code: Select all

    protected void setNewOlympiadEnd()    {        SystemMessage sm = new SystemMessage(SystemMessageId.OLYMPIAD_PERIOD_S1_HAS_STARTED);        sm.addNumber(_currentCycle);                Announcements.getInstance().announceToAll(sm);        //tomasko edit        Calendar currentTime = Calendar.getInstance();        currentTime.add(Calendar.WEEK_OF_MONTH, 1);        currentTime.set(Calendar.DAY_OF_WEEK, 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();    }

Re: Olympiad_end a mistery

Posted: Mon Oct 11, 2010 8:53 am
by _DS_
All timestamps in l2j use milliseconds. Should you look on previous value BEFORE making changes ?

Re: Olympiad_end a mistery

Posted: Mon Oct 11, 2010 8:57 am
by repxl
_DS_ wrote:All timestamps in l2j use milliseconds. Should you look on previous value BEFORE making changes ?
can you give me a link wich you using for convert it in milisecounds ? please .

Re: Olympiad_end a mistery

Posted: Mon Oct 11, 2010 8:59 am
by surskis

Re: Olympiad_end a mistery

Posted: Mon Oct 11, 2010 9:04 am
by _DS_
Did you know how many milliseconds in second ?

Re: Olympiad_end a mistery

Posted: Mon Oct 11, 2010 9:06 am
by repxl
_DS_ wrote:Did you know how many milliseconds in second ?
1000
so the date 1286786880 x 1000 ???

Re: Olympiad_end a mistery

Posted: Mon Oct 11, 2010 9:07 am
by repxl

Re: Olympiad_end a mistery

Posted: Mon Oct 11, 2010 9:11 am
by repxl
okey it,s working now i have need just do x1000 now it write correct
1 answer so i now make oly end in 3 min,s and then next period start i make Sun : 24:00 and it will then automatically make 1 week ??? or i have to change it all time .


im using also this :

Code: Select all

    protected void setNewOlympiadEnd()    {        SystemMessage sm = new SystemMessage(SystemMessageId.OLYMPIAD_PERIOD_S1_HAS_STARTED);        sm.addNumber(_currentCycle);                Announcements.getInstance().announceToAll(sm);        //tomasko edit        Calendar currentTime = Calendar.getInstance();        currentTime.add(Calendar.WEEK_OF_MONTH, 1);        currentTime.set(Calendar.DAY_OF_WEEK, 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();    }