summaryrefslogtreecommitdiff
path: root/src/playerrelations.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-10-05 01:41:54 +0300
committerAndrei Karas <akaras@inbox.ru>2011-10-05 01:41:54 +0300
commitab545fee3daf930dc46aaf303355c1c578320484 (patch)
tree24c8286acb9fea22b1e689810be5534de2323623 /src/playerrelations.cpp
parent851bee28374c5c60114c9f78299e28eaa14891b3 (diff)
downloadManaVerse-ab545fee3daf930dc46aaf303355c1c578320484.tar.gz
ManaVerse-ab545fee3daf930dc46aaf303355c1c578320484.tar.bz2
ManaVerse-ab545fee3daf930dc46aaf303355c1c578320484.tar.xz
ManaVerse-ab545fee3daf930dc46aaf303355c1c578320484.zip
Add blacklist relation. In this mode blocked trades, emotes, speech text.
Diffstat (limited to 'src/playerrelations.cpp')
-rw-r--r--src/playerrelations.cpp15
1 files changed, 9 insertions, 6 deletions
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);
}
}