From 3d9fbd397ee2fa70071e225ae836874061a3e8d9 Mon Sep 17 00:00:00 2001 From: Amber Date: Mon, 28 Apr 2025 08:19:48 -0400 Subject: [PATCH 1/2] 1.1 Fixes only for the VCF.Core --- VCF.Core/Breadstone/VWorld.cs | 4 +- VCF.Core/Framework/ChatCommandContext.cs | 10 +- VCF.Core/Registry/CommandCache.cs | 6 +- VCF.Core/VCF.Core.csproj | 173 ++++++++++++++++++++++- 4 files changed, 186 insertions(+), 7 deletions(-) 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..844f7e7 100644 --- a/VCF.Core/VCF.Core.csproj +++ b/VCF.Core/VCF.Core.csproj @@ -23,10 +23,181 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 6d9c1c567840bab71c87fd6478e1d068f9c5b6e8 Mon Sep 17 00:00:00 2001 From: Amber Date: Mon, 28 Apr 2025 15:44:55 -0400 Subject: [PATCH 2/2] Changed to Nuget --- VCF.Core/VCF.Core.csproj | 173 +-------------------------------------- 1 file changed, 1 insertion(+), 172 deletions(-) diff --git a/VCF.Core/VCF.Core.csproj b/VCF.Core/VCF.Core.csproj index 844f7e7..df9bdde 100644 --- a/VCF.Core/VCF.Core.csproj +++ b/VCF.Core/VCF.Core.csproj @@ -24,178 +24,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +