summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)AuthorFilesLines
2018-02-10Clean up trailing whitespace and non-indent tabsHaru2-4/+3
Signed-off-by: Haru <haru@dotalux.com>
2018-02-09Update HPM hooks.Andrei Karas2-0/+45
2018-01-25HPM Hooks UpdateMurilo Pereti Tavares2-0/+32
2018-01-25Implementation of Official Clan SystemMurilo Pereti Tavares2-1/+61
All official features work including the autokick for inactive members And the system is completely customizable.
2018-01-14HPM Hooks UpdateHercules.ws1-0/+4
Signed-off-by: HerculesWSAPI <dev@herc.ws>
2018-01-09HPM Hooks UpdateHercules.ws2-2/+2
Signed-off-by: HerculesWSAPI <dev@herc.ws>
2018-01-06Enable always asserts and nullpo checks.Andrei Karas1-7/+2
Before this options was depend on debug configure flag. But this options is must because without server may crash in any exploits.
2017-12-17HPM Hooks UpdateHercules.ws1-0/+1
Signed-off-by: HerculesWSAPI <dev@herc.ws>
2017-12-17Merge pull request #1923 from 4144/fixpacketsHaru1-0/+7
Add support for Ragnarok zero clients, split packets.h again
2017-12-08Merge pull request #1898 from Asheraf/homunafHaru1-0/+1
implement homunculus autofeeding for 2017 clients
2017-12-02Add configure option --enable-packetver-zero for enable support for zero ↵Andrei Karas1-0/+7
clients.
2017-11-18Implement Homunculus autofeedingAsheraf1-0/+1
2017-11-18HPM Hooks UpdateHercules.ws1-0/+1
Signed-off-by: HerculesWSAPI <dev@herc.ws>
2017-11-18Assert on the right buffer size on the StmtBind functionsHaru1-36/+59
Signed-off-by: Haru <haru@dotalux.com>
2017-11-18Pass the correct types and sizes to the StmtBind functionsHaru2-0/+10
Fixes #1531 (and other similar issues) Signed-off-by: Haru <haru@dotalux.com>
2017-11-05Reduce confusion between skill IDs and skill DB indexes (part 2)Haru1-3/+7
Remove MAX_SKILL in favor of MAX_SKILL_DB, when referring to the maximum skill DB index. This is opposed to MAX_SKILL_ID, the maximum skill ID. Signed-off-by: Haru <haru@dotalux.com>
2017-10-21Add names for some unnamed enums.Andrei Karas1-2/+2
Need for packet parser.
2017-10-21Add rodex 2017 packets.Andrei Karas1-0/+5
2017-09-21Convert some functions from int32 types to int64.Andrei Karas2-0/+23
This mainly need for base and job exp, because now they using int64 type.
2017-09-21Change char server packets for 20170830 and newer clients.Andrei Karas1-1/+1
2017-09-17Move other view-related variables to `sd->status.look`Haru1-4/+6
The following variables are now moved to `sd->status.look` (from `sd->status`): `head_top`, `head_mid`, `head_bottom`, `robe` Signed-off-by: Haru <haru@dotalux.com>
2017-09-17Differentiate variables that hold a ViewSprite and a Subtype (part 2)Haru1-1/+1
`sd->status.shield` is renamed to `sd->status.look.shield` and only holds ViewSprite IDs. Its previous other meaning is now transferred to `sd->has_shield`, of boolean type (to detect the presence of a shield) Signed-off-by: Haru <haru@dotalux.com>
2017-09-17Differentiate variables that hold a ViewSprite and a weapon SubtypeHaru1-1/+3
`sd->status.weapon` is renamed to `sd->status.look.weapon` and only holds ViewSprite IDs. Its previous other meaning is now transferred to `sd->weapontype` (holding the currently equipped weapon type, considering both hands at once) Signed-off-by: Haru <haru@dotalux.com>
2017-09-17Split 'View' in two different fields in the item databaseHaru1-0/+1
- The field was used both for sprite view IDs and for weapon or ammunition subtypes. Now the fields 'ViewSprite' and 'Subtype' are used respectively. Signed-off-by: Haru <haru@dotalux.com>
2017-08-08Disable warning -Wdiscarded-qualifiers in hpm code for now.Andrei Karas1-0/+7
2017-08-08HPM Hooks UpdateHercules.ws2-0/+51
Signed-off-by: HerculesWSAPI <dev@herc.ws>
2017-07-30Implementation of RoDEXKirieZ1-0/+47
2017-06-29Fix compatibility with MariaDB 10.2Haru1-1/+4
This removes a direct access to a member of the `MYSQL` object and replaces it with the proper accessor for forward/backward compatibility. Signed-off-by: Haru <haru@dotalux.com>
2017-05-27Merge pull request #1722 from Smokexyz/mmo_charstatus-fixHaru1-3/+5
Dismemberment of `storage_data` from `mmo_charstatus`.
2017-05-22Add storage_data reception, parsing and sending to/from the map-server.Smokexyz1-3/+5
Remove loading and saving of storage_data through char.c Re-declaration of structure storage_data as a vector. Re-code of portions in the map-server using storage_data. A new approach is taken by saving the loaded storage data from sql into memory for the duration of the session, thereby removing the need of querying the database to re-load all items everytime a storage save routine is issued from the map-server. Saving of storage items is done through a new function that significantly reduces the number of queries compared to char_memitemdata_tosql(), and therefore run-time speed. This method potentially reduces the number of update and delete queries from MAX_STORAGE (which could be >= 600) times to literally 1. Storage items are stored in a dynamically allocated array and handled accordingly. struct mmo_charstatus size reduces by 34,800 bytes. Update pc_checkitem() with masks for item checks. `sd->state.itemcheck` has been changed to `sd->itemcheck` of type `enum pc_checkitem_types` `battle/items.conf` has been updated to reflect configuration changes. Further updates to assert a successful reception of storage data in related functions.
2017-05-09Merge pull request #1699 from Jedzkie/11-SummerCostumeHaru1-1/+2
Implemented Official Summer 2 Costume
2017-04-26HPM Hooks UpdateHercules.ws1-81/+162
Signed-off-by: HerculesWSAPI <dev@herc.ws>
2017-04-23Coding-style Fixes and White space adjustmentsJedzkie1-1/+1
2017-04-19Implemented Official Summer 2 CostumeJedzkie1-1/+2
Added summer2_ignorepalette configuration
2017-04-09Merge pull request #1598 from Smokexyz/IROHaru2-1/+14
Implementation of Item Options System.
2017-04-04Implementation of Item Options System.Smokexyz2-1/+14
Allows the infusing of equipments with bonus item options. This feature is constrained to clients of packet versions greater than or equal to `20150226`. Item Options and their effects are defined server-side in `db/item_options.conf` and client side in `data/luafiles514/lua files/datainfo/addrandomoptionnametable.lub` The ID of the option must tally with the correct index of the description provided in the client side lua file to avoid bugs. IT_OPT_* keys and MAX_ITEM_OPTIONS macro are also exported from the source as constants. An additional flag `disable_options` has been added to sql, and as `DisableOptions: true/false (boolean, defaults to false !!for equipments only!!)` to item_db.conf files. Script commands documentation is also included. SQL file updates are included. Credits: [Smokexyz](https://github.com/Smokexyz) Style and Script Fixes by [Asheraf](https://github.com/Asheraf) Initial design Idea by [secretdataz](https://github.com/secretdataz)
2017-03-20Add comment to safestrncpy about size checks.Andrei Karas1-0/+1
2017-03-16Increase Character Slots from 9 to 12Jedzkie1-1/+9
- kRO Mains recently increased their character slots from 11 to 12.
2017-01-22Fix CMDLINE_OPT_PARAM arguments in plugins failing to loadHaru1-0/+2
When the server is called with a plugin-defined argument expecting additional values, in the form '--foo bar', the parser is unable to skip the additional value until the plugin is fully loaded. The issue was caused by the first scans of the argument list to find CMDLINE_OPT_PREINIT or CMDLINE_OPT_SILENT arguments, which happen before plugins are loaded, and would cause the parser to choke on the additional values, interpreting them as separate arguments. This is related to PR #1552, where we attempted to use this option for the first time. Signed-off-by: Haru <haru@dotalux.com>
2017-01-10Update md5 calculation to be able to hash a binary buffer instead of only ↵hemagx2-18/+16
strings Signed-off-by: hemagx <ibrahem.h.basyone@gmail.com>
2017-01-02HPM Hooks UpdateHercules.ws2-2/+2
Signed-off-by: HerculesWSAPI <dev@herc.ws>
2016-12-03Add function to retrieve the appropriate fame list type for a job mapidHaru1-0/+1
This commit adds the function `pc->famelist_type()` to retrieve the appropriate fame list for a given job (common operation). When the given job ID doesn't have an appropriate fame list, the newly introduced value RANKTYPE_UNKNOWN is returned. Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Clarify some Job Class vs MapID confusion (1/2)Haru1-3/+5
This commit ensures that `sd->status.class` and related variables only contain Job Classes (i.e. the client-compatible values, where High Novice 4001) and are never checked against the bitmask-based MapID values. As a rule of thumb, from now on, when a variable is named `class`, it is intended to contain a Job Class ID and not a MapID. The type of such variable shall be a signed `int16` or `int`. To ensure that related third party code is also verified when this commit is merged, the variable `struct mmo_charstatus::class_ (i.e. `sd->status.class_`) is renamed to `class`. Some issues in related lines are also fixed, including: - A wrong check in the char server would prevent the correct detection of babies in code related to the family exp sharing. - Baby Arch Bishops would not be affected by Eucharistica. - A wrong check would cause the `questinfo()` script command not to display its information for most classes (except 1-1 classes). - Map IDs and Job Classes were mixed up in `itemdb_jobid2mapid()` and `itemdb_jobmask2mapid()` for 1-1 classes (causing currently no harm, since they just happen to coincide). - The Baby Sura class would not cause parties to be marked as containing a monk type character (for SLS Team Up purposes). - Baby Geneticists would bypass the cart check when trying to equip ammunitions. - Baby Mechanics would bypass the Mado Gear check when trying to equip ammunitions. - Transcendent Shadow Chasers would lose the Stalkers' ability to clone transcendent skills. Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Clarify the meaning of the MAPID_* constantsHaru1-6/+6
The enum values are now written in a more explicit way, showing how they're composed (upper mask + base job). A future-proof static assertion is added, to make sure the base jobs won't overlap the upper masks. Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Add support for static assertions (on compilers that support them)Haru1-0/+27
This introduces the macro `STATIC_ASSERT(ex, msg)`, that works like its C11 counterpart `_Static_assert(ex, msg)`, on compilers that support it. Support is provided, depending on the compiler: - When in C11 mode, use the native `_Static_assert` - If the compiler advertises having the `c_static_assert` feature, use `_Static_assert` (according to the clang documentation). - If the compiler is GCC >= 4.7 (tested to be compatible), use `_Static_assert` (nonstandard extension, C11 feature available in C99). - If the compiler is MSVC (all the currently supported versions have been tested to be compatible), then use `static_assert` (nonstandard extension, C++ feature) - Otherwise, define it as a no-op macro. Signed-off-by: Haru <haru@dotalux.com>
2016-11-19Add fixed-size versions of the _int64 libconfig getters/settersHaru2-13/+87
As we use int64 (instead of long long int) through the code, it's preferable if our libconfig interface does the same, avoiding us to create temporary interchange variables for that purpose. Signed-off-by: Haru <haru@dotalux.com>
2016-11-01Merge pull request #1498 from Lemongrass3110/cleanup/copyright2016Ibrahem Hossam24-24/+24
Fixed copyright year for 2016
2016-10-28Fixed copyright year for 2016Lemongrass311024-24/+24
2016-10-28Fixed wrong nullpo checkLemongrass31101-1/+1
2016-10-22Increases MAX_SKILL to occupy Summoner SkillsDastgir Pojee1-1/+1