Quest Item Restore + Packets w/ Timezone + Item/Exp-dec Field Limits

Fixed leaders being able to create expeditions even though the already passed the day limit.
Fixed overflow case in calculated max value of skills.
Implemented item expiration from DB after the due date.
Refactored item flags using byte-length instead of short.
Added FieldLimit checks for disappearing item drops and no EXP deduction in limited areas.
Added "Quest Item Restore" functionality.
Implemented item flag auto-instantiation when generating items.
Added gate state update in Papulatus lobby area.
Fixed a recent issue regarding bounding box calculation of AoE player skills.
Implemented minidungeon close, to occur as soon as the party leader leaves the area.
Refactored HenesysPQ attributed out of the MapleMap object, now they should be available from the respective event script.
Fixed friendly mobs not dropping item periodically, a recent issue after tweaking the loot system.
Fixed Papulatus expedition closing after the exped leader leaves or a minimum of player required to start is no longer there.
Fixed several expeditions closing after performing party operations, such as "change party leader".
Reviewed expected max damage calculation for summons, which would not work properly in several occasions.
Normalized timezone from packets sent to client, now using the same timezone defined from the server flags.
Fixed certain scenarios in CPQ that would happen within the stage between the "challenge accepted" and ingress in the battlefield.
Revised credits script.
Added GM checks in the autoban method.
This commit is contained in:
ronancpl
2019-07-15 20:22:39 -03:00
parent 0228d4e176
commit ab5cec7f33
73 changed files with 1200 additions and 393 deletions

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="MapleMapFieldLimitChecker" default="default" basedir=".">
<description>Builds, tests, and runs the project MapleMapFieldLimitChecker.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="MapleMapFieldLimitChecker-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>

View File

@@ -0,0 +1,149 @@
# Report File autogenerated from the MapleEmptyItemWzChecker feature by Ronan Lana.
# Generated data takes into account several data info from the server-side WZ.xmls.
String.wz NAMES with no Item.wz node, 130 entries:
20816 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Face\
20817 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Face\
21817 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Face\
21820 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Face\
1002655 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Cap\
1002657 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Cap\
1002658 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Cap\
1003028 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Cap\
1003029 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Cap\
1003030 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Cap\
1003043 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Cap\
1022096 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Accessory\
1042180 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Coat\
1052226 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Longcoat\
1060115 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Pants\
1060138 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Pants\
1061125 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Pants\
1061160 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Pants\
1062036 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Pants\
1062037 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Pants\
1072248 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Shoes\
1072249 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Shoes\
1072418 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Shoes\
1072425 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Shoes\
1080002 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Glove\
1082217 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Glove\
1082221 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Glove\
1082261 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Glove\
1142152 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Accessory\
1142155 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Accessory\
1302032 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1302069 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1322030 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1322034 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1332058 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1382013 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1452047 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1462020 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1462042 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1472057 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
1702113 ../../wz/String.wz/Eqp.img.xml -> Eqp.img\Eqp\Weapon\
2002012 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2002013 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2002014 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2012004 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2022034 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2022036 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2022046 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2022114 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2070014 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2083000 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2084000 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2101016 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2101017 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2101018 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2101019 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2101022 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2101058 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2210023 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2210024 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240004 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240005 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240006 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240007 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240008 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240009 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240010 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240011 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240012 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240013 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240014 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2240015 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2290109 ../../wz/String.wz/Consume.img.xml -> Consume.img\
2390000 ../../wz/String.wz/Consume.img.xml -> Consume.img\
3010044 ../../wz/String.wz/Ins.img.xml -> Ins.img\
3994016 ../../wz/String.wz/Ins.img.xml -> Ins.img\
4000275 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4001150 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031294 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031627 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031628 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031629 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031630 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031631 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031632 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031633 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031634 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031635 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031636 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031637 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031638 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031639 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031640 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031641 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031642 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031643 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031644 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031645 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031646 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031647 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031648 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031795 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4031867 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
4032526 ../../wz/String.wz/Etc.img.xml -> Etc.img\Etc\
5000040 ../../wz/String.wz/Pet.img.xml -> Pet.img\
5000043 ../../wz/String.wz/Pet.img.xml -> Pet.img\
5000046 ../../wz/String.wz/Pet.img.xml -> Pet.img\
5201000 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5201001 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5210000 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5210001 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5210002 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5210003 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5210004 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5210005 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5211001 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5211002 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5211003 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5211047 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5240016 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5240019 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5251004 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5251005 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5251006 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5360009 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5360010 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5360011 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5360012 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5360013 ../../wz/String.wz/Cash.img.xml -> Cash.img\
5360014 ../../wz/String.wz/Cash.img.xml -> Cash.img\
Item.wz ITEMS with no String.wz node, 12 entries:
1942000 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01942000.img.xml -> NOT FOUND
1942001 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01942001.img.xml -> NOT FOUND
1942002 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01942002.img.xml -> NOT FOUND
1952000 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01952000.img.xml -> NOT FOUND
1952001 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01952001.img.xml -> NOT FOUND
1952002 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01952002.img.xml -> NOT FOUND
1962000 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01962000.img.xml -> NOT FOUND
1962001 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01962001.img.xml -> NOT FOUND
1962002 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01962002.img.xml -> NOT FOUND
1972000 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01972000.img.xml -> NOT FOUND
1972001 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01972001.img.xml -> NOT FOUND
1972002 C:\Nexon\HeavenMS\wz\Character.wz\Dragon\01972002.img.xml -> NOT FOUND

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

