TranqRotate

TranqRotate

156k Downloads

Annoucements in player channels does not work

Slivo-fr opened this issue ยท 16 comments

commented

Version : v1.2.0

Announces are not send to custom player chat channel

Additional information

A blizzard error is printed in chat the first time it tries

commented

This feature is blocked by blizzard restriction on channels. It will not work and will be removed at some point

commented

Hi violatorno,

Broadcasting rotation setup to a player channel is indeed something possible and planned. It's however different from the tranqshot announces.

The blizzard function that send chat messages requires to be triggered by a hardware event to allow sending messages to player channels. Clicking the broadcast button is a hardware event. The tranqshot announces on the other hand is triggered on a combat log event which isn't a hardware event.

I didn't find any way around this issue. If you have some idea feel free to share or open a pull request :)

commented

That should work the same way as sending the rotation list to a user created channel?
Announcing the rotation to a user created channel is possible with a modification to the function that broadcasts it.
So announcing tranqshots going out as failed tranqshots should be possible in the same way.

commented

You can un-comment the line 4 of the src/events.lua file, it will consider arcane shot as tranqshot for tests
No debug function, sorry about it.
Yell and say won't work in open world, raid should work in any case.

commented

A guildm8 made this change so that we can switch and broadcast to the class channel instead of it being hardlocked to raid:

-- Sends rotation setup to raid channel
function TranqRotate:broadcastToRaid()
	local channelNumber 
	if TranqRotate.db.profile.channelType == "CHANNEL" then
		channelNumber = GetChannelName(TranqRotate.db.profile.targetChannel)
	end

    if (IsInRaid()) then
        SendChatMessage('--- ' .. L['BROADCAST_HEADER_TEXT'] .. ' ---', TranqRotate.db.profile.channelType, nil, channelNumber or TranqRotate.db.profile.targetChannel)
        SendChatMessage(
            TranqRotate:buildGroupMessage(L['BROADCAST_ROTATION_PREFIX'] .. ' : ', TranqRotate.rotationTables.rotation),
            TranqRotate.db.profile.channelType, nil, channelNumber or TranqRotate.db.profile.targetChannel
        )

        if (#TranqRotate.rotationTables.backup > 0) then
            SendChatMessage(
                TranqRotate:buildGroupMessage(L['BROADCAST_BACKUP_PREFIX'] .. ' : ', TranqRotate.rotationTables.backup),
                TranqRotate.db.profile.channelType, nil, channelNumber or TranqRotate.db.profile.targetChannel
            )
        end
    end

end
commented

The announce part does work in good old YAHT, only to raid channel but can probably be changed to broadcast in the same matter.
https://github.com/Aviana/YaHT

commented

Happens in this section in YAHT:

		if YaHT.db.profile.tranqannounce then
			local num
			if YaHT.db.profile.announcetype == "CHANNEL" then
				num = GetChannelName(YaHT.db.profile.targetchannel)
			end
			SendChatMessage(string.format(YaHT.db.profile.announcemsg,targetName), YaHT.db.profile.announcetype, nil, num or YaHT.db.profile.targetchannel)
		end
	elseif event == "SPELL_MISSED" and name == GetSpellInfo(19801) and casterID == UnitGUID("player") then
		if YaHT.db.profile.tranqannouncefail then
			local num
			if YaHT.db.profile.announcetype == "CHANNEL" then
				num = GetChannelName(YaHT.db.profile.targetchannel)
			end
			SendChatMessage(string.format(YaHT.db.profile.announcefailmsg,targetName), YaHT.db.profile.announcetype, nil, num or YaHT.db.profile.targetchannel)
		end
	end```
commented

As explained, the two feature are different and I won't be able to modify tranq annouces the same way your mate modified the broadcast.

The broadcast channel selection is planned for a future update

commented

I know, but it doesn't even work in raid channel with TranqRotate, Aviana has it working for raid, so just telling you that since it might help towards that you can get it working as well.

commented

it doesn't even work in raid channel with TranqRotate

I didn't understand this part, could you please re-explain what isn't working right now ?

commented

When a hunter uses Tranqshot we don't get any announcements in raid channel

commented

As example, if I use tranqshot with YAHT running it tells the raid that my huntername has put a tranq up on bossname, and it also tells if the shot fails/misses.

commented

This is a totally different issue then.

Do you have any errors ?
Does it works in others channels ? (yell, whispers)
It works perfectly fine in raid and yell on my end

Could you please join discord so we can chat and find out what's going on without spamming this unrelated issue ?

commented

It is enabled by default? I will check it out myself tonight to make sure and get back to you if the announcement doesn't show up.
Is there a debug function I can enable to get some usable info for you?

commented

Figured what the issue is, when you set anouncement to a custom channel in game with the change I posted, rotation order is shown in the custom channel while the tranq out and fail messages don't go anywhere.
Might look over it when I get some time and see if I can find a solution.

commented

I would advice not to use a modified version of the addon.

As said in the issue, tranqshot announces won't work with player channels, and player channel option will be removed in coming updates.
I will add a channel dropdown for setup broadcast at some point too