L2JMobius

C4 Offline Shop accounts get restricted after server restart

glock · 3 · 79

Offline glock

  • Heir
  • **
    • Posts: 16
On C4 pack if you set up a offline shop while "RestoreOffliners = True" in game/config/custom/OfflineTrade.ini And then server restarts, your account gets locked. Any time you try to log in you would get message "Account in use" and thats that.
Before restart offline shop online status in DB is "online: 2" after server restart it goes to "online: 0" But gameserver still treats it as offlineshop.
https://ibb.co/5gvMBC1s
https://ibb.co/4LgHXMw
https://ibb.co/PZRHwVYj
https://ibb.co/bgwpwCdL


Steps to reproduce this bug:
1. Set "RestoreOffliners = True" in game/config/custom/OfflineTrade.ini
2. Start login/game servers.
3. In game: setup a shop and go offline shop mode.
4. Restart game server while offline shop is active.
5. Thats it account now is locked.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19653
We use different login approach for C1 and C4.
Try this.
Code: (diff) [Select]
Index: java/org/l2jmobius/gameserver/LoginServerThread.java
===================================================================
--- java/org/l2jmobius/gameserver/LoginServerThread.java (revision 19601)
+++ java/org/l2jmobius/gameserver/LoginServerThread.java (working copy)
@@ -509,6 +509,24 @@
  client.close(ServerClose.STATIC_PACKET);
  getInstance().sendLogout(account);
  }
+ else // Offline player restored after restart.
+ {
+ for (Player player : World.getInstance().getPlayers())
+ {
+ if (account.equals(player.getAccountName()))
+ {
+ final GameClient playerGameClient = player.getClient();
+ if (playerGameClient != null)
+ {
+ playerGameClient.close(ServerClose.STATIC_PACKET);
+ }
+ player.storeMe();
+ player.deleteMe();
+ getInstance().sendLogout(account);
+ return;
+ }
+ }
+ }
  }
 
  /**