Skip to content

Commit

Permalink
Use CTL's new shiny BNSendGameData API
Browse files Browse the repository at this point in the history
Fixes #56. CTL version 29 or newer now has the necessary public API
to support sending messages over Battle.net, so we no longer need to
reach in and call the Enqueue method manually.
  • Loading branch information
Meorawr committed May 7, 2024
1 parent 6f0485c commit 35278be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
]]

local VERSION = 27
local VERSION = 28

if IsLoggedIn() then
error(("Chomp Message Library (embedded: %s) cannot be loaded after login."):format((...)))
Expand Down
19 changes: 2 additions & 17 deletions Public.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,8 @@ function Chomp.BNSendGameData(bnetIDGameAccount, prefix, text, priority, queue,
error("Chomp.BNSendGameData: prefix: length cannot exceed 16 bytes", 2)
end

-- Revisit this logic later if/when CTL merges in BNSendGameData support;
-- until then let's poke into its guts.

if not ChatThrottleLib.Enqueue then
return
end

ChatThrottleLib:Enqueue(PRIORITY_TO_CTL[priority] or DEFAULT_PRIORITY, queue or prefix, {
f = BNSendGameData,
callbackFn = callback,
callbackArg = callbackArg,
nSize = length + (ChatThrottleLib.MSG_OVERHEAD or 40),
n = 3,
bnetIDGameAccount,
prefix,
text,
})
local kind = "WHISPER"
ChatThrottleLib:BNSendGameData(PRIORITY_TO_CTL[priority] or DEFAULT_PRIORITY, prefix, text, kind, bnetIDGameAccount, queue, callback, callbackArg)
end

function Chomp.IsSending()
Expand Down

0 comments on commit 35278be

Please sign in to comment.