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
Index: java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java===================================================================--- java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java (revision 4411)+++ java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java (working copy)@@ -20,6 +20,7 @@ import com.l2jserver.Config; import com.l2jserver.gameserver.SevenSignsFestival;+import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.model.L2Party; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.L2GameClient;@@ -30,7 +31,6 @@ import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.taskmanager.AttackStanceTaskManager; - /** * This class ... *@@ -41,57 +41,57 @@ private static final String _C__46_REQUESTRESTART = "[C] 46 RequestRestart"; private static final Logger _log = Logger.getLogger(RequestRestart.class.getName()); protected static final Logger _logAccounting = Logger.getLogger("accounting");-+ @Override protected void readImpl() { // trigger }-+ @Override protected void runImpl() { final L2PcInstance player = getClient().getActiveChar();-+ if (player == null) return;-- if(player.getActiveEnchantItem() != null || player.getActiveEnchantAttrItem() != null)+ + if (player.getActiveEnchantItem() != null || player.getActiveEnchantAttrItem() != null) { sendPacket(RestartResponse.valueOf(false)); return; }-+ if (player.isLocked()) { _log.warning("Player " + player.getName() + " tried to restart during class change."); sendPacket(RestartResponse.valueOf(false)); return; }-+ if (player.getPrivateStoreType() != 0) { player.sendMessage("Cannot restart while trading"); sendPacket(RestartResponse.valueOf(false)); return; }-+ if (player.getActiveRequester() != null) { player.getActiveRequester().onTradeCancel(player); player.onTradeCancel(player.getActiveRequester()); }-+ if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) && !(player.isGM() && Config.GM_RESTART_FIGHTING)) { if (Config.DEBUG) _log.fine("Player " + player.getName() + " tried to logout while fighting.");-+ player.sendPacket(new SystemMessage(SystemMessageId.CANT_RESTART_WHILE_FIGHTING)); sendPacket(RestartResponse.valueOf(false)); return; }-+ // Prevent player from restarting if they are a festival participant // and it is in progress, otherwise notify party members that the player // is not longer a participant.@@ -103,9 +103,9 @@ sendPacket(RestartResponse.valueOf(false)); return; }-+ final L2Party playerParty = player.getParty();-+ if (playerParty != null) player.getParty().broadcastToPartyMembers(SystemMessage.sendString(player.getName() + " has been removed from the upcoming festival.")); }@@ -113,29 +113,37 @@ player.removeFromBossZone(); final L2GameClient client = getClient();-+ LogRecord record = new LogRecord(Level.INFO, "Logged out");- record.setParameters(new Object[]{client});+ record.setParameters(new Object[] { client }); _logAccounting.log(record);-- // detach the client from the char so that the connection isnt closed in the deleteMe- player.setClient(null);-- player.logout(); - getClient().setActiveChar(null);-- // return the client to the authed status- client.setState(GameClientState.AUTHED);-- sendPacket(RestartResponse.valueOf(true));-- // send char list- final CharSelectionInfo cl = new CharSelectionInfo(client.getAccountName(), client.getSessionId().playOkID1);- sendPacket(cl);- client.setCharSelection(cl.getCharInfo());+ ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()+ {+ + @Override+ public void run()+ {+ // detach the client from the char so that the connection isnt closed in the deleteMe+ player.setClient(null);+ + player.logout();+ + getClient().setActiveChar(null);+ + // return the client to the authed status+ client.setState(GameClientState.AUTHED);+ + sendPacket(RestartResponse.valueOf(true));+ + // send char list+ final CharSelectionInfo cl = new CharSelectionInfo(client.getAccountName(), client.getSessionId().playOkID1);+ sendPacket(cl);+ client.setCharSelection(cl.getCharInfo());+ }+ }, 5000); }-+ /* (non-Javadoc) * @see com.l2jserver.gameserver.clientpackets.ClientBasePacket#getType() */@@ -144,4 +152,4 @@ { return _C__46_REQUESTRESTART; }-}\ No newline at end of file+}
....but problem is not resolved.
These codes prevent you from restarting only so you can still exit without delay.
As topic owner wrote: this bug exists during exit, not relogging.
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
Anyway I made it only for Restart, but now you should just re-made it for Exit, too
Also you could create a new state (like isRestarting or isLeaving) and block any kind of exploitation
EDIT:
JIV wrote:Also your revision 4411 is old, latest epilogue is 4413.
Set 1000 (1 second) to limit every action during restart/exit, then when you return in game click on your stats' panel, so try to move your character..
I set logout and restart 1 sec, but i do any action and dont move return in game, i click on my stats panel, bun dont move, i try scroll of escape and i move.