summaryrefslogtreecommitdiff
path: root/src/char
AgeCommit message (Collapse)AuthorFilesLines
2017-09-17Move other view-related variables to `sd->status.look`Haru1-17/+17
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-5/+5
`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-5/+5
`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-12Fix several typos and grammar mistakesHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2017-08-08Fix hpm issues after rodex commit.Andrei Karas3-3/+3
2017-07-30Implementation of RoDEXKirieZ9-3/+627
2017-07-27Fix possible buffer overflows with snprintf.Andrei Karas1-1/+1
2017-07-17Merge pull request #1760 from Smokexyz/memitemtosql-fixHaru3-225/+243
Optimisation of char_memitemdata_to_sql()
2017-07-05Optimisation of char_memitemdata_to_sql()smokexyz3-225/+243
Implements the storage saving algorithm for inventory, cart and guild storage tables. Total queries to a table in any call would be no more than 4 per call, replacing the original algorithm that could make a lot more through single update queries per call. This significantly reduces the run time speed for saving/loading of item data from the game server.
2017-06-03Add packet 0xac5 for clients >= 20170329.Andrei Karas1-7/+14
2017-06-02Fix replace statement formatting in storage save function.smokexyz1-3/+3
2017-05-31Fix a race condition when saving the storage on logoutHaru3-82/+18
The storage data is no longer cached in the char server. This removal doesn't cause any performance loss, since the cached data was refreshed (loaded from the database) after every save operation. This commit moves the load at the beginning of the save rather than at the end, and discars the cached copy after the save is completed. Related to #1754 Signed-off-by: Haru <haru@dotalux.com>
2017-05-30Merge pull request #1756 from Smokexyz/mmo_charstatus-fixsmokexyz1-7/+6
Fix storage saving checks and amount update.
2017-05-30Fix storage saving checks and amount update.smokexyz1-7/+6
Special thanks to @MishimaHaruna for the fix.
2017-05-29Fix memory leak in storage item vector (Fixes #1751)Andrei Karas3-1/+16
2017-05-22Add storage_data reception, parsing and sending to/from the map-server.Smokexyz6-49/+345
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-04-14Fix compilation warning in char.cAndrei Karas1-1/+3
2017-04-09Merge pull request #1598 from Smokexyz/IROHaru4-54/+153
Implementation of Item Options System.
2017-04-09Fix wrong parameters in a call to mapif->party_broken()Haru1-1/+1
The call is in a code path currently unused, and so was never noticed during normal gameplay. The wrong line dates back to (j)Athena, and was already present in snapshots from 2003. Signed-off-by: Haru <haru@dotalux.com>
2017-04-04Implementation of Item Options System.Smokexyz4-54/+153
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-21Add support for sex based character creation for 2015-10+ clients.Dastgir2-17/+29
Allow select for new char gender and human or doram class. Doram starting point not implimented. Based on ragemu commit: commit 5d618a64b041341a48ce24a92633a6a2dcf5af4f Author: Dastgir <dastgirp@gmail.com> Date: Sun Jun 12 22:11:51 2016 +0530 Added Support for Sex Based Character Creation for 2015-10+ clients.
2017-02-12Follow-up 946b7f8490e952fbd90c6760f256ddfdd1e98137KirieZ1-16/+3
2016-12-23Follow-up 19c07f4KirieZ1-3/+3
2016-12-20Follow-up ea449a7, fixed coding-styleKirieZ1-8/+5
2016-12-18Changed behavior when party leader leaves it from party being disbanded to ↵KirieZ1-18/+24
leader being changed to the second user. Closes #1107
2016-12-03Clarify some Job Class vs MapID confusion (1/2)Haru7-71/+71
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-11-19Extend the previous linker library order fix to other makefilesHaru1-3/+3
This also fixed a typo (misplaced parentheses around LIBCONFIG_OBJ) in the *_DEPENDS variable of makefiles Signed-off-by: Haru <haru@dotalux.com>
2016-11-19Add fixed-size versions of the _int64 libconfig getters/settersHaru1-1/+1
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-10-28Fixed copyright year for 2016Lemongrass311020-20/+20
2016-10-22Fix incorrect coding style used in char/char.c and map/skill.cDastgir Pojee1-2/+2
2016-10-22Added Summoner Class.Dastgir Pojee2-4/+7
(Only Placeholder, other things related to summoner will follow-up soon) Added SQL-Upgrade: Added `class` column in charlog
2016-10-22Added Packets for Several Clients: 2015-10-01, 2015-10-29, 2015-11-04 andDastgir Pojee2-20/+37
2015-12-16 Added New Char Creation Packet(0xa39). Added Placeholder of JOB_SUMMONER
2016-10-16Dont send packets for known unsupported client versions.Andrei Karas1-1/+5
Fixed packets between 20111005 to 20141022. As reference was used client packet logs from https://gitlab.com/4144/servergreps/tree/master/peek_all/packets
2016-09-27Save also quest time while updating quest in db.Andrei Karas1-1/+1
2016-08-22Corrected an issue that caused the setting inter_configuration/log/log_inter ↵Haru2-1/+33
to be ignored Signed-off-by: Haru <haru@dotalux.com>
2016-08-22Corrected an issue that caused the setting ↵Haru1-1/+6
char_configuration/permission/display_new to be ignored Fixes #1407 Signed-off-by: Haru <haru@dotalux.com>
2016-08-22Temporary quick-fix for a warning in the linux buildsHaru1-1/+1
- libconfig uses 'long long' for its 64 bit lookup/set/get functions, rather than a well-defined size integer (such as int64_t). GCC doesn't like the use of an int64_t* where a long long* is required, especially on linux x86_64, where int64_t is typedeffed as long int - In future, the function signature will be changed, so we can use int64 normally. Signed-off-by: Haru <haru@dotalux.com>
2016-08-21Corrected some issues reported by coverityHaru1-4/+7
- Incorrect sizeof expression in char_config_set_ip() - Invalid comparison (when MAX_ZENY == MAX_INT) in char_config_read_player_new() Signed-off-by: Haru <haru@dotalux.com>
2016-08-20Re-added HPM support for configuration settingsHaru1-2/+4
Plugin settings should be relative to the the libconfig file root. For example, a configuration setting of type HPCT_CHAR will be relative to the root of conf/char/char-server.conf. In order to add a configuration entry inside the char_configuration block, the full configuration path (slash-delimited) should be passed to addCharConf(), as in the following example: `addCharConf("char_configuration/my_setting", my_parser_function);` Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Ported socket.conf (was packet.conf) to libconfigHaru1-0/+1
Ported to modern Hercules and cleaned up from Panikon's commits: b10f2a88073882bea812c6278fdec7848102ab87, bc5007299a92898ea4630f2a977d9a1b42b6c145 Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Ported inter-server.conf to libconfigHaru4-142/+262
Ported to modern Hercules and cleaned up from Panikon's commits: 40f9ec33868e2240cab013308897898ed252b3e0, a9d646da19e25ab6fcf44dbd1ae7d90c30f6686c, 1aa8581a0aecbfd53e877686c399ffb731dcd75e, 72c645b015ae6130ca7d4309d0fb1413340e7f23, f8c906a0496b9acdae1d8244b1544fa03592061e, 51d88a58983c9552dfd1a0f059e5a031742aed61, 443684b3c77f4c32fe7877a7f8d62debf73b1e93, cf93eafef1f322cd1583226272b7d4008f562da4 Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Ported char-server.conf to libconfigHaru4-234/+607
Fixed issue: 8115, now start items can be equipped as well Ported to modern Hercules and cleaned up from Panikon's commits: c6482e9870645ffe59a6a059b819574d4ac79fd9, 832fb27d4f767e4bc8b68c432d0da00b7cb7a4f9, f81b579899e3a15bd472ca8c6a6e0116c43bec92, e23723725499b617def03d05661eca637edaeabd, 0b783a83d82e588efd760f7f4baec0c8074a6fd1, 1b7de91308a57ea07b158ed95a2515a3c8cc36bd, 677d3430cbda0962b320a60cf499e9dadf637d00 Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Renamed some char and inter server variablesHaru10-74/+75
- `int save_log` -> `bool chr->show_save_log` - `bool char_new` -> `bool enable_char_creation` - `int log_char` -> `bool chr->enable_logs` - `int log_inter` -> `bool inter->enable_logs` - `int chr->new_display` -> `int16 chr->new_display` - `int char_aegis_delete` -> `bool char_aegis_delete` Split and improved from Panikon's commit 832fb27d4f767e4bc8b68c432d0da00b7cb7a4f9 Signed-off-by: Haru <haru@dotalux.com>
2016-08-16Add missing quote chars in char.cAndrei Karas1-1/+1
2016-08-16Add missing escaping for saved player strings into db.Andrei Karas1-2/+5
2016-08-10Fix login and char servers null pointer access if packet handler in plugin ↵Andrei Karas1-1/+4
initiate server termination.
2016-07-14Changed mmo_charstatus::status_point and mmo_charstatus::skill_point to intHaru1-5/+5
Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-07-14Changed mmo_charstatus::base_level and mmo_charstatus::job_level to intHaru2-11/+11
Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-07-13Add missing includes into HPM.Andrei Karas1-0/+3
2016-07-03Add into travis configure option --enable-buildbot.Andrei Karas1-0/+2
Also disable all known default warnings if build bot option enabled.