Cash Shop patch + new features

Cash shop fix, new item sorting features, minor patches.
This commit is contained in:
ronancpl
2016-01-03 11:13:07 -02:00
parent 7b4fcf7861
commit 7e32e5a762
21 changed files with 312 additions and 67 deletions

View File

@@ -2971,7 +2971,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public static MapleCharacter loadCharFromDB(int charid, MapleClient client, boolean channelserver) throws SQLException {
try {
MapleCharacter ret = new MapleCharacter();
MapleCharacter ret = new MapleCharacter();
ret.client = client;
ret.id = charid;
Connection con = DatabaseConnection.getConnection();
@@ -3857,6 +3857,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
ps.executeBatch();
}
} catch (SQLException se) {
se.printStackTrace();
}
}
}
@@ -3871,6 +3872,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
ps.execute();
}
} catch (SQLException se) {
se.printStackTrace();
}
}
@@ -3959,6 +3961,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
con.setAutoCommit(true);
con.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
@@ -4216,7 +4219,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
con.commit();
con.setAutoCommit(true);
if (cashshop != null) {
if (cashshop != null) {
cashshop.save(con);
}
if (storage != null) {

View File

@@ -506,6 +506,7 @@ public class MapleClient {
rs.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
if (loginok == 0) {
@@ -755,12 +756,12 @@ public class MapleClient {
}
public final void disconnect(boolean shutdown, boolean cashshop) {//once per MapleClient instance
if (disconnecting) {
if (disconnecting) {
return;
}
disconnecting = true;
if (player != null && player.isLoggedin() && player.getClient() != null) {
MapleMap map = player.getMap();
MapleMap map = player.getMap();
final MapleParty party = player.getParty();
final int idz = player.getId();
final int messengerid = player.getMessenger() == null ? 0 : player.getMessenger().getId();
@@ -771,13 +772,17 @@ public class MapleClient {
final MapleGuildCharacter chrg = player.getMGC();
final MapleGuild guild = player.getGuild();
removePlayer();
player.saveCooldowns();
player.saveToDB();
if (channel == -1 || shutdown) {
removePlayer();
player.saveCooldowns();
player.saveToDB();
player = null;
return;
}
removePlayer();
final World worlda = getWorldServer();
try {
if (!cashshop) {
@@ -854,7 +859,10 @@ public class MapleClient {
}
player.logOff();
}
player = null;
player.saveCooldowns();
player.saveToDB();
player = null;
}
}
if (!serverTransition && isLoggedIn()) {

View File

@@ -56,6 +56,7 @@ public final class MonsterBook {
c.announce(MaplePacketCreator.addCard(false, cardid, 1));
c.announce(MaplePacketCreator.showGainCard());
calculateLevel();
c.getPlayer().saveToDB();
}