Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
For historical reasons, sprites get a 16 pixel offset by default, which
is used to position them correctly on their tile.
When pixel-based movement was added, actors are now positioned on the
middle of a tile and the built-in offset was removed. Servers that use
sprites that do not rely on this offset can now set the spriteOffsetY
option to 0.
|
|
* 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).
|
|
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)
|
|
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.
|
|
* 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)
|
|
To match mana/manaserv@9c4b8e24487843f0b52108ba99c8c01f03bfae81.
|
|
To match mana/manaserv@9ff69160ea1c3c64ea7012cd70a3b50ff4373264.
|
|
* Moved the memory buffer and mutex handling into the Download class to
simplify the code updating the UI in ServerDialog and UpdaterWindow.
* Replaced the "DownloadUpdate" callback function with simply polling
Download::getState, since in the end polling was happening anyway.
This changes also fixes handling of the Enter key while downloading
updates, which no longer cancels the update process. Also, when pressing
Escape while things are being downloaded, the first press cancels and
only the second press goes back to login.
Introduced a ThreadSafe template class, which wraps any type and makes
it only accessible by calling lock(). This ensures the data is never
accessed without locking the relevant mutex.
|
|
While cleaning up resources on shutdown, the resources they in turn
referenced (like an Image referenced by an ImageSet) ended up in
mOrphanedResources. Since the orphaned resources were only taken into
account once, a lot of remaining orphans never got deleted.
Technically a non-issue because it leaked on shutdown only, but it
resulted in many faulty log entries about resources still being
referenced as well as much noise from memory leak detectors.
|
|
The UI became unresponsive as a result of not actually deleting the
OkDialog. The dialog is now managed by the AwayListener, which now
schedules Away dialog for deletion when necessary, using a DeathListener
to clear the reference to the dialog.
The WindowContainer now uses an std::set instead of std::list to keep
track of widgets scheduled for deletion, to avoid crashing when a widget
is scheduled for deletion multiple times.
|
|
This removes the buffered SDL_RWops functionality that was just added in
51b0c3239265ddee2d1bf445f873299cc8193ab9. We just call PHYSFS_setBuffer
instead.
Using the PhysicsFS buffer is a little bit slower, likely because it
operates at a lower level, but it is fast enough for our purposes.
Uncompressed music files loaded from ZIP files can start playing in
about 1-2 ms.
I've also landed a fix for the problem in SDL_mixer, which works even
better in any case: https://github.com/libsdl-org/SDL_mixer/pull/671
|
|
* DebugWindow and SkillDialog were not deleting their tabs nor their tab
widgets.
* TabbedArea was not deleting its arrow buttons.
* Button was deleting its TextPopup on deletion of the last Button
instance, which was wrong because it was also being deleted by the
WindowContainer. Also removed some misplaced event forwarding to the
TextPopup.
TabbedArea is tricky because it does not automatically delete added tabs
or their widgets. Tab instances are only deleted when they were added by
name.
Issues found by Valgrind memory analyzer.
|
|
* ActorSpriteManager failed to delete its AutoCompleteLister instances.
* CharCreateDialog was relying on ~Window to delete its child widgets,
but it wasn't always adding all its widgets, so some failed to get
deleted. Now it only creates the widgets it needs.
* SkillDialog didn't delete its SkillModels.
* PlayerList didn't delete its player Avatar instances.
* Fixed deletion of the EffectManager.
Leaks located using AddressSanitizer.
|
|
All ResourceManager functions that load resources now return respective
ResourceRef values, which helps to make sure resources are properly
cleaned up.
The Sound class was cleaned up and now also allows SoundEffect resources
to be unloaded.
The Animation class now keeps its ImageSet loaded only as long as
necessary. Previously, SimpleAnimation and ParticleEmitter would keep
the ImageSet loaded indefinitely by never decreasing its reference
count.
Reduced duplicated animation loading code between SimpleAnimation and
ParticleEmitter.
|
|
It triggers the following warning on MinGW:
warning: unknown conversion type character 'z' in format [-Wformat=]
Since we don't expect the number of online players to go beyond
UINT_MAX, we can simply do a cast and use %u instead of %zu.
|
|
It no longer exists among the dependencies.
|
|
The download thread was setting itself to nullptr (d->mThread = nullptr)
in a number of locations. This caused a later call to SDL_WaitThread to
be unable to perform cleanup.
This reverts most of 1eb02f83a5d3895e4e18db30ea10d88da94ba4c0 (including
making Download::cancel no longer blocking), but keeps the necessary
waiting for the thread to finish before freeing the memory buffer in
~UpdaterWindow(), which might have been the bug fixed by that change.
Fixed removal of downloaded .part file when its checksum failed. It
trying to remove the file without .part appended instead.
Fixed download progress indication in ServerDialog to not be reversed,
though this is rarely visible due to the server list being so small.
Fixed reporting of curl error.
|
|
Addendum to !108.
Cherry-picked from M+ commit 78430c4bd86412a4b011632135c4eca71a435a1d.
|
|
Based on the name attributes in the status-effect XML elements.
Also cleanup the code a little. Since the MiniStatusWindow now adjust
its size to respect the status icons, those icons no longer have to be
drawn from the Viewport.
|
|
Use a std::map to ease the lookup of triggered effects.
|
|
The status effect icons are implemented as sprites. Traditionally, since
sprites were rendered on the map, they were by default centered
horizontally on a tile and aligned to the bottom of the tile. The
necessary offsets were part of the animation frames.
This was changed in ae4aea451d6e2c44b273c963026c4fd697568f79 and
0248b2f58c783f21b7e68a20deadc0a3f942c869, which moved this offset to be
applied at a later stage. At that point, client data was changed to
remove this offset from the status effect icons, where it wasn't
meaningful.
Unfortunately, those client data changes were later reverted because the
M+ fork of the client still applies the above offsets to the animation
frames. Hence, to fix the status icon sprite positions, Mana client now
applies the same offsets when rendering the status icons.
Closes https://git.themanaworld.org/mana/mana/-/issues/95
|
|
Normally one was expected to just leave out this property to disable it,
but on TMW some of the particle effects have a value="0" attribute.
|
|
The main feature of the ParticleContainer seemed to be to provide
persistent access to particles, even though they are generally owned by
their parent particle. This allowed particles to be moved along with the
ActorSprite and to be killed explicitly when they were no longer wanted.
The ParticleHandle now takes care of disabling automatic deletion and of
killing the particle along with the handle. It allows the particle
references to be stored in whatever container is suitable, like a vector
for general ActorSprite particle effects, separate vectors for equipment
based particles and finally a map for status effect particles.
Moving the particles along with the ActorSprite does need to happen more
explicitly now, but overall it's a nice cleanup.
|
|
Supporting these fields is necessary to correctly identify status
effects sent by tmwAthena.
This is a manual port of ac4e40a1408ad4d6fbcfce9d2bc6a0bc187ea5a4,
542d2ba78d84e0fa051e0620ccab5fb3a0c711e3 and
8800940bb4b94f6dab7dcf80bf0abc3e3b09e35f from M+.
|
|
Fixed leaking of Sprite instances.
|
|
Cherry-picked from M+ commit 6b92b52308211bc61320e3c8062c59e7b4e81f65.
|
|
With AnimatedSprite being the only implementation of the Sprite
interface, there was no longer a point in separating these.
|
|
The only use of ImageSprite was for FloorItem instances, which now just
draw the item icon in FloorItem::draw.
This leaves only one Sprite subclass, AnimatedSprite, which means we can
remove the entire virtual Sprite interface.
|
|
Also, CompoundSprite itself no longer derives from Sprite.
This simplifies the class hierarchies and avoids the compiler warning
about Being::setDirection shadowing Sprite::setDirection.
|
|
Emotes just need an image to be represented in the UI, so we don't need
to use ImageSprite.
|
|
Since this stuff is only relevant for Being instances and not for
FloorItem instances.
Also removed the virtual getWidth/getHeight from Actor, since they were
not actually used.
|
|
AnimatedSprite works with delta time since 7de0b165f196cb0c1f983b6d2a.
Adjusted some parameter names for clarity.
Closes https://git.themanaworld.org/mana/mana/-/issues/94
|
|
In fact filling the buffer only happens when the buffer was exhausted
or empty, so we always want to fill it entirely and don't need to bother
with moving remaining contents.
This is what happens when you let AI write your code.
|
|
This is a workaround for a performance issue when SDL_mixer is using
stb_vorbis. Since stb_vorbis will request the file one byte at a time,
the overhead of using SDL_RWops to call PHYSFS_readBytes is too high.
Solved by introducing a buffered SDL_RWops wrapper with a fixed 2048
byte buffer. This is a more optimal solution than loading the entire OGG
file in memory. Now starting a new song takes less than 1ms, when the
OGG file isn't compressed (almost down to 0.2ms when SDL_mixer uses
libvorbisfile).
See https://github.com/libsdl-org/SDL_mixer/issues/670
Closes https://git.themanaworld.org/mana/mana/-/issues/93
|
|
* Wrapped remaining PhysFS API calls and set PHYSFS_DEPRECATED to
suppress deprecation warnings for PHYSFS_getUserDir, since no
alternative is available for now.
* Removed support for decompressing .gz files, since it has been unused
for years and doesn't seem useful when updates are anyway served in an
archive.
* Use SDL_LoadFile and SDL_LoadFile_RW convenience functions (raises
minimum SDL version to 2.0.10).
* Removed ResourceManager::copyFile, since it was unused and will likely
stay unused.
* Removed ResourceManager::loadTextFile. Instead, split up the string in
BrowserBox::addRows without making additional copies.
|
|
* Most direct PhysFS calls now contained within a single header file.
* File class that automatically closes.
* Files class allows iterating files with range-based for.
* Use std::optional to force error handling where applicable.
|
|
After failure to connect it would immediately try to connect to the
chosen server, only to fail again. Now it goes back to the server choice
dialog instead.
Closes https://git.themanaworld.org/mana/mana/-/issues/86
|
|
This appears to have been a regression in
f405849b49614254f42eb3ee6147434458978623, which for some reason erased
the port (and any trailing parts) from not just the update directory but
also from the update URL.
Unfortunately we can't access Mana-Mantis #381 at the moment, but
presumably the port was removed due to the colon being a problematic
character. Instead, now the colon (and other special characters) are
replaced by _ when determining the update directory.
Closes https://git.themanaworld.org/mana/mana/-/issues/80
|
|
It was trying to call a virtual method for cleanup with the intention of
doing cleanup in its subclasses, but that doesn't work in a destructor.
Could simplify ActorSprite destructor as a result.
|
|
|
|
The GM command @class (alias @charclass) can be used by GMs to change
their character class (also referred to as job, race, base or species).
Changes of the class are now supported, even supporting switching
between appearing as player, monster or NPC.
Part of https://git.themanaworld.org/mana/mana/-/issues/92
|
|
Specifying an unknown sprite or direction is reported as error and will
not cause any replacements. Specific item replacements are supported
also when not specifying the sprite.
Replacements do not affect particle effects.
Part of https://git.themanaworld.org/mana/mana/-/issues/92
|
|
|
|
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.
|
|
|
|
No need to wait for Apply for this option.
Using `ConfigOptionChanged` event rather than direct call into
`ActorSpriteManager::updatePlayerNames`.
|
|
With the statically typed config we no longer get an event for each
changed config value. Where relevant, this is now done through
`setConfigValue`.
The `Event` now uses a `std::any`, which for `ConfigOptionChanged`
events is set to the changed `Config` member. This allows for a
type-safe check on which config value was changed.
|
|
This makes accessing the config values much faster, since it no longer
needs to do a lookup nor string conversion, which means we could remove
some needless copying of the values.
Overall it makes it easier to find out where settings are used and it
puts the defaults along with the declaration.
Options with default values are no longer saved to the config file. This
does not include unrecognized options, which are kept around to provide
some compatibility with older clients.
While most basic options have kept the same name, more complicated
settings like window geometry, shortcuts, outfits, etc. now have their
own XML elements. Older clients will ignore these and erase them when
saving the configuration.
|
|
|