summaryrefslogtreecommitdiff
path: root/src/char/inter.c
AgeCommit message (Collapse)AuthorFilesLines
2020-05-09Adjust size of fields holding a string variable's value to ↵Kenpachi Developer1-4/+4
SCRIPT_STRING_VAR_LENGTH + 1 Also exclude NULL-terminator from string variable value length in inter-server communication.
2020-01-13Update copyright headers for year 2020Haru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2019-08-26Remove round-trip to the inter-server for the guild chat messagesHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2019-08-26Remove round-trip to the inter-server for the party messagesHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2019-08-26Remove round-trip to the inter-server for the broadcast messagesHaru1-2/+1
Signed-off-by: Haru <haru@dotalux.com>
2019-08-26Remove round-trip to the inter-server for the whisper-to-gm messagesHaru1-2/+1
Signed-off-by: Haru <haru@dotalux.com>
2019-08-25Remove whisper dispatch code from the inter serverHaru1-88/+1
The code was currently not in use (assuming the only officially supported case of a single-zone server) Signed-off-by: Haru <haru@dotalux.com>
2019-04-14Add account id and char id into inter server rodex update packetAndrei Karas1-1/+1
2019-02-11Extend class and level field in packet 0x3035Andrei Karas1-1/+1
2019-02-11Extend class and level field in packet 0x3080Andrei Karas1-1/+1
2018-07-24Implementation of the official Achievement System.smokexyz1-1/+5
Source: http://ro.gnjoy.com/news/update/View.asp?seq=163&curpage=1 Script Commands - ``` achievement_progress(<ach_id>,<obj_idx>,<progress>,<incremental?>{,<char_id>}); ``` Includes an achievement_db.conf generator that reads from the item_db, mob_db (server side) and achievement_list.lub files to determine valid achievement entries based on item/monster availability. Achievements containing unsupported entries are commented out. This feature, although renewal-only in official servers, is capable of being used in pre-renewal mode on Hercules. Does not include the title system yet. A big thanks to - @MishimaHaruna for constantly reviewing. @4144 for all the support. @Asheraf for a lot of official information. Co-authored-by: "Dastgir" <dastgirp@gmail.com>
2018-07-19Replace item id shorts to int in map server.Andrei Karas1-1/+1
2018-07-01Change functions to static where possible (Part 3 - char)Haru1-35/+36
This fixes issues with plugins defining symbols with the same names Signed-off-by: Haru <haru@dotalux.com>
2018-06-30Move mapif functions from inter.c to mapif.cHaru1-306/+0
Signed-off-by: Haru <haru@dotalux.com>
2018-06-30Move some non-mapif functionality from the mapif interface to the inter/char ↵Haru1-45/+64
interfaces Signed-off-by: Haru <haru@dotalux.com>
2018-04-22Remove the stat-reporting mechanismHaru1-2/+1
Signed-off-by: Haru <haru@dotalux.com>
2018-02-20Dont show password and pincode in @accinfo gm command.Andrei Karas1-0/+3
This need for better security.
2018-01-25Implementation of Official Clan SystemMurilo Pereti Tavares1-1/+3
All official features work including the autokick for inactive members And the system is completely customizable.
2017-07-30Implementation of RoDEXKirieZ1-1/+5
2017-05-22Add storage_data reception, parsing and sending to/from the map-server.Smokexyz1-1/+1
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.
2016-12-03Clarify some Job Class vs MapID confusion (1/2)Haru1-26/+26
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-10-22Added Summoner Class.Dastgir Pojee1-0/+3
(Only Placeholder, other things related to summoner will follow-up soon) Added SQL-Upgrade: Added `class` column in charlog
2016-08-22Corrected an issue that caused the setting inter_configuration/log/log_inter ↵Haru1-1/+32
to be ignored Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Ported inter-server.conf to libconfigHaru1-40/+74
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-19Renamed some char and inter server variablesHaru1-2/+3
- `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 escaping for saved player strings into db.Andrei Karas1-2/+5
2016-07-14Changed mmo_charstatus::base_level and mmo_charstatus::job_level to intHaru1-2/+2
Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-05-08Fixed various issues pointed out by cppcheckHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-04-30Corrected truncation of the last letter in whisper messagesHaru1-3/+3
- Follow-up to ccfd054 - Fixes #1275 Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedef from DBMapHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedefs from union DBKey and struct DBDataHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Removed unnecessary typedefs from sql.hHaru1-0/+1
- Sql -> struct Sql - SqlStmt -> struct SqlStmt - SqlDataType -> enum SqlDataType This is expected to improve compile time, by removing #include cycles (and forward declaring instead) Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Removed several unnecessary explicit casts of the WFIFOP resultHaru1-4/+4
Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Removed several unnecessary RFIFOP typecastsHaru1-7/+6
- While this is arguable, those explicit typecasts are potentially dangerous/misleading (for example, a const specifier might get accidentally dropped without even generating a compiler warning, or a variable type might change during code changes, and any related warning would get silenced by the explicit typecast). - As a reminder Hercules is written in C, and not in C++ (and there's no such thing as "compiling in C++ mode" - they're two different languages.) As such, it is legal to let the compiler automatically promote void* from/to any non-const pointer type, as well as const void* from/to any const pointer type. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Added const qualifier to several variable/argument pointersHaru1-3/+3
- This is necessary for compatibility with a const RFIFOP. Signed-off-by: Haru <haru@dotalux.com>
2015-12-22Ensured 32+1 bytes for all buffers that hold variable namesHaru1-5/+7
Related: #865, #866, #867 Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-0/+1
Improved compatibility, portability and standards conformance. - Since it is not possible to portably and reliably re-use the core's symbols in plugins, symbols are no longer exported unless explicitly required, in the UNIX builds. This mimics the Windows behavior and adds HPM compatibility to OSes such as FreeBSD. Credits to Andrei Karas for making this possible. - For convenience, it is no longer necessary to call GET_SYMBOL, since the plugin will automatically import all the available symbols when it's loaded, depending on the included headers. - Plugins are now supposed to include the "common/hercules.h" header before including anything else. Incluing common/HPMi.h, common/cbasetypes.h or conf/core.h is no longer necessary, as those are guaranteed to be automatically included by hercules.h. - HPM API version bumped to 1.1. Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Cleaned up socket interfaceHaru1-4/+4
- Replaced some macro calls with the proper interface syntax - Removed useless macros and workarounds API changes summary: - WFIFOSET() can now be safely used both inside and outside socket.c - RFIFOSKIP() can now be safely used both inside and outside socket.c - do_close() is now sockt->close() - flush_fifo() is now sockt->flush() - flush_fifos() is now sockt->flush_fifos() - getips() is now sockt->getips() - host2ip() is now sockt->host2ip() - ip2str() is now sockt->ip2str() - ntows() is now sockt->ntows() - make_connection() is now sockt->make_connection() - make_listen_bind() is now sockt->make_listen_bind() - realloc_fifo() is now sockt->realloc_fifo() - realloc_writefifo() is now sockt->realloc_writefifo() - session_isActive() is now sockt->session_is_active() - session_isValid() is now sockt->session_is_valid() - set_defaultparse() is now sockt->set_defaultparse() - set_eof() is now sockt->eof() - set_noblocking() is now sockt->set_noblocking() - str2ip() is now sockt->str2ip() Signed-off-by: Haru <haru@dotalux.com>
2015-07-12Remove useless checks from char server.Andrei Karas1-1/+1
2015-06-19Cleaned up some #includesHaru1-1/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Removed ".." from include directivesHaru1-23/+23
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-06-01Replaced some of the hardcoded values with constants (char)Haru1-2/+2
- Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru <haru@dotalux.com>
2015-04-09Add checks to inter.cAndrei Karas1-1/+23
2015-01-24Fixed 18 minor issuesHaru1-0/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-01-20Minor fixes and tweaks suggested by cppcheckHaru1-3/+2
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
2015-01-1727 Fixesshennetsind1-21/+15
Addressing out of bounds read/write, pointless null checks on already deferenced variables. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2014-12-31fix typo in inter.c in initerface initialisation.Andrei Karas1-1/+1