Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SayText message is broken in recent builds #2531

Closed
2010kohtep opened this issue Jun 16, 2019 · 17 comments
Closed

SayText message is broken in recent builds #2531

2010kohtep opened this issue Jun 16, 2019 · 17 comments
Assignees

Comments

@2010kohtep
Copy link

In the latest build, the SayText message can't process chat message from some plugins correctly. Instead of a chat message, the letter s is written.

image

It happens due to the code in the __MsgFunc_SayText function, which removes the % characters from String1. Some game plugins store formatting rules in this line.

image

In the image below, you can see that the message is completely correct, but the latest builds of the game cannot correctly process it.

image

@SamVanheer
Copy link

Possible duplicate of #1819

@2010kohtep
Copy link
Author

@SamVanheer, this problem arose in the 8xxx build generation. The problem is missing in the 7960 build. Perhaps the problems are similar, but they are not identical.

@RauliTop
Copy link

@mikela-valve both problems should be fixed on Next release, please

@mikela-valve
Copy link
Member

@2010kohtep That's weird that 7960 didn't have this change in it as it looks like Alfred added it in mid-2013. Do you happen to know what the build date is for 7960?

This might require a choice between security and convenience though, at least without rewriting SayTextPrint to handle localization differently. As you'd figure, percent characters are stripped from that due to it being used as a printf formatter later when localization tokens are replaced in it. I'd have to look more closely at strings passed to SayTextPrint to see if there is a different way I can process the text effectively to still handle localization correctly.

Could you give me some examples of how rules are stored? Possibly I could find some compromise that could add some special handling for % like still stripping it out of the string but adding it as a separate message, appending it to the message or something else that wouldn't require a rewrite of SayTextPrint.

@metita
Copy link

metita commented Jun 17, 2019

@mikela-valve
image

@mikela-valve
Copy link
Member

Thanks @basuritashka. It looks like 7960 should have this same % filtering and should work the same so it's quite strange if it didn't have that filtering in it.

@2010kohtep are you sure this is actually different from #1819 as @SamVanheer pointed out? I don't see anything different happening in this issue other than the string arguments subsequently being ignored due to the % in the format specifier being stripped out.

The main issue that complicates allowing format specifiers in the input string is that SayTextPrint handles both localized and non-localized input strings so there numerous ways things could go wrong at the moment if they weren't filtered. I may be able to update SayTextPrint to allow format specifiers in the input string so long as there aren't any localization tokens in the string and filter out any excess specifiers before formatting it but I'll have to do a bit more investigation first.

@afwn90cj93201nixr2e1re
Copy link

Yes. It's seems like different issues.
It's not duplicate.

@mikela-valve
Copy link
Member

I'm not sure I follow, how exactly is it different?

#1819 is caused by the % being stripped from the input string to MsgFunc_SayText and this is also caused by the % being stripped leading to only s being displayed instead of being replaced by ☹*DEAD* ♥Player☹ : test 123. It's fine if there are multiple issues I just want to clarify what they are.

@mikela-valve mikela-valve added this to the Next Release milestone Jun 18, 2019
@mikela-valve mikela-valve self-assigned this Jun 18, 2019
@mikela-valve
Copy link
Member

@2010kohtep I updated SayTextPrint as I described above where it's able to have up to four format specifiers that the four string parameters are mapped to. Any format specifier beyond the fourth or any specifier that is not %s will be filtered as it is currently. This will be included in the next beta release.

@afwn90cj93201nixr2e1re
Copy link

Check %s0.

@mikela-valve
Copy link
Member

@afwn90cj93201nixr2e1re Sorry, forgot to mention that I did fix that bug as well when working on this. Thanks!

@afwn90cj93201nixr2e1re
Copy link

afwn90cj93201nixr2e1re commented Jun 19, 2019

But what 'bout icons in tab, xD?
It's easy to implement defuse/bomb icon, for each team, and for VIP you can add just icon with 'V' letter.

#702 (comment) check all my comment's from this/

@mikela-valve
Copy link
Member

This should be fixed in beta update '15:46:27 Jun 11 2019 (8265)'.

@Mistrick
Copy link

@mikela-valve I think you broke some lang keys.
Current output

Time Remaining:  11: .2s

title.txt

Game_timelimit
{
Time Remaining:  %s:%.2s
}

@mikela-valve
Copy link
Member

Thanks @Mistrick, I changed where the format stripping was occurring which happened to mistakenly apply it to pre-formatted strings like that one. I've fixed it to filter the input strings in the same place as before.

@mikela-valve
Copy link
Member

@Mistrick This should be fixed now in beta.

@mikela-valve
Copy link
Member

Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants