Skip to content

Commit cbdefab

Browse files
committed
📦 Packaging for Thunderstore release, nit formating +semver:minor
1 parent ec97090 commit cbdefab

File tree

9 files changed

+95
-85
lines changed

9 files changed

+95
-85
lines changed

‎.editorconfig‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@ indent_style = tab
99
indent_style = space
1010
indent_size = 2
1111

12+
13+
1214
[*.cs]
1315
# Organize usings
1416
dotnet_separate_import_directive_groups = false
1517
dotnet_sort_system_directives_first = true
1618
file_header_template = unset
17-
19+
# IDE0005: Using directive is unnecessary.
20+
dotnet_diagnostic.IDE0005.severity = suggestion
1821
csharp_using_directive_placement = outside_namespace:silent
1922
csharp_prefer_simple_using_statement = true:suggestion
2023
csharp_prefer_braces = true:silent
21-
csharp_style_namespace_declarations = file_scoped:suggestion
24+
csharp_style_namespace_declarations = file_scoped:warning
2225
csharp_style_prefer_method_group_conversion = true:silent
2326
csharp_style_prefer_top_level_statements = true:silent
2427
csharp_style_expression_bodied_methods = false:silent

‎Commands.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public void TopCommand(ChatCommandContext ctx)
1919

2020
offset = offset > topKillers.Length ? topKillers.Length : offset;
2121
num = num > topKillers.Length ? topKillers.Length : num;
22-
23-
22+
23+
2424

2525
var pad = (string name) => new string('\t'.Repeat(6 - name.Length / 5).ToArray());
2626

