Skip to content

Commit

Permalink
🔀 Merge pull request #13 from decaprime/undo_bloodstone_migration +se…
Browse files Browse the repository at this point in the history
…mver:minor

Undo Bloodstone hosting VCF
  • Loading branch information
decaprime authored Jun 7, 2023
2 parents dd6b216 + a064d92 commit 47368fa
Show file tree
Hide file tree
Showing 23 changed files with 58 additions and 329 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ jobs:
with:
additionalArguments: '/updateprojectfiles /overrideconfig "mode=Mainline"'

- name: Build
run: dotnet build . -p:Version=$GitVersion_SemVer
- name: Build (Release)
run: dotnet build . --configuration Release -p:Version=$GitVersion_SemVer

- name: Run Unit Tests
run: dotnet test

- name: Package Nuget
run: dotnet pack -p:Version=$GitVersion_SemVer --output ./nuget
run: dotnet pack VCF.Core --configuration Release -p:Version=$GitVersion_SemVer --output ./nuget

- name: Upload a Build Artifact
if: ${{ !env.ACT }}
if: ${{ !env.ACT && github.event_name == 'push' }}
uses: actions/[email protected]
with:
path: ./nuget
Expand All @@ -62,7 +62,7 @@ jobs:
with:
body: Automatic pre-release of ${{ env.GitVersion_SemVer }} for ${{ env.GitVersion_ShortSha }}
name: v${{ env.GitVersion_SemVer }}
files: ./VampireCommandFrameworkPlugin/bin/Debug/net6.0/*.dll
files: ./VCF.Core/bin/Debug/net6.0/VampireCommandFramework.dll
fail_on_unmatched_files: true
prerelease: true
tag_name: v${{ env.GitVersion_SemVer }}
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
run: gh release download ${{ env.RELEASE_TAG }} -D ./dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Install tcli
# run: dotnet tool install --global tcli
# - name: Run tcli
# run: tcli publish --token ${{ secrets.THUNDERSTORE_KEY }} --package-version ${RELEASE_TAG:1}
# - name: Upload a Build Artifact
# uses: actions/[email protected]
# with:
# path: ./build
- name: Install tcli
run: dotnet tool install --global tcli
- name: Run tcli
run: tcli publish --token ${{ secrets.THUNDERSTORE_KEY }} --package-version ${RELEASE_TAG:1}
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
path: ./build
2 changes: 1 addition & 1 deletion VCF.Core/Basics/HelpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace VampireCommandFramework.Basics;

public static class HelpCommands
internal static class HelpCommands
{
private static readonly Regex _trailingLongDashRegex = new Regex(@"-\d+$");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace VampireCommandFramework.Breadstone;

[HarmonyPriority(200)]
[HarmonyBefore("gg.deca.Bloodstone")]
[HarmonyPatch(typeof(ChatMessageSystem), nameof(ChatMessageSystem.OnUpdate))]
public static class ChatMessageSystem_Patch
{
Expand Down Expand Up @@ -49,14 +50,7 @@ public static bool Prefix(ChatMessageSystem __instance)
else if (result != CommandResult.Unmatched)
{
//__instance.EntityManager.AddComponent<DestroyTag>(entity);

var whisperChatEvent = new ChatMessageEvent()
{
MessageText = chatEventData.MessageText,
MessageType = ChatMessageType.Whisper,
ReceiverEntity = chatEventData.ReceiverEntity
};
__instance.EntityManager.SetComponentData(entity, whisperChatEvent);
VWorld.Server.EntityManager.DestroyEntity(entity);
return true;
}

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions VCF.Core/Common/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

namespace VampireCommandFramework.Common;

public static class Log
internal static class Log
{
public static ManualLogSource Instance { get; set; }
internal static ManualLogSource Instance { get; set; }

public static void Warning(string s) => LogOrConsole(s, s => Instance.LogWarning(s));
public static void Error(string s) => LogOrConsole(s, s => Instance.LogError(s));
Expand Down
5 changes: 4 additions & 1 deletion VCF.Core/Common/Utility.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Text;
using RootMotion.FinalIK;
using System;
using System.Collections.Generic;
using System.Text;

namespace VampireCommandFramework.Common;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,10 @@ public override void Load()

CommandRegistry.RegisterCommandType(typeof(Basics.HelpCommands));
CommandRegistry.RegisterCommandType(typeof(Basics.BepInExConfigCommands));
CommandRegistry.RegisterCommandType(typeof(Breadstone.Reload));


IL2CPPChainloader.Instance.Plugins.TryGetValue(PluginInfo.PLUGIN_GUID, out var info);
Log.LogMessage($"VCF Loaded: {info?.Metadata.Version}");


// Attempting to speed up Gloomrot compatibility development, server reload
// functionality was taken from Wetstone by molenzwiebel. Should be compatible with Wetstone as well.
// Please don't rely on this persisting or use for production.
Breadstone.Reload.Initialize("BepInEx/VCF-Reloadable-Debugging");
}

public override bool Unload()
Expand Down
42 changes: 26 additions & 16 deletions VCF.Core/VCF.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Basics\RoleMiddleware.cs" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>VampireCommandFramework</AssemblyName>
<Description>My first plugin</Description>
<Version>0.0.999</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<NuspecFile>../nuget.nuspec</NuspecFile>
<NuspecProperties>version=$(Version)</NuspecProperties>
<BepInExPluginGuid>gg.deca.VampireCommandFramework</BepInExPluginGuid>
<PackageId>VampireCommandFramework</PackageId>
<RootNamespace>VampireCommandFramework</RootNamespace>
<Authors>deca</Authors>
</PropertyGroup>
<!-- Copy VampireCommandFramework.dll to /dist -->
<Target Name="Thunderstore Copy to Dist" AfterTargets="AfterBuild" Condition=" '$(Configuration)' == 'Release'">
<Copy SourceFiles="$(OutDir)\VampireCommandFramework.dll" DestinationFolder="$(SolutionDir)/dist" />
</Target>
<ItemGroup>
<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="1.*" />
<PackageReference Include="VRising.Unhollowed.Client" Version="0.6.5.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="VCF.Tests" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be*" IncludeAssets="compile" />
<PackageReference Include="BepInEx.Core" Version="6.0.0-be*" IncludeAssets="compile" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions VCF.SimpleSamplePlugin/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace VCF.SimpleSamplePlugin;

[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency("gg.deca.VampireCommandFramework")]
[VampireCommandFramework.Breadstone.Reloadable]
[Bloodstone.API.Reloadable]
internal class Plugin : BasePlugin
{
public override void Load()
Expand Down
6 changes: 3 additions & 3 deletions VCF.SimpleSamplePlugin/VCF.SimpleSamplePlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<ItemGroup>
<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="1.*" />
<PackageReference Include="VRising.Unhollowed.Client" Version="0.6.1.57247001" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
<PackageReference Include="VRising.Unhollowed.Client" Version="0.6.5.*" />
<PackageReference Include="Vrising.Bloodstone" Version="0.1.*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VampireCommandFrameworkPlugin\VampireCommandFramework.csproj" />
<ProjectReference Include="..\VCF.Core\VCF.Core.csproj" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions VCF.Tests/HelpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void HelpCommand_Help_ListsAll()
Assert.That(CommandRegistry.Handle(AnyCtx, ".help"), Is.EqualTo(CommandResult.Success));
AnyCtx.AssertReply($"""
[vcf] Listing all commands
Commands from VCF.Core:
Commands from VampireCommandFramework:
.help-legacy [search=]
.help [search=]
""");
Expand All @@ -46,9 +46,9 @@ [vcf] Listing all commands
[Test]
public void HelpCommand_Help_ListsAssemblyMatch()
{
Assert.That(CommandRegistry.Handle(AnyCtx, ".help VCF.Core"), Is.EqualTo(CommandResult.Success));
Assert.That(CommandRegistry.Handle(AnyCtx, ".help VampireCommandFramework"), Is.EqualTo(CommandResult.Success));
AnyCtx.AssertReply($"""
[vcf] Commands from VCF.Core:
[vcf] Commands from VampireCommandFramework:
.help-legacy [search=]
.help [search=]
""");
Expand Down
1 change: 0 additions & 1 deletion VCF.Tests/VCF.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\VampireCommandFrameworkPlugin\VampireCommandFramework.csproj" />
<ProjectReference Include="..\VCF.Core\VCF.Core.csproj" />
</ItemGroup>
</Project>
8 changes: 1 addition & 7 deletions VCF.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32519.111
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VampireCommandFramework", "VampireCommandFrameworkPlugin\VampireCommandFramework.csproj", "{54C82B43-DB9B-4E83-8E43-79FFE691CE85}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VCF.Core", "VCF.Core\VCF.Core.csproj", "{54C82B43-DB9B-4E83-8E43-79FFE691CE85}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VCF.SimpleSamplePlugin", "VCF.SimpleSamplePlugin\VCF.SimpleSamplePlugin.csproj", "{85CE497F-326B-4E35-97FA-01439C4F8CA6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VCF.Tests", "VCF.Tests\VCF.Tests.csproj", "{05FC95C7-6679-48C8-8633-FB27CC94A43F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VCF.Core", "VCF.Core\VCF.Core.csproj", "{34DBB564-4F68-428D-8597-1511606C672D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -29,10 +27,6 @@ Global
{05FC95C7-6679-48C8-8633-FB27CC94A43F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05FC95C7-6679-48C8-8633-FB27CC94A43F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05FC95C7-6679-48C8-8633-FB27CC94A43F}.Release|Any CPU.Build.0 = Release|Any CPU
{34DBB564-4F68-428D-8597-1511606C672D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34DBB564-4F68-428D-8597-1511606C672D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34DBB564-4F68-428D-8597-1511606C672D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34DBB564-4F68-428D-8597-1511606C672D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
30 changes: 0 additions & 30 deletions VampireCommandFrameworkPlugin/Breadstone/IRunOnInitialized.cs

This file was deleted.

48 changes: 0 additions & 48 deletions VampireCommandFrameworkPlugin/Breadstone/OnInitialize.cs

This file was deleted.

Loading

0 comments on commit 47368fa

Please sign in to comment.