summaryrefslogtreecommitdiff
path: root/src/common/core.c
AgeCommit message (Collapse)AuthorFilesLines
2014-11-16Whitespace cleanup (no code changes)Haru1-15/+15
This includes, and is not limited to: mixed or wrong indentation, excess whitespace (horizontal and vertical), misalignment, trailing spaces. Signed-off-by: Haru <haru@dotalux.com>
2014-07-11Explicitly specify 'void' when a function expects no argumentsHaru1-1/+1
- See CERT DCL20-C. Signed-off-by: Haru <haru@dotalux.com>
2014-07-10Re-added revision info to the memory leak logHaru1-1/+1
- Information was missing because sysinfo->final() was freeing the data before iMalloc->final() could log it. Signed-off-by: Haru <haru@dotalux.com>
2014-05-16Follow-up to b6b3f58795288701d0e162d43fa6f0a47af913b3Haru1-4/+5
- Includes in some files weren't sorted alphabetically. Special thanks to KeiKun. Signed-off-by: Haru <haru@dotalux.com>
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-17/+21
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-21/+17
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/
2014-05-09Fixed order of includes in all source filesHaru1-17/+21
- 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>
2014-05-09Added support to return a different exit status to the OS.Haru1-2/+3
- This can be easily used by plugins. - See an example at http://github.com/HerculesWS/StaffPlugins/Haru/script_mapquit Signed-off-by: Haru <haru@dotalux.com>
2014-04-17Added sysinfo (System Information) functionalitiesHaru1-132/+19
- More informative messages are displayed during startup, to make it easier to identify what system and environment Hercules is running. - Git/SVN revision detection is improved, separating the source version (cached at compile time) from the runtime version, in case the user updated their working copy without recompiling the server. Git version detection is also more reliable, in case a non-default branch is used. - The get_revision script command has been removed (as it was useless to begin with, after the switch to git). An alternative will be provided later, for feature-probing purposes. - The patch was tested under Linux (Gentoo / gcc 4.7 on i686 and x86_64, Debian 6 / gcc 4.4 on i686, Raspbian / gcc 4.6 on armv6l, CentOS 5 / gcc 4.1 on i686, CentOS 6 / gcc 4.4 on x86_64, Linux Mint 15 / gcc 4.7 on x86_64, OS X Mountain Lion / clang 5.0 and gcc 4.8 on x86_64, Cygwin-NT-5.1/gcc 4.8 on i686, FreeBSD 8 / gcc 4.2 on i386, FreeBSD 9 / gcc 4.2 on amd64, FreeBSD 10 / clang 3.3 on amd64, NetBSD 5 / gcc 4.1 on i386, NetBSD 6 / gcc 4.5 on amd64, OpenBSD 5 / gcc 4.2 on amd64, Solaris 11 / gcc 4.5 on i86pc, Windows 7 / Visual Studio 2012 on x86, Windows 8 / Visual Studio 2010 on WOW64, Windows 8.1 / Visual Studio 2013 on WOW64. Signed-off-by: Haru <haru@dotalux.com>
2014-03-16Improved ERS memory handlingshennetsind1-0/+2
On shutdown the ERS will loop thru leftover managers and clear them according to each manager's settings, while also printing errors according to each manager's settings. Will also help pinpoint the causes of http://hercules.ws/board/tracker/issue-8093-memory-leak-after-stop-server-cant-fix/ and similar issues. Signed-off-by: shennetsind <ind@henn.et>
2014-01-18Socket interfacedshennetsind1-4/+5
We designed this one with having as little changes required elsewhere in mind, thus the way most socket-related things are called has not changed. Plugins may now take a greater advantage of the socket features. Signed-off-by: shennetsind <ind@henn.et>
2014-01-18Libconfig Interfacedshennetsind1-0/+2
Ready for plugin use. Thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
2013-12-17Fixed several compiler warningsHaru1-3/+0
- 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>
2013-11-19Sanitized and improved several macros through the codeHaru1-1/+1
- 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>
2013-11-09HPM Support for plugin-implemented "--args" (options)shennetsind1-0/+5
As a necessary measure for the upcoming bot that will keep .sql files in sync with their .txt counterparts. Special Thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
2013-11-05Introducing the Hercules Standalone Script Syntax CheckerHaru1-2/+12
- 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.
2013-09-25Renamed iTimer interface to timer.shennetsind1-3/+3
Also removed duplicate mentions of timer within calls to shorten.
2013-07-09Travis Report Fixesshennetsind1-6/+0
warn_unused_result shielding, dropped unused variables and fixed battle_calc_return_damage delay behavior (pointer was unchaged; resulting in the var afterwards always as 0) Special Thanks to Xgear. Signed-off-by: shennetsind <ind@henn.et>
2013-07-05HCache | Item Packages Updateshennetsind1-1/+5
http://hercules.ws/board/topic/1389-hcache-item-packages-update/ Signed-off-by: shennetsind <ind@henn.et>
2013-06-08Follow up d73783f22b2bb881aab74524d153d89a5932a199shennetsind1-2/+2
Adjusting db.c interface name to adhere with the rest (pretty much we try to make it as short as we can, and being there were no conflicts we saw no reason to maintain the 'i') Signed-off-by: shennetsind <ind@henn.et>
2013-06-07Hercules Renewal Phase One : pc, party, map, timerSusu1-7/+7
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
2013-05-17- Made DB and malloc lib HPM-friendlySusu1-4/+6
- Also fixed a bug preventing the plugins to be loeaded because HPMI and HPMI_s weren't HPExport
2013-05-16Fixed Bug #7248shennetsind1-2/+2
http://hercules.ws/board/tracker/issue-7248-after-compiling-patches-from-1505-mapserver-crashed/ Signed-off-by: shennetsind <ind@henn.et>
2013-05-15HPM Updateshennetsind1-9/+14
Made SQL and strlib functions HPM-friendly, special thanks to Yommy for bringing the issue up. Added partial map.c support, for the all-handy map[] array, beware that soon the whole map.c renewal design will be commit and when that happens your usage of map.c functions in plugins might require some updates. Signed-off-by: shennetsind <ind@henn.et>
2013-05-02Introducing Hercules Plugin Manangershennetsind1-4/+12
http://hercules.ws/board/topic/549-introducing-hercules-plugin-manager/ Signed-off-by: shennetsind <ind@henn.et>
2013-03-17Re-Introducing Console Inputshennetsind1-114/+75
It's back. It's efficient. It's awesome. http://hercules.ws/board/topic/272-re-introducing-console-input/ Signed-off-by: shennetsind <ind@henn.et>
2013-02-18Improvements all over the placeshennetsind1-1/+1
Committing on the behalf of mkbu95 who is unable to do it himself, he coded it all and sent me the diff. Thanks mkbu95! Signed-off-by: shennetsind <ind@henn.et>
2013-02-16Updating the Headers across source filesshennetsind1-1/+1
And adding missing ones. Signed-off-by: shennetsind <ind@henn.et>
2013-02-15Modified GIT_ORIGIN macroshennetsind1-2/+2
Made it possible to modify the whole path, making it flexible to users with customised repositories -- special thanks to Trojal Signed-off-by: shennetsind <ind@henn.et>
2013-02-14Introducing Git Hashshennetsind1-4/+36
Added 'Git Hash' way to identify where you last updated your working copy (it won't detect your local changes' hash -- intended). Also Implemented HERC_UNKNOWN_VER, a simple way to detect whether get_svn_revision or get_git_hash failed to detect (before you'd need to strncmp for "unknown" or similars) Signed-off-by: shennetsind <ind@henn.et>
2013-02-07Fixing mistake in modified source code headersshennetsind1-1/+1
Signed-off-by: shennetsind <ind@henn.et>
2013-02-03Updating the headers of so-far modified files with outdated headersshennetsind1-2/+3
Signed-off-by: shennetsind <ind@henn.et>
2013-02-03Introducing MySQL Reconnectshennetsind1-0/+2
* mysql_reconnect_type ** 1: when mysql disconnects during runtime, the server tries to reconnect mysql_reconnect_count times and, if unsuccessful, the server is shut down ** 2: when mysql disconnects during runtime it tries to reconnect indefinitely mysql_reconnect_type:2 * mysql_reconnect_count ** number of reconnect attempts the server should do when the database disconnects during runtime ** only used when mysql_reconnect_type is 1 mysql_reconnect_count:1 ~Ind Signed-off-by: shennetsind <ind@henn.et>
2013-01-26Changing ASCI Art / Moving stat server to Hercules.shennetsind1-13/+14
Changed the ASCI art (not quite final; just changing it prior to release), moving stat server to hercules end Signed-off-by: shennetsind <ind@henn.et>
2012-12-05- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).brianluau1-222/+225
[16969:16991/trunk/src/] will be re-committed in the next 24 hours. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-25Applied AStyle code formating as discussed on tid:74602.greenboxal21-225/+222
Removed /SAFESEH option from MSVC11 projects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-23-Apply mkdu95 fix for bugreport:5145 preventing clone if player dead, (for ↵glighta1-4/+4
slave and evil clone) -Fix old fread, fgets warnings, displaying a msg errors when failed now -Cleaning checkweight debug showinfo git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16952 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-10-27- Adjusted spacing in ASCII art so all lines are 70 characters wide.brianluau1-10/+10
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16832 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-09-29* Merged eAthena changeset ea:15190. (bugreport:5138)eathenabot1-35/+73
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16807 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-08-02lowercase'd the r in the console ASCII logo.shennetsind1-8/+8
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16556 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-10- added some missing copyrightsblacksirius1-2/+3
- merged (bs-coreoptimize->trunk) generic athena style configuration parser (raconf) - merged (bs-coreoptimize->trunk) threadsafe memory pool (mempool) [i need it for the new 'socket' system] - set svn:eol-style property on newer files were it was missing git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16263 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-03feature merge bs-coreoptimize->trunk: Atomic Operations, Threading, Spinlock ↵blacksirius1-0/+5
implemnetation. [commit 1/2, windows will followup] - Added Abstractions for Atomic Operations (lock instructions.. windows guy's may now this as Interlocked* stuff ..) - Added Threading api abstraction for Pthread based OS's and Windows - Added Spinlock Implementation (uses CAS / if you need more informations - just read the source - its simple.) - Due to Interlocked(Compare)Exchange64 .. we now require at least i686 (Pentium Pro) for 32Bit Builds :) youll also may feel some performance improvements when using 32bit builsd due to "newer" minimal arch the compiler is now able to use CMOV's .... ================================================================ = Important Warning: ================================================================ Dont use threading at the moment athena is not threadsafe! you'll mess up everthing when accessing data from other threads .., no synchronization is provided. A way to process tasks asynchronously will come up after / with the new socket system. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16221 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-03cleaned up windows header usage (added one central file to use windows / ↵blacksirius1-1/+1
winapi specific stuff, to be able to set the appropriate flags before including it correctly) Note: this may screw up mingw or cygwin building, ill fix it later... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16219 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-01removed the old obsolete Plugin system (commit 1/2)blacksirius1-5/+0
- Removed @ Autoconf/make and CMake, VC Projects will be cleaned in a additional commit. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16203 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-21* Made branding more consistent.xazax-hun1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15905 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-24Fixed Ctrl+c shutdown function on windows, followup r15706. (bugreport:5495)xazax-hun1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15790 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-18* Properly handling, when closing the consoles via X button on windows.xazax-hun1-0/+35
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15706 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-02-16- Removed outdated version number handling (follow-up to r11503).gepard19841-1/+0
- Fixed mapcache compilation issues in Linux. - Added some missing `svn:ignore` properties. - Moved `BLOCK_SIZE` definition from header to source file. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15586 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-17Fixed root usercheck not printing warning if file is suid-root.gepard19841-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15482 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-03fixing a warning in ubuntu's gcc, follow up r15358shennetsind1-5/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15359 54d463be-8e91-2dee-dedb-b68131a5f0ec