summaryrefslogtreecommitdiff
path: root/src/net
AgeCommit message (Collapse)AuthorFilesLines
2024-06-03Added handling of SMSG_SCRIPT_MESSAGEThorbjørn Lindeijer1-0/+13
These are server chat messages triggered from scripts. In TMW this appears to be used only by the magic system. Added in client protocol version 5 (see issue #71).
2024-04-18Simplify TmwAthena::MessageOutThorbjørn Lindeijer5-84/+27
Since for tmwAthena we're writing messages directly into the output buffer, the MessageOut implementation does not need any members. Also used SDL_SwapLE16 and SDL_SwapLE32 for convenience.
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-13Adjusted handling of SMSG_LOGIN_DATA to what tmwa sendsThorbjørn Lindeijer1-3/+4
2024-03-12General code cleanupsThorbjørn Lindeijer4-13/+1
* Use default member initializers * Use range-based for loops * Avoid needless pointer references for ShopItem::mDuplicates * Removed type aliases that are only used once or twice * Removed more unused includes * Removed some unused functions * Removed superfluous .c_str() * Rely on default copy and assignment operators for Vector class * Use std::unique_ptr in some places * Removed duplicated mPlayerMoney updating in SellDialog * Removed duplicated Game::handleInput call * Removed unused SDLInput::mMouseInWindow * Removed remnant of manual widget positioning in HelpWindow * Removed superfluous initialization of static pointers
2024-03-06General code cleanupsThorbjørn Lindeijer41-88/+58
* 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 Lindeijer11-45/+85
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-04Added support for handling SMSG_NPC_COMMANDThorbjørn Lindeijer2-26/+82
This only adds support for the NPC_CLOSE_DIALOG and NPC_CLEAR_DIALOG sub-commands. Closes #47
2024-03-04Fixed duplication of player name in chatThorbjørn Lindeijer3-15/+39
* Fixed duplication of player name in chat Closes #49
2024-03-02Changed server type to "enum class"Thorbjørn Lindeijer3-34/+35
2024-03-02Added support for -y / --server-type parameterThorbjørn Lindeijer4-11/+21
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-29Re-download updates when their checksum no longer matchesThorbjørn Lindeijer2-29/+27
The Mana World currently likes to just update its "TMW.zip" file, whereas updates were always given unique names in the past. With this change, the client checks the Adler32 checksum to know when it should re-download an update file. This matches the behavior of ManaPlus commit 96150f1aeacf55d311c41ffe12d9e754b1cda001.
2024-02-22General code cleanupsThorbjørn Lindeijer19-69/+30
* 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-15Fix handling of non-consecutive emote IDsThorbjørn Lindeijer2-2/+2
Previous code was assuming there would be no gaps in the emote IDs. Also cleaned up some confusion where the "emote ID" being passed around in the code was often offset by 1. Now it is only offset in communication with tmwAthena and when saving the shortcuts.
2024-02-14Avoid crash when receiving SMSG_MAP_MASK without Game instanceThorbjørn Lindeijer1-2/+3
It happened to me a few times. Needs checking whether we could instead make sure we always have a Game instance when receiving this message, because this way a map mask might get ignored. Or maybe the map mask just needs to be stored elsewhere.
2024-02-13Updated tmwAthena network protocolThorbjørn Lindeijer20-492/+465
* 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 guild handling remnants for tmwAthenaThorbjørn Lindeijer1-373/+1
This stuff was removed from tmwAthena, so it will never be supported.
2024-02-13Removed no longer supported admin messagesThorbjørn Lindeijer5-130/+2
* 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 Lindeijer7-33/+17
* 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 Lindeijer4-36/+16
This patch is not exhaustive.
2024-02-02Fixed use of deprecated CURLOPT_PROGRESSFUNCTION optionThorbjørn Lindeijer2-10/+13
Closes #51
2024-01-29Fixed logic error in ManaServ::BeingHandlerThorbjørn Lindeijer1-5/+6
2024-01-29Removed unused includes in various filesThorbjørn Lindeijer4-11/+2
2024-01-29Apply C++11 fixitsThorbjørn Lindeijer4-26/+22
modernize-loop-convert modernize-deprecated-headers
2024-01-28Added support for map/layer maskThorbjørn Lindeijer4-3/+19
A custom "Mask" property on a layer or a "foregroundXmask" property on a map can now be used in combination with the SMSG_MAP_MASK to dynamically disable certain map layers from the server. Feature previously seen on ManaPlus and implemented for Mana client for compatibility. Also added a ResourceRef class for automating the Resource reference counting. Closes #44
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer73-497/+495
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2024-01-26Added support for the "persistentIp" server info settingThorbjørn Lindeijer5-36/+27
This option was added in ManaPlus and support for it is required to connect to The Mana World as it is currently set up, since the server sends 127.0.0.1 for the character server and map server IP. Can't play yet, because of an unknown packet 0x226 being received once connecting to the map server.
2024-01-25Ported to SDL2Thorbjørn Lindeijer2-2/+2
2024-01-24Increased client version to 20Thorbjørn Lindeijer1-1/+1
It is unclear whether there are any protocol differences that should be dealt with at this point, but without this the login fails with "Client too old." error.
2024-01-24Add error for non tradable items.Andrei Karas1-0/+5
2024-01-24Fixed compilation issues and use of deprecated C++ featuresThorbjørn Lindeijer2-2/+2
* 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-09-08Fixing packet length of CMSG_NPC_STR_RESPONSEStefan Dombrowski1-1/+1
The CMSG_NPC_STR_RESPONSE packet transmits a string of variable length.
2013-06-08Fixed MessageIn::getUnreadLengthThorbjørn Lindeijer2-2/+8
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 Grzywacz2-23/+1
2013-05-02Fixed network layer doing delayed actor deletionThorbjørn Lindeijer4-4/+4
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-27Added support for charcreation.xml settingsThorbjørn Lindeijer2-13/+26
This file was introduced by ManaPlus as a way of configuring the character creation process. It defines the number of hair styles and colors, how stat points should be divided and what the starting equipment of the player is. The minimum and maximum hair color/style IDs are not supported at the moment. This is mostly a backport of ManaPlus commits 10cf52b5 and dcc18eba, with some style changes. Mantis-issue: 501 Reviewed-by: Ablu
2013-04-27Always read the attributes.xml fileThorbjørn Lindeijer7-489/+29
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-12-05Ignore unsupported messages in public chatAndrei Karas1-0/+5
Reviewed-by: Erik Schilling.
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-05Merge branch '0.6'Thorbjørn Lindeijer1-0/+1
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 Lindeijer81-654/+612
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-05-05Fixed compilation errors and warnings with GCC 4.7Thorbjørn Lindeijer1-0/+1
Also, since GCC 4.7 there is a binary compatibility issue when linking with a Guichan that was not compiled in C++11 mode. This commit also allows compiling with GCC 4.7 with C++11 mode turned off. Reviewed-by: Erik Schilling
2012-04-19Client side fix for manaserv guild systemErik Schilling2-6/+36
- kick code untested because no kick button exists yet Reviewed-by: bjorn.