Playerbot: BotGear addon — send via PBCFLEET target, not the bot's name
Whispering the bot's character name routes the server's OnChat hook to the headless bot's session (pool account), so GEAR responses were never sent to the owner. Match PlayerbotControl: whisper the magic 'PBCFLEET' target; the bot guid is carried in the payload and the handlers authorize via Owners().
This commit is contained in:
@@ -39,12 +39,16 @@ local EQUIP_SLOT_NAMES = {
|
|||||||
|
|
||||||
-- Comms -------------------------------------------------------------
|
-- Comms -------------------------------------------------------------
|
||||||
local seqCounter = 1 -- server rejects frames with seq == 0
|
local seqCounter = 1 -- server rejects frames with seq == 0
|
||||||
|
local FLEET_TARGET = "PBCFLEET" -- magic whisper target intercepted server-side
|
||||||
local function Send(mtype, ...)
|
local function Send(mtype, ...)
|
||||||
local args = {...}
|
local args = {...}
|
||||||
local body = table.concat(args, "|")
|
local body = table.concat(args, "|")
|
||||||
local f = string.format("1|%08x|1|1|%s|%s", seqCounter, mtype, body)
|
local f = string.format("1|%08x|1|1|%s|%s", seqCounter, mtype, body)
|
||||||
seqCounter = (seqCounter % 0xFFFFFFFF) + 1
|
seqCounter = (seqCounter % 0xFFFFFFFF) + 1
|
||||||
C_ChatInfo.SendAddonMessage(PREFIX, f, "WHISPER", botName or UnitName("player"))
|
-- Send to PBCFLEET like PlayerbotControl: whispering the bot's name
|
||||||
|
-- routes the server's OnChat hook to the headless bot session instead of
|
||||||
|
-- the owner, so no reply ever reaches us.
|
||||||
|
C_ChatInfo.SendAddonMessage(PREFIX, f, "WHISPER", FLEET_TARGET)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function ResolveTarget()
|
local function ResolveTarget()
|
||||||
|
|||||||
Reference in New Issue
Block a user