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(Func<S6Environment>, Func<String>, Func<HttpRequestMessage, Task>, Func<HttpClient>, Action<String>, Action<String>, Action<String>)
Declaration
public EntityClient(Func<S6Environment> getEnv, Func<string> getLicense, Func<HttpRequestMessage, Task> getHeaders, Func<HttpClient> getHttpClient, Action<string> logInfo, Action<string> logWarn, Action<string> logError)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<S6Environment> | getEnv | |
| System.Func<System.String> | getLicense | |
| System.Func<HttpRequestMessage, System.Threading.Tasks.Task> | getHeaders | |
| System.Func<HttpClient> | getHttpClient | |
| System.Action<System.String> | logInfo | |
| System.Action<System.String> | logWarn | |
| System.Action<System.String> | logError |
Methods
BanPlayersAsync(String, List<BannedUser>)
Ban a list of players for a user.
Declaration
public async Task<bool> BanPlayersAsync(string userID, List<BannedUser> players)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userID | User that is banning the players |
| List<BannedUser> | players | List of users to ban. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Boolean> | true if the ban was successful. Otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| BanException | Fail to bann players. |
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 |
|---|---|
| System.Threading.Tasks.Task |
Exceptions
| Type | Condition |
|---|---|
| ClearEntityException | Fail to delete game entities. |
ClearPlayerAsync(String, String)
Lift a player's ban.
Declaration
public async Task<bool> ClearPlayerAsync(string userID, string playerID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userID | User that banned the player |
| System.String | playerID | Player's ID to remove ban. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Boolean> | true if the ban was successfully lifted. Otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| BanException | Fail to lift player's ban. |
CreateBuild(String)
Create a new build with unity rmb and actor file types. The returned build data contains the build ID of the created build.
Declaration
public async Task<BuildData> CreateBuild(string desc)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | desc |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<BuildData> |
Exceptions
| Type | Condition |
|---|---|
| CreateBuildException |
DeleteGameEntityAsync(List<EntityDef>)
Delete game entities.
Declaration
public async Task DeleteGameEntityAsync(List<EntityDef> entities)
Parameters
| Type | Name | Description |
|---|---|---|
| List<EntityDef> | 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 |
|---|---|
| System.Threading.Tasks.Task |
Exceptions
| Type | Condition |
|---|---|
| DeleteGameEntityException | Fail to delete game entities. |
DeleteUserEntityAsync(String, List<EntityDef>)
Delete user entities.
Declaration
public async Task DeleteUserEntityAsync(string userID, List<EntityDef> entities)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userID | |
| List<EntityDef> | 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 |
|---|---|
| System.Threading.Tasks.Task |
Exceptions
| Type | Condition |
|---|---|
| DeleteUserEntityException | Fail to delete user entities. |
GetBannedUsersAsync(String)
Get a Dictionary of banned users.
Declaration
public async Task<List<BannedUser>> GetBannedUsersAsync(string userID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userID | User that banned the players |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<List<BannedUser>> | A list of banned players. |
Exceptions
| Type | Condition |
|---|---|
| BanException | Fail to get banned players list. |
GetBuilds()
Return list of builds for this game. This includes all file types.
Declaration
public async Task<List<BuildData>> GetBuilds()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<List<BuildData>> |
Exceptions
| Type | Condition |
|---|---|
| GetBuildsException |
GetGameEntitiesAsync()
Get all entities for a game.
Declaration
public async Task<List<EntityDef>> GetGameEntitiesAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<List<EntityDef>> |
Exceptions
| Type | Condition |
|---|---|
| GetGameEntityException | Fail to get game entities. |
GetGameEntityAsync(String)
Get a single game entity.
Declaration
public async Task<EntityDef> GetGameEntityAsync(string enityName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | enityName |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<EntityDef> |
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<EntityDef>> GetUserEntitiesAsync(string userID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userID |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<List<EntityDef>> |
Exceptions
| Type | Condition |
|---|---|
| GetUserEntityException | Fail to get user entities. |
GetUserEntityAsync(String, EntityType, String)
Get a single user entity.
Declaration
public async Task<EntityDef> GetUserEntityAsync(string userID, EntityType entityType, string entityName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userID | |
| EntityType | entityType | |
| System.String | entityName |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<EntityDef> |
Exceptions
| Type | Condition |
|---|---|
| GetUserEntityException | Fail to get user entity. |
UpsertGameEntityAsync(List<EntityDef>)
Update or create game entities.
Declaration
public async Task UpsertGameEntityAsync(List<EntityDef> entities)
Parameters
| Type | Name | Description |
|---|---|---|
| List<EntityDef> | entities | List of entities to upsert. License and SubjectID are automatically filled out. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Exceptions
| Type | Condition |
|---|---|
| UpsertGameEntityException | Fail to upsert game entities. |
UpsertUserEntityAsync(String, List<EntityDef>)
Update or create user entities.
Declaration
public async Task UpsertUserEntityAsync(string userID, List<EntityDef> entities)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userID | |
| List<EntityDef> | entities | List of entities to upsert. License and SubjectID are automatically filled out. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Exceptions
| Type | Condition |
|---|---|
| UpsertUserEntityException | Fail to upsert user entities. |