Age | Commit message (Collapse) | Author | Files | Lines |
|
- Includes in some files weren't sorted alphabetically. Special thanks
to KeiKun.
Signed-off-by: Haru <haru@dotalux.com>
|
|
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
|
|
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3.
Fixes issue 8184
http://hercules.ws/board/tracker/issue-8184-cart-related/
|
|
- Changed order according to the (upcoming) code style guidelines.
- Fixes several issues caused by missing headers when their include
order is changed or in plugins.
Signed-off-by: Haru <haru@dotalux.com>
|
|
- This affects normal execution as well as ./script-checker runs.
Signed-off-by: Haru <haru@dotalux.com>
|
|
- The script command pcre_match and the operator ~= will return the
number of regular expression matches in a given string (roughly
equivalent to the php function preg_match or the perl operator =~)
- The operator ~! is the opposite of ~= (roughly equivalent to the perl
operator !~)
- See script_commands and npc/custom/test.txt for more information.
Signed-off-by: Haru <haru@dotalux.com>
|
|
Fixes the following issues:
- donpcevent could cause a crash when used to a event of the same npc
- input/other-dialog-interactions could cause a crash when sending data to a disabled-fakenpc-id'd.
Special Thanks to Haruna, ossi0110.
Signed-off-by: shennetsind <ind@henn.et>
|
|
- Fixes bugreport:8074, thanks to ahmadshidqi
http://hercules.ws/board/tracker/issue-8074-help-crash/
- Also fixed some DBMap allocation mistakes introduced in 4f3156b.
- Added testcases to the self-test script.
- Made possible thanks to Ind.
Signed-off-by: Haru <haru@dotalux.com>
|
|
different scopes
- Fixes bugreport:8008, special thanks to KeyWorld
http://hercules.ws/board/tracker/issue-8008-copyarray-fail-on-a-referenced-array-argument/
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Updated several functions to properly use the data structures defined
in parts 1 and 2.
- Special thanks to Ind for his help on this, as well as the previous
two parts.
- Fixes some crashes related to variable references passed back and
forth between nested callfunc/callsub scopes (related: 2669e9a,
3259f89, 4f2de07)
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Reorganized regs var/array DBMaps into a specific reg_db structure
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Moved string and numeric mapregs into the same DBMap (for consistency
with the other reg types.)
Signed-off-by: Haru <haru@dotalux.com>
|
|
NPC Error is now printed as well as the original message as proposed by Emistry in http://hercules.ws/board/topic/1864-mapindex-name2id-display-which-npc-caused-this/
Special Thanks to Haru!
Signed-off-by: shennetsind <ind@henn.et>
|
|
a benefit, for example, would be that the compounds are always up to date regardless if new members are added, also added a new compound OPTION_COSTUME
Special Thanks to Haruna, and AnnieRuru for pointing out constdb's outdatedness.
Signed-off-by: shennetsind <ind@henn.et>
|
|
Did not affect write/read, except getarraysize and deletearray.
Special Thanks to Haru!
Signed-off-by: shennetsind <ind@henn.et>
|
|
- Fixes bugreport:8015, thanks to N e s s
http://hercules.ws/board/tracker/issue-8015-error-in-compiling-in-debian-linux-latest-rev/
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Fixes bugreport:8013, thanks to Dastgir Pojee
http://hercules.ws/board/tracker/issue-8013-script-add-str-problem/
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Added script command strtol (conforming to the ISO C90 function)
- Modified script command axtoi to internally use strtol instead of an
unnecessary own implementation.
- Fixed sscanf behavior to conform to the C specifications in case the
input string is empty. It now correctly returns -1, or 0 if the format
string is also empty. Fixes bugreport:8009, thanks to AnnieRuru -
http://hercules.ws/board/tracker/issue-8009-sscanf-should-return-1-if-the-string-field-is-an-empty-string/
Signed-off-by: Haru <haru@dotalux.com>
|
|
http://hercules.ws/board/topic/4283-introducing-hpm-datacheck/
Signed-off-by: shennetsind <ind@henn.et>
|
|
- Fixes issue 7968, thanks to Moguri
http://hercules.ws/board/tracker/issue-7968-trader-npc-not-working/
- Corrected sprite name for KO_KAGE to match latest kRO info (previouly
KO_ZANZOU, conflicting with a Kagerou/Oboro skill identifier)
- Updated self-test script to include checks for constants and for setd
and getd.
- Made possible thanks to Ind.
Signed-off-by: Haru <haru@dotalux.com>
|
|
Special Thanks to Haruna. Also fixed a compiler warning, thanks to ossi0110
Signed-off-by: shennetsind <ind@henn.et>
|
|
http://hercules.ws/board/topic/3886-hercules-1st-2014-megapatch/
Signed-off-by: shennetsind <ind@henn.et>
|
|
- Fixes bugreport:7901, thanks to Angelmelody
http://hercules.ws/board/tracker/issue-7901-about-pass-variable-type-as-function-parameter
- Bonus: debugmes can now take both strings and numbers (i.e. to print a
number variable you no longer need to do 'debugmes "" + .@num;')
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Warnings detected thanks to Xcode's compiler settings (more strict by
default) and clang, warnings mostly but not only related to data sizes
on 64 bit systems, that were silenced until now by very lax compiler
settings.
- This also decreases by a great deal the amount of warnings produced by
MSVC in x64 mode (for the adventurous ones who tried that)
- Also fixed (or silenced in case of false positives) the potential
issues pointed out by the (awesome) clang static analyzer.
- Patch co-produced with Ind, I'm merging and committing in his place!
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Removed duplicate code shared between script_hp_add and
script_parse_builtin.
- Improved error handling in script_hp_add to be on par with the
script_parse_builtin version.
- Added script->add_builtin function, providing a hooking point for
plugins (i.e. text editor syntax definition generators) to obtain the
builtin commands list.
- Special thanks to Ind.
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Follow up to c6c2ad187c386d8d27d3336dcbdd5a92555493d2
- Special thanks to Ind
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Fixes bugreport:7810, thanks to Wend, kyeme, evilpuncker, jaBote, and
various other people I may be forgetting to mention
http://hercules.ws/board/tracker/issue-7810-disguise-script-command
- Due to the nature of this change, I'm leaving the deprecation messages
lingering around for a while more (as errors rather than warnings), to
make sure they won't pass unnoticed, in case you haven't yet updated
your custom scripts to comply with this.
- Special thanks to Ind.
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Any scripts using the wrong case, that were throwing deprecation
warnings until now, will become invalid.
- Related to bugreport:7810.
Signed-off-by: Haru <haru@dotalux.com>
|
|
- [ This commit is part of a larger script engine related update ]
- Suffix ++ and -- operators now behave like in other languages
(updating the variable *after* its value is returned.)
- Prefix ++ and -- operators are added for parity with other
scripting/programming languages. They update the variable they're
applied to *before* returning its value.
- Please note that the implementation of the prefix form of those
operators (like it happens in most languages) is more efficient than
the suffix form. '++.@i' is (slightly) faster than '.@i++', or at
least not slower.
- Fixed some outdated script debug functions.
- Follow-up to c18f438.
Signed-off-by: Haru <haru@dotalux.com>
|
|
- HPMi->addCommand is now addAtcommand, dropped usage of ACMD_A()
- HPMi->addScript is now addScriptCommand, dropped usage of BUILDIN_A()
- HPMi->addCPCommand is now addCPCommand, dropped necessity of CPCMD_A()
- HPMi->addPacket is now addPacket, 5th param (HPMi->pid) is now automatically filled by the macro, therefore param count drops to 4 (packetID,packetLength,packetFunction,packetIncomingPoint).
There is no longer necessity to check for the availability of the commands, the macros will do it on their own and drop a warning about it upon failure.
These changes won't affect pre-compiled plugins.
Signed-off-by: shennetsind <ind@henn.et>
|
|
- Sanitized all potentially unsafe macros (related eA:15259)
- Improved some function-like macros to evaluate their argument only
once and keep it in a temporary variable. This improves performance
in the damage calculation related code.
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Reduced number of false positives when parsing .@scope variables.
- Added correct error source information where it previously said
'source not found'.
- Special thanks to Ind.
Signed-off-by: Haru <haru@dotalux.com>
|
|
- These messages are temporary, only meant to help those with custom
scripts to transition them to the correct case-sensitive syntax. If
you ignore the deprecation messages you encounter, your scripts may
continue to work just as they did until now, but this will no longer
be true in the near future, and they may stop working at any time.
If you ignore this, and your scripts break, you'll get to keep the
pieces :)
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Added a note about variables and command scripts case sensitivity.
Even though the engine still accepts variable, function and command
names in a case insensitive way, it is discouraged to rely on such
behavior. Please update your custom scripts as soon as possible.
Signed-off-by: Haru <haru@dotalux.com>
|
|
Special Thanks to Haruna
Signed-off-by: shennetsind <ind@henn.et>
|
|
- Added a command line argument '--script-check' to check a script's
syntax without running the server (and without requiring a SQL
connection). Usage: ./map-server --script-check /path/to/the/script.txt
- For convenience, a script-checker bash script is provided, to set the
path correctly when called from a different directory. Usage:
/path/to/Hercules/script-checker /path/to/the/script/to/check.txt
- While the script checker will supposedly work under windows as well,
no convenience scripts are currently provided for platforms other than
UNIX (feel free to open a pull request with a .bat launcher or
whatever you like)
- Integration with IDEs or text editors is possible. In fact, I already
have a fully functional plugin for vim (through vim-syntastic), and if
there's enough interest, I'll publish it. - screenshot: http://d.pr/i/NOBD
- If you want an online checker, http://haru.ws/scriptchecker/ is
running this code, without modifications and will be kept up to date
(without any warranty though.)
- Special thanks to Ind, Yommy, Streusel, who helped making this
possible, in a way or another.
|
|
Item in shadow slots are now able to give bonuses properly, thanks to rosfus for pointing it out!
Also added the missing constants for script handling.
Signed-off-by: shennetsind <ind@henn.et>
|
|
- This fixes an issue with timers that stop working after about 24-49
days when the tick overflows (note that this may happen much earlier
than that, and at hard to predict times, on some systems)
- Updated the RDTSC help message in the configure script to also warn
users about issues with SpeedStep enabled systems.
- On Windows, tick() still has a resolution of 10~15ms (or even as low
as 100ms on some systems). A TODO comment (thanks, Ai4rei) was added
for a follow-up patch, as I want this one to be as small as possible)
- Note: on Windows versions earlier than 6.x (Vista, Server 2008), the
tick overflow issue is NOT fixed, since they don't support the
function used to retrieve a 64 bit tick. This isn't a big issue, since
those platforms are already - or going soon to be - out of their
extended support period, and it's already advisable to upgrade, for
other reasons. If you're the unfortunate user of such a system, it is
recommended that you reboot your machine at least once every 49 days
for Hercules to work reliably.
- Note: To clear some doubts, since I've already been asked, this has
absolutely NOTHING to do with 32/64 bit CPUs or OSes. It's all about
a variable's size, not the size of registers of your CPU, and your
32bit CPU will be able to handle this just fine.
Signed-off-by: Haru <haru@dotalux.com>
|
|
As requested by the community in http://hercules.ws/board/topic/1477-mapflag-for-cash-shop/ and http://hercules.ws/board/topic/1476-disable-cashshop-in-pvp-woe/
'nocashshop' mapflag disables the usage of the cashshop button as well as any attempts to purchase (in case the flag is turned on after someone gets the shop open).
Signed-off-by: shennetsind <ind@henn.et>
|
|
Fully Interfaced.
Moved missing vars and declarations of interest into the interface, removed duplicate mentions of script within calls to shorten wherever it made sense to.
Signed-off-by: shennetsind <ind@henn.et>
|
|
(related: b9c8f57)
Most renames are trivial (just to avoid shadowing global variables, even
if they currently did no harm), but there were some cases of partly
renamed variables that caused some NULL checks to always pass and who
knows what could have been happened when they were too subtle to make
the application crash.
Also corrected some potentially unsafe macro definitions
Signed-off-by: Haru <haru@dotalux.com>
|
|
- Changed overflow errors to be non-fatal. The value will now be capped
to INT_MAX or INT_MIN.
- Follow-up to 8351881
Signed-off-by: Haru <haru@dotalux.com>
|
|
Cleared 3 out of 5, #69
Support for the cancel button, for pre-game position to return afterwards and fix to the queue position problem after first game.
Signed-off-by: shennetsind <ind@henn.et>
|
|
Hercules Renewal Phase One.
Signed-off-by: shennetsind <ind@henn.et>
|
|
Item name constants conflicting with script var names will now result in a map server warning/notice and in the background map server will prioritise the script variable over the item name constant.
http://hercules.ws/board/tracker/issue-7525-set-variable-is-not-recognized-causing-freezing/
---
Also followup 586c0f7983f81e97ca70c57712e25d4d51453d6b sc_config.txt update
Signed-off-by: shennetsind <ind@henn.et>
|
|
Special Thanks to Shikazu, wouldn't have been able to identify this issue without his help!
http://hercules.ws/board/index.php?app=tracker&showissue=7216
Signed-off-by: shennetsind <ind@henn.et>
|
|
Special Thanks to Igniz for bringing it to my attention,
ALSO: over 10% script parsing speed boost!<3.
Signed-off-by: shennetsind <ind@henn.et>
|
|
http://hercules.ws/board/topic/1302-bg-queue-debug/
Signed-off-by: shennetsind <ind@henn.et>
|
|
http://hercules.ws/board/topic/1244-official-item-grouppackagechain/
Also
Further implemented itemdb.c/storage.c interfaces, and a minor update to db2sql plugin.
Signed-off-by: shennetsind <ind@henn.et>
|
|
http://hercules.ws/board/tracker/issue-7367-error-vdb-destroy-during-shutting-down-of-server/
Signed-off-by: shennetsind <ind@henn.et>
|