diff --git a/VCF.Core/Breadstone/VWorld.cs b/VCF.Core/Breadstone/VWorld.cs index 903100f..712f73e 100644 --- a/VCF.Core/Breadstone/VWorld.cs +++ b/VCF.Core/Breadstone/VWorld.cs @@ -1,5 +1,6 @@ using ProjectM; using ProjectM.Network; +using Unity.Collections; using Unity.Entities; using UnityEngine; @@ -12,7 +13,8 @@ internal static class VWorld { public static void SendSystemMessage(this User user, string message) { - ServerChatUtils.SendSystemMessageToClient(Server.EntityManager, user, message); + FixedString512Bytes unityMessage = message; + ServerChatUtils.SendSystemMessageToClient(Server.EntityManager, user, ref unityMessage); } private static World _serverWorld; diff --git a/VCF.Core/Framework/ChatCommandContext.cs b/VCF.Core/Framework/ChatCommandContext.cs index 3ed1dcd..2a94b80 100644 --- a/VCF.Core/Framework/ChatCommandContext.cs +++ b/VCF.Core/Framework/ChatCommandContext.cs @@ -1,6 +1,8 @@ -using ProjectM; +using Engine.Console; +using ProjectM; using ProjectM.Network; using System; +using Unity.Collections; using VampireCommandFramework.Breadstone; namespace VampireCommandFramework; @@ -44,9 +46,11 @@ public ChatCommandContext(VChatEvent e) static int maxMessageLength = 509; public void Reply(string v) { - if(v.Length > maxMessageLength) + if (v.Length > maxMessageLength) v = v[..maxMessageLength]; - ServerChatUtils.SendSystemMessageToClient(VWorld.Server.EntityManager, User, v); + + FixedString512Bytes unityMessage = v; + ServerChatUtils.SendSystemMessageToClient(VWorld.Server.EntityManager, User, ref unityMessage); } // todo: expand this, just throw from here as void and build a handler that can message user/log. diff --git a/VCF.Core/Registry/CommandCache.cs b/VCF.Core/Registry/CommandCache.cs index 8dad810..a4d610d 100644 --- a/VCF.Core/Registry/CommandCache.cs +++ b/VCF.Core/Registry/CommandCache.cs @@ -41,15 +41,17 @@ internal void AddCommand(string key, ParameterInfo[] parameters, CommandMetadata internal CacheResult GetCommand(string rawInput) { + var lowerRawInput = rawInput.ToLowerInvariant(); // todo: I think allows for overlap between .foo "bar" and .foo bar List possibleMatches = new(); foreach (var (key, argCounts) in _newCache) { - if (rawInput.StartsWith(key)) + var lowerKey = key.ToLowerInvariant(); + if (lowerRawInput.StartsWith(lowerKey)) { // there's no need to inspect the parameters if the next character isn't a space or the end of the string // because it means that this was part of a different prefix token - if (rawInput.Length > key.Length && rawInput[key.Length] != ' ') + if (lowerRawInput.Length > lowerKey.Length && lowerRawInput[lowerKey.Length] != ' ') { continue; } diff --git a/VCF.Core/VCF.Core.csproj b/VCF.Core/VCF.Core.csproj index 1ef87ac..df9bdde 100644 --- a/VCF.Core/VCF.Core.csproj +++ b/VCF.Core/VCF.Core.csproj @@ -23,8 +23,8 @@ - +