summaryrefslogtreecommitdiff
path: root/src/playerrelations.h
AgeCommit message (Collapse)AuthorFilesLines
2025-04-02Use a consistent naming style for enum class valuesThorbjørn Lindeijer1-4/+4
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-01-21Replaced include guards with #pragma onceThorbjørn Lindeijer1-5/+1
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-20Made client config statically typedThorbjørn Lindeijer1-20/+2
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.
2024-10-29Fixed storing of player relationsThorbjørn Lindeijer1-5/+0
There were two issues here. First, the loading of the relations was triggering a storing of the settings before they were loaded. In effect, all the related settings were reset on every startup. And since storing of the relations wasn't enabled by default, they were always cleared. Second problem was in `PlayerConfSerialiser::readConfigItem`, which was never setting any relation because of an inverted condition introduced in 9a702e64449ba54fab28706c5b9c5ff9f2a41f8a.
2024-10-29Turned the PlayerRelation struct into an enum classThorbjørn Lindeijer1-34/+23
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-29Optimise PlayerRelationsManager::clearThorbjørn Lindeijer1-6/+6
Previous implementation was O(n^2), doing lots of work (saving file and updating UI) for each removed player.
2024-10-29Avoid some needless pointer indirectionThorbjørn Lindeijer1-7/+4
* Don't use `PlayerRelation*` in `mRelations`, but just store the value. * Pass `std::vector<PlayerIgnoreStrategy *>` by reference instead of pointer. * Return player list in `PlayerRelationsManager::getPlayers` by value instead of pointer. Overall these changes simplify the code, making it less prone to errors.
2024-03-02General code cleanupsThorbjørn Lindeijer1-3/+3
* Don't needlessly store or return raw pointers in BeingInfo * Less copying, more moving * Less else after return * Make AddDEF a template instead of a macro * Removed some unused includes * Use range-based for loops
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2012-01-09Hopefully fixed the crash related to player relations.Yohann Ferreira1-0/+4
I removed all the misuse of std::map::operator[] I could find, especially there: if (!(*container)[name]) where the [] was creating the entry while checking for its existence. This should avoid the memory corruption problem seen in the Mana-Mantis #400. Patch tested in game by: Ablu. Resolves: Mana Mantis #400 Reviewed-by: Ablu.
2011-10-23Fixed a certain class of Doxygen warningsThorbjørn Lindeijer1-4/+4
All cases of documentation for non-existing parameters are now fixed. Also marked a few getters as 'const', removed some superfluous 'inline' keywords and removed the unused 'forceQuantity' option from ItemContainer. Reviewed-by: Yohann Ferreira
2010-05-17Remove Monster, Player, and NPC classesJared Adams1-2/+1
Instead of having these three subclasses with minor differences, this commit merges them back into Being. In the future, we can make Beings that are talkable to some, attackable by others, etc. This also puts back support for monster equipment. Also changes remaining references to Being::Type and the constants to refer to ActorSprite::Type. Reviewed-by: Freeyorp
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2009-11-03Remove more _SUPPORT ifdefs and do some cleanupJared Adams1-1/+1
2009-04-29Removed underscores from some non-conforming filenamesBjørn Lindeijer1-0/+240
We don't use underscores in the filenames generally, and let's be consistent on that matter.