Class DataStorageHelper
- Namespace
- Archipelago.MultiClient.Net.Helpers
- Assembly
- Archipelago.MultiClient.Net.dll
Provides access to a server side data storage to share and store values across sessions and players
public class DataStorageHelper : IDataStorageHelper, IDataStorageWrapper
- Inheritance
-
DataStorageHelper
- Implements
- Inherited Members
Properties
this[Scope, string]
Stored or retrieves a value from the server side data storage. Assignment operations like = or *= will run asynchronously on server only The retrievals are done synchronously however this storage is implemented using deferred execution.
public DataStorageElement this[Scope scope, string key] { get; set; }
Parameters
scope
ScopeThe scope of the key
key
stringThe key for which the value should be stored or retrieved
Property Value
- DataStorageElement
A value
this[string]
Stored or retrieves a value from the server side data storage. Assignment operations like = or *= will run asynchronously on server only The retrievals are done synchronously however this storage is implemented using deferred execution.
public DataStorageElement this[string key] { get; set; }
Parameters
key
stringThe key under which the value should be stored or retrieved
Property Value
- DataStorageElement
A value
Methods
GetClientStatus(int?, int?)
Retrieves the client status for the specified player slot and team
public ArchipelagoClientState GetClientStatus(int? slot = null, int? team = null)
Parameters
slot
int?the slot id of the player to request the status for, defaults to the current player's slot if left empty
team
int?the team id of the player to request the status for, defaults to the current player's team if left empty
Returns
- ArchipelagoClientState
The status of the client or null if the slot or team does not exist
GetClientStatusAsync(Action<ArchipelagoClientState>, int?, int?)
Retrieves the client status for the specified player slot and team
public void GetClientStatusAsync(Action<ArchipelagoClientState> onStatusRetrieved, int? slot = null, int? team = null)
Parameters
onStatusRetrieved
Action<ArchipelagoClientState>the method to call with the retrieved client status
slot
int?the slot id of the player to request the status for, defaults to the current player's slot if left empty
team
int?the team id of the player to request the status for, defaults to the current player's team if left empty
GetHints(int?, int?)
Retrieves all unlocked hints for the specified player slot and team
public Hint[] GetHints(int? slot = null, int? team = null)
Parameters
slot
int?the slot id of the player to request hints for, defaults to the current player's slot if left empty
team
int?the team id of the player to request hints for, defaults to the current player's team if left empty
Returns
- Hint[]
An array of unlocked hints or null if the slot or team does not exist
GetHintsAsync(Action<Hint[]>, int?, int?)
Retrieves all unlocked hints for the specified player slot and team
public void GetHintsAsync(Action<Hint[]> onHintsRetrieved, int? slot = null, int? team = null)
Parameters
onHintsRetrieved
Action<Hint[]>the method to call with the retrieved hints
slot
int?the slot id of the player to request hints for, defaults to the current player's slot if left empty
team
int?the team id of the player to request hints for, defaults to the current player's team if left empty
GetItemNameGroups(string)
Retrieves the defined item name groups for the specified game
public Dictionary<string, string[]> GetItemNameGroups(string game = null)
Parameters
game
stringthe game name to request item name groups for, defaults to the current player's game if left empty
Returns
- Dictionary<string, string[]>
An Dictionary with item group names for keys and an array of item names as value
GetItemNameGroupsAsync(Action<Dictionary<string, string[]>>, string)
Retrieves the defined item name groups for the specified game
public void GetItemNameGroupsAsync(Action<Dictionary<string, string[]>> onItemNameGroupsRetrieved, string game = null)
Parameters
onItemNameGroupsRetrieved
Action<Dictionary<string, string[]>>the method to call with the retrieved item name groups
game
stringthe game name to request item name groups for, defaults to the current player's game if left empty
GetLocationNameGroups(string)
Retrieves the defined location name groups for the specified game
public Dictionary<string, string[]> GetLocationNameGroups(string game = null)
Parameters
game
stringthe game name to request location name groups for, defaults to the current player's game if left empty
Returns
- Dictionary<string, string[]>
An Dictionary with location group names for keys and an array of location names as value
GetLocationNameGroupsAsync(Action<Dictionary<string, string[]>>, string)
Retrieves the defined location name groups for the specified game
public void GetLocationNameGroupsAsync(Action<Dictionary<string, string[]>> onLocationNameGroupsRetrieved, string game = null)
Parameters
onLocationNameGroupsRetrieved
Action<Dictionary<string, string[]>>the method to call with the retrieved location name groups
game
stringthe game name to request location name groups for, defaults to the current player's game if left empty
GetRaceMode()
Retrieves the server's race mode setting. false for disabled or unavailable, true for enabled
public bool GetRaceMode()
Returns
- bool
The race mode setting. false for disabled or unavailable, true for enabled
GetRaceModeAsync(Action<bool>)
Retrieves the server's race mode setting. false for disabled or unavailable, true for enabled
public void GetRaceModeAsync(Action<bool> onRaceModeRetrieved)
Parameters
GetSlotData(int?)
Retrieves the custom slot data for the specified slot
public Dictionary<string, object> GetSlotData(int? slot = null)
Parameters
slot
int?the slot id of the player to request slot data for, defaults to the current player's slot if left empty
Returns
- Dictionary<string, object>
An Dictionary with string keys, and custom defined values, the keys and values differ per game
GetSlotDataAsync(Action<Dictionary<string, object>>, int?)
Retrieves the custom slot data for the specified slot
public void GetSlotDataAsync(Action<Dictionary<string, object>> onSlotDataRetrieved, int? slot = null)
Parameters
onSlotDataRetrieved
Action<Dictionary<string, object>>the method to call with the retrieved slot data
slot
int?the slot id of the player to request slot data for, defaults to the current player's slot if left empty
GetSlotDataAsync<T>(Action<T>, int?)
Retrieves the custom slot data for the specified slot
public void GetSlotDataAsync<T>(Action<T> onSlotDataRetrieved, int? slot = null) where T : class
Parameters
onSlotDataRetrieved
Action<T>the method to call with the retrieved slot data
slot
int?the slot id of the player to request slot data for, defaults to the current player's slot if left empty
Type Parameters
T
The type to convert the slot data to
GetSlotData<T>(int?)
Retrieves the custom slot data for the specified slot
public T GetSlotData<T>(int? slot = null) where T : class
Parameters
slot
int?The slot ID of the player ot request slot data for, defaults to the current player's slot if left empty
Returns
- T
The slot data, converted to a modeled object of the specified type
Type Parameters
T
The type to convert the slot data to
TrackClientStatus(Action<ArchipelagoClientState>, bool, int?, int?)
Sets a callback to be called with all updates to the client status for the specified player slot and team
public void TrackClientStatus(Action<ArchipelagoClientState> onStatusUpdated, bool retrieveCurrentClientStatus = true, int? slot = null, int? team = null)
Parameters
onStatusUpdated
Action<ArchipelagoClientState>the method to call with the updated hints
retrieveCurrentClientStatus
boolshould the current status be retrieved or just the updates
slot
int?the slot id of the player to request the status for, defaults to the current player's slot if left empty
team
int?the team id of the player to request the status for, defaults to the current player's team if left empty
TrackHints(Action<Hint[]>, bool, int?, int?)
Sets a callback to be called with all updates to the unlocked hints for the specified player slot and team
public void TrackHints(Action<Hint[]> onHintsUpdated, bool retrieveCurrentlyUnlockedHints = true, int? slot = null, int? team = null)
Parameters
onHintsUpdated
Action<Hint[]>the method to call with the updated hints
retrieveCurrentlyUnlockedHints
boolshould the currently unlocked hints be retrieved or just the updates
slot
int?the slot id of the player to request hints for, defaults to the current player's slot if left empty
team
int?the team id of the player to request hints for, defaults to the current player's team if left empty