View File

@@ -0,0 +1,197 @@
/*
This file is part of the HeavenMS MapleStory Server
Copyleft (L) 2016 - 2018 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package maplemapfieldlimitchecker;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
/**
*
* @author RonanLana
*
This application seeks from the XMLs all mapid entries that holds the specified
fieldLimit.
*/
public class MapleMapFieldLimitChecker {
static String newFile = "lib/Report.txt";
static String outputWzPath = "lib";
static PrintWriter printWriter = null;
static InputStreamReader fileReader = null;
static BufferedReader bufferedReader = null;
static String wzPath = "../../wz";
static int initialStringLength = 50;
static int itemFileNameSize = 13;
static int fieldLimit = 0x400000;
static byte status = 0;
static int mapid = 0;
private static String getName(String token) {
int i, j;
char[] dest;
String d;
i = token.lastIndexOf("name");
i = token.indexOf("\"", i) + 1; //lower bound of the string
j = token.indexOf("\"", i); //upper bound
dest = new char[initialStringLength];
token.getChars(i, j, dest, 0);
d = new String(dest);
return(d.trim());
}
private static String getValue(String token) {
int i, j;
char[] dest;
String d;
i = token.lastIndexOf("value");
i = token.indexOf("\"", i) + 1; //lower bound of the string
j = token.indexOf("\"", i); //upper bound
dest = new char[initialStringLength];
token.getChars(i, j, dest, 0);
d = new String(dest);
return(d.trim());
}
private static void forwardCursor(int st) {
String line = null;
try {
while(status >= st && (line = bufferedReader.readLine()) != null) {
simpleToken(line);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
private static void simpleToken(String token) {
if(token.contains("/imgdir")) {
status -= 1;
}
else if(token.contains("imgdir")) {
status += 1;
}
}
private static void listFiles(String directoryName, ArrayList<File> files) {
File directory = new File(directoryName);
// get all the files from a directory
File[] fList = directory.listFiles();
for (File file : fList) {
if (file.isFile()) {
files.add(file);
} else if (file.isDirectory()) {
listFiles(file.getAbsolutePath(), files);
}
}
}
private static int getMapIdFromFilename(String name) {
try {
return Integer.valueOf(name.substring(0, name.indexOf('.')));
} catch(Exception e) {
return -1;
}
}
private static void translateToken(String token) {
if(token.contains("/imgdir")) {
status -= 1;
}
else if(token.contains("imgdir")) {
status += 1;
if (status == 2) {
String d = getName(token);
if (!d.contentEquals("info")) {
forwardCursor(status);
}
}
}
else {
if (status == 2) {
String d = getName(token);
if (d.contentEquals("fieldLimit")) {
int value = Integer.valueOf(getValue(token));
if ((value & fieldLimit) == fieldLimit) {
System.out.println(mapid + " " + value);
}
}
}
}
}
private static void inspectMapEntry() {
String line = null;
try {
while((line = bufferedReader.readLine()) != null) {
translateToken(line);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
private static void loadMapWz() throws IOException {
System.out.println("Reading Map.wz ...");
ArrayList<File> files = new ArrayList<>();
listFiles(wzPath + "/Map.wz/Map", files);
for(File f : files) {
fileReader = new InputStreamReader(new FileInputStream(f), "UTF-8");
bufferedReader = new BufferedReader(fileReader);
mapid = getMapIdFromFilename(f.getName());
inspectMapEntry();
bufferedReader.close();
fileReader.close();
}
}
public static void main(String[] args) {
try {
loadMapWz();
System.out.println("Done!");
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}