LFG MatchMaker

LFG MatchMaker

10.4k Downloads

Listen to Trade-Channel

ap0yuv opened this issue ยท 2 comments

commented

Common situation observerd is that People like to abuse the Trade Channel for LFG/LFM aswell.
Would it be possible to add this feature (maybe as Option) to hook into Trade Channel too?

Quick solution (for PoC) is to simply copy LFGMM_Utility_GetLfgChannelName() and make it Match the Trade Channel.
Then adding a new Var in LFGMM_GLOBAL Scope and extending the listening part if channelName == LFG or channelName == Trade

...
		-- Join LFG channel
		C_Timer.After(5, function()
			LFGMM_GLOBAL.LFG_CHANNEL_NAME = LFGMM_Utility_GetLfgChannelName();
			LFGMM_GLOBAL.TRADE_CHANNEL_NAME = LFGMM_Utility_GetTradeChannelName();
			JoinTemporaryChannel(LFGMM_GLOBAL.LFG_CHANNEL_NAME);
			JoinTemporaryChannel(LFGMM_GLOBAL.TRADE_CHANNEL_NAME);
		end);
...
	-- Parse LFG channel message
	elseif (event == "CHAT_MSG_CHANNEL") then
		local channelName = select(9, ...);

		if (channelName == LFGMM_GLOBAL.LFG_CHANNEL_NAME) or (channelName == LFGMM_GLOBAL.TRADE_CHANNEL_NAME) then
`

commented
commented

Thank you for the contribution.

I looked at your issue and PR and did some tests with parsing messages from the trade channel.

It seems that there were some additional tweaks that had to be done to make this work, and I wanted to limit the amount of messages listed from other channels than LFG to prevent the list of matches to be populated with false positives and non-LFG messages.

Also, seeing that the trade channel is not always available depending on where you are, I had to add a check if it was available or not before joining it.

In addition to some other updates I have now added an opt-in configuration to also listen to general and trade channels in the latest release of the addon (1.0.9) (#25 )
Though, messages from these channels will only be matched if both type and dungeon is matched to prevent false positives and non-LFG messages.

I hope this is a suitable update.