diff --git a/ChebsValheimLibrary/Base.cs b/ChebsValheimLibrary/Base.cs index 2fdd169..a7e4ff5 100644 --- a/ChebsValheimLibrary/Base.cs +++ b/ChebsValheimLibrary/Base.cs @@ -26,7 +26,7 @@ namespace ChebsValheimLibrary { public class Base { - public static readonly System.Version CurrentVersion = new("2.5.2"); + public static readonly System.Version CurrentVersion = new("2.5.3"); public static bool VersionCheck(System.Version version, out string message) { diff --git a/ChebsValheimLibrary/ChebsValheimLibrary.csproj b/ChebsValheimLibrary/ChebsValheimLibrary.csproj index 3a8cbe5..32de9b4 100644 --- a/ChebsValheimLibrary/ChebsValheimLibrary.csproj +++ b/ChebsValheimLibrary/ChebsValheimLibrary.csproj @@ -16,7 +16,7 @@ ChebsValheimLibrary A library which contains shared classes and things required by all my mods. - 2.5.2 + 2.5.3 Initial Joshua Paul Woods Joshua Paul Woods diff --git a/ChebsValheimLibrary/Properties/AssemblyInfo.cs b/ChebsValheimLibrary/Properties/AssemblyInfo.cs index 2d7bec9..ae9d6f9 100644 --- a/ChebsValheimLibrary/Properties/AssemblyInfo.cs +++ b/ChebsValheimLibrary/Properties/AssemblyInfo.cs @@ -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("2.5.2.0")] -[assembly: AssemblyFileVersion("2.5.2.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.5.3.0")] +[assembly: AssemblyFileVersion("2.5.3.0")] \ No newline at end of file diff --git a/ChebsValheimLibrary/PvP/PvPManager.cs b/ChebsValheimLibrary/PvP/PvPManager.cs index 292cd83..0980c44 100644 --- a/ChebsValheimLibrary/PvP/PvPManager.cs +++ b/ChebsValheimLibrary/PvP/PvPManager.cs @@ -207,19 +207,21 @@ private static Dictionary> ReadAllyFile() /// /// /// - public static void UpdatePlayerFriendsDict(List list) + /// + public static void UpdatePlayerFriendsDict(List list, Player player = null) { - UpdatePlayerFriendsDict(string.Join(",", list.Select(s => s.Trim()))); + UpdatePlayerFriendsDict(string.Join(",", list.Select(s => s.Trim())), player); } - private static void UpdatePlayerFriendsDict(string list) + private static void UpdatePlayerFriendsDict(string list, Player player = null) { - if (Player.m_localPlayer == null) + if (player == null) player = Player.m_localPlayer; + if (player == null) { Logger.LogWarning($"UpdatePlayerFriendsDict m_localPlayer is null"); return; } - var content = $"{UpdateDictString};{Player.m_localPlayer.GetPlayerName()};{list}"; + var content = $"{UpdateDictString};{player.GetPlayerName()};{list}"; var package = new ZPackage(Encoding.UTF8.GetBytes(content)); _pvPrpc.SendPackage(ZRoutedRpc.instance.GetServerPeerID(), package); } diff --git a/ChebsValheimLibrary/_site/api/ChebsValheimLibrary.PvP.PvPManager.html b/ChebsValheimLibrary/_site/api/ChebsValheimLibrary.PvP.PvPManager.html index 1945484..b3df0ba 100644 --- a/ChebsValheimLibrary/_site/api/ChebsValheimLibrary.PvP.PvPManager.html +++ b/ChebsValheimLibrary/_site/api/ChebsValheimLibrary.PvP.PvPManager.html @@ -281,13 +281,13 @@
Declaration
| - Improve this Doc + Improve this Doc - View Source + View Source -

UpdatePlayerFriendsDict(List<String>)

+

UpdatePlayerFriendsDict(List<String>, Player)

Update the server's dictionary of PvP friends for the local player. Snippet taken from Cheb's Mercenaries command for adding a friend via console.

@@ -306,7 +306,7 @@

Declaration
-
public static void UpdatePlayerFriendsDict(List<string> list)
+
public static void UpdatePlayerFriendsDict(List<string> list, Player player = null)
Parameters
@@ -323,6 +323,11 @@
Parameters
+ + + + +
list
Playerplayer
diff --git a/ChebsValheimLibrary/_site/index.html b/ChebsValheimLibrary/_site/index.html index 8a5e35c..a2383a0 100644 --- a/ChebsValheimLibrary/_site/index.html +++ b/ChebsValheimLibrary/_site/index.html @@ -82,6 +82,10 @@

Features

  • Mining
  • +
  • PvP
      +
    • Via the PvP manager, friends/allies are remembered server-side and sent to clients when needed.
    • +
    +
  • Requirements

      diff --git a/ChebsValheimLibrary/_site/manifest.json b/ChebsValheimLibrary/_site/manifest.json index 0bc9ed1..b0566b9 100644 --- a/ChebsValheimLibrary/_site/manifest.json +++ b/ChebsValheimLibrary/_site/manifest.json @@ -72,10 +72,10 @@ "output": { ".html": { "relative_path": "index.html", - "hash": "PPcR6/9PdZ9Y6/KKoJ+rCgevmT8a+BDoU9hCCdwRWKE=" + "hash": "iYxzXd5QMcAbm8DiaE1nkQV6vTRk4G8mLGNtzXpFbYw=" } }, - "is_incremental": true, + "is_incremental": false, "version": "" }, { @@ -1188,7 +1188,7 @@ "output": { ".html": { "relative_path": "api/ChebsValheimLibrary.PvP.PvPManager.html", - "hash": "Mvx+qN6gjYesNvmkPDSGeyGDrfNMNoCFY8YdcWnjcnQ=" + "hash": "c+EqehOr2tpIonZGzlTVziGevVQsMEPjJeI1q3LhXnA=" } }, "is_incremental": false, @@ -1280,7 +1280,7 @@ "can_incremental": true, "incrementalPhase": "build", "total_file_count": 5, - "skipped_file_count": 5 + "skipped_file_count": 4 }, "ManagedReferenceDocumentProcessor": { "can_incremental": true, diff --git a/ChebsValheimLibrary/_site/xrefmap.yml b/ChebsValheimLibrary/_site/xrefmap.yml index 8092440..d37e75a 100644 --- a/ChebsValheimLibrary/_site/xrefmap.yml +++ b/ChebsValheimLibrary/_site/xrefmap.yml @@ -4914,15 +4914,15 @@ references: isSpec: "True" fullName: ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest nameWithType: PvPManager.InitialFriendsListRequest -- uid: ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List{System.String}) - name: UpdatePlayerFriendsDict(List) - href: api/ChebsValheimLibrary.PvP.PvPManager.html#ChebsValheimLibrary_PvP_PvPManager_UpdatePlayerFriendsDict_System_Collections_Generic_List_System_String__ - commentId: M:ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List{System.String}) - name.vb: UpdatePlayerFriendsDict(List(Of String)) - fullName: ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List) - fullName.vb: ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List(Of System.String)) - nameWithType: PvPManager.UpdatePlayerFriendsDict(List) - nameWithType.vb: PvPManager.UpdatePlayerFriendsDict(List(Of String)) +- uid: ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List{System.String},Player) + name: UpdatePlayerFriendsDict(List, Player) + href: api/ChebsValheimLibrary.PvP.PvPManager.html#ChebsValheimLibrary_PvP_PvPManager_UpdatePlayerFriendsDict_System_Collections_Generic_List_System_String__Player_ + commentId: M:ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List{System.String},Player) + name.vb: UpdatePlayerFriendsDict(List(Of String), Player) + fullName: ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List, Player) + fullName.vb: ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List(Of System.String), Player) + nameWithType: PvPManager.UpdatePlayerFriendsDict(List, Player) + nameWithType.vb: PvPManager.UpdatePlayerFriendsDict(List(Of String), Player) - uid: ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict* name: UpdatePlayerFriendsDict href: api/ChebsValheimLibrary.PvP.PvPManager.html#ChebsValheimLibrary_PvP_PvPManager_UpdatePlayerFriendsDict_