#include <player_relations.h>
Definition at line 93 of file player_relations.h.
Public Member Functions | |
PlayerRelationsManager () | |
~PlayerRelationsManager () | |
void | init () |
Initialise player relations manager (load config file etc. | |
void | load () |
Load configuration from our config file, or substitute defaults. | |
void | store () |
Save configuration to our config file. | |
unsigned int | checkPermissionSilently (const std::string &player_name, unsigned int flags) |
Determines whether the player in question is being ignored, filtered by the specified flags. | |
bool | hasPermission (Being *being, unsigned int flags) |
Tests whether the player in question is being ignored for any of the actions in the specified flags. | |
bool | hasPermission (const std::string &being, unsigned int flags) |
void | setRelation (const std::string &name, PlayerRelation::Relation relation) |
Updates the relationship with this player. | |
PlayerRelation::Relation | getRelation (const std::string &name) |
Updates the relationship with this player. | |
void | removePlayer (const std::string &name) |
Deletes the information recorded for a player. | |
unsigned int | getDefault () const |
Retrieves the default permissions. | |
void | setDefault (unsigned int permissions) |
Sets the default permissions. | |
std::vector < PlayerIgnoreStrategy * > * | getPlayerIgnoreStrategies () |
Retrieves all known player ignore strategies. | |
PlayerIgnoreStrategy * | getPlayerIgnoreStrategy () const |
Return the current player ignore strategy. | |
void | setPlayerIgnoreStrategy (PlayerIgnoreStrategy *strategy) |
Sets the strategy to call when ignoring players. | |
int | getPlayerIgnoreStrategyIndex (const std::string &shortname) |
For a given ignore strategy short name, find the appropriate index in the ignore strategies vector. | |
std::vector< std::string > * | getPlayers () |
Retrieves a sorted vector of all players for which we have any relations recorded. | |
void | clear () |
Removes all recorded player info. | |
bool | getPersistIgnores () const |
Do we persist our `ignore' setup? | |
void | setPersistIgnores (bool value) |
Change the `ignore persist' flag. | |
void | addListener (PlayerRelationsListener *listener) |
void | removeListener (PlayerRelationsListener *listener) |
Private Member Functions | |
void | signalUpdate (const std::string &name) |
Private Attributes | |
bool | mPersistIgnores |
unsigned int | mDefaultPermissions |
PlayerIgnoreStrategy * | mIgnoreStrategy |
std::map< std::string, PlayerRelation * > | mRelations |
std::list < PlayerRelationsListener * > | mListeners |
std::vector < PlayerIgnoreStrategy * > | mIgnoreStrategies |
PlayerRelationsManager::PlayerRelationsManager | ( | ) |
Definition at line 89 of file player_relations.cpp.
PlayerRelationsManager::~PlayerRelationsManager | ( | ) |
Definition at line 96 of file player_relations.cpp.
void PlayerRelationsManager::init | ( | ) |
Initialise player relations manager (load config file etc.
)
Definition at line 141 of file player_relations.cpp.
void PlayerRelationsManager::load | ( | ) |
Load configuration from our config file, or substitute defaults.
Definition at line 124 of file player_relations.cpp.
void PlayerRelationsManager::store | ( | ) |
unsigned int PlayerRelationsManager::checkPermissionSilently | ( | const std::string & | player_name, | |
unsigned int | flags | |||
) |
Determines whether the player in question is being ignored, filtered by the specified flags.
Definition at line 174 of file player_relations.cpp.
bool PlayerRelationsManager::hasPermission | ( | Being * | being, | |
unsigned int | flags | |||
) |
Tests whether the player in question is being ignored for any of the actions in the specified flags.
If so, trigger appropriate side effects if requested by the player.
Definition at line 199 of file player_relations.cpp.
bool PlayerRelationsManager::hasPermission | ( | const std::string & | being, | |
unsigned int | flags | |||
) |
Definition at line 206 of file player_relations.cpp.
void PlayerRelationsManager::setRelation | ( | const std::string & | name, | |
PlayerRelation::Relation | relation | |||
) |
PlayerRelation::Relation PlayerRelationsManager::getRelation | ( | const std::string & | name | ) |
void PlayerRelationsManager::removePlayer | ( | const std::string & | name | ) |
unsigned int PlayerRelationsManager::getDefault | ( | ) | const |
void PlayerRelationsManager::setDefault | ( | unsigned int | permissions | ) |
std::vector< PlayerIgnoreStrategy * > * PlayerRelationsManager::getPlayerIgnoreStrategies | ( | ) |
Retrieves all known player ignore strategies.
The player ignore strategies are allocated statically and must not be deleted.
Definition at line 356 of file player_relations.cpp.
PlayerIgnoreStrategy* PlayerRelationsManager::getPlayerIgnoreStrategy | ( | ) | const [inline] |
Return the current player ignore strategy.
Definition at line 169 of file player_relations.h.
void PlayerRelationsManager::setPlayerIgnoreStrategy | ( | PlayerIgnoreStrategy * | strategy | ) | [inline] |
int PlayerRelationsManager::getPlayerIgnoreStrategyIndex | ( | const std::string & | shortname | ) |
For a given ignore strategy short name, find the appropriate index in the ignore strategies vector.
The | short name of the ignore strategy to look up |
Definition at line 114 of file player_relations.cpp.
std::vector< std::string > * PlayerRelationsManager::getPlayers | ( | ) |
Retrieves a sorted vector of all players for which we have any relations recorded.
Definition at line 237 of file player_relations.cpp.
void PlayerRelationsManager::clear | ( | ) |
bool PlayerRelationsManager::getPersistIgnores | ( | ) | const [inline] |
void PlayerRelationsManager::setPersistIgnores | ( | bool | value | ) | [inline] |
Change the `ignore persist' flag.
value | Whether to persist ignores |
Definition at line 212 of file player_relations.h.
void PlayerRelationsManager::addListener | ( | PlayerRelationsListener * | listener | ) | [inline] |
Definition at line 214 of file player_relations.h.
void PlayerRelationsManager::removeListener | ( | PlayerRelationsListener * | listener | ) | [inline] |
Definition at line 219 of file player_relations.h.
void PlayerRelationsManager::signalUpdate | ( | const std::string & | name | ) | [private] |
Definition at line 166 of file player_relations.cpp.
bool PlayerRelationsManager::mPersistIgnores [private] |
Definition at line 227 of file player_relations.h.
unsigned int PlayerRelationsManager::mDefaultPermissions [private] |
Definition at line 228 of file player_relations.h.
Definition at line 230 of file player_relations.h.
std::map<std::string, PlayerRelation *> PlayerRelationsManager::mRelations [private] |
Definition at line 231 of file player_relations.h.
std::list<PlayerRelationsListener *> PlayerRelationsManager::mListeners [private] |
Definition at line 232 of file player_relations.h.
std::vector<PlayerIgnoreStrategy *> PlayerRelationsManager::mIgnoreStrategies [private] |
Definition at line 233 of file player_relations.h.