Jump to content
  • 0

[Request] Restart countdown screen message


Question

Posted

Hey guys!

It's been a while since I last asked for your help.

 

I need a code that makes a countdown until the restart/ shutdown show up on the bottom right corner of the screen, not only on the chat window.

I've seen it on many servers but I've been searching for it for a long time and I can't find it.

 

Thanks in advance. ::)

5 answers to this question

Recommended Posts

  • 0
Posted

For the countdown code itself (wasn't really clear if you asked only the second or/and the first part of your question too), you can see Shutdown.java file which use a countdown to shutdown server.

 

For what happen in the countdown code : you got a class named Broadcast.java listing all methods to broadcast things. On shutdown you use notably SendServerQuit( method using it (from my memories of basic L2JIL, it doesn't, but it should).

 

	private static void SendServerQuit(int seconds)
{
	SystemMessage sysm = SystemMessage.getSystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECONDS);
	sysm.addNumber(seconds);
	Broadcast.toAllOnlinePlayers(sysm);
}

 

Instead of SystemMessage, use the packet I have given the name above. About the right corner thing you have to know how the given packet is working, and so find some documentations about parameters the packet can use.

 

PS : THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECONDS is supposed to show a message as a ExShowScreenMessage. Some SystemMessage got that property. So if your ask got nothing to do with customs, and you want simply add the function correctly, I got no idea why it is wrong for you (or eventually you are using a chronicle where such packet wasn't *EVENTUALLY* existing).

  • 0
Posted

private static void SendServerQuit(int seconds)

{

SystemMessage sysm = SystemMessage.getSystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECONDS);

sysm.addNumber(seconds);

Broadcast.toAllOnlinePlayers(sysm);

 

I'm assuming you meant to change the highlighted part with ExShowScreenMessage. I did that and sadly, it didn't work.

I should probably mention that there was no "ExShowScreenMessage.java" file in my serverpackets, so I added one I found online.

 

(I forgot to say in my first post that I use L2j Server Interlude)

  • 0
Posted

L2J IL hasn't that packet registered. You can find correct implementation on aCis for exemple. L2JFrozen probably got it aswell.

 

About the use :

 

Broadcast.toAllOnlinePlayers(new ExShowScreenMessage(param1, 2, 3, ...));

 

You didn't answer about if you wanted to use for custom or to fix Shutdown.java. As I stated, if you want to fix Shutdown.java, you have to search elsewhere, probably SystemMessage system itself is broken.

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

    • We've added 5% discounts for bulk purchases of Google accounts for orders of 300 or more, and 10% for orders of 500 or more. The discount is applied automatically when you place your order! The discount is indicated in the product title and description for each category.  
    • 🎄 CHRISTMAS EVENT 🎄   ‼️ Information and details: https://forum.l2harbor.com/threads/rozhdestvenskie-xlopoty-christmas-chores.9430/post-171464
    • METATG.ORG Direct Telegram Service Provider A bonus of +7% on every order! *We add 7% more followers than your ordered amount to proactively cover potential drops and guarantee you an honest result." Telegram Followers - Price per 1000 SUBSCRIBERS Subscribers 3 days - $0.10 ~ 8 RUB Subscribers. Daily Completion: 200,000,000 Subscribers 7 days - $0.17 ~ 13.6 RUB Subscribers. Daily Completion: 200,000,000 Subscribers 14 days - $0.20 ~ 16 RUB Subscribers. Daily Completion: 200,000,000 Subscribers 30 days - $0.30 ~ 24 RUB Subscribers. Daily Completion: 200,000,000 Subscribers 60 days - $0.40 ~ 32 RUB Subscribers, 14-day guarantee. Daily Completion: 200,000,000 Subscribers 90 days (Super Fast) - $0.50 ~ 40 RUB Subscribers, 14-day guarantee. Daily Completion: 200,000,000 Subscribers 120 days (Super Fast) - $0.60 ~ 48 RUB Subscribers, 14-day guarantee. Daily Completion: 200,000,000 Subscribers Lifetime (Super Fast) - $0.70 ~ 56 RUB Lifetime Subscribers. 14-day guarantee. Daily Completion: 200,000,000 Telegram Services - Price per 1000 Post Views - $0.06 ~ 5 RUB Reactions - $0.08 ~ 6.5 RUB Bot Starts - $0.10 ~ 8 RUB Bot Starts with referrals - $0.15 ~ 12 RUB DISCOUNTS and CASHBACK for large volumes Direct Supplier. We work from our own accounts with our own software! High execution speed. Multiple payment methods. We work 24/7! Additional discounts are discussed for volumes starting from $1000 per day. SUPPORT 24/7 - TELEGRAM WEBSITE 24/7 - METATG.ORG
    • Added: a brand-new default dashboard template. You can now add multiple game/login server builds. Full support for running both PTS & L2J servers simultaneously, with switching between them. Payment systems: added OmegaPay and Pally (new PayPal-style API). Account history now stores everything: donations, items delivered to characters, referrals, transfers between game accounts, and coin transfers to another master account. Personal Promo Code System: you can create a promo code and assign it to a user or promoter. When donating, a player can enter this promo code to receive bonus coins, and the promo code owner also receives a bonus — all fully configurable in the admin panel.     Look demo site: demo
  • 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