L2JMobius
Free Users => Solved/Invalid Bug Reports => Topic started by: ver on January 14, 2021, 12:39:14 PM
-
Hello,
I've performed simple shutdown procedure. Gave ppl like 60 secs.
Unfortunatelly during that time the items that were created/spoiled in last 30..40 mins were gone. Looks like items were not stored in DB during the shutdown.
Is it normal? Guess not?
Best regards
-
Did you receive any error logs? I have never had the same problem. 500 players online without item loss.
-
Nope, error log clean ;/
-
I think the problem is with your mysql server and not with the gameserver. All changes are sent to mysql. Maybe mysql crashed and lost some data.
-
This is exactly what I suspected at the first.
Checked database, all logs on my box, even tables structure (maybe they are corrupted or something). But not... All was pretty much normal.
Today I made simple shutdown with 120 sec. All went fine. Server got closed etc. No errors whatsoever.
After the start it appeared that some dropped items in line 15..20 min before, was not inserted in items table. It looks like it was just in memory/some java threads and simply just not inserted when it suppose to be.
Maybe there is something there? Like items are stored in db to rarely? (Dunno, just made up shot in a dark).
-
After all - its not so strange. The players inventory was not stored at all on shutdown procedure because store() method is not saveing that...
File: java/org/l2jmobius/gameserver/Shutdown.java (manually created patch)
private void saveAllPlayers()
{
LOGGER.info("Saving all players data...");
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if (player == null)
{
continue;
}
// Logout Character
try
{
// Save player status
player.store();
player.getInventory().updateDatabase();
player.getWarehouse().updateDatabase();
}
catch (Throwable t)
{
}
}
}
I don't know if its proper fix, but at least it does save players stuff.
-
Can you try this instead?
Index: java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java (revision 8154)
+++ java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java (working copy)
@@ -8583,6 +8583,10 @@
aVars.storeMe();
}
+ getInventory().updateDatabase();
+ getWarehouse().updateDatabase();
+ getFreight().updateDatabase();
+
// If char is in Offline trade, setStored must be true
setStored(isInOfflineMode());
}
-
Tried, works smooth ;)
-
Fixed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/64e40bccde3bca9aeaaab6a558928d8fcd917ba6
Thanks :D