Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion VCF.Core/Basics/RoleMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Expand Down
4 changes: 3 additions & 1 deletion VCF.Core/Breadstone/VWorld.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ProjectM;
using ProjectM.Network;
using Unity.Collections;
using Unity.Entities;
using UnityEngine;

Expand All @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions VCF.Core/Common/Utility.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using RootMotion.FinalIK;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VampireCommandFramework.Common;
Expand Down
10 changes: 7 additions & 3 deletions VCF.Core/Framework/ChatCommandContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using ProjectM;
using Engine.Console;
using ProjectM;
using ProjectM.Network;
using System;
using Unity.Collections;
using VampireCommandFramework.Breadstone;

namespace VampireCommandFramework;
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions VCF.Core/Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
using BepInEx;
using BepInEx.IL2CPP;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using ProjectM;
using ProjectM.Audio;
using System;
using System.Reflection;
using Unity.Entities;
using Unity.Transforms;
using VampireCommandFramework.Basics;

namespace VampireCommandFramework;

Expand Down
2 changes: 1 addition & 1 deletion VCF.Core/VCF.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.690" IncludeAssets="compile" />
<PackageReference Include="BepInEx.Core" Version="6.0.0-be.690" IncludeAssets="compile" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="VRising.Unhollowed.Client" Version="1.0.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="VRising.Unhollowed.Client" Version="1.1.*" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion VCF.SimpleSamplePlugin/VCF.SimpleSamplePlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be*" IncludeAssets="compile" />
<PackageReference Include="BepInEx.Core" Version="6.0.0-be*" IncludeAssets="compile" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
<PackageReference Include="VRising.Unhollowed.Client" Version="1.0.*" />
<PackageReference Include="VRising.Unhollowed.Client" Version="1.1.*" />
<PackageReference Include="Vrising.Bloodstone" Version="0.1.*" />
</ItemGroup>
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion VCF.Tests/CommandArgumentConverterTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using FakeItEasy;
using NUnit.Framework;
using VampireCommandFramework;
using VampireCommandFramework.Basics;

namespace VCF.Tests;
public class CommandArgumentConverterTests
Expand Down Expand Up @@ -32,7 +31,7 @@
public void TestCommand(ICommandContext ctx, SomeType value) { }

[Command("test-default")]
public void TestWithefault(ICommandContext ctx, SomeType value = null) { }

Check warning on line 34 in VCF.Tests/CommandArgumentConverterTests.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.

Check warning on line 34 in VCF.Tests/CommandArgumentConverterTests.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.

Check warning on line 34 in VCF.Tests/CommandArgumentConverterTests.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.
}

internal class SecondaryContext : ICommandContext
Expand Down
9 changes: 1 addition & 8 deletions VCF.Tests/CommandContextTests.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
using FakeItEasy;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using VampireCommandFramework;
using VampireCommandFramework.Common;
using VampireCommandFramework.Registry;

namespace VCF.Tests;

Expand Down Expand Up @@ -56,7 +49,7 @@


// TODO: factor into unique test what about admin check
_goodContext.IsAdmin = false;

Check warning on line 52 in VCF.Tests/CommandContextTests.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 52 in VCF.Tests/CommandContextTests.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 52 in VCF.Tests/CommandContextTests.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.
Assert.That(CommandRegistry.Handle(_goodContext, ".Concrete-GoodContextTest"), Is.EqualTo(CommandResult.Denied), "Command should not be invoked with wrong context");
}

Expand Down
7 changes: 1 addition & 6 deletions VCF.Tests/HelpTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using FakeItEasy;
using FakeItEasy;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using VampireCommandFramework;
using VampireCommandFramework.Basics;
using VampireCommandFramework.Registry;
Expand Down
3 changes: 1 addition & 2 deletions VCF.Tests/MiddlewareTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Consumer;
using NUnit.Framework;
using FakeItEasy;
using NUnit.Framework;
using System.Reflection;
using VampireCommandFramework;

Expand Down
2 changes: 0 additions & 2 deletions VCF.Tests/OverloadTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using FakeItEasy;
using NUnit.Framework;
using VampireCommandFramework;
using VampireCommandFramework.Registry;

namespace VCF.Tests;

Expand Down
3 changes: 1 addition & 2 deletions VCF.Tests/ParsingTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Consumer;
using NUnit.Framework;
using FakeItEasy;
using VampireCommandFramework.Registry;
using NUnit.Framework;
using VampireCommandFramework;

namespace VCF.Tests;
Expand Down
1 change: 0 additions & 1 deletion VCF.Tests/StaticCommandsTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using FakeItEasy;
using NUnit.Framework;
using VampireCommandFramework;
using VampireCommandFramework.Registry;

namespace VCF.Tests;

Expand Down
Loading