Archipelago.MultiClient.Net.Analyzers
1.1.0
See the version list below for details.
dotnet add package Archipelago.MultiClient.Net.Analyzers --version 1.1.0
NuGet\Install-Package Archipelago.MultiClient.Net.Analyzers -Version 1.1.0
<PackageReference Include="Archipelago.MultiClient.Net.Analyzers" Version="1.1.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Archipelago.MultiClient.Net.Analyzers --version 1.1.0
#r "nuget: Archipelago.MultiClient.Net.Analyzers, 1.1.0"
// Install Archipelago.MultiClient.Net.Analyzers as a Cake Addin #addin nuget:?package=Archipelago.MultiClient.Net.Analyzers&version=1.1.0 // Install Archipelago.MultiClient.Net.Analyzers as a Cake Tool #tool nuget:?package=Archipelago.MultiClient.Net.Analyzers&version=1.1.0
Archipelago.MultiClient.Net.Analyzers
Source analyzers, fixes, and code generation for the Archipelago.MultiClient.Net library.
Analyzers and Diagnostics
MULTICLIENT001 - DataStorageElement assigned outside of DataStorageHelper
This warning is intended to prevent bugs which may be caused by misuse of DataStorageHelper
. The Archipelago
network protocol allows batching several data storage operations in an atomic fashion. In order to support this,
DataStorageHelper
only sends a packet to the server when a DataStorageElement
, containing the batched operations,
is re-assigned back to the DataStorageHelper
. This means that storing a DataStorageElement
into a variable can
cause undesirable side effects on the element, as well as prevent it from being sent to the server at all. Instead,
it is recommended to use a compound assignment operator to apply edits directly to the DataStorageHelper
.
This analyzer also offers a corresponding fix action "Make DataStorage access inline" on variable declarations, which will remove the offending declaration and inline it at all usage sites.
Incorrect Code:
// MULTICLIENT001
DataStorageElement elem = session.DataStorage[Scope.Slot, "MyData"];
elem.Initialize(0);
// This will never make it to the server
elem += 2;
Fixed Code:
session.DataStorage[Scope.Slot, "MyData"].Initialize(0);
// This will make it to the server
session.DataStorage[Scope.Slot, "MyData"] += 2;
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.