Commit graph

4 commits

Author SHA1 Message Date
Eduardo Dantas
37296c49d9
improve: player components to scoped object (#3130)
Refactored Player interfaces to use scoped objects instead of unique_ptr

• Replaced std::unique_ptr with scoped objects for Player interfaces (Wheel, Achievement, Badge, Title, Cyclopedia, VIP, etc.).
• Improved performance by avoiding unnecessary allocations/deallocations (from unique ptr) when players log in and out.
• Simplified code by removing redundant make_unique calls.
• Centralized includes in player.hpp to streamline dependencies.
2025-03-18 09:45:48 -03:00
Eduardo Dantas
8881493284
cleanup: remove unnecessary inheritance from lua interface classes (#3046)
Fixed circular dependencies
Removed various unnecessary inheritance from lua interface
Removed legacy unused codes
2024-11-10 16:12:47 -03:00
Eduardo Dantas
ceace165cf
perf: remove unnecessary event callbacks (#3076)
Removed Lua callbacks from `MonsterType` of various monsters. These
callbacks were empty, which meant the functions were still being
"called" by the monsters without performing any action, creating a
significant performance bottleneck.

Removed the `onHear` event callback, which had a significant impact on
the server and was not used anywhere. It executed the `onHear` callback
for each spectator, causing an unnecessary overload without any real
benefit, especially as we have other methods to check for these events.

Additionally, the `monsterOnSpawn` event callback was removed and
replaced with `MonsterType::onSpawn`, which is much more efficient since
it only needs to be declared in the script for each monster that
actually uses it.

Finally, the way `setRewardBoss` was handled was improved. Previously,
it was executed in an `onSpawn` event callback, but now it is done
directly during the parsing of each monster script, marking them as
reward bosses at the time of script loading, improving efficiency.
2024-11-08 01:44:09 -03:00
Beats
cdd68ad8d2
refactor: remove circular dependencies from header files (#3025)
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
2024-10-30 19:13:33 -03:00