Jump to content

Recommended Posts

Posted

image.jpg

 

image.jpg

-			long milliToEnd;
-			if (_period == 0)
-				milliToEnd = getMillisToOlympiadEnd();
-			else
-				milliToEnd = getMillisToValidationEnd();
-			
-			LOGGER.info("Olympiad System: " + Math.round(milliToEnd / 60000) + " minutes until period ends");
-			
-			if (_period == 0)
-			{
-				milliToEnd = getMillisToWeekChange();
-				
-				LOGGER.info("Olympiad System: Next weekly change is in " + Math.round(milliToEnd / 60000) + " minutes");
-			}

+			long milliToEnd;
+			if (_period == 0)
+				milliToEnd = getMillisToOlympiadEnd();
+			else
+				milliToEnd = getMillisToValidationEnd();
+						
+			double numSecs = (milliToEnd / 1000) % 60;
+			double countDown = ((milliToEnd / 1000) - numSecs) / 60;
+			final int numMins = (int) Math.floor(countDown % 60);
+			countDown = (countDown - numMins) / 60;
+			int numHours = (int) Math.floor(countDown % 24);
+			int numDays = (int) Math.floor((countDown - numHours) / 24);
+			
+			LOGGER.info("Olympiad System: " + numDays + " days, " + numHours + " hours and " + numMins + " mins. until period ends");
+			
+			if (_period == 0)
+			{
+				long milliToEnd2 = getMillisToWeekChange();
+				
+				double numSecs1 = (milliToEnd2 / 1000) % 60;
+				double countDown1 = ((milliToEnd2 / 1000) - numSecs1) / 60;
+				final int numMins1 = (int) Math.floor(countDown1 % 60);
+				countDown1 = (countDown - numMins1) / 60;
+				int numHours1 = (int) Math.floor(countDown1 % 24);
+				int numDays1 = (int) Math.floor((countDown1 - numHours1) / 24);
+				
+				LOGGER.info("Olympiad System: Next weekly change in " + numDays1 + " days, " + numHours1 + " hours and " + numMins1 + " mins.");
			}
  • Like 1
  • Upvote 1
  • 4 weeks later...
  • 1 month later...
Posted (edited)

 

image.jpg

 

 

Thank you for the share, but Explain me something, please!

"6 days, 17 hours and 5 min until period ends" this means that weekly competition will end in this time, correct?

 

So what does this mean? > Next weekly change in 0 days, 02 hour and 14 min. ??? Isnt the weekly change above already?

:wacko:  :wacko:

Edited by vecc
  • 2 months later...
Posted

 

image.jpg

 

image.jpg

-			long milliToEnd;
-			if (_period == 0)
-				milliToEnd = getMillisToOlympiadEnd();
-			else
-				milliToEnd = getMillisToValidationEnd();
-			
-			LOGGER.info("Olympiad System: " + Math.round(milliToEnd / 60000) + " minutes until period ends");
-			
-			if (_period == 0)
-			{
-				milliToEnd = getMillisToWeekChange();
-				
-				LOGGER.info("Olympiad System: Next weekly change is in " + Math.round(milliToEnd / 60000) + " minutes");
-			}

+			long milliToEnd;
+			if (_period == 0)
+				milliToEnd = getMillisToOlympiadEnd();
+			else
+				milliToEnd = getMillisToValidationEnd();
+						
+			double numSecs = (milliToEnd / 1000) % 60;
+			double countDown = ((milliToEnd / 1000) - numSecs) / 60;
+			final int numMins = (int) Math.floor(countDown % 60);
+			countDown = (countDown - numMins) / 60;
+			int numHours = (int) Math.floor(countDown % 24);
+			int numDays = (int) Math.floor((countDown - numHours) / 24);
+			
+			LOGGER.info("Olympiad System: " + numDays + " days, " + numHours + " hours and " + numMins + " mins. until period ends");
+			
+			if (_period == 0)
+			{
+				long milliToEnd2 = getMillisToWeekChange();
+				
+				double numSecs1 = (milliToEnd2 / 1000) % 60;
+				double countDown1 = ((milliToEnd2 / 1000) - numSecs1) / 60;
+				final int numMins1 = (int) Math.floor(countDown1 % 60);
+				countDown1 = (countDown - numMins1) / 60;
+				int numHours1 = (int) Math.floor(countDown1 % 24);
+				int numDays1 = (int) Math.floor((countDown1 - numHours1) / 24);
+				
+				LOGGER.info("Olympiad System: Next weekly change in " + numDays1 + " days, " + numHours1 + " hours and " + numMins1 + " mins.");
			}

