Shutdown question

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
tacu
Posts: 5
Joined: Sat Feb 02, 2008 2:57 pm

Shutdown question

Post by tacu »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: 5937
L2JDP Revision Number: 9641

Hi guys,

I just need a little info, you may help.
Our server is kicking players out one after another each second when we are shutting down a server or making a restart - thus the whole shutdown process is really slow.
We would like to reopen our server somewhen in the future, but this problem annoys me.
I remember it used to be like kicking everybody out at once.

Is there a setting for it, or shall I modify the core somewhere?

Thanks!
User avatar
BiggBoss
L2j Veteran
L2j Veteran
Posts: 1104
Joined: Wed Apr 15, 2009 3:11 pm
Location: Spain

Re: Shutdown question

Post by BiggBoss »

the player disconnect process is defined in ShutDown.java

Code: Select all

 protected final class DisconnectAllCharacters implements TObjectProcedure<L2PcInstance>    {        private final Logger _log = Logger.getLogger(DisconnectAllCharacters.class.getName());                @Override        public final boolean execute(final L2PcInstance player)        {            if (player != null)            {                // Logout Character                try                {                    L2GameClient client = player.getClient();                    if ((client != null) && !client.isDetached())                    {                        client.close(ServerClose.STATIC_PACKET);                        client.setActiveChar(null);                        player.setClient(null);                    }                    player.deleteMe();                }                catch (Throwable t)                {                    _log.log(Level.WARNING, "Failed logour char " + player, t);                }            }            return true;        }    } 
The task is applied by the own player container as safeForEachValue (which uses a lock that may be being used by other threads, so disconnect task has to wait for it, causing some delay between players disconnects). If you want to get rid of such delay, you may change safeForEachValue to forEachKey, knowing that from now one, the shutdown process wont be thread safe
Image
tacu
Posts: 5
Joined: Sat Feb 02, 2008 2:57 pm

Re: Shutdown question

Post by tacu »

Thank you for the answer.
I guess we'll try to make the least restarts possible and timing them to hours when less player is playing.
I wouldn't take such a risk for faster operation.

Thanks again!
Post Reply