summaryrefslogtreecommitdiff
path: root/src/net/manaserv
AgeCommit message (Collapse)AuthorFilesLines
13 daysUse a consistent naming style for enum class valuesThorbjørn Lindeijer2-6/+6
Sometimes I've used CamelCase and sometimes SNAKE_CASE for these values. Since "enum class" values are always prefixed with the enum name, which uses CamelCase, I find it more fitting to use it for the values as well. Also fixes compilation on Windows where 'ERROR' was conflicting with a define.
2025-03-13Removed needless case-insensitive string comparisonsThorbjørn Lindeijer1-0/+1
These are not necessary since we can instead make sure the referenced values match case, like we do for everything else. This affects server types in the server list and colors referenced in theme files. The server version was also compared case-insensitively for some reason.
2025-03-07Removed the functionality to split item stacksThorbjørn Lindeijer3-9/+0
No longer supported by manaserv and not supported by tmwAthena.
2025-03-07General code cleanupsThorbjørn Lindeijer2-6/+0
2025-03-07Fixed GeneralHandler deletion when switching server typesThorbjørn Lindeijer4-24/+18
When switching between tmwAthena and Manaserv the GeneralHandler was not getting deleted, resulting in crashes later on when the still around instance (or one of its child handlers) would try to respond to events it was listening to.
2025-03-07Fixed handling of equipmentThorbjørn Lindeijer3-18/+34
* Fixed ManaServ::EquipBackend removing all slots in response to GPMSG_INVENTORY_FULL, rather than resetting them to empty. * Fixed updating of buttons in InventoryWindow as relevant from the ManaServ::InventoryHandler. * Updated handling of equipment sprites in messages related to character appearance (Manaserv now always sends all relevant equipment and as such does not send removals).
2025-03-07Support triggering attacks and play use ability animationsThorbjørn Lindeijer2-10/+38
For now, PlayerHandler::attack just tries to trigger the "Strike" ability. Adjusted the AbilityDB to the removal of ability categories and the addition of the useaction attribute (mana/manaserv@81f126ae001b1446dc0be37341f133dca5ab2923)
2025-03-07Updated manaserv protocol to version 9Thorbjørn Lindeijer14-401/+362
This extends the messages regarding abilities, replacing the specific "attack" messages. It also unifies attribute handling, with a generic system replacing specific variables for attributes like level, xp and skills. The inventory and equipment handling was adjusted such that equipped items stay in the inventory. Support for quest states was added. Added: * GPMSG_ABILITY_REMOVED (mana/manaserv@e3fcc1a47db312933a0f5b7e725c5779a1a45722) * GPMSG_ABILITY_COOLDOWN (mana/manaserv@c2f00b2f3ba920cb25333d19a1d37d251342caf8) * GPMSG_BEING_ABILITY_POINT * GPMSG_BEING_ABILITY_BEING (mana/manaserv@2f2393b6d190deb8958fcb806b58418508d25e28) * GPMSG_ATTRIBUTE_POINTS_STATUS (mana/manaserv@1e5a15c0a5e24fb4b358fff75a7082d65496e1f9) * PGMSG_USE_ABILITY_ON_DIRECTION (mana/manaserv@05fc955a3f8a03539088fa7569395434e29d90e8) * GPMSG_BEING_ABILITY_DIRECTION (mana/manaserv@54389afd7ba9fecf0761333185145e968e2453ae) * GPMSG_QUESTLOG_STATUS (mana/manaserv@66a98a3a0df795761328d62ef2ad07f81e383f9e) Removed: * PGMSG_ATTACK * GPMSG_BEING_ATTACK (mana/manaserv@f31277b327df701361391b1d4b8bd6f89f4e3109) * GPMSG_PLAYER_EXP_CHANGE * GPMSG_LEVELUP * GPMSG_LEVEL_PROGRESS (mana/manaserv@44ee071d7ece5a2023f79307f36e8a244c9e7b3a) Changed: * GPMSG_ABILITY_STATUS (mana/manaserv@ba573fcc38580a01985172b9bc864c97ce855af3) * GPMSG_BEING_LOOKS_CHANGE (mana/manaserv@8ddda85d923a528c7497a628d2fe10fc40b80a1f) * APMSG_CHAR_INFO (mana/manaserv@4f5053f463fd8da0de1615ca6b0f212f02f3d653) * APMSG_CHAR_CREATE_RESPONSE (mana/manaserv@1263c729d85df649c7ab59726bddad7c8cd7ae81) * GPMSG_NPC_BUYSELL_RESPONSE (mana/manaserv@336ce321a9b996e56a61a5364bb32124efa84dd9) Equipment changes (mana/manaserv@f712d68495dd8e040c32da3b1c85bcb7845543ec): * Changed GPMSG_INVENTORY_FULL, GPMSG_EQUIP * Removed PGMSG_MOVE_ITEM * Added GPMSG_EQUIP_RESPONSE, GPMSG_UNEQUIP_RESPONSE, GPMSG_UNEQUIP While this change deals with some of the protocol changes, there's still many changes required in the UI regarding using of abilities (including attacking), showing of certain attributes and quest log.
2025-03-07Ability related network message adjustmentsThorbjørn Lindeijer2-2/+9
* Handle GPMSG_ABILITY_REMOVED for removal of abilities (mana/manaserv@e3fcc1a47db312933a0f5b7e725c5779a1a45722) * Adjust GPMSG_ABILITY_STATUS now that it only sends abilities that have changed state, so it should no longer clear all abilities. (mana/manaserv@3598685c0fcbb9b5fdbcdbbaee258e2b55d5c98a)
2025-03-07Renamed specials to abilitiesThorbjørn Lindeijer6-27/+27
To match mana/manaserv@9ff69160ea1c3c64ea7012cd70a3b50ff4373264.
2025-01-21Replaced include guards with #pragma onceThorbjørn Lindeijer25-100/+25
Thanks to https://github.com/cgmb/guardonce and a follow-up replace to remove duplicated newlines at end of file: find src -type f -name '*.h' -exec \ sed --in-place -e :a -e '/^\n*$/{$d;N;};/\n$/ba' {} \; Source: https://unix.stackexchange.com/questions/81685/how-to-remove-multiple-newlines-at-eof Fixes compile on macOS, which appears to have been due to the EVENT_H include guard.
2025-01-20Wrapped xmlNodePtr access with a Node classThorbjørn Lindeijer2-17/+17
Slightly more ergonomic and this eliminates direct libxml2 usage from many places.
2024-10-29Turned the PlayerRelation struct into an enum classThorbjørn Lindeijer1-1/+1
Less code to achieve the same thing (strong type and namespaced values). The permissions related values have been moved to a PlayerPermissions struct, which is also a bit less confusing.
2024-10-23Changed SERVER_NOTICE macro to inline functionThorbjørn Lindeijer4-41/+37
Seems to be no point in using a macro here.
2024-10-23Various small fixes to translatable stringsThorbjørn Lindeijer2-6/+9
Mostly adjustments based on feedback from the Finnish translator.
2024-10-08Do a single logic update each frameThorbjørn Lindeijer2-11/+7
The logic update now uses Time::deltaTimeMs() where needed to make it framerate-independent. This means there will no longer be multiple logic calls per frame (as was usually the case with logic ticking at 100 fps whereas the game would generally run at 60 fps). At the same time, the game can be more precise at higher framerates and should now run smoother at 144 Hz, for example. Previously the game would sometimes skip logic ticks at that rate. This change affects: * Updating of animations * Being movement speed * More moving of manual time variables to Timer Notoriously, the particle system still does 100 ticks/second.
2024-09-27Replaced for_each_xml_child_node macro with helper classThorbjørn Lindeijer1-2/+2
The new XML::Children class enables using a C++11 range-based for loop to iterate over the children of an xmlNodePtr.
2024-08-25Fixed initialization of equipment backendThorbjørn Lindeijer2-17/+11
For new characters (and in general, when logging in with a character that had nothing equipped), the equipment backend wasn't being initialized. This resulted in the equipment not being visible in the Equipment window. Fixes #83
2024-08-04Removed a bunch of unused NPC related eventsThorbjørn Lindeijer1-33/+0
Nobody cared for the events that were emitted when NPC related network messages had been sent.
2024-06-25Added online player list to Social windowDavid Athay1-0/+2
The online list refreshes every 18 seconds, which matches ManaVerse behavior. It's not ideal, but to improve this would mean diving into TMWA. The client version was bumped to 8 to get a SMSG_ONLINE_LIST reply. Further changes needed related to the client version are tracked by #71. This also changes the TabbedArea to take into account the frame size for its tab widgets, to make sure those frames are not clipped by the TabbedArea widget (as happened in the Social window). The horizontal scroll bar is now disabled in all social tabs, with the vertical one appearing only when necessary. Closes #61
2024-04-02General code cleanupsThorbjørn Lindeijer1-4/+2
* Removed some unused includes * Removed unused ListBox::mFont * Removed wrong cast to SDL_Scancode * Removed superfluous .c_str() * Removed superfluous explicit std::string construction * Removed unused variable * Use more emplace_back * Turned FindBeingFunctor into a lambda * Avoid needless pointer references for ambient layers and use a vector
2024-03-06General code cleanupsThorbjørn Lindeijer20-37/+22
* Use final for all message handlers, Client, LocalPlayer, Being::getType, Being::setPosition and Being::setMap. (avoids some warnings about virtual dispatch in constructors) * Use auto in more places * Use emplace_back instead of push_back in some places * Use default member initializers * Less else after return * Removed superfluous .c_str() * Removed type aliases that are only used once * Removed more unused includes
2024-03-04Fixed character displayThorbjørn Lindeijer2-7/+7
This change fixes hair style to take into account "race", which makes the faces visible again. Hair colors should also be fixed now, with partial support for itemcolors.xml added. The Mana client now also supports per-character gender, and it now hides the hair style and color buttons on character creation, when there are none to choose from. Closes #43
2024-03-02Added support for -y / --server-type parameterThorbjørn Lindeijer2-4/+2
Usually this would be guessed correctly by the port, but now it is also possible to just specify the server type and the port will be derived from there, unless a default port is given in the branding file. Closes #56
2024-02-22General code cleanupsThorbjørn Lindeijer7-21/+11
* Use default member initializers * Use range-based loops * Don't use 'else' after 'return' * Removed some unused includes * Construct empty strings with std::string() instead of "" * Clear strings with .clear() instead of assigning "" * Check whether strings are empty with .empty() instead of comparing to "" * Removed redundant initializations
2024-02-13Updated tmwAthena network protocolThorbjørn Lindeijer3-8/+2
* The code defining the message IDs and sizes are now generated by the tools/protocol.py script in the tmwAthena repository. * Reduced client version from 20 to 6, because that is currently the minimum supported version, and any adjustments needed for later likely still need to be made. * Removed use of no longer handled messages: - CMSG_SKILL_USE_BEING - CMSG_SKILL_USE_POSITION - CMSG_SKILL_USE_MAP - SMSG_PARTY_MOVE - CMSG_WHO_REQUEST - SMSG_WHO_ANSWER - SMSG_MVP - SMSG_BEING_MOVE2 - SMSG_BEING_CHANGE_LOOKS * Some messages were renamed to match the server side - CMSG_PLAYER_ATTACK -> CMSG_PLAYER_CHANGE_ACT - CMSG_PLAYER_RESTART -> CMSG_PLAYER_REBOOT - SMSG_ADMIN_IP -> SMSG_BEING_IP_RESPONSE Part of addressing issues #55 and #47, which we now know are about handling SMSG_PLAYER_HP and SMSG_NPC_COMMAND respectively. The client will now ignore them (with a warning) instead of crash.
2024-02-13Removed no longer supported admin messagesThorbjørn Lindeijer2-49/+0
* Removed /announce command * Changed "Kick player" in player pop-up to kick by name Other messages, like CMSG_ADMIN_HIDE, CMSG_ADMIN_MUTE and CMSG_ADMIN_LOCAL_ANNOUNCE were already not used by the client. Also, none of this was implemented for Manaserv.
2024-02-13General code cleanupsThorbjørn Lindeijer1-3/+1
* Removing unused includes * Use member initialization * Use range-based for loops * Use nullptr * Removed no longer used aliases * Use override * Don't use else after return * Use '= delete' to remove implicit members * Use std::string::empty instead of comparing to ""
2024-02-09C++11: Use default member initializersThorbjørn Lindeijer3-20/+10
This patch is not exhaustive.
2024-01-29Fixed logic error in ManaServ::BeingHandlerThorbjørn Lindeijer1-5/+6
2024-01-29Removed unused includes in various filesThorbjørn Lindeijer2-7/+2
2024-01-29Apply C++11 fixitsThorbjørn Lindeijer2-17/+13
modernize-loop-convert modernize-deprecated-headers
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer32-222/+222
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2024-01-24Fixed compilation issues and use of deprecated C++ featuresThorbjørn Lindeijer1-1/+1
* Fixed compiler errors due to dynamic exception specifications * Replace std::auto_ptr with std::unique_ptr * Replace std::mem_fun with std::mem_fn * Prefix for_each with std:: (apparently not needed before) * Just use lambda instead of std::bind2nd * Removed usages of std::unary_function
2013-06-08Fixed MessageIn::getUnreadLengthThorbjørn Lindeijer1-1/+4
It should not return large numbers after reading past the end of a message. This can cause infinite loops in several places in the client when a message happened to be shorter than expected.
2013-05-04Client-side settings are now available from settings.xmlPrzemysław Grzywacz1-10/+0
2013-05-02Fixed network layer doing delayed actor deletionThorbjørn Lindeijer2-2/+2
The delayed actor deletion was meant to be used during the logic calls, to avoid modifying the container while it is being iterated. The deletions happening from the network layer are not done while iterating the set of actors, so it can delete immediately. This fixes an issue where an NPC would disappear when changing appearance on tmwAthena, because this was implemented as a remove + add, which broke due to the delayed deletion. Mantis-issue: 507 Reviewed-by: Jared Adams
2013-04-30Bumped protocol version to 3Thorbjørn Lindeijer1-1/+1
This is so that master and lpc2012 use the same protocol again, where starting attributes are sent on character creation.
2013-04-27Always read the attributes.xml fileThorbjørn Lindeijer5-485/+8
This way it can also be used when connecting to a tmwAthena server for customizing the min/max of attributes and the amount of starting points. Mantis-issue: 501 Reviewed-by: Ablu
2012-10-11Client side patch for change of sending order of genderErik Schilling2-8/+13
Reviewed-by: Stefan Beller.
2012-10-11Give feedback when guild invite failedErik Schilling1-0/+4
Server was already sending a error message. But the client ignored it. Reviewed-by: Stefan Beller.
2012-08-12Fixed special keeping in list after serverside removeErik Schilling1-0/+1
Reviewed-by: Thorbjørn Lindeijer.
2012-07-25Added handler to display text particles sent by serverErik Schilling3-0/+14
Change is tested. Reviewed-by: bjorn.
2012-05-25Fixed skill display for manaservErik Schilling2-1/+3
- shows manaserv skills at all - shows the progress bar for manaserv skills again - shows the level for this skills (server side patch needed) TODO: URGENT: Fix attributes and skills getting stored in same list. Reviewed-by: Bertram.
2012-05-06Small protocol fix for NPC messagesThorbjørn Lindeijer1-1/+1
They are no longer sent as fixed-length string since this doesn't work when the new protocol debugging mode is used. Reviewed-by: Ben Longbons
2012-05-05Added debugging mode to the protocolThorbjørn Lindeijer5-21/+119
This makes the client able to send and receive messages sent in debugging mode, where the contents of the messages are annotated. For messages sent from the client the debugging mode is currently always enabled. Later on this could be an internal option or controlled from the server side. Reviewed-by: Erik Schilling
2012-05-05Removed the shared base classes of MessageIn and MessageOutThorbjørn Lindeijer38-114/+272
There wasn't a whole lot gained by sharing a common base class, and it makes extending the manaserv Message{In,Out} classes with a debugging mode unnecessarily complicated. Reviewed-by: Yohann Ferreira
2012-04-19Client side fix for manaserv guild systemErik Schilling2-6/+36
- kick code untested because no kick button exists yet Reviewed-by: bjorn.
2012-04-04Synced specials to latest manaserv changesErik Schilling2-4/+13
Reviewed-by: bjorn.
2012-04-01Made changes to compile on Mac OSX 10.6 and laterDavid Athay1-0/+1
Also added Xcode project for others to compile for Mac OSX. Reviewed-by: Thorbjørn Lindeijer