Lobby Chat infinite loop


CarlZalph
  • Fixed

If a player's username is multi-lined (Ex: "\nBobby") and the person types a chat message in the pre-game lobby, then it will cause everyone to lock in an infinite loop.

They get caught up in scripts/widgets/text.lua:

while self.inst.TextWidget:GetRegionSize() > maxwidth do
    str = str:utf8sub(1, -2)
    self.inst.TextWidget:SetString(str..ellipses)
end

 

To fix this, an edit to scripts/widgets/redux/lobbychatqueue.lua:

group.user_widget:SetTruncatedString(data.username..":", self.username_maxwidth, 30, "..:")

Changed to:

group.user_widget:SetMultilineTruncatedString(data.username..":", self.multiline_maxrows, self.username_maxwidth, self.line_maxchars, "..:")

Of course since this is the username field it could also apply restrictions of multiline_maxrows to 1, and change the line_maxchars to the arbitrary '30' from before.


Steps to Reproduce
Have a person with a newline as the start of their username join a room and type a message, then watch the locking.

Status: Fixed

This issue has been fixed in either a future version or updated in a previous version.


  • Like 1
  Report Bug


User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
....

Further, I would surmise that the loop only really catches if the username's disproportionally longer after the newline than before it.

"a\nBob" vs "Bob\na".

Share this comment


Link to comment
Share on other sites
.... ....


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now