- Changes to make the live version work with the BfA Beta.

This commit is contained in:
Tercio
2018-05-03 14:51:47 -03:00
parent febf9dd34f
commit 117913ab8d
24 changed files with 501 additions and 116 deletions
+17 -7
View File
@@ -23,7 +23,7 @@
-- LICENSE: ChatThrottleLib is released into the Public Domain
--
local CTL_VERSION = 23
local CTL_VERSION = 24
local _G = _G
@@ -213,9 +213,15 @@ function ChatThrottleLib:Init()
return ChatThrottleLib.Hook_SendChatMessage(...)
end)
--SendAddonMessage
hooksecurefunc("SendAddonMessage", function(...)
return ChatThrottleLib.Hook_SendAddonMessage(...)
end)
if _G.C_ChatInfo then
hooksecurefunc(_G.C_ChatInfo, "SendAddonMessage", function(...)
return ChatThrottleLib.Hook_SendAddonMessage(...)
end)
else
hooksecurefunc("SendAddonMessage", function(...)
return ChatThrottleLib.Hook_SendAddonMessage(...)
end)
end
end
self.nBypass = 0
end
@@ -461,7 +467,7 @@ function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype, target,
local nSize = text:len();
if RegisterAddonMessagePrefix then
if C_ChatInfo or RegisterAddonMessagePrefix then
if nSize>255 then
error("ChatThrottleLib:SendAddonMessage(): message length cannot exceed 255 bytes", 2)
end
@@ -478,7 +484,11 @@ function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype, target,
if not self.bQueueing and nSize < self:UpdateAvail() then
self.avail = self.avail - nSize
bMyTraffic = true
_G.SendAddonMessage(prefix, text, chattype, target)
if _G.C_ChatInfo then
_G.C_ChatInfo.SendAddonMessage(prefix, text, chattype, target)
else
_G.SendAddonMessage(prefix, text, chattype, target)
end
bMyTraffic = false
self.Prio[prio].nTotalSent = self.Prio[prio].nTotalSent + nSize
if callbackFn then
@@ -490,7 +500,7 @@ function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype, target,
-- Message needs to be queued
local msg = NewMsg()
msg.f = _G.SendAddonMessage
msg.f = _G.C_ChatInfo and _G.C_ChatInfo.SendAddonMessage or _G.SendAddonMessage
msg[1] = prefix
msg[2] = text
msg[3] = chattype