From 22a476d017aca106e695f9185cc2e505c0c91fc3 Mon Sep 17 00:00:00 2001 From: InspectorCaracal <51038201+InspectorCaracal@users.noreply.github.com> Date: Sat, 27 Apr 2024 12:36:41 -0600 Subject: [PATCH] support full capitalization in GMCP commands --- evennia/server/portal/telnet_oob.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/evennia/server/portal/telnet_oob.py b/evennia/server/portal/telnet_oob.py index 6fe68ff7a1..37c1f8067c 100644 --- a/evennia/server/portal/telnet_oob.py +++ b/evennia/server/portal/telnet_oob.py @@ -257,11 +257,8 @@ class TelnetOOB: if cmdname in EVENNIA_TO_GMCP: gmcp_cmdname = EVENNIA_TO_GMCP[cmdname] elif "_" in cmdname: - if cmdname.istitle(): - # leave without capitalization - gmcp_cmdname = ".".join(word for word in cmdname.split("_")) - else: - gmcp_cmdname = ".".join(word.capitalize() for word in cmdname.split("_")) + # enforce initial capitalization of each command part, leaving fully-capitalized sections intact + gmcp_cmdname = ".".join(word.capitalize() if not word.isupper() else word for word in cmdname.split("_")) else: gmcp_cmdname = "Core.%s" % (cmdname if cmdname.istitle() else cmdname.capitalize())