Skip to content

Commit

Permalink
Update package refs
Browse files Browse the repository at this point in the history
  • Loading branch information
Digitalroot committed Dec 1, 2021
1 parent 89fda39 commit c189e7b
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 42 deletions.
128 changes: 128 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
*.sln merge=binary
*.csproj merge=binary
*.vbproj merge=binary
*.vcxproj merge=binary
*.vcproj merge=binary
*.dbproj merge=binary
*.fsproj merge=binary
*.lsproj merge=binary
*.wixproj merge=binary
*.modelproj merge=binary
*.sqlproj merge=binary
*.wwaproj merge=binary
*.user merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
*.jpg binary
*.jpeg binary
*.png binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
# SVG treated as an asset (binary) by default.
# *.svg text
# If you want to treat it as binary,
# use the following line instead.
*.svg binary
*.eps binary
*.webp binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.bibtex text diff=bibtex
*.md text
*.tex text diff=tex
*.adoc text
*.textile text
*.mustache text
*.csv text
*.tab text
*.tsv text
*.txt text
*.sql text
*.ps1 text
*.props text
*.config text
.DotSettings text
LICENSE text

# Scripts
*.bash text eol=lf
*.fish text eol=lf
*.sh text eol=lf
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
*.cmd text eol=crlf

# Serialisation
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text

# Archives
*.7z binary
*.gz binary
*.tar binary
*.tgz binary
*.zip binary
*.rar binary

# Unity
*.unitypackage binary
*.manifest merge=binary

# Text files where line endings should be preserved
*.patch -text

