Code Coupons + Worldmap update + Mini-games + Player Interaction wrap
Fixed several cases on the Cash Shop that would freeze some player actions when triggered, requiring exit Cash Shop to unstuck. Implemented Code Coupons, supporting several items bundled on the same code, and also devised a way to automate code generation. Added a current status on-demand option on the Buyback command. Info such as "current fee" or "time remaining" are available now. Reviewed several cases where non-owned items would get stacked with owner-tagged items. Added Door support for Happyville, Crimsonwood Keep. Added worldmap tooltip support for some maps in Masteria's C. Keep and H. House. Added Masteria region to the world map. C. Keep interiors no longer relocates players to entrance after actions such as logout. Overhauled minigame mechanics: from player boxes tooltip and in-match improvements to deploy different minigame types, accordingly with item description or player choice. Fixed Amoria outskirts not relocating players to city after getting KO'ed. Fixed issues with pets, rings and cash items being assigned the same cash unique ids leading to some quirks on the cash shop inventory. Fixed an issue with the recently added HP/MP ratio update, arbitrarily taking off 1 point in certain cases. Answer positions on the explorer's 3rd job quiz are now randomed. Fixed several issues that showed up when the bcrypt system is disabled. DOT from maps such as El Nath and Aqua Road now procs at a 5sec interval, GMS-like. Improved performance of Whodrops and Search commands. Concurrently protected player interaction handlers, thus mitigating several exploits on these lines. Adjusted several expedition timers, such as Horntail, now having a more sane deadline. Concurrently protected chair modules. Fixed "seduce" debuff not working on chairs.
This commit is contained in:
@@ -80,6 +80,7 @@ import client.MapleCharacter;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ItemFactory;
|
||||
import client.inventory.manipulator.MapleCashidGenerator;
|
||||
import client.newyear.NewYearCardRecord;
|
||||
import constants.ItemConstants;
|
||||
import constants.GameConstants;
|
||||
@@ -90,7 +91,6 @@ import server.life.MaplePlayerNPCFactory;
|
||||
import server.quest.MapleQuest;
|
||||
import tools.AutoJCE;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.FilePrinter;
|
||||
import tools.Pair;
|
||||
|
||||
public class Server {
|
||||
@@ -518,6 +518,34 @@ public class Server {
|
||||
return couponRates;
|
||||
}
|
||||
|
||||
public static void cleanNxcodeCoupons(Connection con) throws SQLException {
|
||||
if (!ServerConstants.USE_CLEAR_OUTDATED_COUPONS) return;
|
||||
|
||||
long timeClear = System.currentTimeMillis() - 14 * 24 * 60 * 60 * 1000;
|
||||
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM nxcode WHERE expiration <= ?");
|
||||
ps.setLong(1, timeClear);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (!rs.isLast()) {
|
||||
PreparedStatement ps2 = con.prepareStatement("DELETE FROM nxcode_items WHERE codeid = ?");
|
||||
while (rs.next()) {
|
||||
ps2.setInt(1, rs.getInt("id"));
|
||||
ps2.addBatch();
|
||||
}
|
||||
ps2.executeBatch();
|
||||
ps2.close();
|
||||
|
||||
ps2 = con.prepareStatement("DELETE FROM nxcode WHERE expiration <= ?");
|
||||
ps2.setLong(1, timeClear);
|
||||
ps2.executeUpdate();
|
||||
ps2.close();
|
||||
}
|
||||
|
||||
rs.close();
|
||||
ps.close();
|
||||
}
|
||||
|
||||
private void loadCouponRates(Connection c) throws SQLException {
|
||||
PreparedStatement ps = c.prepareStatement("SELECT couponid, rate FROM nxcoupons");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
@@ -818,6 +846,7 @@ public class Server {
|
||||
ps.executeUpdate();
|
||||
ps.close();
|
||||
|
||||
cleanNxcodeCoupons(c);
|
||||
loadCouponRates(c);
|
||||
updateActiveCoupons();
|
||||
|
||||
@@ -825,6 +854,9 @@ public class Server {
|
||||
} catch (SQLException sqle) {
|
||||
sqle.printStackTrace();
|
||||
}
|
||||
|
||||
MapleCashidGenerator.loadExistentCashIdsFromDb();
|
||||
|
||||
IoBuffer.setUseDirectBuffer(false);
|
||||
IoBuffer.setAllocator(new SimpleBufferAllocator());
|
||||
acceptor = new NioSocketAcceptor();
|
||||
@@ -893,17 +925,6 @@ public class Server {
|
||||
online = true;
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
try {
|
||||
TimerManager.getInstance().stop();
|
||||
acceptor.unbind();
|
||||
} catch (NullPointerException e) {
|
||||
FilePrinter.printError(FilePrinter.EXCEPTION_CAUGHT, e);
|
||||
}
|
||||
System.out.println("Server offline.");
|
||||
System.exit(0);// BOEIEND :D
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.setProperty("wzpath", "wz");
|
||||
Security.setProperty("crypto.policy", "unlimited");
|
||||
|
||||
Reference in New Issue
Block a user