summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bindings/PluginManager.cpp')
-rw-r--r--src/Bindings/PluginManager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index 19d2e8b4d..fc37c2e2d 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -1188,14 +1188,20 @@ bool cPluginManager::CallHookPlayerUsingItem(cPlayer & a_Player, int a_BlockX, i
-bool cPluginManager::CallHookPluginMessage(cClientHandle & a_Client, const AString & a_Channel, const AString & a_Message)
+bool cPluginManager::CallHookPluginMessage(cClientHandle & a_Client, const AString & a_Channel, cByteBuffer & a_Buffer)
{
FIND_HOOK(HOOK_PLUGIN_MESSAGE);
VERIFY_HOOK;
+ a_Buffer.CommitRead();
+ AString Data;
+ a_Buffer.ReadAll(Data);
+ cByteBuffer Temp(Data.size());
+
for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
{
- if ((*itr)->OnPluginMessage(a_Client, a_Channel, a_Message))
+ Temp.WriteBuf(Data.c_str(), Data.size());
+ if ((*itr)->OnPluginMessage(a_Client, a_Channel, Temp))
{
return true;
}