Skip to content

Commit

Permalink
chore: bump version to 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nwesterhausen committed May 29, 2024
1 parent cabb10f commit 885f157
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 159 deletions.
25 changes: 16 additions & 9 deletions DiscordConnector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<PropertyGroup>
<!-- Set the path to the game folder. This is used when including references below -->
<GamePath Condition="$(GamePath) == ''">C:\Program Files (x86)\Steam\steamapps\common\Valheim</GamePath>
<GamePath Condition="$(GamePath) == ''">G:\Valheim\0.218.15</GamePath>
<!-- Make the references to folders used in the build process a lot simpler -->
<BinDir>$(ProjectDir)bin/</BinDir>
<DiscordConnectorDir>$(BinDir)DiscordConnector/</DiscordConnectorDir>
Expand All @@ -29,7 +29,8 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3"
PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand All @@ -53,15 +54,17 @@
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>$(ValheimManagedLibs)\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<Reference
Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>$(ValheimManagedLibs)\UnityEngine.CoreModule.dll</HintPath>
</Reference>
</ItemGroup>

<Target Name="PreparePluginDir" AfterTargets="PrepareForBuild">
<!-- Create the artifact output location (if it doesn't exist) -->
<MakeDir Directories="$(DiscordConnectorDir)" Condition="!Exists('$(DiscordConnectorDir)')" />
<MakeDir Directories="$(DiscordConnectorDir)plugins" Condition="!Exists('$(DiscordConnectorDir)plugins')" />
<MakeDir Directories="$(DiscordConnectorDir)plugins"
Condition="!Exists('$(DiscordConnectorDir)plugins')" />
<!-- Make a reference to children of the output location -->
<ItemGroup>
<OldBuildArtifacts Include="$(DiscordConnectorDir)**\*" />
Expand All @@ -75,7 +78,7 @@
<BuiltLibraryAndDeps Include="$(TargetDir)DiscordConnector.dll" />
<!-- Include Newtonsoft.Json dependency -->
<BuiltLibraryAndDeps Include="$(TargetDir)Newtonsoft.Json.dll" />
<BuiltLibraryAndDeps Include="$(ValheimManagedLibs)\System.Runtime.Serialization.dll"/>
<BuiltLibraryAndDeps Include="$(ValheimManagedLibs)\System.Runtime.Serialization.dll" />
<!-- Include LiteDB dependency -->
<BuiltLibraryAndDeps Include="$(TargetDir)LiteDB.dll" />
<!-- Metadata files for Thunderstore -->
Expand All @@ -84,14 +87,18 @@
<ThunderstoreMetadata Include="$(MetadataDir)README.md" />
</ItemGroup>
<!-- Plugin files go into a 'plugins' subdirectory -->
<Copy SourceFiles="@(BuiltLibraryAndDeps)" DestinationFolder="$(DiscordConnectorDir)plugins" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(BuiltLibraryAndDeps)" DestinationFolder="$(DiscordConnectorDir)plugins"
SkipUnchangedFiles="true" />
<!-- Metadata files go into the base directory -->
<Copy SourceFiles="@(ThunderstoreMetadata)" DestinationFolder="$(DiscordConnectorDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(ThunderstoreMetadata)" DestinationFolder="$(DiscordConnectorDir)"
SkipUnchangedFiles="true" />
</Target>

<Target Name="ZipPlugin" AfterTargets="CopyPluginFiles">
<!-- Remove the zip file if it exists, so that we can create a new one. -->
<Delete Files="$(BinDir)DiscordConnector.zip" Condition="Exists('$(BinDir)DiscordConnector.zip')" />
<ZipDirectory SourceDirectory="$(DiscordConnectorDir)" DestinationFile="$(BinDir)DiscordConnector.zip" />
<Delete Files="$(BinDir)DiscordConnector.zip"
Condition="Exists('$(BinDir)DiscordConnector.zip')" />
<ZipDirectory SourceDirectory="$(DiscordConnectorDir)"
DestinationFile="$(BinDir)DiscordConnector.zip" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion Metadata/DiscordConnector-Nexus.readme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DISCORD CONNECTOR - 2.1.17
DISCORD CONNECTOR - 2.2.0
Connect your Valheim server to a Discord Webhook. Works for both dedicated and client-hosted servers. (Visit the github repo for a how-to guide.)

:: REQUIREMENTS ::
Expand Down
153 changes: 7 additions & 146 deletions Metadata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,153 +34,14 @@ See the [current roadmap](https://github.com/nwesterhausen/valheim-discordconnec

## Changelog

## Version 2.1.17
## Version 2.2.0

Fixes:
Features

- Build against latest Valheim version
- Working time online leaderboard (@jterrace)

## Version 2.1.16
Fixes

Fixes:

- include additional JSON dependency

## Version 2.1.15

Fixes:

- updated to valheim 0.217.27 and new BepInEx 2201

## Version 2.1.14

Fixes:

- error from ZDOID property changes preventing player actions being sent
- bumps BepInEx dependency to latest on Thunderstore

## Version 2.1.13

Features:

- Added send shouts in all caps toggle.
- Added the "Log Debug Messages" setting for improved troubleshooting.

Fixes:

- Updated build against Valheim 0.215.2

## Version 2.1.12

Update to Valheim 0.214.300

## Version 2.1.11

This is for build 0.214.2 onward of Valheim. The signature of the chat messages was changed which was causing an argument out of bounds exception with Discord Connector.

Fixes:

- Argument out of bounds exception which was occurring.

## Version 2.1.10

Thanks a lot to everyone who reported and helped resolve this error. Missed it in my initial testing because I was eager to test both webhooks and didn't end up testing with only one set.

Fixes:

- Null pointer error which would spam when only 1 webhook was set

## Version 2.1.9

Adds a requested feature for a second webhook. Both webhooks can be configured to accept messages of any type that Discord
Connector sends, and by default (to be non-breaking) they will send all messages (which is the behavior of 2.1.8 and previous).
Some plugins which may make use of Discord Connector's webhook to send messages can use the same method for sending and will
be tagged as 'other' webhook events. For a full list of what webhook events can be configured, see the
[documentation](https://discordconnector.valheim.nwest.games/config/main.html#webhook-events).

Features:

- Adds a second webhook entry
- Adds webhook events configuration entries (webhooks can be configured to only send certain messages)

Fixes:

- Empty leaderboards now send an empty leaderboard (instead of not sending anything)
- Configuration for how to differentiate players may have swapped the Name and NameAndPlayerId definitions

### Version 2.1.8

Fixes:

- Leader boards not being sent (but active players were)

### Version 2.1.7

Fixes:

- Death messages weren't respecting the POS enabled setting

### Version 2.1.6

Changes:

- Regress web request async changes until more reliable method is determined.

### Version 2.1.5

Fixes:

- Players leaving were being recorded as joining in the database

Changes:

- Web Request methods changed to used Async methods and `ContinueWith` instead of dispatching a task
- `%PUBLIC_IP%` variable now gets its information by asking the server instead of finding out itself

### Version 2.1.4

Fixes:

- Death messages were referencing "LeavePosEnabled" instead of "DeathPosEnabled"
- Shout messages were referencing "PingPosEnabled" instead of "ShoutPosEnabled"

### Version 2.1.3

Fixes:

- Extra JSON data was getting sent to Discord when some LiteDB lookups were happening

### Version 2.1.2

Mistlands update.

### Version 2.1.1

Fixes:

- Missing dependency in final bundle (error in csharp project file)

### Version 2.1.0

A full leaderboard overhaul is in the version. The previous settings for the statistic leaderboards are depreciated in favor of configuration defined statistic leaderboard settings. Look in the `discordconnector-leaderboards.cfg` file and configure any number of the 4 leaderboards to present the kind of data you want. In addition to multiple leaderboards, there are now time-based filters for the leaderboards; restrict them to today or this week or leave them set to all-time. By default, all leaderboards are disabled. If you were using a leaderboard before, you will have to set up a leaderboard to accomplish what you were sending before and enable it. Sorry for the inconvenience but this was the safest tradeoff.

Also relating to statistic leaderboards, there is a new statistic available for the leaderboards, 'Time Online' which uses the saved 'join' and 'leave' records to estimate a player's time on the server and present that as a value. This obviously doesn't work if you had disabled one or the other pieces of tracking (either disabled recording 'join' or 'leave' stats in the toggles config file). This values are calculated when the leaderboard is created but that should be OK since it is in a non-blocking task call.

The new Active Player's Announcement can be configured to announce server activity at a pre-defined interval. Configurable stats for it include players currently online, unique players online today, unique players online this week and unique players all time. It will use the same method set in the main config file (`discordconnector.cfg`) for how to determine individual players to count unique players for these time spans.

Additionally, the configuration files are nested in a subdirectory now. This is from a request on the plugin repository. When loading 2.1.0 (or future versions), the Discord Connector config files that are in the `BepInEx/config` directory will be automatically moved to the subdirectory and loaded from there. The subdirectory is `BepInEx/config/games.nwest.valheim.discordconnector`, and the config files themselves have shortened filenames. The records database is also moved to this subdirectory and renamed `records.db`.

Features:

- Adds new tracked stat for time on server (only works if you have enabled join and leave stats) *The duration provided will probably be inaccurate*
- Adds dynamically configured leaderboards (disabled by default)
- Adds an Active Players Announcement (disabled by default)

Changes:

- Configuration files are now nested in a subdirectory (first run will migrate them automatically)
- Database file moved into the subdirectory (first run will migrate it automatically)
- `config-debug.json` file is dumped to subdirectory after config load to be useful for debugging issues with the plugin (sensitive info is redacted, i.e. the webhook url)
- Multiple-choice config options use Enums on the backend now instead of Strings (may affect `discordconnector.cfg`: How to discern players in Record Retrieval)
- Building the plugin with the optimization flag present; in my tests, startup time of a Valheim server with just DiscordConnector installed was quicker
- Public IP is only queried if it is used (by including the %PUBLICIP% variable in a message)
- Build against the Ashlands update
- Properly calculate time online (@jterrace)
- Ping show the ping POS instead of player's POS (@jimw383)
9 changes: 7 additions & 2 deletions Metadata/thunderstore.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ schemaVersion = "0.0.1"
[package]
namespace = "nwesterhausen"
name = "DiscordConnector"
versionNumber = "2.1.17"
versionNumber = "2.2.0"
description = "Connects your Valheim server to a Discord webhook. Works for both dedicated and client-hosted servers."
websiteUrl = "https://discordconnector.valheim.nwest.games/"
containsNsfwContent = false
Expand All @@ -24,4 +24,9 @@ target = "./"
[publish]
repository = "https://thunderstore.io"
communities = ["valheim"]
categories = ["hildirs-request-update", "utility", "server-side"]
categories = [
"hildirs-request-update",
"utility",
"server-side",
"ashlands-update",
]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ Thanks for the helpful contributions!
- @Digitalroot
- @nwesterhausen
- @thedefside
- @Jimw383
- @jterrace

Thanks for an excellent original plugin @aequasi!
12 changes: 12 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

A full changelog of changes, dating all the way back to the first release.

## Version 2.2.0

Features

- Working time online leaderboard (@jterrace)

Fixes

- Build against the Ashlands update
- Properly calculate time online (@jterrace)
- Ping show the ping POS instead of player's POS (@jimw383)

## Version 2.1.17

Fixes:
Expand Down
2 changes: 1 addition & 1 deletion src/PluginInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static class PluginInfo
{
public const string PLUGIN_ID = "games.nwest.valheim.discordconnector";
public const string PLUGIN_NAME = "Valheim Discord Connector";
public const string PLUGIN_VERSION = "2.1.17";
public const string PLUGIN_VERSION = "2.2.0";
public const string PLUGIN_REPO_SHORT = "github: nwesterhausen/valheim-discordconnector";
public const string PLUGIN_AUTHOR = "Nicholas Westerhausen";
public const string SHORT_PLUGIN_ID = "discordconnector";
Expand Down

0 comments on commit 885f157

Please sign in to comment.