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

    • It's also the players' fault, because there have been decent servers implementing some of the things you said plus some other 'innovations', plus many QOL things for newbies (ingame bestiary, with drops searchers, etc). In the end, it's the players who decide to feed into that shit and play the most garbage servers simply because the owners of the servers gave their clan leaders 100 euros, or they insta quit the server because they didn't win the first QA, etc, etc, etc.   In the end, if a server is garbage or great it doesn't really matter if the players don't wanna stay in there.   Players are no better than the devs themselves, in the end it seems there are abusive devs who will milk the shit out of their willingly milkable players, or there are none, goes both ways.
    • In my opinion, L2 is dead because the people who make servers didn’t adapt to today’s reality. People are getting older, life moves faster, there are more responsibilities, and less free time. And I’m not even talking about newcomers—how can you expect someone new to this game to learn by Googling every drop location or quest requirement? These things should’ve been integrated into the game, made accessible with just a few clicks through the interface. Instead, so much time was wasted trying to recreate retail-like features that no one asked for. Everyone hates autofarm, but why? Because admins never found a smart way to implement it. You could have made it available only in specific zones, with reduced drops, working like Adrenaline, or auto-teleporting to farm for a limited time per day—just enough to help people with limited time stay relevant in-game. There should also be zones with better drops, where active farming actually matters. Other features feel pointless—like the Life Stone system. Spamming LS to get a skill? Instead, you could create a system where you level up the skill with low chances per level, something that feels progressive and fair. Crafting should be simpler too. Right-click a recipe, and the required materials should show up right there. As for sieges, why not create daily clan war events at peak hours—one for Europeans, one for Latinos? You could spawn crystals inside or outside castles that give points and trigger PvP. Add a boss during the event that gives even more points, and let the top clan in the ranking take the castle. I could go on forever, but what’s the point? The community died because the people who had the knowledge to improve the game just took the easy way out, copying the same server formula over and over until no one could enjoy playing it anymore.
    • It's not because I'm an admin that he treated me differently. I actually gave him several clients from my side without him even knowing they came from me, and most of them had no issues. I was also waiting 3–4 weeks at times for things I bought from AvE, even when I was in a rush. He still delivered in the end. That said, I'm not defending him blindly. I'm just saying it's unlikely he’d risk scamming someone over 60–100€, especially knowing how quickly word spreads here.
    • For exact same reason - there were accusation that I scammed. When was it? 2016? But in that time, admins actually didn't listen. I got banned, then unbaned (when I prooved I've refunded) but I was trash talking to mods. When few months later same shit happened, Grisom (?) old global mod, banned me anyway. You can read somewhere on forum how I was shitting on him for doing that (from other account because original account was banned) - which was banned too. He is not here anymore I think. Back in the days I was well know for not carring that much if I was talking to mod or admin, I didn't hold my tongue. Now You know. Just like You know - if I delay, I deliver or refund. I'm not a scammer, even if my old time haterz love to repeat themselfs like mantra. I don't care.
    • Okay I respect that but why is your other account banned?   I don't think this happened just because you delayed somebodys work even in 2012
  • Topics

×
×
  • Create New...