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(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

TypeNameDescription
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

TypeNameDescription
System.StringuserID

User that is banning the players

List<BannedUser>players

List of users to ban.

Returns

TypeDescription
System.Threading.Tasks.Task<System.Boolean>

true if the ban was successful. Otherwise, false.

Exceptions

TypeCondition
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

TypeNameDescription
EntityTypeentityType
System.StringentityName

Returns

TypeDescription
System.Threading.Tasks.Task

Exceptions

TypeCondition
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

TypeNameDescription
System.StringuserID

User that banned the player

System.StringplayerID

Player's ID to remove ban.

Returns

TypeDescription
System.Threading.Tasks.Task<System.Boolean>

true if the ban was successfully lifted. Otherwise, false.

Exceptions

TypeCondition
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

TypeNameDescription
System.Stringdesc

Returns

TypeDescription
System.Threading.Tasks.Task<BuildData>

Exceptions

TypeCondition
CreateBuildException

DeleteGameEntityAsync(List<EntityDef>)

Delete game entities.

Declaration

public async Task DeleteGameEntityAsync(List<EntityDef> entities)

Parameters

TypeNameDescription
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

TypeDescription
System.Threading.Tasks.Task

Exceptions

TypeCondition
DeleteGameEntityException

Fail to delete game entities.

DeleteUserEntityAsync(String, List<EntityDef>)

Delete user entities.

Declaration

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

Parameters

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

TypeDescription
System.Threading.Tasks.Task

Exceptions

TypeCondition
DeleteUserEntityException

Fail to delete user entities.

GetBannedUsersAsync(String)

Get a Dictionary of banned users.

Declaration

public async Task<List<BannedUser>> GetBannedUsersAsync(string userID)

Parameters

TypeNameDescription
System.StringuserID

User that banned the players

Returns

TypeDescription
System.Threading.Tasks.Task<List<BannedUser>>

A list of banned players.

Exceptions

TypeCondition
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

TypeDescription
System.Threading.Tasks.Task<List<BuildData>>

Exceptions

TypeCondition
GetBuildsException

GetGameEntitiesAsync()

Get all entities for a game.

Declaration

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

Returns

TypeDescription
System.Threading.Tasks.Task<List<EntityDef>>

Exceptions

TypeCondition
GetGameEntityException

Fail to get game entities.

GetGameEntityAsync(String)

Get a single game entity.

Declaration

public async Task<EntityDef> GetGameEntityAsync(string enityName)

Parameters

TypeNameDescription
System.StringenityName

Returns

TypeDescription
System.Threading.Tasks.Task<EntityDef>

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<EntityDef>> GetUserEntitiesAsync(string userID)

Parameters

TypeNameDescription
System.StringuserID

Returns

TypeDescription
System.Threading.Tasks.Task<List<EntityDef>>

Exceptions

TypeCondition
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

TypeNameDescription
System.StringuserID
EntityTypeentityType
System.StringentityName

Returns

TypeDescription
System.Threading.Tasks.Task<EntityDef>

Exceptions

TypeCondition
GetUserEntityException

Fail to get user entity.

UpsertGameEntityAsync(List<EntityDef>)

Update or create game entities.

Declaration

public async Task UpsertGameEntityAsync(List<EntityDef> entities)

Parameters

TypeNameDescription
List<EntityDef>entities

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

Returns

TypeDescription
System.Threading.Tasks.Task

Exceptions

TypeCondition
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

TypeNameDescription
System.StringuserID
List<EntityDef>entities

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

Returns

TypeDescription
System.Threading.Tasks.Task

Exceptions

TypeCondition
UpsertUserEntityException

Fail to upsert user entities.