ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.61k stars 809 forks source link

chat box text display formatting error #13851

Closed lanzer-gaia closed 7 months ago

lanzer-gaia commented 11 months ago

Describe the bug

Game URL - http://www.gaiaonline.com/launch/fishing

To reproduce bug:

  1. login to Gaia https://www.gaiaonline.com/ (registration required)
  2. access game http://www.gaiaonline.com/launch/fishing
  3. Select any game server (eg Angelic fishing)
  4. Select CREATE for a new room
  5. Select PLAY to start game
  6. Send 10 messages, and your messages will eventually show up but formatting is bad (your own messages are being sent and displayed correctly on other player's chat window)

Issue: Welcome message is not displayed unless you scroll up on the scroll bar. It should be displayed without needing to scroll up. Screen Shot 2023-11-03 at 12 46 12 AM

Formatting on welcome message is incorrect. In particular, line breaks are not displayed, and the last 18 or so characters on each line is covered by the next line of text. Screen Shot 2023-11-03 at 12 46 32 AM

When enough messages are sent, messages will show up, but formatting is bad Screen Shot 2023-11-03 at 12 47 43 AM

Expected behavior

This is what expected text formatting should look like:

Screen Shot 2023-11-03 at 12 26 38 AM Screen Shot 2023-11-03 at 12 27 19 AM

Affected platform

Self-hosted version

Operating system

macOS

Browser

Chrome Version 118.0.5993.88 (Official Build) (x86_64)

Additional information

No response

lanzer-gaia commented 11 months ago

Another game also use the same chat system. For this game, the user list on the right hand side does not display any usernames at all. Game URL: http://www.gaiaonline.com/launch/blackjack

Screen Shot 2023-11-03 at 1 24 33 AM

Expected output

Screen Shot 2023-11-03 at 1 23 03 AM
Dinnerbone commented 11 months ago

Somewhat minimal reproduction: gaia_fishing_text.zip

It's just an empty text box with the following AS2 code:

text.html = true;
text.htmlText += "<br><br><br><b><font color=\'#0000FF\'>Reminder! Room Names and in-game chat must follow the <font color=\'#FF0000\'><u><A HREF=\'http://www.gaiaonline.com/info/tos.php\' TARGET=\'_blank\'>Terms of Service</a></u></font> and <font color=\'#FF0000\'><U><A HREF=\'http://www.gaiaonline.com/info/tos.php?info=rules\' TARGET=\'_blank\'>Rules & Guidelines</A></U></font>. <font color=\'#FF0000\'><U><A HREF=\'http://www.gaiaonline.com/forum/viewtopic.php?t=11856831\' TARGET=\'_blank\'>Click here to read more</A></U></font>.</font></b>";
lanzer-gaia commented 10 months ago

Thank you for fixing the text formatting. However the recent fix seemed to have introduced a different problem.

Currently no line breaks are printed on screen, so the initial welcome message is one long line cutting off after 360 characters.

All incoming messages are added to the same line, causing them to not be visible as the line is already cut off.

Hope we can get the line break situation sorted then chat should be working properly.

PS -If you select all and paste the text somewhere else you can see all the chat messages that had been cut off.

lanzer-gaia commented 7 months ago

The text formatting issues have been fixed! Thank you Dinnerbone and all who helped on the issue.