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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • I was looking for  server with a low rates,eventually i found l2 elixir.I Joined beta and after so many years since 2008 i found  a friend that we played together, memories came back. i cant wait for the grand oppening!. dont miss it!
    • Seems legit, for sure deserves a try!
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
  • 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