xanChat

xanChat

20.1k Downloads

Copy Button, vol.3.

Natlyz opened this issue ยท 50 comments

commented

Hello!

The copy button won't let me copy in-game b.net chat and officer chat: it simply doesn't show b.net and /o channels in the copy window.

Thanks ๐Ÿ˜Š

commented

Hello! Sadly I'm currently not playing WOW anymore. I grew bored with it :(

That being said I don't really know why this issue would be happening. The copy module quite literally retrieves all the messages in a chat window. So unless these are being filtered out somehow on a separate chat frame or what not, I don't know why this bug occurs.

Let me give you an example.

	for i = startPos, endPos do
		local chatMsg, r, g, b, chatTypeID = _G["ChatFrame"..chatIndex]:GetMessageInfo(i)
		if not chatMsg then break end
		
		--fix situations where links end the color prematurely
		if (r and g and b and chatTypeID) then
			local colorCode = RGBToColorCode(r, g, b)
			chatMsg = string.gsub(chatMsg, "|r", "|r"..colorCode)
			chatMsg = colorCode..chatMsg
		end
		
		if (i == startPos) then
			lineText = unescape(chatMsg).."|r"
		else
			lineText = "\n"..unescape(chatMsg).."|r"
		end	
		
		`parentEditBox:Insert(lineText)`
	end

In this part of the code it's going from startPos message count usually 1 to endPos which is usually the last 500 messages. So it's going from message 1 to message 500.

It grabs the current message in the loop from position i

local chatMsg, r, g, b, chatTypeID = _G["ChatFrame"..chatIndex]:GetMessageInfo(i)

Then prints it out in the chat.

parentEditBox:Insert(lineText)

There is no filtering and no reason the officers chat and or battle next messages should be ignored UNLESS they aren't processed the same way as all other messages. Since I'm not an officer in a guild nor have the ability to test battle.net messages, this would be extremely difficult for me to debug and fix.

I wish I had better news ๐Ÿ˜ž

commented

