From ab545fee3daf930dc46aaf303355c1c578320484 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Oct 2011 01:41:54 +0300 Subject: Add blacklist relation. In this mode blocked trades, emotes, speech text. --- src/playerrelations.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/playerrelations.cpp') diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp index 00a9d1cad..d7532b884 100644 --- a/src/playerrelations.cpp +++ b/src/playerrelations.cpp @@ -103,11 +103,12 @@ class PlayerConfSerialiser : static PlayerConfSerialiser player_conf_serialiser; // stateless singleton const unsigned int PlayerRelation::RELATION_PERMISSIONS[RELATIONS_NR] = { - /* NEUTRAL */ 0, // we always fall back to the defaults anyway - /* FRIEND */ EMOTE | SPEECH_FLOAT | SPEECH_LOG | WHISPER | TRADE, - /* DISREGARDED*/ EMOTE | SPEECH_FLOAT, - /* IGNORED */ 0, - /* ERASED */ INVISIBLE + /* NEUTRAL */ 0, // we always fall back to the defaults anyway + /* FRIEND */ EMOTE | SPEECH_FLOAT | SPEECH_LOG | WHISPER | TRADE, + /* DISREGARDED*/ EMOTE | SPEECH_FLOAT, + /* IGNORED */ 0, + /* ERASED */ INVISIBLE, + /* BLACKLISTED */ SPEECH_LOG | WHISPER }; PlayerRelation::PlayerRelation(Relation relation) @@ -278,6 +279,7 @@ unsigned int PlayerRelationsManager::checkPermissionSilently( case PlayerRelation::DISREGARDED: case PlayerRelation::IGNORED: case PlayerRelation::ERASED: + case PlayerRelation::BLACKLISTED: default: permissions &= mDefaultPermissions; // narrow } @@ -395,13 +397,14 @@ void PlayerRelationsManager::ignoreTrade(std::string name) if (relation == PlayerRelation::IGNORED || relation == PlayerRelation::DISREGARDED + || relation == PlayerRelation::BLACKLISTED || relation == PlayerRelation::ERASED) { return; } else { - player_relations.setRelation(name, PlayerRelation::DISREGARDED); + player_relations.setRelation(name, PlayerRelation::BLACKLISTED); } } -- cgit v1.2.3-60-g2f50