Skip to content

Commit 3d9fbd3

Browse files
committed
1.1 Fixes only for the VCF.Core
1 parent 9fc78e8 commit 3d9fbd3

File tree

4 files changed

+186
-7
lines changed

4 files changed

+186
-7
lines changed

VCF.Core/Breadstone/VWorld.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using ProjectM;
22
using ProjectM.Network;
3+
using Unity.Collections;
34
using Unity.Entities;
45
using UnityEngine;
56

@@ -12,7 +13,8 @@ internal static class VWorld
1213
{
1314
public static void SendSystemMessage(this User user, string message)
1415
{
15-
ServerChatUtils.SendSystemMessageToClient(Server.EntityManager, user, message);
16+
FixedString512Bytes unityMessage = message;
17+
ServerChatUtils.SendSystemMessageToClient(Server.EntityManager, user, ref unityMessage);
1618
}
1719

1820
private static World _serverWorld;

VCF.Core/Framework/ChatCommandContext.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
using ProjectM;
1+
using Engine.Console;
2+
using ProjectM;
23
using ProjectM.Network;
34
using System;
5+
using Unity.Collections;
46
using VampireCommandFramework.Breadstone;
57

68
namespace VampireCommandFramework;
@@ -44,9 +46,11 @@ public ChatCommandContext(VChatEvent e)
4446
static int maxMessageLength = 509;
4547
public void Reply(string v)
4648
{
47-
if(v.Length > maxMessageLength)
49+
if (v.Length > maxMessageLength)
4850
v = v[..maxMessageLength];
49-
ServerChatUtils.SendSystemMessageToClient(VWorld.Server.EntityManager, User, v);
51+
52+
FixedString512Bytes unityMessage = v;
53+
ServerChatUtils.SendSystemMessageToClient(VWorld.Server.EntityManager, User, ref unityMessage);
5054
}
5155

5256
// todo: expand this, just throw from here as void and build a handler that can message user/log.

VCF.Core/Registry/CommandCache.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ internal void AddCommand(string key, ParameterInfo[] parameters, CommandMetadata
4141

4242
internal CacheResult GetCommand(string rawInput)
4343
{
44+
var lowerRawInput = rawInput.ToLowerInvariant();
4445
// todo: I think allows for overlap between .foo "bar" and .foo bar <no parameters>
4546
List<CommandMetadata> possibleMatches = new();
4647
foreach (var (key, argCounts) in _newCache)
4748
{
48-
if (rawInput.StartsWith(key))
49+
var lowerKey = key.ToLowerInvariant();
50+
if (lowerRawInput.StartsWith(lowerKey))
4951
{
5052
// there's no need to inspect the parameters if the next character isn't a space or the end of the string
5153
// because it means that this was part of a different prefix token
52-
if (rawInput.Length > key.Length && rawInput[key.Length] != ' ')
54+
if (lowerRawInput.Length > lowerKey.Length && lowerRawInput[lowerKey.Length] != ' ')
5355
{
5456
continue;
5557
}

0 commit comments

Comments
 (0)