Well, I don't know why, but /o and b.net don't show up in the copy field for me :(

commented

Hello!

I've installed the addon from the ZIP archive, logged in and did some testing.

WoWScrnShot_050620_173231

The addon still doesn't see /o chat in both general and private chat tabs.

What is that filtering issue you mentioned?

commented

xanChat.zip

Try this DEBUG version. I'm trying to see if I can figure it out without having to have a WOW account. The first thing I'll see if it's a filtering issue.

commented

Hello!

Installed, got/wrote some bnet and /o messages, opened /td, opened Copy Chat, took a screenshot.

WoWScrnShot_050720_160937

Hope I did everything correctly and this helps.

commented

Hi! Sorry for the delayed response. Since I have no active subscription you will have to test for me. In terms of the filtering issue, I'm trying to determine if the officer and bnet chat is filtered differently through the chat then the other messages. I don't see why they would do this but it's a possibility.

So in the first zip file I gave you I disabled my built in filtering for things like textures in the links and money icons as well as things like the raid role identifiers that is used in party chat sometimes.

We need to rule out certain things before I have a general idea of what's going on. :) So you can help me debug it to do the coding.

debug-xanchat.zip

In that zip is two addons. xanChat and a debugging addon I've used for years from Tekkub a really well known addon author.

Install both and then bring up the debug window by typing /td or /tekdebug

Then click on xanChat on the left as a category. Now you will see all the Debug messages that xanChat prints out.

I made a debug line that prints out the last 150 messages. If you see your OFFICER and BNET messages in the xanChat debug window then that really helps me out. Note they may not be colored the same, but it will still be outputted to the debug window.

commented

Oh I should point out each Debug line will be the (ChatFrame # it came from, PageNum if any, and finally the actual chat message)

commented

Hello!

Installed, got/wrote some bnet and /o messages, opened /td, opened Copy Chat, took a screenshot.

WoWScrnShot_050720_160937

Hope I did everything correctly and this helps.

This is good news! That means the addon is getting the messages but somehow they aren't being pushed the copy window frame. So we need to determine why.

Using the same tekkub debug window. Use this new xanChat debug addon.

debug-xanchat.zip

In this one you will get 3 different debug printouts PER LINE.

input-1 = the chat line exactly how blizzard pushed it to xanChat
input-2 = the chat line modified by color to prepare it for the copy window.
input-3 = the line added to the previous line so it can be pushed to the copy window.

If the BNET and Officer chat lines show up in input-1, input-2 and input-3 then we know the culprit. Otherwise if it stops in any of them then we can at least identify where it's stopping.

commented

Hello!

Here's what I got.

WoWScrnShot_050820_104211

Looks like nothing goes into input-3 ๐Ÿ˜…

commented

Hello!

Here's what I got.

WoWScrnShot_050820_104211

Looks like nothing goes into input-3 ๐Ÿ˜…

It does ๐Ÿ˜„ If you look on every input-3 it goes under the line because it's pushed to a new line and doesn't follow the nil. on the same line. So what this tells me is that the officer and bnet messages are STILL being stored but somehow it's not pushed to the copy frame. This is very interesting. I'll need to do a little research.

commented

Hope that can be fixed.

commented

Hope that can be fixed.

I did a little research and it may be something with the actual multi-line editbox I'm using to display the copy frame. I'm not 100% sure but it seems that way. So we are going to do a bit of testing to determine if that's the issue.

debug-xanchat.zip

Use the debug version above. You WON'T need the other Debug addon as this will be displayed directly to the Copy Frame window. So if you notice any differences in the output in the CopyFrame window, you'll know it worked or not. Although this time you will be doing an additional step ๐Ÿ˜„

So I basically had to add switches to the code to test out different ways to send text to the CopyFrame. You will need to rotate through them and test it to see if anything is different and if any of them actually send the Officer and BNET text to the CopyFrame.

you will need to type the following in WOW chat box to rotate through them. THIS IS CASE SENSATIVE. So use upper and lower case exactly as it's written below.

/script XCDebug=0

  • You will need to run the script command BEFORE you open the Copy Frame okay ๐Ÿ˜„

  • Also you shouldn't need to type new officer messages or bnet messages to try each one. Just type the new /script and open the copy frame again. Check to see if there is any changes, close the copy frame, type the new /script and open it again.

just change the 0 from a 1 - 9 to test out the following below. So XCDebug=1, XCDebug=2, XCDebug=3, etc.. etc.. make sure to always have /script in the front.

XCDebug=0 : Should be the regular copy frame text insert that was released with the addon. You can check it if you like, but I'm sure it's still not going to work.

XCDebug=1 : Should be the message unfiltered completely. It should NOT go to a new line after each message and look like a giant blob of text with no separation at all.

XCDebug=2 : Should be unfiltered message, but will have a new line after each message so it looks exactly like the WOW chat frame.

XCDebug=3 : This is a new technique I'm using. Should be an exact copy of the WOW Chat frame including officer and BNET to the Copy Frame. This is the one I'm hoping works ๐Ÿ˜จ

XCDebug=4 : This is the new technique but it's completely unfiltered and won't have any new lines after messages.

XCDebug=5 : This is the new technique completely unfiltered but should have new lines after each message.

XCDebug=6 : Old technique, This should be a uncolored version of the text with no new lines after each message.

XCDebug=7 : Old technique, should be uncolored but have new lines after each message.

XCDebug=8 : This is new technique but the text should be pushed uncolored with no new lines after each message.

XCDebug=9 : This is new technique but the text should be pushed uncolored and have new lines after each message.

Honestly I'm hoping XCDebug=3 works. That is the one I think should be the fix. But I guess we will see. If NONE of these work, then the culprit is the multi-line editbox. Which means I would have to replace the entire copy frame again.

commented

I edited the text above, I forgot to type a few things that have to do with how to test.

commented

Hello!

Installed the addon from the archive, did /script XCDebug=1, opened Copy frame, took screenshot, did /script XCDebug=2, opened Copy frame, took screenshot.. etc.

Debug 1
D1

Debug 2
D2

Blank copy frame for Debugs: 3, 4, 5, 8, 9
D3

Debug 6
D6

Debug 7
D7

Hope I did everything correctly. Tested some debugs several times just to make sure.

commented

You did everything perfectly. Thank you so much for your diligent testing! I truly appreciate it! I'm a bit disappointed though. I was hoping that Debug 3 would work. I don't understand why the others failed under 3, 4, 5, 8, 9. So I will take a look at it and provide another debug update. Using the same /script technique. It has to be something really stupid that is breaking the addon.

commented

debug-xanchat.zip

Try this latest debug.

use again:

/script XCDebug=0

This time I did it from 0 to 17. So XCDebug=1, XCDebug=2, XCDebug=3, etc.. etc.. make sure to always have /script in the front.

Only take a screenshot if you think it's relevant this time. 17 screenshots would be a lot LOL. ๐Ÿ˜† If you see the Officer and or BNET chat in the copy frame that would be awesome. If you notice any discrepancies or anything you think I should see, a screenshot would be perfect.

If this doesn't work then I'm completely at a loss as to why this isn't working. Other then me having to replace the entire multi-line editbox. Which looks like it will happen ๐Ÿ˜ข . But lets see if any of the above work this time.

commented

Hello!

Here you can watch the tests: Click!

commented

I'll look into this. It will take me a bit.

commented

Hello!

Here you can watch the tests: Click!

Thanks the video. Very informative and creative. There were a few I was a bit surprised that worked and then the very last two definitely should have worked. I'm beginning to suspect it's something in the text that is hiding any previous and future text from being displayed in the copy frame. Otherwise why would all the other ones work with exception to the Officer and BNET lines and yet the last two that have ALL previous lines merged together wouldn't work? It's because it contains the officer and BNET lines hardcoded into it. Which means either the Copy Frame is bonkers and needs to be replaced or something in the officer chat and bnet chat that blizzard transmits causes information to be hidden.

commented

I thought video was the best option, since it eliminates the chance of me doing something wrong.

Maybe the issue's somehow conntected with the fact /o and b.net channels aren't regular channels? Officer chat needs permissions to be used/seen, and b.net is a private chat between b.net friends. But to think of it if I have persmisson to use those channels why can't I copy text from them? I don't know, just tell me what to test ๐Ÿ˜‰

commented

Is possible to somehow capture the /o and b.net text separately, change their "format" and send the text to Copy Frame? I have no idea what I'm talking about.

commented

Actually you do know what you are talking about. Those two suggestions are quite possible. I can use those suggestions as well to determine what is going on. Your second suggestion is something I was considering. The problem is determining if indeed they are treated as special by the WOW client. It can be a little tricky. Your first suggestion involves permissions and it's quite possible that those particular lines of text are being filtered by permissions. The problem is... where LOL. I'll do some more research. I won't lie this issue is quite boggling to me as it's just text and it should JUST WORK. But it's probably something really stupid that I'm overlooking.

commented

Okay after some research it seems like there are several ways this could be broken. I won't be able to pinpoint it unless we debug it together. To that note, please private message me on WOWInterface.com. My username there is Xruptor, or just look for any of my addons lol. I'll discuss there how we can communicate with each other. I'd rather not post private information here on GitHub.

commented

I'm fine communicating here, when I have time to reply. Just tell me what needs to be tested and I'll do it.

commented

That's the problem, in order for me to debug this I need to have hands on myself with it. Working back and forth with another person. It's just too complex at this point to do it via text based communication. The only reason for using WOWInterface.com private message system is to communicate private information in regards to communicating with each other IN GAME. So we can both work on fixing this issue. If you aren't comfortable with that I understand, however it may be difficult for me to fix this problem without some hands on with it.

commented

I can give you my b.net if you want to communicate in game? But I'm pretty inactive atm, since I'm preparing for exams and have to finish some projects.

commented

I can give you my b.net if you want to communicate in game? But I'm pretty inactive atm, since I'm preparing for exams and have to finish some projects.

๐Ÿ˜„ That's kind of private information to some folks. I didn't want to have your BNET or email publicly here. GitHub tickets are open to the public to view. Which is why I was recommending that you contact me on WOWInterface.com

You can private message me on WOWInterface.com by my name there Xruptor. You may have to register an account if you don't already have one. You can find my profile easily by just visiting any of my addons.

XanChat Addon on WOWInterface

commented

You have your PM disabled there.

commented

You have your PM disabled there.

Whoops I must have turned it off at some point in the past. Sorry about that. It should be enabled now.

commented

Alright I replied to you in WOWInterface.

commented

It seems we play on different regions of WOW. That's okay. I'll pester my friend to help me debug the addon. I do have another update for you to try in the meantime.

Try this version:
debug-xanchat.zip

Blizzard seems to be using protected strings to hide certain chat. So when it's copied over to the Copy Frame it's removed/hidden thus we can't see it. I'm trying to remove those protected strings and replace them.

I want to point out that one of the protected strings is the BNET usernames. There is no way for an addon to grab that, so instead I replaced it with their battle.net. It's the only thing I can do sadly. It's better than nothing. Hopefully this works for Officer chat as well.

Finally, when you are done testing. I need you to attach or send me the xanChat.lua from your WTF folder within WOW Installation.

C:\YOUR WOW INSTALL\_retail\WTF\Account\YOUR ACCOUNT\SavedVariables\xanChat.lua

commented

Yeah, I play on EU realms. Hopefully I'll have time to test that later today.

Do I use /script XCDebug=0-17 again?

commented

Yeah, I play on EU realms. Hopefully I'll have time to test that later today.

Do I use /script XCDebug=0-17 again?

Nope you don't have to use the /script debug commands. This is just a built in fix to test to see if it works or not. I do need you to attach the WTF xanChat.lua file as described above after your testing though.

commented

Hello!

I tested with /script XCDebug=0 and /script XCDebug=1.

WoWScrnShot_051620_151948

It seems the addon displays correct b.net text now, but with b.net tag names (not sure it's a good thing, I'd say b.net tag without the number code is enough).

The /o channel is also displayed in the Copy Frame, but with incorrect text.

Here's the file from SavedVariables folder.

(Xruptor: Hey Natlyz, I got the file downloaded but I removed it from here for security reasons. Just in case ๐Ÿ˜„ )

Hope that helps!

commented

Hello!

I tested with /script XCDebug=0 and /script XCDebug=1.

WoWScrnShot_051620_151948

It seems the addon displays correct b.net text now, but with b.net tag names (not sure it's a good thing, I'd say b.net tag without the number code is enough).

The /o channel is also displayed in the Copy Frame, but with incorrect text.

Here's the file from SavedVariables folder.

(Xruptor: Hey Natlyz, I got the file downloaded but I removed it from here for security reasons. Just in case ๐Ÿ˜„ )

Hope that helps!

Thanks for the update. In terms of the BNET Tag. I explained that above and there really isn't any way around that. To be fair you will be the only one seeing the battle.net tags in the copy frame unless of course you take a screenshot like you did LOL. I'll see if I can remove the pound sign stuff.

Let me repost what I mentioned above.

I want to point out that one of the protected strings is the BNET usernames. There is no way for an addon to grab that, so instead I replaced it with their battle.net. It's the only thing I can do sadly. It's better than nothing. Hopefully this works for Officer chat as well.

Let me take a look at the officer issue. That shouldn't be happening.

commented

Is there a difference between numbers and letters for the addon? Is it possible to make the addon only display letters in the b.net name?

commented

Is there a difference between numbers and letters for the addon? Is it possible to make the addon only display letters in the b.net name?

Yes it's possible. I'm a little confused at reviewing the xanChat.lua you gave me from WTF. According to what I'm seeing you didn't say test in officer chat, you said v1. I told it to store the raw data that was said in officer chat. So unless Blizzard is hiding that information too, I'm not sure why it displayed v1.

Please try it again in Officer chat, but this time use a long sentence or something. Also please post a screenshot with both the chat box with the officer message and the copyframe. It looks like I took care of BNET. Now I just need to figure out Officer chat.

Here is the updated xanChat with the BNET tag changes. I still need to figure out Officer chat, so I'll wait for your data above.
debug-xanchat.zip

commented

Hmm, I'm 100% sure I said "test" then /w'd my b.net friend. I'll test it again.

That's what I see in /o chat history.

WoWScrnShot_051620_164243

commented

Tested with the new version you linked.

WoWScrnShot_051620_164701

commented

Tested with the new version you linked.

WoWScrnShot_051620_164701

That's what I feared. It looks like Blizzard is protecting officer chat as well. We will need to test one last time just to make sure. If it comes back positive Natlyz there is nothing I can do. It will be out of my hands for Officer chat, since addons are restricted when Blizzard deems something protected. Even addons like ElvUI have this problem (I know because I've researched this problem). Blizzard is just beginning to protect text in chat. I suppose addons were abusing it or they where using it to steal account information.

Please try BNET and Officer chat with this latest version. When posting in Officer, please use long sentences and multiple entries for Officer.

debug-xanchat.zip

I will be needing your xanChat.lua from WTF again.
C:\YOUR WOW INSTALL\_retail\WTF\Account\YOUR ACCOUNT\SavedVariables\xanChat.lua

commented

Hm, why's /o protected more than b.net chat? B.net seems to be working fine now :)

WoWScrnShot_051620_175533

(Xruptor: Hey Natlyz, I got the file downloaded but I removed it from here for security reasons. Just in case ๐Ÿ˜„ )

commented

Hm, why's /o protected more than b.net chat? B.net seems to be working fine now :)

WoWScrnShot_051620_175533

(Xruptor: Hey Natlyz, I got the file downloaded but I removed it from here for security reasons. Just in case ๐Ÿ˜„ )

Okay so I have one final testing version. Let me know if everything checks out then I will push it to the live version of xanChat.

In terms of why they are protecting Officer chat more than BNET chat. I actually have no idea. They didn't specify why. Sometimes they protect things without saying why, because they don't want it to be publicly exploited or common knowledge. So it makes it harder for developers.

The only thing I can assume is that exploiters were using Officer chat to gain private information to hack into accounts, since you are more readily to speak on private information in Officer chat. Also it may have been exploited to gain access to guilds and strip them of all their guild bank. In the end I'm just assuming why, but it doesn't mean that's exactly why. It's a mystery.

Let me know if this version is okay and then I'll close this ticket and push it to live.
debug-xanchat.zip

commented

In addition if you or any others viewing this ticket would like more information on protected strings. Please visit the following link.
https://wow.gamepedia.com/UI_escape_sequences

Scroll down to the following under "Other".
|K[gsf][0-9]+|k[0]+|k

This link also contains the same information:
https://wowwiki.fandom.com/wiki/UI_escape_sequences

Also
https://www.wowinterface.com/forums/showthread.php?t=43306

Finally if you review the C_BattleNet.GetFriendAccountInfo function that returns a BNET accountname. Under "accountName" for the key, the description mention it's returned as a protected string that utilizes the "|K|k" escape characters. |K[gsf][0-9]+|k[0]+|k
https://wow.gamepedia.com/API_C_BattleNet.GetFriendAccountInfo

commented

Security reasons? Should I be worried?

commented

Security reasons? Should I be worried?

Nope. I just don't like posting stuff publicly that belongs to someone. Like their chat and stuff. Just one of those paranoia things I have. You are absolutely safe though. I'm just overly cautious lol and protective of those that work with me in debugging.

commented

Anyways, let me know if that last version is okay and I'll move forward with it. I added a little message for officer chat. To make sure folks know it's protected. You can post a screenshot if you like. BNET should be working.

commented

It still shows the "v1, v2.." text. B.net is working fine.

test43

commented

It still shows the "v1, v2.." text. B.net is working fine.

test43

Perfect thanks for all your hard work testing this Natlyz. Sorry it wasn't the result you wanted, but Blizzard can at times make it difficult for addon developers. Sadly, some exploiters ruin it for everyone.

Don't worry about the v1 or v2 at the front of officer chat. That's just the replacement text that Blizzard sends back as protected. I'll keep it there for pretty and future debugging. The red warning text is the more important part. It looks great! You rock!

Hey at least I got BNET chat working!

commented

Thanks for fixing the addon. Don't worry, soon I'll find another bug ๐Ÿ˜ˆ

Suggestion: instead of multiple /o messages replace everything with 1 message that says the channel is protected. It can get really spammy with real /o conversation.

commented

Thanks for fixing the addon. Don't worry, soon I'll find another bug ๐Ÿ˜ˆ

Suggestion: instead of multiple /o messages replace everything with 1 message that says the channel is protected. It can get really spammy with real /o conversation.

Okay thanks. In terms of the Officer spam. I cannot really control that as I'm restricted in that as well It would require another filter on top of what is already there. That would slow things down quite a bit. Generally speaking you are going to use Copy Frame to grab what you need. Yes it's a bit spammy, but it's not like you are going to copy that particular Officer chat. No real way around I'm afraid. Sorry about that.