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.

Inheritance

System.Object
EntityClient

Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
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

TypeNameDescription
System.StringentityManagerUrl
System.Stringlicense
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

TypeNameDescription
EntityTypeentityType
System.StringentityName

Returns

TypeDescription
Task

Exceptions

TypeCondition
ClearEntityException

Fail to delete game entities.

DeleteGameEntityAsync(List<Entity>)

Delete game entities.

Declaration

public async Task DeleteGameEntityAsync(List<Entity> entities)

Parameters

TypeNameDescription
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

TypeDescription
Task

Exceptions

TypeCondition
DeleteGameEntityException

Fail to delete game entities.

DeleteUserEntityAsync(String, List<Entity>)

Delete user entities.

Declaration

public async Task DeleteUserEntityAsync(string userID, List<Entity> entities)

Parameters

TypeNameDescription
System.StringuserID
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

TypeDescription
Task

Exceptions

TypeCondition
DeleteUserEntityException

Fail to delete user entities.

GetGameEntitiesAsync()

Get all entities for a game.

Declaration

public async Task<List<Entity>> GetGameEntitiesAsync()

Returns

TypeDescription
Task<List<Entity>>

Exceptions

TypeCondition
GetGameEntityException

Fail to get game entities.

GetGameEntityAsync(String)

Get a single game entity.

Declaration

public async Task<Entity> GetGameEntityAsync(string enityName)

Parameters

TypeNameDescription
System.StringenityName

Returns

TypeDescription
Task<Entity>

Exceptions

TypeCondition
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

TypeNameDescription
System.StringuserID

Returns

TypeDescription
Task<List<Entity>>

Exceptions

TypeCondition
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

TypeNameDescription
System.StringuserID
EntityTypeentityType
System.StringentityName

Returns

TypeDescription
Task<Entity>

Exceptions

TypeCondition
GetUserEntityException

Fail to get user entity.

UpsertGameEntityAsync(List<Entity>)

Update or create game entities.

Declaration

public async Task UpsertGameEntityAsync(List<Entity> entities)

Parameters

TypeNameDescription
List<Entity>entities

List of entities to upsert. License and SubjectID are automatically filled out.

Returns

TypeDescription
Task

Exceptions

TypeCondition
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

TypeNameDescription
System.StringuserID
List<Entity>entities

List of entities to upsert. License and SubjectID are automatically filled out.

Returns

TypeDescription
Task

Exceptions

TypeCondition
UpsertUserEntityException

Fail to upsert user entities.