Skip to content

Commit

Permalink
2.5.2: add function to request initial state of friends list
Browse files Browse the repository at this point in the history
  • Loading branch information
jpw1991 committed Jan 13, 2024
1 parent bc2df42 commit 7890eb9
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ChebsValheimLibrary/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace ChebsValheimLibrary
{
public class Base
{
public static readonly System.Version CurrentVersion = new("2.5.1");
public static readonly System.Version CurrentVersion = new("2.5.2");

public static bool VersionCheck(System.Version version, out string message)
{
Expand Down
2 changes: 1 addition & 1 deletion ChebsValheimLibrary/ChebsValheimLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PropertyGroup>
<Title>ChebsValheimLibrary</Title>
<Description>A library which contains shared classes and things required by all my mods.</Description>
<Version>2.5.1</Version>
<Version>2.5.2</Version>
<ReleaseNotes>Initial</ReleaseNotes>
<Authors>Joshua Paul Woods</Authors>
<Owners>Joshua Paul Woods</Owners>
Expand Down
4 changes: 2 additions & 2 deletions ChebsValheimLibrary/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("2.5.1.0")]
[assembly: AssemblyFileVersion("2.5.1.0")]
[assembly: AssemblyVersion("2.5.2.0")]
[assembly: AssemblyFileVersion("2.5.2.0")]
11 changes: 11 additions & 0 deletions ChebsValheimLibrary/PvP/PvPManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ private static Dictionary<string, List<string>> PlayerFriends
set => _playerFriends = value;
}

/// <summary>
/// Make an initial request of the friends list. Best used when a player first connects to a server.
/// </summary>
public static void InitialFriendsListRequest()
{
if (!ZNet.instance.IsClientInstance() && !ZNet.instance.IsLocalInstance()) return;
var package =
new ZPackage(Encoding.UTF8.GetBytes(GetDictString + " " + Player.m_localPlayer.GetPlayerID()));
_pvPrpc.SendPackage(ZRoutedRpc.instance.GetServerPeerID(), package);
}

/// <summary>
/// Get a list of the local player's friends.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h3 id="methods">Methods
<a href="https://github.com/jpw1991/chebs-valheim-library/new/master/apiSpec/new?filename=ChebsValheimLibrary_PvP_PvPManager_ConfigureRPC.md&amp;value=---%0Auid%3A%20ChebsValheimLibrary.PvP.PvPManager.ConfigureRPC%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/jpw1991/chebs-valheim-library/blob/master/ChebsValheimLibrary/PvP/PvPManager.cs/#L96">View Source</a>
<a href="https://github.com/jpw1991/chebs-valheim-library/blob/master/ChebsValheimLibrary/PvP/PvPManager.cs/#L107">View Source</a>
</span>
<a id="ChebsValheimLibrary_PvP_PvPManager_ConfigureRPC_" data-uid="ChebsValheimLibrary.PvP.PvPManager.ConfigureRPC*"></a>
<h4 id="ChebsValheimLibrary_PvP_PvPManager_ConfigureRPC" data-uid="ChebsValheimLibrary.PvP.PvPManager.ConfigureRPC">ConfigureRPC()</h4>
Expand All @@ -177,7 +177,7 @@ <h5 class="decalaration">Declaration</h5>
<a href="https://github.com/jpw1991/chebs-valheim-library/new/master/apiSpec/new?filename=ChebsValheimLibrary_PvP_PvPManager_Friendly_System_String_System_String_.md&amp;value=---%0Auid%3A%20ChebsValheimLibrary.PvP.PvPManager.Friendly(System.String%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/jpw1991/chebs-valheim-library/blob/master/ChebsValheimLibrary/PvP/PvPManager.cs/#L86">View Source</a>
<a href="https://github.com/jpw1991/chebs-valheim-library/blob/master/ChebsValheimLibrary/PvP/PvPManager.cs/#L97">View Source</a>
</span>
<a id="ChebsValheimLibrary_PvP_PvPManager_Friendly_" data-uid="ChebsValheimLibrary.PvP.PvPManager.Friendly*"></a>
<h4 id="ChebsValheimLibrary_PvP_PvPManager_Friendly_System_String_System_String_" data-uid="ChebsValheimLibrary.PvP.PvPManager.Friendly(System.String,System.String)">Friendly(String, String)</h4>
Expand Down Expand Up @@ -237,7 +237,7 @@ <h5 class="returns">Returns</h5>
<a href="https://github.com/jpw1991/chebs-valheim-library/new/master/apiSpec/new?filename=ChebsValheimLibrary_PvP_PvPManager_GetPlayerFriends.md&amp;value=---%0Auid%3A%20ChebsValheimLibrary.PvP.PvPManager.GetPlayerFriends%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/jpw1991/chebs-valheim-library/blob/master/ChebsValheimLibrary/PvP/PvPManager.cs/#L66">View Source</a>
<a href="https://github.com/jpw1991/chebs-valheim-library/blob/master/ChebsValheimLibrary/PvP/PvPManager.cs/#L77">View Source</a>
</span>
<a id="ChebsValheimLibrary_PvP_PvPManager_GetPlayerFriends_" data-uid="ChebsValheimLibrary.PvP.PvPManager.GetPlayerFriends*"></a>
<h4 id="ChebsValheimLibrary_PvP_PvPManager_GetPlayerFriends" data-uid="ChebsValheimLibrary.PvP.PvPManager.GetPlayerFriends">GetPlayerFriends()</h4>
Expand All @@ -263,12 +263,28 @@ <h5 class="returns">Returns</h5>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/jpw1991/chebs-valheim-library/new/master/apiSpec/new?filename=ChebsValheimLibrary_PvP_PvPManager_InitialFriendsListRequest.md&amp;value=---%0Auid%3A%20ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/jpw1991/chebs-valheim-library/blob/master/ChebsValheimLibrary/PvP/PvPManager.cs/#L66">View Source</a>
</span>
<a id="ChebsValheimLibrary_PvP_PvPManager_InitialFriendsListRequest_" data-uid="ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest*"></a>
<h4 id="ChebsValheimLibrary_PvP_PvPManager_InitialFriendsListRequest" data-uid="ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest">InitialFriendsListRequest()</h4>
<div class="markdown level1 summary"><p>Make an initial request of the friends list. Best used when a player first connects to a server.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static void InitialFriendsListRequest()</code></pre>
</div>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/jpw1991/chebs-valheim-library/new/master/apiSpec/new?filename=ChebsValheimLibrary_PvP_PvPManager_UpdatePlayerFriendsDict_System_Collections_Generic_List_System_String__.md&amp;value=---%0Auid%3A%20ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List%7BSystem.String%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/jpw1991/chebs-valheim-library/blob/master/ChebsValheimLibrary/PvP/PvPManager.cs/#L199">View Source</a>
<a href="https://github.com/jpw1991/chebs-valheim-library/blob/master/ChebsValheimLibrary/PvP/PvPManager.cs/#L210">View Source</a>
</span>
<a id="ChebsValheimLibrary_PvP_PvPManager_UpdatePlayerFriendsDict_" data-uid="ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict*"></a>
<h4 id="ChebsValheimLibrary_PvP_PvPManager_UpdatePlayerFriendsDict_System_Collections_Generic_List_System_String__" data-uid="ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List{System.String})">UpdatePlayerFriendsDict(List&lt;String&gt;)</h4>
Expand Down
2 changes: 1 addition & 1 deletion ChebsValheimLibrary/_site/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@
"output": {
".html": {
"relative_path": "api/ChebsValheimLibrary.PvP.PvPManager.html",
"hash": "6Nt1sgB+MaYvbHm7OZpCm6YlrPXJLoBoCXJSWvAuSSA="
"hash": "Mvx+qN6gjYesNvmkPDSGeyGDrfNMNoCFY8YdcWnjcnQ="
}
},
"is_incremental": false,
Expand Down
13 changes: 13 additions & 0 deletions ChebsValheimLibrary/_site/xrefmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4901,6 +4901,19 @@ references:
commentId: F:ChebsValheimLibrary.PvP.PvPManager.HeavyLogging
fullName: ChebsValheimLibrary.PvP.PvPManager.HeavyLogging
nameWithType: PvPManager.HeavyLogging
- uid: ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest
name: InitialFriendsListRequest()
href: api/ChebsValheimLibrary.PvP.PvPManager.html#ChebsValheimLibrary_PvP_PvPManager_InitialFriendsListRequest
commentId: M:ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest
fullName: ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest()
nameWithType: PvPManager.InitialFriendsListRequest()
- uid: ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest*
name: InitialFriendsListRequest
href: api/ChebsValheimLibrary.PvP.PvPManager.html#ChebsValheimLibrary_PvP_PvPManager_InitialFriendsListRequest_
commentId: Overload:ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest
isSpec: "True"
fullName: ChebsValheimLibrary.PvP.PvPManager.InitialFriendsListRequest
nameWithType: PvPManager.InitialFriendsListRequest
- uid: ChebsValheimLibrary.PvP.PvPManager.UpdatePlayerFriendsDict(System.Collections.Generic.List{System.String})
name: UpdatePlayerFriendsDict(List<String>)
href: api/ChebsValheimLibrary.PvP.PvPManager.html#ChebsValheimLibrary_PvP_PvPManager_UpdatePlayerFriendsDict_System_Collections_Generic_List_System_String__
Expand Down

0 comments on commit 7890eb9

Please sign in to comment.