How do I put the days that are missing from the community htm? I mean, what code does it have to be used on HTM to display?

  • 3 months later...
Posted

Hey, i have a question!

I'm added this code, changed config to:

# You can decide if enable custom period setting feature. Once enabled,
# Alt Oly period: MONTH/DAY/WEEK
# es. 2weeks-->AltOlyPeriod=WEEK and AltOlyPeriodMultiplier=2
AltOlyUseCustomPeriodSettings= True
AltOlyPeriod = WEEK
AltOlyPeriodMultiplier = 1

Deleted everything from Olympiad.cfg

Restarted our server, and for me now show in console this:

INFO  Olympiad System: Loading Olympiad System....
INFO  Olympiad System: Currently in Olympiad Period
INFO  Olympiad System: 14 days, 23 hours and 8 mins. until period ends
INFO  Olympiad System: Next weekly change in 0 days, 5 hours and 45 mins.
INFO  Olympiad System: Loaded 0 Nobles
INFO  Olympiad System: Competition Period Starts in 0 days, 5 hours and 8 mins.
INFO  Olympiad System: Event starts/started : Thu Nov 16 18:00:26 EET 2017
INFO  Hero System: Loaded 0 Heroes.
INFO  Hero System: Loaded 0 all time Heroes.

So my question is, then will change heroes now?

Posted (edited)

INFO  Olympiad System: Next weekly change in 0 days, 5 hours and 45 mins.

Heroes will change after this time, so the new circle will start after this time.

Edited by KruMix
Posted

Now show that:

INFO  Olympiad System: Loading Olympiad System....
INFO  Olympiad System: Currently in Olympiad Period
INFO  Olympiad System: 14 days, 10 hours and 35 mins. until period ends
INFO  Olympiad System: Next weekly change in 0 days, 5 hours and 12 mins.
INFO  Olympiad System: Loaded 0 Nobles
INFO  Olympiad System: Competition Period Starts in 0 days, 16 hours and 35 mins.
INFO  Olympiad System: Event starts/started : Fri Nov 17 18:00:21 EET 2017
INFO  Hero System: Loaded 0 Heroes.
INFO  Hero System: Loaded 0 all time Heroes.

i don't think that is true.  So heroes frozen changing not on Sunday night?

Posted

Something is weird, you are right, the period will end after this time  14 days, 10 hours and 35 mins.

 

Try to give heroes manually and after see if the period will be for 7 days.

Posted

I make manual heroes, and restarted server. Now show in console:

INFO  Olympiad System: Loading Olympiad System....
INFO  Olympiad System: Currently in Validation Period
INFO  Olympiad System: 0 days, 23 hours and 58 mins. until period ends
INFO  Olympiad System: Loaded 0 Nobles
INFO  Hero System: Loaded 0 Heroes.
INFO  Hero System: Loaded 0 all time Heroes.

Posted
40 minutes ago, SweeTs said:

There is a 24h 'validation' window.

so how to set this setup, to change heroes every sunday night at 00:00? Because i can't understand that console info..

