pdinklag / MinecraftStats

A Minecraft player statistics browser for the web - supports 1.13 and later!
https://discord.gg/brH5PGG8By
Other
226 stars 53 forks source link

serverName still being a bit weird #227

Closed mercurialmusic closed 9 hours ago

mercurialmusic commented 12 months ago

Hello! Thanks for the recent update (and heads up) about 3.2.0. Still having a bit of trouble with the serverName field, where previously the page wouldn't load when pulling from the MOTD when it included a section symbol, colors are still not quite being translated correctly (when they were showing correctly in the previous non-Java version):

https://gyazo.com/0cd860902d5fc8552e9d455d5f6758d0

I was able to set "serverName": "<font color='#17b4e6'>BadWolfMC: An Adult Minecraft Server</font>", which translates well enough on the page (https://gyazo.com/4cd4378ebd73e79a6e1836fa08d2f110) but then that shows the <font color='#17b4e6'>BadWolfMC: An Adult Minecraft Server</font> as the overall page name in the tab.

My actual MOTD uses MiniMessage gradients (https://gyazo.com/8200c356b9d6157128a62ff866454cea), which as mentioned did show correctly in the previous version of MinecraftStats.

Not a huge deal ofc - I just set it back to the boring white string for now, but would be a nice thing to have.

Thanks!

pdinklag commented 12 months ago

but then that shows the BadWolfMC: An Adult Minecraft Server as the overall page name in the tab.

That's because the server name is inserted into the <title> tag of the webserver. If anything, this would be a browser issue, because I do not believe the client script should be responsible for parsing the actual content out of that string.

In any event, the server name is not meant to contain HTML.

My actual MOTD uses MiniMessage gradients (https://gyazo.com/8200c356b9d6157128a62ff866454cea), which as mentioned did show correctly in the previous version of MinecraftStats.

Would you give me the MOTD from your server.properties so I can properly test this?

mercurialmusic commented 12 months ago

I confused myself before, I'm on a Bungee/Waterfall setup and my Bungee MOTD is in MiniMessage using a plugin that gives the pretty MOTD.

My MOTD in server.properties for all of the Paper servers was motd=§9Create yourself @ §awww.badwolfmc.com§3\! I enter this as \u00A79Create yourself @ \u00A7awww.badwolfmc.com\u00A73! and it automatically converts it on server restart to the section symbol. This is what is giving the bugged image I linked first.

I also wondered if, since I'm using multiple Paper servers as data source, if something is happening trying to combine the MOTDs or something? They are otherwise all the same on all the servers.

pdinklag commented 11 months ago

I also wondered if, since I'm using multiple Paper servers as data source, if something is happening trying to combine the MOTDs or something? They are otherwise all the same on all the servers.

No, MinecraftStats gets the first MOTD that it finds, so if you use BungeeCord and have multiple sources configured, the first source that has a server.properties with a MOTD set will determine the MOTD displayed in the web frontend.

My MOTD in server.properties for all of the Paper servers was motd=§9Create yourself @ §awww.badwolfmc.com§3\! I enter this as \u00A79Create yourself @ \u00A7awww.badwolfmc.com\u00A73! and it automatically converts it on server restart to the section symbol. This is what is giving the bugged image I linked first.

When I use motd=§9Create yourself @ §awww.badwolfmc.com§3\!, it turns into motd=\u00C2\u00A79Create yourself @ \u00C2\u00A7awww.badwolfmc.com\u00C2\u00A73\! once I start the server (Spigot). The \u00C2 is the encoding for the character  that we see in your first image. I don't know why Spigot / Paper (maybe even vanilla) do this, but this seems like a bug in the server to me, nothing I would be fixing in MinecraftStats.

If I use motd=\u00A79Create yourself @ \u00A7awww.badwolfmc.com\u00A73!, everything works fine for me in version 3.2.0, which fixes any trouble caused by the "section symbol" (§). Clipboard01

Doc94 commented 10 months ago

Hi i have a motd like \u00a76=== Conterstine Subs [PBE-DEV] ===\u00a7r\n\u00a79Furro Power\u00a7r - \u00a7aMantenido por @MrDoc94 but when reload the paper server (1.21.1) turns into §6\=\=\= Conterstine Subs [PBE-DEV] \=\=\=§r\n§9Furro Power§r - §aMantenido por @MrDoc94 and fail to load

pdinklag commented 6 months ago

This may be fixed by 3.3.0.

Doc94 commented 6 months ago

Testes in latest version and still has the error. The site show this in console. image and the issue is the motd format. image

pdinklag commented 9 hours ago

There was an issue with parsing newlines, which has been fixed in 3.3.1.