Skip to content

Commit

Permalink
Merge pull request #14 from Vapok/vapok/r1.0.4
Browse files Browse the repository at this point in the history
Release 1.0.4
  • Loading branch information
Vapok authored Jan 21, 2023
2 parents 9a558e0 + 834bfde commit 4e997a2
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion AdventureBackpacks/AdventureBackpacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class AdventureBackpacks : BaseUnityPlugin, IPluginInfo
//Module Constants
private const string _pluginId = "vapok.mods.adventurebackpacks";
private const string _displayName = "AdventureBackpacks";
private const string _version = "1.0.3";
private const string _version = "1.0.4";

//Interface Properties
public string PluginId => _pluginId;
Expand Down
4 changes: 2 additions & 2 deletions AdventureBackpacks/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
[assembly: AssemblyVersion("1.0.4.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
3 changes: 3 additions & 0 deletions PATCHNOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Adventure Backpacks Patchnotes

# 1.0.4.0
* Fixed a rare error on Piece Manager where on local play, if there is no adminlist file, it would error in the console.
* Fixed, In the event that there are multiple language files found for the same language, LocalizationManager would fail thus failing to load the mod.
# 1.0.3.0
* Fixed Locking Server Config with Config Sync. Set 'Lock Config' to True in Server config (set while server is off)
* Various Code Refactors and reorganization of methods.
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ stage of maturity. This includes a backpack progression that will start at Meado
* v2.0.0 - To be determined!

# Current Patch Notes
# 1.0.3.0
* Fixed Locking Server Config with Config Sync. Set 'Lock Config' to True in Server config (set while server is off)
* Various Code Refactors and reorganization of methods.
* Added Config to allow inventory and bag to be closed with the same hotkey.
## 1.0.4.0
* Fixed a rare error on Piece Manager where on local play, if there is no adminlist file, it would error in the console.
* Fixed, In the event that there are multiple language files found for the same language, LocalizationManager would fail thus failing to load the mod.

## Compatible Mods (Verified)
* Epic Loot 0.9.3+
Expand Down
19 changes: 18 additions & 1 deletion Vapok.Common/Managers/LocalizationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,26 @@ private static void LoadLocalization(Localization __instance, string language)
{
localizationObjects.Add(new WeakReference<Localization>(__instance));
}


localizationLanguage.Add(__instance, language);

Dictionary<string, string> localizationFiles = Directory.GetFiles(Path.GetDirectoryName(Paths.PluginPath)!, $"{plugin.Info.Metadata.Name}.*", SearchOption.AllDirectories).Where(f => fileExtensions.IndexOf(Path.GetExtension(f)) >= 0).ToDictionary(f => Path.GetFileNameWithoutExtension(f).Split('.')[1], f => f);
Dictionary<string, string> localizationFiles = new();

var languageFilesFound = Directory
.GetFiles(Path.GetDirectoryName(Paths.PluginPath)!, $"{plugin.Info.Metadata.Name}.*",
SearchOption.AllDirectories).Where(f => fileExtensions.IndexOf(Path.GetExtension(f)) >= 0);

foreach (var languageFile in languageFilesFound)
{
var languageKey = Path.GetFileNameWithoutExtension(languageFile).Split('.')[1];
if (localizationFiles.ContainsKey(languageKey))
{
LogManager.Log.Warning($"{languageKey} has already been added. {languageFile} not added.");
continue;
}
localizationFiles.Add(languageKey, languageFile);
}

if (LoadTranslationFromAssembly("English") is not { } englishAssemblyData)
{
Expand Down
2 changes: 1 addition & 1 deletion Vapok.Common/Managers/PieceManager/PieceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ class RegisterClientRPCPatch
{
private static void Postfix(ZNet __instance, ZNetPeer peer)
{
if (!__instance.IsServer())
if (!__instance.IsServer() || __instance.m_adminList == null)
{
peer.m_rpc.Register<ZPackage>(BuildPiece._plugin?.Info.Metadata.Name + " PMAdminStatusSync",
RPC_InitialAdminSync);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AdventureBackpacks",
"version_number": "1.0.3",
"version_number": "1.0.4",
"website_url": "https://github.com/Vapok/AdventureBackpacks",
"description": "A Valheim Mod to add Adventuring Backpacks to the Game. These packs will grow and become more useful as the game progresses.",
"dependencies": [
Expand Down

0 comments on commit 4e997a2

Please sign in to comment.