‎DataStore.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ PlayerStatistics UpsertName(ulong steamId, string name, string clanName)
201201
// while this is naieve and whole file, in append or WAL this might be better
202202
WriteToDisk();
203203
}
204-
204+
205205
private static void AnnounceKill(PlayerStatistics victimUser, PlayerStatistics killerUser, int lostStreakAmount)
206206
{
207207
if (!Settings.AnnounceKills) return;
@@ -225,7 +225,7 @@ private static void AnnounceKill(PlayerStatistics victimUser, PlayerStatistics k
225225
};
226226

227227
ServerChatUtils.SendSystemMessageToAllClients(VWorld.Server.EntityManager, Markup.Prefix + message);
228-
228+
229229
if (!string.IsNullOrEmpty(killMsg) && Settings.AnnounceKillstreak)
230230
{
231231
ServerChatUtils.SendSystemMessageToAllClients(VWorld.Server.EntityManager, Markup.Prefix + killMsg);

‎ECSExtensions.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ internal static void With<T>(this Entity entity, VExtensions.ActionRef<T> action
2222
internal static bool Has<T>(this Entity entity) where T : struct
2323
{
2424
int typeIndex = TypeManager.GetTypeIndex(Il2CppType.Of<T>());
25-
25+
2626
return VWorld.Game.EntityManager.HasComponentRaw(entity, typeIndex);
2727
}
2828

29-
internal unsafe static T RW<T>(this Entity entity) where T: struct
29+
internal unsafe static T RW<T>(this Entity entity) where T : struct
3030
{
3131
int typeIndex = TypeManager.GetTypeIndex(Il2CppType.Of<T>());
3232
T* componentDataRawRW = (T*)VWorld.Game.EntityManager.GetComponentDataRawRW(entity, typeIndex);
@@ -41,7 +41,7 @@ internal unsafe static T Read<T>(this Entity entity) where T : struct
4141
{
4242
int typeIndex = TypeManager.GetTypeIndex(Il2CppType.Of<T>());
4343
T* componentDataRawRO = (T*)VWorld.Game.EntityManager.GetComponentDataRawRO(entity, typeIndex);
44-
if(componentDataRawRO == null)
44+
if (componentDataRawRO == null)
4545
{
4646
throw new InvalidOperationException($"Failure to access ReadOnly <{typeof(T).Name}> typeIndex({typeIndex}) on entity({entity}).");
4747
}

‎Killfeed.csproj‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<Copy SourceFiles="$(OutDir)\Killfeed.dll" DestinationFolder="$(ProjectDir)/dist" />
1616
</Target>
1717
<ItemGroup>
18-
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.668" IncludeAssets="compile" />
19-
<PackageReference Include="BepInEx.Core" Version="6.0.0-be.668" IncludeAssets="compile" />
18+
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.691" IncludeAssets="compile" />
19+
<PackageReference Include="BepInEx.Core" Version="6.0.0-be.691" IncludeAssets="compile" />
2020
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
21-
<PackageReference Include="VRising.Unhollowed.Client" Version="1.0.0.*" />
22-
<PackageReference Include="VRising.VampireCommandFramework" Version="0.8.*" />
23-
<PackageReference Include="VRising.Bloodstone" Version="0.1.*" />
21+
<PackageReference Include="VRising.Unhollowed.Client" Version="1.0.*" />
22+
<PackageReference Include="VRising.VampireCommandFramework" Version="0.9.*" />
23+
<PackageReference Include="VRising.Bloodstone" Version="0.2.*" />
2424
</ItemGroup>
2525
</Project>

‎Plugin.cs‎

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Diagnostics;
1+
using System.Diagnostics;
22
using BepInEx;
33
using BepInEx.Logging;
44
using BepInEx.Unity.IL2CPP;
@@ -14,30 +14,29 @@ namespace Killfeed;
1414
[Bloodstone.API.Reloadable]
1515
public partial class Plugin : BasePlugin
1616
{
17-
Harmony _harmony;
18-
public static ManualLogSource Logger;
19-
public override void Load()
20-
{
21-
Logger = Log;
22-
// Plugin startup logic
23-
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} version {MyPluginInfo.PLUGIN_VERSION} is loaded!");
17+
Harmony _harmony;
18+
public static ManualLogSource Logger;
19+
public override void Load()
20+
{
21+
Logger = Log;
22+
// Plugin startup logic
23+
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} version {MyPluginInfo.PLUGIN_VERSION} is loaded!");
2424

25-
// Harmony patching
26-
_harmony = new Harmony(MyPluginInfo.PLUGIN_GUID);
27-
_harmony.PatchAll(System.Reflection.Assembly.GetExecutingAssembly());
25+
// Harmony patching
26+
_harmony = new Harmony(MyPluginInfo.PLUGIN_GUID);
27+
_harmony.PatchAll(System.Reflection.Assembly.GetExecutingAssembly());
2828

29-
// Register all commands in the assembly with VCF
30-
CommandRegistry.RegisterAll();
29+
// Register all commands in the assembly with VCF
30+
CommandRegistry.RegisterAll();
31+
Settings.Initialize(Config);
3132

32-
Settings.Initialize(Config);
33+
DataStore.LoadFromDisk();
34+
}
3335

34-
DataStore.LoadFromDisk();
35-
}
36-
37-
public override bool Unload()
38-
{
39-
CommandRegistry.UnregisterAssembly();
40-
_harmony?.UnpatchSelf();
41-
return true;
42-
}
43-
}
36+
public override bool Unload()
37+
{
38+
CommandRegistry.UnregisterAssembly();
39+
_harmony?.UnpatchSelf();
40+
return true;
41+
}
42+
}

‎README.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
![](logo.png)
22
# Killfeed - PvP Announcer and Statistics
33

4-
## `BETA`
5-
64
## Features
75
- Announce PvP kills in chat
86
- Kill Leaderboard
@@ -13,4 +11,12 @@
1311
## Upcoming features
1412
- Announce kill streaks
1513
- Announce multi-kills
16-
- Track by clan
14+
- Track by clan
15+
16+
## https://vrisingmods.com/discord
17+
18+
# Changelog
19+
- 0.2.0
20+
- Update for 1.0
21+
- 0.1.0
22+
- Initial release

‎VampireDownedHook.cs‎

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Bloodstone.API;
1+
using Bloodstone.API;
22
using HarmonyLib;
33
using ProjectM;
44
using Unity.Collections;
@@ -10,62 +10,62 @@ namespace Killfeed;
1010
[HarmonyPatch(typeof(VampireDownedServerEventSystem), nameof(VampireDownedServerEventSystem.OnUpdate))]
1111
public static class VampireDownedHook
1212
{
13-
public static void Prefix(VampireDownedServerEventSystem __instance)
14-
{
15-
var downedEvents = __instance.__query_1174204813_0.ToEntityArray(Allocator.Temp);
16-
foreach (var entity in downedEvents)
17-
{
18-
ProcessVampireDowned(entity);
19-
}
20-
}
21-
22-
private static void ProcessVampireDowned(Entity entity)
23-
{
24-
25-
if(!VampireDownedServerEventSystem.TryFindRootOwner(entity, 1, VWorld.Server.EntityManager, out var victimEntity))
26-
{
27-
Plugin.Logger.LogMessage("Couldn't get victim entity");
28-
return;
29-
}
30-
13+
public static void Prefix(VampireDownedServerEventSystem __instance)
14+
{
15+
var downedEvents = __instance.__query_1174204813_0.ToEntityArray(Allocator.Temp);
16+
foreach (var entity in downedEvents)
17+
{
18+
ProcessVampireDowned(entity);
19+
}
20+
}
21+
22+
private static void ProcessVampireDowned(Entity entity)
23+
{
24+
25+
if (!VampireDownedServerEventSystem.TryFindRootOwner(entity, 1, VWorld.Server.EntityManager, out var victimEntity))
26+
{
27+
Plugin.Logger.LogMessage("Couldn't get victim entity");
28+
return;
29+
}
30+
3131
var downBuff = entity.Read<VampireDownedBuff>();
3232

33-
33+
3434
if (!VampireDownedServerEventSystem.TryFindRootOwner(downBuff.Source, 1, VWorld.Server.EntityManager, out var killerEntity))
3535
{
3636
Plugin.Logger.LogMessage("Couldn't get victim entity");
3737
return;
3838
}
39-
39+
4040
var victim = victimEntity.Read<PlayerCharacter>();
4141

4242
Plugin.Logger.LogMessage($"{victim.Name} is victim");
4343
var unitKiller = killerEntity.Has<UnitLevel>();
44-
44+
4545
if (unitKiller)
46-
{
46+
{
4747
Plugin.Logger.LogInfo($"{victim.Name} was killed by a unit. [Not currently tracked]");
48-
return;
48+
return;
4949
}
5050

5151
var playerKiller = killerEntity.Has<PlayerCharacter>();
5252

5353
if (!playerKiller)
54-
{
55-
Plugin.Logger.LogWarning($"Let deca know there is another killer abouts and it's not a player or a unit.");
56-
return;
57-
}
58-
54+
{
55+
Plugin.Logger.LogWarning($"Killer could not be identified for {victim.Name}, if you know how to reproduce this please contact deca on discord or report on github");
56+
return;
57+
}
58+
5959
var killer = killerEntity.Read<PlayerCharacter>();
6060

6161
if (killer.UserEntity == victim.UserEntity)
62-
{
63-
Plugin.Logger.LogInfo($"{victim.Name} killed themselves. [Not currently tracked]");
64-
return;
65-
}
66-
67-
var location = victimEntity.Read<LocalToWorld>();
68-
69-
DataStore.RegisterKillEvent(victim, killer, location.Position);
70-
}
62+
{
63+
Plugin.Logger.LogInfo($"{victim.Name} killed themselves. [Not currently tracked]");
64+
return;
65+
}
66+
67+
var location = victimEntity.Read<LocalToWorld>();
68+
69+
DataStore.RegisterKillEvent(victim, killer, location.Position);
70+
}
7171
}

‎thunderstore.toml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ schemaVersion = "0.0.1"
44
[package]
55
namespace = "deca"
66
name = "Killfeed"
7-
versionNumber = "0.1.0"
7+
versionNumber = "0.2.0"
88
description = "PvP Leaderboard and Killfeed Announcements"
99
websiteUrl = "https://github.com/decaprime/Killfeed"
1010
containsNsfwContent = false
1111

1212
[package.dependencies]
13-
BepInEx-BepInExPack_V_Rising = "1.668.5"
14-
deca-VampireCommandFramework = "0.8.0"
15-
deca-Bloodstone = "0.1.4"
13+
BepInEx-BepInExPack_V_Rising = "1.691.3"
14+
deca-VampireCommandFramework = "0.9.0"
15+
deca-Bloodstone = "0.2.2"
1616

1717
[build]
1818
icon = "./logo.png"
@@ -24,6 +24,8 @@ source = "./dist"
2424
target = ""
2525

2626
[publish]
27-
repository = "https://v-rising.thunderstore.io"
27+
repository = "https://thunderstore.io"
2828
communities = ["v-rising"]
29-
categories = ["gloomrot-update", "mods", "server"]
29+
30+
[publish.categories]
31+
v-rising = ["gloomrot-update", "mods", "server"]

0 commit comments

Comments
 (0)