summaryrefslogtreecommitdiff
path: root/src/char/int_guild.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-12Changed some void* to the correct data types where applicableHaru1-1/+0
Signed-off-by: Haru <haru@dotalux.com>
2013-12-17Fixed several compiler warningsHaru1-18/+12
- 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-10-26Changed 'tick' variables to 64 bitHaru1-3/+2
- 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>
2013-09-25Renamed iTimer interface to timer.shennetsind1-3/+3
Also removed duplicate mentions of timer within calls to shorten.
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-5/+5
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
2013-05-17- Made DB and malloc lib HPM-friendlySusu1-2/+2
- Also fixed a bug preventing the plugins to be loeaded because HPMI and HPMI_s weren't HPExport
2013-05-16Fixed Bug #7250shennetsind1-1/+1
Screwed up. http://hercules.ws/board/tracker/issue-7250-cant-create-party-and-guild/ Follow up 0aee4fd57f2f4135361f4182a08a98cf52ed9d10 Signed-off-by: shennetsind <ind@henn.et>
2013-05-15HPM Updateshennetsind1-134/+134
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-02-18Improvements all over the placeshennetsind1-5/+6
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-07Fixing mistake in modified source code headersshennetsind1-1/+1
Signed-off-by: shennetsind <ind@henn.et>
2013-02-06Fixed Bug #7056shennetsind1-1/+1
atoll was introduced in a 2011 lib and vc9 and 10 dont have that, dropping to atol since we dont need the int64 and using a tricky conversion to get it to unsigned http://hercules.ws/board/tracker/issue-7056-compiling-error/ Signed-off-by: shennetsind <ind@henn.et>
2013-02-04Allow unsigned int values for guild exp (as it was before the change).akrus1-2/+2
2013-01-31Fixed Bug #3080shennetsind1-3/+4
Replaced strncpy with safestrncpy where I found would be beneficial. http://hercules.ws/board/tracker/issue-3080-safestrncpy-instead-of-strncpy-where-applicable/ Also modifying headers accordingly. Signed-off-by: shennetsind <ind@henn.et>
2013-01-27Fixed Bug #7035shennetsind1-1/+1
Char server displaying extra '/' in exp_guild path. http://hercules.ws/board/tracker/issue-7035-typo-in-charserv-sqlbat/ Signed-off-by: shennetsind <ind@henn.et>
2013-01-02-Follow up r17065 glighta1-25/+25
--removing useless check on skill_id --fix few broken atcommand due to failed sscanf -Change skill_amotion_leniency as pointed out on tid:76492 so amotion delay wont be twice by default, (also increase intervall if you do want higher acd) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17072 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-12-30-Harmonize skillid, skill_num, skillnum, skill, to skill_id and same for ↵glighta1-5/+5
skill_lv -Optimise type from int to int16 in order to reduce ram consumtion. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17065 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-12-22Community Contribution Time!momacabu1-2/+2
* Fixed bugreport:6303: official servers now always reshuffle the dice emoticon. To disable change the configuration to 'no'. Thanks to Vianna for providing the information! * Fixed bugreport:7026: creating a guild and exiting in a short amount of time wouldn't save the guild properly. Thank you clydelion! * Fixed bugreport:7030: removed warning introduced by r16987. Thanks Mr. Brian and Sir BuildBot for pointing! * Fixed bugreport:7031: if a player crashed during warp it would cause OnTouch_ to not trigger anymore. Thanks to flaviojs (eA-r15185) for the fix and Napster for pointing out! * Fixed bugreport:7032: Clementia and Canto Candidus give an additional of +1 str/agi/dex each 10 job levels (from caster). Thanks solvent! git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17034 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-12-12- Follow up r17004 & bugreport:6995, added safer calculation to strategic ↵markzd1-2/+2
points at battle.c&status.c. - Implemented reading of renewal exp_guild.txt. (tid:75398) - Fixed Status Fogwall(Blinding Mist) to be reduced by status/card. (bugreport:4543) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17017 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-12-09* Use sv_readdb to read exp_guild.momacabu1-24/+11
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17012 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-12-05- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).brianluau1-1539/+1533
[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-1533/+1539
Removed /SAFESEH option from MSVC11 projects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-10-29-Add some src basic documentation.glighta1-7/+9
-Change some remaining -1 for status ending timer. -Move some hardcoded msg in msg_athena -Small optimisation on battle_attr_fix git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16835 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-13Enhanced `DBMap` implementation to allow storing integer type data in ↵gepard19841-3/+6
addition to void pointers. - Added enum for data: `int`, `unsigned int` and `void*` - Replaced generic `void*` data with `DBData` struct to hold `int`, `unsigned int` or `void*` (member of `DBNode`) - Added `db_i2data`, `db_ui2data` and `db_ptr2data` functions to cast from `int`/`uint`/`void*` to `DBData` (used in `DBMap::put()`) - Added `db_data2i`, `db_data2ui` and `db_data2ptr` functions to get `int`/`uint`/`void*` from `DBData` - Enabled statistics for new functions in `db_stats` struct - `DBCreateData` functions (used in `DBMap::ensure()`) now return `DBData` instead of `void*` - `DBApply` functions (used in `DBMap::foreach()` and `DBMap::destroy()`) now take `DBData*` as a parameter instead of `void*` - `DBMatcher` functions (used in `DBMap::getall()`) now take `DBData` as a parameter instead of `void*` - `DBReleaser` functions now take `DBData` as parameter instead of `void*` - Default releasers release data if it is `void*` (`DB_DATA_PTR`) type - `DBIterator` functions: `first()`, `last()`, `next()` and `prev()` now return `DBData*` instead of `void*` - `DBIterator::remove()` now returns `int` (1 if node was found and removed, 0 otherwise) instead of `void*` and takes an extra `DBData*` parameter for the data of removed entry - `DBMap::get()` and `DBMap::ensure()` now return `DBData*` instead of `void*` - `DBMap::remove()` and `DBMap::put()` now return `int` (1 if node already existed, 0 otherwise) instead of `void*` and take an extra `DBData*` parameter for the data of removed entry - `DBMap::put()` now takes `DBData` as parameter instead of `void*` - `DBMap::getall()` now puts data into `DBData**` buffer instead of `void**` buffer - Updated macros: - (`i`/`ui`/`str`)`db_get` and (`i`/`ui`/`str`)`db_ensure` were wrapped with `db_data2ptr` to extract data from `DBData*` that is now returned by `DBMap::get()` - added (`i`/`ui`/`str`)`db_iget` and (`i`/`ui`/`str`)`db_uiget` that get `DBData` from `DBMap` and extract `int`/`unsigned int` from it (with `db_data2i`/`db_data2ui`) - `db_put`, `idb_put`, `uidb_put` and `strdb_put` data params were wrapped with `db_ptr2data` to match new signature of `DBMap::put()` (`DBData` instead of `void*`) - added (`i`/`ui`/`str`)`db_iput` and (`i`/`ui`/`str`)`db_uiput` that put `int`/`unsigned int` into `DBMap` (first wrapping it with `DBData`) - added `NULL` in place of extra parameter for removed data in `db_remove` macros - `dbi_first`, `dbi_last`, `dbi_next` and `dbi_prev` were wrapped with `db_data2ptr` to extract data from `DBData*` that is now returned by these `DBIterator` functions - Updated `DBMap` documentation, and fixed a dozen of typos in it. - Updated rest of rA code to reflect `DBMap` changes (mostly required signature changes of `DBCreateData` and `DBApply` functions). - Fixed a bug where `DBMap::put()` would return data of a deleted entry. - Removed some unnecessary pointer casts. - Increased `showmsg.c` static buffer size to fit entire DBMap stats report. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15682 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-09Code cleanup: replaced `DBIterator` function calls with macros where possible. gepard19841-3/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15668 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-05- Guild Castle code cleanup:gepard19841-21/+3
- all changes to guild castle data are now handled first by map-server and only sent to char-server for saving - ensured that changes made to guild castle during char-server disconnection time will be resent on reconnect - actually removed definition of `MAX_GUILDCASTLE` (r15657) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15658 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-04- Guild Castle code cleanup:gepard19841-201/+125
- removed `MAX_GUILDCASTLE` limit - char-server now caches guild castles in `DBMap` - improved guild castle SQL queries to support non-default values of `MAX_GUARDIANS` - disallowed declaring guild castles on maps that are on other map-servers - map-server now requests data for all guild castles from char-server on initial connect (bugreport:287) - removed ''guildcastleinfo events'' as they were esentially duplicated ''OnAgitInit'' - optimized castle data load packets (bugreport:287) - updated WoE scripts to reflect source changes (scripts no longer need or should request castle or guild data) - updated related docs - Added `db_size` macro. - Replaced manual counting of castles occupied by a guild with `guild_checkcastles()` calls. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15657 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-02Replaced some magic numbers related to castle guardians with `MAX_GUARDIANS`.gepard19841-18/+6
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15650 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-30- Removed more trailing tabs.brianluau1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15527 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-20Merged TXT removal branch back to trunk.gepard19841-985/+1392
* TXT save engine is removed and no longer supported. * See also tid:53926, tid:57717. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15503 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-07* Reverted r14563, due to multiple issues which render the source ↵ai4rei1-15/+15
malfunctioning or uncompilable. To be redone later (bugreport:4627). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14567 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-07Changed almost all instances of sprintf() to snprintf().Paradox924X1-15/+15
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14563 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-02* Added defines for guild notice sizes (MAX_GUILDMES1 and MAX_GUILDMES2).ai4rei1-4/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14544 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-22* Fixed guild and guild member exp truncation issue (bugreport:4130, since ↵ai4rei1-15/+15
r14242). - Fixed guild member position, hair, hair color, gender, class and level could potentially become corrupted due to shorts being read as ints (partially since r2986). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14487 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-22* Fixed saving/loading errors with compilers (such as VC6, MinGW), which do ↵ai4rei1-2/+2
not recognize %ll format (since r14242). - This also fixes guild leader name being displayed and saved as "(null)" in the guild member list. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14486 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-22* Fixed map server getting notified of hair, hair color, gender, class and ↵ai4rei1-1/+2
level changes from a char server (TXT only) twice (since r2986). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14485 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-06-01Replaced all occurrences of 'leaved' with 'withdraw'.Paradox924X1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14319 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-02-09Expanded range for cached and stored-in-db guild member exp (devotion) from ↵Paradox924X1-3/+3
uint32 to uint64. (bugreport:3983) Capped value when sending to client to INT_MAX to prevent confusion. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14242 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-16Fixed an exploit that makes guild skill get higher level than the max ↵Inkfish1-3/+3
defined in guild_skill_tree. (bugreport:3241) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13894 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-04-12TXT code has been re uploaded. Please note this does not change the fact ↵Kevin1-0/+1579
that TXT support has been dropped. There is no guarantee the code base will be managed and it will in the near future be REMOVED. If there is in ANY way TXT support in the future, it will be abstracted through a sql interface so only the sql code has to be maintained. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12572 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-04-12I live in a giant bucket.Kevin1-1579/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12570 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-26Adjusted eAthena code to compile cleanly in C++ mode.ultramage1-22/+22
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12436 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-21- Fixed new guilds displaying online-connect member count at 0 rather than ↵skotlex1-0/+1
1, and the guild master not knowing it is one (eg: it cannot edit the guild notice of a newly created guild until relogging). - Fixed acc_reg2 parsing screwing up the char_id and subtracting 2 from it rather than passing it as it is. - Extended the auth_node/auth_db system in chrif.c to handle log in/out and mapserver-change procedures. This way players are not in the main dbs when they are not "active", which blocks potential invalid accesses to them. - Replaced states auth, waiting_disconnect and finalsave with active. - Cleaned some the party/guild login and creation procedures, removed the party_sent/guild_sent states. - Removed a redundant guild_check_member call which is beyond not-needed and into the realm of wasting resources. - clif_parse will no longer process packets from !sd->state.active players, this also makes checking for finalsave uneccessary (since players re already removed from the maps and dbs by this point, so you can't access them in any other way) - Separated the roles of unit_free and map_quit, the former will handle cleaning structures from the player so it can be free'd safely, while the latter performs additional routines which are unique to characters logging out normally (map-server changes will invoke unit_free and bypass map_quit). - Removed pc_isplaying, quit_db, map_knowsaccount, MAPIT_PCISPLAYING among other functions/defines which are no longer needed due to the new login scheme. - Cleand up a bit some code in the clif_send(_sub) functions. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12223 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-06Modified showmsg code to not attach a timestamp to MSG_NONE-type messages, ↵ultramage1-1/+0
generated by ShowMessage(). It now works exactly like printf(). Removed/replaced all printf calls in the code. Added a new flag to setting 'console_silent', for filtering debug messages. Silenced the "Broken pipe found" and "Server running in debug mode" messages. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12020 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-18Fixed a glitch where the TXT charserver would not unlock castle.txt after ↵ultramage1-2/+2
creating it, thus preventing it from being saved correctly. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11941 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-14Guardian hp handling code removal (see bugreport:342)ultramage1-100/+33
- removed guardian hp from the castle data structure, database, savefiles and various script functions (use upgrade_svn11914.sql) - removed guardian hp calculation and manipulation from the castle manager npc, now the hp values are updated by the server itself (glitch: when castle defense changes, all guardians are healed to full) - tweaked script function 'guardianinfo' to provide some data needed by the manager npc (currently available are hp, maxhp and visibility); also, it doesn't need a player attached to execute anymore The whole thing is experimental, use at your own risk (seems to work though...) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11915 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-12Some more tweaks to the guild codeultramage1-120/+171
- unrolling of foreach()/_sub() pairs using db iterators - usage of ARR_FIND instead of for()/break; - old function header adjustment git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11896 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-12* Some preparations for the guild script updateultramage1-195/+256
- cleaned up npc event execution code - cleaned up guild data loading/saving code; to be improved later - removed dummy 'account name' expulsion list management code - removed columns 'rsv1' and 'rsv2' from guild member data - removed columns 'rsv1' 'rsv2' 'rsv3' and 'acc' from guild expulsion data - added upgrade_svn11895.sql for SQL git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11895 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-12Removed the badly designed/unfinished guild_check_conflict() data integrity ↵ultramage1-35/+0
check (that wasn't actually being used up 'till now). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11894 54d463be-8e91-2dee-dedb-b68131a5f0ec