Archipelago.MultiClient.Net.Analyzers 1.1.0

There is a newer version of this package available.
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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Archipelago.MultiClient.Net.Analyzers" Version="1.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Archipelago.MultiClient.Net.Analyzers --version 1.1.0                
#r "nuget: Archipelago.MultiClient.Net.Analyzers, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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;
There are no supported framework assets in this package.

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.

Version Downloads Last updated
1.3.0 240 9/22/2024
1.2.0 167 8/25/2024
1.1.0 141 8/17/2024
1.0.0 117 8/12/2024