#
# Exclude files from exporting
#
.gitattributes export-ignore
.gitignore export-ignore
.gitkeep export-ignore
File renamed without changes.
7 changes: 4 additions & 3 deletions src/Digitalroot.Valheim.Common.Utils.sln
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31515.178
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Digitalroot.Valheim.Common.Utils", "Digitalroot.Valheim.Common.Utils\Digitalroot.Valheim.Common.Utils.csproj", "{0471A9E8-849B-4CF8-9F9C-509A52DFDCDE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{538AE9FE-4607-4E9E-84AD-F9BDC01941FE}"
ProjectSection(SolutionItems) = preProject
..\.gitattributes = ..\.gitattributes
..\.gitignore = ..\.gitignore
..\LICENSE = ..\LICENSE
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{BCAE0D15-8650-4F22-85DD-CB0257FBB5DE}"
Expand All @@ -19,7 +21,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{AEF35CB5-96F3-4E94-969F-45FB4AF9DD50}"
ProjectSection(SolutionItems) = preProject
..\docs\LICENSE = ..\docs\LICENSE
..\docs\README.md = ..\docs\README.md
EndProjectSection
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,21 @@
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Digitalroot.Valheim.Common.Log" Version="1.1.12" />
<PackageReference Include="Digitalroot.Valheim.Common.References" Version="0.204.5" />
</ItemGroup>

<ItemGroup>
<None Include="ico\ValheimRcon_black.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.16">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Digitalroot.Valheim.Common.Log" Version="1.1.14">
<ExcludeAssets></ExcludeAssets>
</PackageReference>
<PackageReference Include="Digitalroot.Valheim.Common.References" Version="0.205.6" />
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions src/Digitalroot.Valheim.Common.Utils/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "<Pending>", Scope = "member", Target = "~M:Digitalroot.Valheim.Common.Utils.Spawn(System.String,UnityEngine.GameObject,UnityEngine.Vector3,UnityEngine.Transform)~UnityEngine.GameObject")]
25 changes: 11 additions & 14 deletions src/Digitalroot.Valheim.Common.Utils/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public static DirectoryInfo AssemblyDirectory
{
get
{
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
var codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new(codeBase);
var fileInfo = new FileInfo(Uri.UnescapeDataString(uri.Path));
return fileInfo.Directory;
}
Expand Down Expand Up @@ -97,7 +97,7 @@ public static IEnumerable<string> AllNames(Type type)
public static Vector3 GetLocalPlayersPosition() => Player.m_localPlayer.transform.position;

[UsedImplicitly]
public static ObjectDB GetObjectDB() => ObjectDB.instance != null ? ObjectDB.instance : null;
public static ObjectDB GetObjectDB() => ObjectDB.instance;

[UsedImplicitly]
public static string GetPluginPath(Type modPluginType) => Path.GetDirectoryName(modPluginType.Assembly.Location);
Expand All @@ -111,25 +111,22 @@ public static IEnumerable<string> AllNames(Type type)
[UsedImplicitly]
public static T GetPrivateField<T>(object instance, string name)
{
FieldInfo var = instance.GetType().GetField(name, BindingFlags.NonPublic | BindingFlags.Instance);
var var = instance.GetType().GetField(name, BindingFlags.NonPublic | BindingFlags.Instance);

if (var == null)
{
Log.Error(Logger,"Variable " + name + " does not exist on type: " + instance.GetType());
return default(T);
}
if (var != null) return (T)var.GetValue(instance);
Log.Error(Logger,"Variable " + name + " does not exist on type: " + instance.GetType());
return default;

return (T) var.GetValue(instance);
}

[UsedImplicitly]
public static object InvokePrivate(object instance, string name, object[] args = null)
{
MethodInfo method = instance.GetType().GetMethod(name, BindingFlags.NonPublic | BindingFlags.Instance);
var method = instance.GetType().GetMethod(name, BindingFlags.NonPublic | BindingFlags.Instance);

if (method == null)
{
Type[] types = args == null ? Type.EmptyTypes : args.Select(arg => arg.GetType()).ToArray();
var types = args == null ? Type.EmptyTypes : args.Select(arg => arg.GetType()).ToArray();
method = instance.GetType().GetMethod(name, types);
}

Expand Down Expand Up @@ -183,7 +180,7 @@ public static string Localize(string value)
[UsedImplicitly]
public static Vector3 GetStartTemplesPosition()
{
if (ZoneSystem.instance.FindClosestLocation("StartTemple", Vector3.zero, out ZoneSystem.LocationInstance locationInstance))
if (ZoneSystem.instance.FindClosestLocation("StartTemple", Vector3.zero, out var locationInstance))
{
Log.Trace(Logger, $"[GetStartTemplesPosition] StartTemple at {locationInstance.m_position}");
return locationInstance.m_position;
Expand All @@ -196,7 +193,7 @@ public static Vector3 GetStartTemplesPosition()
[UsedImplicitly]
public static void SetPrivateField(object instance, string name, object value)
{
FieldInfo var = instance.GetType().GetField(name, BindingFlags.NonPublic | BindingFlags.Instance);
var var = instance.GetType().GetField(name, BindingFlags.NonPublic | BindingFlags.Instance);

if (var == null)
{
Expand Down
39 changes: 19 additions & 20 deletions src/Digitalroot.Valheim.Common.Utils/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,40 @@
"version": 1,
"dependencies": {
".NETFramework,Version=v4.6.2": {
"Digitalroot.Valheim.Common.Log": {
"BepInEx.Core": {
"type": "Direct",
"requested": "[1.1.12, )",
"resolved": "1.1.12",
"contentHash": "B3hSoUf7LmO5kRdmn4Wi2NLFkAve24LSpTTFAL1F8DfoDPWE5m6jqqhH46H0wtTq/nGcqCTwNZ01GNQWncoKPw==",
"requested": "[5.4.16, )",
"resolved": "5.4.16",
"contentHash": "ywMFKW0SInV5U8h3mluStFI2xTJdrIaL8PLgrUMMhEA17NUZOKj8ZdlTu1Qoz6QJQslhp7b6KtwTOJXuAy9D+Q==",
"dependencies": {
"BepInEx.BaseLib": "5.4.16",
"BepInEx.Core": "5.4.16",
"Digitalroot.Valheim.Common.Json": "1.0.13"
"HarmonyX": "2.5.5"
}
},
"Digitalroot.Valheim.Common.Log": {
"type": "Direct",
"requested": "[1.1.14, )",
"resolved": "1.1.14",
"contentHash": "+w/4bla2r6TRvFagSjxfozcnqDiH/xPfD33QtTECkQj6LZPQtZOM8IA1zeV/77mIECpbMyomJAHTVURtFFlF0w==",
"dependencies": {
"Digitalroot.Valheim.Common.Json": "1.0.14"
}
},
"Digitalroot.Valheim.Common.References": {
"type": "Direct",
"requested": "[0.204.5, )",
"resolved": "0.204.5",
"contentHash": "5+E+7FDWDKAYzL8A1GfBFWmxu2p6LLbd+D5PR79RCAVmJTn/b2cPXdTCiNNe5/msrcpdyaGT3GFra1AjY/V+aA=="
"requested": "[0.205.6, )",
"resolved": "0.205.6",
"contentHash": "zXSnFD/lHssUcRpM/gciECcTNW5CXa/GyWXaqHM5labGjLW4ALui5cxuZuoD5N2pjt98bHLKdGFIm1xGIfO+IA=="
},
"BepInEx.BaseLib": {
"type": "Transitive",
"resolved": "5.4.16",
"contentHash": "DydXiAQqbb1mqC++WlwYqwJ5DN7o+jM8LSQ8P43t82WCAkJFny0ode48brrD6vilDQuxZ621SOK9uuI3xo3Gyg=="
},
"BepInEx.Core": {
"type": "Transitive",
"resolved": "5.4.16",
"contentHash": "ywMFKW0SInV5U8h3mluStFI2xTJdrIaL8PLgrUMMhEA17NUZOKj8ZdlTu1Qoz6QJQslhp7b6KtwTOJXuAy9D+Q==",
"dependencies": {
"BepInEx.BaseLib": "5.4.16",
"HarmonyX": "2.5.5"
}
},
"Digitalroot.Valheim.Common.Json": {
"type": "Transitive",
"resolved": "1.0.13",
"contentHash": "OQAKK7D9+HHYSy8wi87C7s++6TFiTlE6oFPe1oqnO737ZUEQ1Ja0hb5AKjucaES9NdT9di7mk3sg48ajmv4RIQ==",
"resolved": "1.0.14",
"contentHash": "4ogco1dwkUwExMfr23rV69SH6KqgyUA4P+Vtims8K53WPg8+5IIf6vHfcnk9HMrKxMm53CA83BVYlemL0grwkg==",
"dependencies": {
"UnityEngine.Modules": "[2019.4.32]",
"fastJSON": "2.4.0.4"
Expand Down

0 comments on commit c189e7b

Please sign in to comment.