Class EntityClient
EntityManager is a cloud resource that stores game and user data. EntityClient provides functions to access EntityManager through Web API.
See EntityType for the 3 types of entity.
Guest user is able to read game entity.
A registered user is required to access user entity. However, user cannot modify UserRead entity type.
Game owner and actor have read/write access to all game and user entities.
Inherited Members
Namespace: StreamSIX.Entity
Assembly: cs.temp.dll.dll
Syntax
public class EntityClient
Constructors
EntityClient(String, String, Func<HttpRequestMessage, Task>, Func<HttpClient>, Action<String>, Action<String>, Action<String>)
Declaration
public EntityClient(string entityManagerUrl, string license, Func<HttpRequestMessage, Task> getHeaders, Func<HttpClient> getHttpClient, Action<string> logInfo, Action<string> logWarn, Action<string> logError)
Parameters
Type | Name | Description |
---|---|---|
System.String | entityManagerUrl | |
System.String | license | |
Func<HttpRequestMessage, Task> | getHeaders | |
Func<HttpClient> | getHttpClient | |
Action<System.String> | logInfo | |
Action<System.String> | logWarn | |
Action<System.String> | logError |
Methods
ClearEntityAsync(EntityType, String)
Delete the given entity for all the players of a given game.
Declaration
public async Task ClearEntityAsync(EntityType entityType, string entityName)
Parameters
Type | Name | Description |
---|---|---|
EntityType | entityType | |
System.String | entityName |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
ClearEntityException | Fail to delete game entities. |
DeleteGameEntityAsync(List<Entity>)
Delete game entities.
Declaration
public async Task DeleteGameEntityAsync(List<Entity> entities)
Parameters
Type | Name | Description |
---|---|---|
List<Entity> | entities | Data is ignored. The other entity members are used to identify an entity to delete. License and SubjectID are automatically filled out. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
DeleteGameEntityException | Fail to delete game entities. |
DeleteUserEntityAsync(String, List<Entity>)
Delete user entities.
Declaration
public async Task DeleteUserEntityAsync(string userID, List<Entity> entities)
Parameters
Type | Name | Description |
---|---|---|
System.String | userID | |
List<Entity> | entities | Data is ignored. The other entity members are used to identify an entity to delete. License and SubjectID are automatically filled out. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
DeleteUserEntityException | Fail to delete user entities. |
GetGameEntitiesAsync()
Get all entities for a game.
Declaration
public async Task<List<Entity>> GetGameEntitiesAsync()
Returns
Type | Description |
---|---|
Task<List<Entity>> |
Exceptions
Type | Condition |
---|---|
GetGameEntityException | Fail to get game entities. |
GetGameEntityAsync(String)
Get a single game entity.
Declaration
public async Task<Entity> GetGameEntityAsync(string enityName)
Parameters
Type | Name | Description |
---|---|---|
System.String | enityName |
Returns
Type | Description |
---|---|
Task<Entity> |
Exceptions
Type | Condition |
---|---|
GetGameEntityException | Fail to get game entity. |
GetUserEntitiesAsync(String)
Get all entities under a user. These can be either UserRead or UserReadWrite
Declaration
public async Task<List<Entity>> GetUserEntitiesAsync(string userID)
Parameters
Type | Name | Description |
---|---|---|
System.String | userID |
Returns
Type | Description |
---|---|
Task<List<Entity>> |
Exceptions
Type | Condition |
---|---|
GetUserEntityException | Fail to get user entities. |
GetUserEntityAsync(String, EntityType, String)
Get a single user entity.
Declaration
public async Task<Entity> GetUserEntityAsync(string userID, EntityType entityType, string entityName)
Parameters
Type | Name | Description |
---|---|---|
System.String | userID | |
EntityType | entityType | |
System.String | entityName |
Returns
Type | Description |
---|---|
Task<Entity> |
Exceptions
Type | Condition |
---|---|
GetUserEntityException | Fail to get user entity. |
UpsertGameEntityAsync(List<Entity>)
Update or create game entities.
Declaration
public async Task UpsertGameEntityAsync(List<Entity> entities)
Parameters
Type | Name | Description |
---|---|---|
List<Entity> | entities | List of entities to upsert. License and SubjectID are automatically filled out. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
UpsertGameEntityException | Fail to upsert game entities. |
UpsertUserEntityAsync(String, List<Entity>)
Update or create user entities.
Declaration
public async Task UpsertUserEntityAsync(string userID, List<Entity> entities)
Parameters
Type | Name | Description |
---|---|---|
System.String | userID | |
List<Entity> | entities | List of entities to upsert. License and SubjectID are automatically filled out. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
UpsertUserEntityException | Fail to upsert user entities. |