From 9976c0bbb570a248934a0dbb3c121f412418e7c0 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Sat, 21 Sep 2024 13:16:01 +0200 Subject: [PATCH] fix: cut world's motd to its limit --- MyMcRealms/Controllers/WorldsController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MyMcRealms/Controllers/WorldsController.cs b/MyMcRealms/Controllers/WorldsController.cs index e0648b1..0cc4d78 100644 --- a/MyMcRealms/Controllers/WorldsController.cs +++ b/MyMcRealms/Controllers/WorldsController.cs @@ -53,6 +53,13 @@ namespace MyMcRealms.Controllers worldState = "CLOSED"; } + if (SemVersion.Parse(gameVerision, SemVersionStyles.OptionalPatch).ComparePrecedenceTo(SemVersion.Parse("1.19.4", SemVersionStyles.OptionalPatch)) < 0) { + world.Motd = world.Motd.Remove(32); // Pre 1.19.4 MOTD limit + } else + { + world.Motd = world.Motd.Remove(52); // Post 1.19.4 MOTD limit + } + WorldResponse response = new() { Id = AllServers.Servers.IndexOf(world),