1
0
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-10-18 08:52:52 -04:00

fix: check if world's motd is longer than the limit first (idk some C# shenanigans)

This commit is contained in:
CyberL1 2024-09-22 08:31:02 +02:00
parent 9976c0bbb5
commit 79c97c7415

View File

@ -54,11 +54,17 @@ namespace MyMcRealms.Controllers
} }
if (SemVersion.Parse(gameVerision, SemVersionStyles.OptionalPatch).ComparePrecedenceTo(SemVersion.Parse("1.19.4", SemVersionStyles.OptionalPatch)) < 0) { if (SemVersion.Parse(gameVerision, SemVersionStyles.OptionalPatch).ComparePrecedenceTo(SemVersion.Parse("1.19.4", SemVersionStyles.OptionalPatch)) < 0) {
if (world.Motd.Length > 32)
{
world.Motd = world.Motd.Remove(32); // Pre 1.19.4 MOTD limit world.Motd = world.Motd.Remove(32); // Pre 1.19.4 MOTD limit
}
} else } else
{
if (world.Motd.Length > 52)
{ {
world.Motd = world.Motd.Remove(52); // Post 1.19.4 MOTD limit world.Motd = world.Motd.Remove(52); // Post 1.19.4 MOTD limit
} }
}
WorldResponse response = new() WorldResponse response = new()
{ {