2
0
Эх сурвалжийг харах

BETA: Fixing minor problem with PlayerVariables for some reason it stores booleans as 0/1 instead of false/true.
* Also added missing cleanup of character_variables table for non-existing players.
* Patch by: nBd
* Also using batches for store query.

Rumen Nikiforov 12 жил өмнө
parent
commit
d3d9b0cd47

+ 1 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/idfactory/IdFactory.java

@@ -259,6 +259,7 @@ public abstract class IdFactory
 			cleanCount += stmt.executeUpdate("DELETE FROM character_offline_trade_items WHERE character_offline_trade_items.charId NOT IN (SELECT charId FROM characters);");
 			cleanCount += stmt.executeUpdate("DELETE FROM character_quest_global_data WHERE character_quest_global_data.charId NOT IN (SELECT charId FROM characters);");
 			cleanCount += stmt.executeUpdate("DELETE FROM character_tpbookmark WHERE character_tpbookmark.charId NOT IN (SELECT charId FROM characters);");
+			cleanCount += stmt.executeUpdate("DELETE FROM character_variables WHERE character_variables.charId NOT IN (SELECT charId FROM characters);");
 			
 			// If the clan does not exist...
 			cleanCount += stmt.executeUpdate("DELETE FROM clan_privs WHERE clan_privs.clan_id NOT IN (SELECT clan_id FROM clan_data);");

+ 3 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/PlayerVariables.java

@@ -96,9 +96,10 @@ public class PlayerVariables extends StatsSet
 				for (Entry<String, Object> entry : getSet().entrySet())
 				{
 					st.setString(2, entry.getKey());
-					st.setObject(3, entry.getValue());
-					st.execute();
+					st.setString(3, String.valueOf(entry.getValue()));
+					st.addBatch();
 				}
+				st.executeBatch();
 			}
 		}
 		catch (SQLException e)