summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-03 22:05:00 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-03 22:05:00 +0300
commit13b4a16c46983b786d31f6cf67632a3bd4e14b8f (patch)
tree3119ff5b25c671bd78cc1a2bda9997a13bf6b15d
parenta10b859b3874ee4343116ae391f6634da1889be5 (diff)
downloadplus-13b4a16c46983b786d31f6cf67632a3bd4e14b8f.tar.gz
plus-13b4a16c46983b786d31f6cf67632a3bd4e14b8f.tar.bz2
plus-13b4a16c46983b786d31f6cf67632a3bd4e14b8f.tar.xz
plus-13b4a16c46983b786d31f6cf67632a3bd4e14b8f.zip
Impliment manner messages.
-rw-r--r--src/net/eathena/chathandler.cpp34
-rw-r--r--src/resources/notifications.h12
-rw-r--r--src/resources/notifytypes.h3
3 files changed, 44 insertions, 5 deletions
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index d60661b9f..57d57ca6c 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -23,6 +23,7 @@
#include "net/eathena/chathandler.h"
#include "actormanager.h"
+#include "notifymanager.h"
#include "being/localplayer.h"
#include "being/playerrelations.h"
@@ -40,6 +41,7 @@
#include "net/eathena/protocol.h"
#include "resources/chatobject.h"
+#include "resources/notifytypes.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -904,15 +906,37 @@ void ChatHandler::processMVPNoItem(Net::MessageIn &msg)
void ChatHandler::processMannerMessage(Net::MessageIn &msg)
{
- UNIMPLIMENTEDPACKET;
- msg.readInt32("type");
+ const int result = msg.readInt32("type");
+ switch(result)
+ {
+ case 0:
+ NotifyManager::notify(NotifyTypes::MANNER_CHANGED);
+ break;
+ case 5:
+ break;
+ default:
+ UNIMPLIMENTEDPACKET;
+ break;
+ }
}
void ChatHandler::processChatSilence(Net::MessageIn &msg)
{
- UNIMPLIMENTEDPACKET;
- msg.readUInt8("type");
- msg.readString(24, "gm name");
+ const int result = msg.readUInt8("type");
+ const std::string name = msg.readString(24, "gm name");
+
+ switch (result)
+ {
+ case 0:
+ NotifyManager::notify(NotifyTypes::MANNER_POSITIVE_POINTS, name);
+ break;
+ case 1:
+ NotifyManager::notify(NotifyTypes::MANNER_NEGATIVE_POINTS, name);
+ break;
+ default:
+ UNIMPLIMENTEDPACKET;
+ break;
+ }
}
void ChatHandler::processChatTalkieBox(Net::MessageIn &msg)
diff --git a/src/resources/notifications.h b/src/resources/notifications.h
index 78b19b7e9..019879aba 100644
--- a/src/resources/notifications.h
+++ b/src/resources/notifications.h
@@ -499,6 +499,18 @@ namespace NotifyManager
// TRANSLATORS: notification message
N_("Pet feeding error."),
NotifyFlags::EMPTY},
+ {"manner changed",
+ // TRANSLATORS: notification message
+ N_("A manner point has been successfully aligned."),
+ NotifyFlags::EMPTY},
+ {"manner positive points",
+ // TRANSLATORS: notification message
+ N_("You got positive manner points from %s."),
+ NotifyFlags::STRING},
+ {"manner negative points",
+ // TRANSLATORS: notification message
+ N_("You got negative manner points from %s."),
+ NotifyFlags::STRING},
};
} // namespace NotifyManager
#endif // RESOURCES_NOTIFICATIONS_H
diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h
index 017e61a9d..27bad8673 100644
--- a/src/resources/notifytypes.h
+++ b/src/resources/notifytypes.h
@@ -143,6 +143,9 @@ namespace NotifyTypes
SEARCH_STORE_FAILED_NO_INFORMATION,
PET_FEED_OK,
PET_FEED_ERROR,
+ MANNER_CHANGED,
+ MANNER_POSITIVE_POINTS,
+ MANNER_NEGATIVE_POINTS,
TYPE_END
};