summaryrefslogtreecommitdiff
path: root/src/char/char.c
AgeCommit message (Collapse)AuthorFilesLines
2018-06-29Add new field into packet char_send_map_info.Andrei Karas1-2/+11
But unused for now.
2018-06-13Fix job field size in function char_parse_char_create_new_char.Andrei Karas1-1/+1
2018-04-22Remove the stat-reporting mechanismHaru1-45/+1
Signed-off-by: Haru <haru@dotalux.com>
2018-04-22Merge pull request #2007 from Jedzkie/PincodeUpdateHaru1-1/+3
Pincode Update
2018-04-07Implementation of Attendance systemAsheraf1-4/+7
2018-04-06Add support for packet 0xaf7 in zero clients.Andrei Karas1-1/+1
2018-04-02Pincode UpdateJedzkie1-1/+3
- Added blacklist feature - Added official message when successfully create a pincode / successfully change a pincode
2018-03-29Simplify version checks with new packet version defines.Andrei Karas1-1/+1
2018-03-11Fix packet character name request reply for 20180221 clients.Andrei Karas1-0/+5
2018-02-10Clean up trailing whitespace and non-indent tabsHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2018-01-25Implementation of Official Clan SystemMurilo Pereti Tavares1-4/+9
All official features work including the autokick for inactive members And the system is completely customizable.
2017-11-25correct wrong conf file path in showerrorAsheraf1-1/+1
2017-11-18Pass the correct types and sizes to the StmtBind functionsHaru1-147/+152
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-5/+5
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-09-21Change char server packets for 20170830 and newer clients.Andrei Karas1-7/+20
2017-09-19remove trailing whitespaces from sourcegumi1-1/+1
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-07-30Implementation of RoDEXKirieZ1-0/+4
2017-07-17Merge pull request #1760 from Smokexyz/memitemtosql-fixHaru1-223/+240
Optimisation of char_memitemdata_to_sql()
2017-07-05Optimisation of char_memitemdata_to_sql()smokexyz1-223/+240
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-05-31Fix a race condition when saving the storage on logoutHaru1-4/+0
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-29Fix memory leak in storage item vector (Fixes #1751)Andrei Karas1-1/+1
2017-05-22Add storage_data reception, parsing and sending to/from the map-server.Smokexyz1-13/+7
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/IROHaru1-9/+42
Implementation of Item Options System.
2017-04-04Implementation of Item Options System.Smokexyz1-9/+42
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.Dastgir1-16/+28
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.
2016-12-03Clarify some Job Class vs MapID confusion (1/2)Haru1-34/+34
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-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-22Fix incorrect coding style used in char/char.c and map/skill.cDastgir Pojee1-2/+2
2016-10-22Added Summoner Class.Dastgir Pojee1-4/+4
(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 Pojee1-19/+36
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-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 libconfigHaru1-99/+180
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 libconfigHaru1-206/+541
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 variablesHaru1-41/+39
- `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-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 intHaru1-9/+9
Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-07-03Add into travis configure option --enable-buildbot.Andrei Karas1-0/+2
Also disable all known default warnings if build bot option enabled.
2016-07-03Add --run-once flag into char server.Andrei Karas1-0/+14