summaryrefslogtreecommitdiff
path: root/src/net/tmwa/chathandler.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-10-29 16:19:55 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-10-29 17:16:37 +0100
commit6cd8881f1b11c99f8e72735017e743c50094e922 (patch)
tree7f6726d2ed01fe39b78c4e2eb6cc4561c6e0db80 /src/net/tmwa/chathandler.cpp
parent93ad5ec32de124dfa0c054acfd1f2a378cb9ca75 (diff)
downloadmana-6cd8881f1b11c99f8e72735017e743c50094e922.tar.gz
mana-6cd8881f1b11c99f8e72735017e743c50094e922.tar.bz2
mana-6cd8881f1b11c99f8e72735017e743c50094e922.tar.xz
mana-6cd8881f1b11c99f8e72735017e743c50094e922.zip
Turned the PlayerRelation struct into an enum class
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.
Diffstat (limited to 'src/net/tmwa/chathandler.cpp')
-rw-r--r--src/net/tmwa/chathandler.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 883ae083..4f998922 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -129,7 +129,7 @@ void ChatHandler::handleMessage(MessageIn &msg)
chatMsg.find("!sellitem ") == 0)
return;
- if (player_relations.hasPermission(nick, PlayerRelation::WHISPER))
+ if (player_relations.hasPermission(nick, PlayerPermissions::WHISPER))
{
Event event(Event::Whisper);
event.setString("nick", nick);
@@ -176,13 +176,13 @@ void ChatHandler::handleMessage(MessageIn &msg)
if (being->getType() == Being::PLAYER)
{
perms = player_relations.checkPermissionSilently(sender_name,
- PlayerRelation::SPEECH_LOG | PlayerRelation::SPEECH_FLOAT);
+ PlayerPermissions::SPEECH_LOG | PlayerPermissions::SPEECH_FLOAT);
}
else
{
perms = player_relations.getDefault()
- & (PlayerRelation::SPEECH_LOG
- | PlayerRelation::SPEECH_FLOAT);
+ & (PlayerPermissions::SPEECH_LOG
+ | PlayerPermissions::SPEECH_FLOAT);
}
// This is a sure sign of some special command of manaplus,
@@ -232,8 +232,8 @@ void ChatHandler::handleMessage(MessageIn &msg)
event.setString("nick", local_player->getName());
event.setInt("beingId", local_player->getId());
event.setInt("permissions", player_relations.getDefault()
- & (PlayerRelation::SPEECH_LOG
- | PlayerRelation::SPEECH_FLOAT));
+ & (PlayerPermissions::SPEECH_LOG
+ | PlayerPermissions::SPEECH_FLOAT));
event.trigger(Event::ChatChannel);
}
else