Posted
protected void setNewOlympiadEndCustom()
    {
        final SystemMessage sm = new SystemMessage(SystemMessageId.OLYMPIAD_PERIOD_S1_HAS_STARTED);
        sm.addNumber(_currentCycle);
        
        Announcements.getInstance().announceToAll(sm);
        
        final Calendar currentTime = Calendar.getInstance();
        currentTime.set(Calendar.AM_PM, Calendar.AM);
        currentTime.set(Calendar.HOUR, 12);
        currentTime.set(Calendar.MINUTE, 0);
        currentTime.set(Calendar.SECOND, 0);
        
        final Calendar nextChange = Calendar.getInstance();
        
        switch (Config.ALT_OLY_PERIOD)
        {
            case DAY:
            {
                currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
                currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
                
                if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
                {
                    _nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
                }
                else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
                {
                    _nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
                }
                else
                {
                    // nothing to do, too low period
                }
                
            }
                break;
            case WEEK:
            {
                currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
                currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
                
                if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
                {
                    _nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
                }
                else
                {
                    _nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
                }
                
            }
                break;
            case MONTH:
            {
                currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
                currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
                
                _nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
                
            }
                break;
        }
        
        _olympiadEnd = currentTime.getTimeInMillis();
        
        scheduleWeeklyChange();
    }
    
    private void schedulePointsRestoreCustom()
    {
        long final_change_period = WEEKLY_PERIOD;
        
        switch (Config.ALT_OLY_PERIOD)
        {
            case DAY:
            {
                
                if (Config.ALT_OLY_PERIOD_MULTIPLIER < 10)
                {
                    
                    final_change_period = WEEKLY_PERIOD / 2;
                    
                }
                
            }
                break;
            case WEEK:
            {
                
                if (Config.ALT_OLY_PERIOD_MULTIPLIER == 1)
                {
                    final_change_period = WEEKLY_PERIOD / 2;
                }
                
            }
                break;
        }
        
        _scheduledWeeklyTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new OlympiadPointsRestoreTask(final_change_period), getMillisToWeekChange(), final_change_period);
        
    }
    
    class OlympiadPointsRestoreTask implements Runnable
    {
        
        private final long restoreTime;
        
        public OlympiadPointsRestoreTask(final long restoreTime)
        {
            this.restoreTime = restoreTime;
        }
        
        @Override
        public void run()
        {
            addWeeklyPoints();
            LOGGER.info("Olympiad System: Added points to nobles");
            
            final Calendar nextChange = Calendar.getInstance();
            _nextWeeklyChange = nextChange.getTimeInMillis() + restoreTime;
        }
        
    }
}

This is the part of Olympiad.java code.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • I wouldn't expect something less, since you work with Psadek (or I maybe mistake you with NightW0lf from itopz, in that case soz) Let's throw rocks at Java Golds and elevate "original L2OFF Golds", no?
    • We are delighted to announce our partnership with the leading resource, Active Anticheat, specializing in protection against bot programs, clickers, and additional modules for the game client that enhance the experience for both you and the players!   When you purchase Active Anticheat for our product, you will also receive a $50 discount.   Here's a brief overview of the features of Active Anticheat: Best protection against bots, including private and premium versions. Window limitation. HWID spoofing protection. Virtual machine protection. File hash protection for client files, preventing players from modifying them (e.g., interface files). Encryption of any game files. Integration with Discord to attract new players! Additional plugins: - Window with saved player logins/passwords. Players no longer need to enter them every time! - HWID sending to the game server. - Game window optimizer for quick switching. - Background FPS adjustment. - Window name customization in the format "%character_name% - %server_name%". - Ctrl+C/V permission. - Login and password saving (for Interlude -> High Five). - Launching the browser via server packets. - Launching interface events via server packets. - Interlude: fixing a known game bug (History: UpdateAnimation <- AActor::Tick <- TickAllActors <- ULevel::Tick <- (NetMode=0) <- TickLevel <- UGameEngine::Tick <- UpdateWorld <- MainLoop). - Interlude: debuff feature. 9) All of this is available without modifying the game server code (some plugins may require minor changes). Take note of newest plugin, which is highly useful: Guides section
    • The Lucera2 Multiprotocol is an advanced server branch for Lineage 2 that enables seamless support for multiple client versions on a single server instance. This allows players to connect and play using either the legacy (old) client or the newer Classic client simultaneously, without any compatibility issues or loss of functionality. Key Benefits Dual Client Support: Both the old Interlude client and Classic: Secret of Empire 2.6 client can run concurrently on the same server. All features from the Classic client (e.g., enhanced UI, new mechanics) remain fully available, while the old client retains its alternative features (e.g., simplified interfaces for lower-end hardware). Expanded Player Base: Ideal for regions with limited access to modern gaming setups, as it accommodates a wider range of devices and preferences, merging Legacy and Classic communities into one forum section for unified discussions. No Functionality Gaps: Extensive testing ensures zero disruptions—players on either client experience complete game integrity, including quests, PvP, raids, and custom Lucera2 subsystems. You can fully test and explore all aspects of Multiprotocol on the dedicated Test Server. Supported Protocols C6 (Old Client): Protocol versions 740–770. Classic Client (Secret of Empire 2.6): Protocol versions 166–192.
    • Connect to the server you need to >>>download<<< game client launch from /system_en/. Login server setup on auto registration, admin rights in game by default . Or you can use a patch specifying the l2.ini Connect to address classic.lucera2.com if you already have a game client Download updated patch All major/minor subsystems operate in a proper view. Absolutely ready to combat the server.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock