Page 1 of 1

Shutdown question

Posted: Sat Feb 01, 2014 7:35 pm
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!

Re: Shutdown question

Posted: Sun Feb 02, 2014 10:27 am
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

Re: Shutdown question

Posted: Sun Feb 02, 2014 2:06 pm
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!