Class UserTextureManagerServer
Holds user texture registrar and texture saving/conversion logic.
Inheritance
System.Object
UserTextureManagerServer
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
public class UserTextureManagerServer : Singleton<UserTextureManagerServer>, IController, IViewController, IHasUniversalID, INotifyPropertyChanged
Constructors
UserTextureManagerServer()
Declaration
public UserTextureManagerServer()
Fields
Init
Declaration
Field Value
UserTextures
Declaration
public Registrar<UserTexture> UserTextures
Field Value
Properties
AdditionalReviewers
Declaration
public ControllerList<User> AdditionalReviewers { get; set; }
Property Value
Config
Declaration
public UserTextureConfig Config { get; }
Property Value
ControllerID
Declaration
public ref int ControllerID { get; }
Property Value
Type |
Description |
System.Int32 |
|
UnreviewedTextureCount
Declaration
public int UnreviewedTextureCount { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
AddReviewer(User, User)
Gives the right to review textures to a non admin user.
Declaration
public void AddReviewer(User authorizer, User recipient)
Parameters
Type |
Name |
Description |
User |
authorizer |
Person that is giving the right to review textures.
|
User |
recipient |
User that will become a reviewer.
|
ApproveOrBlock(User, UserTexture, Boolean)
Approves or blocks the textureToBlock.
Declaration
public Task ApproveOrBlock(User user, UserTexture textureToReview, bool approved)
Parameters
Type |
Name |
Description |
User |
user |
|
UserTexture |
textureToReview |
|
System.Boolean |
approved |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
CreateUserTexture(Byte[], User, UserTextureType, Boolean, Boolean)
Creates a new UserTexture, adds it to registrar and returns it.
Declaration
public Task<UserTexture> CreateUserTexture(byte[] bytes, User author, UserTextureType userTextureType, bool allowEmbedding = false, bool needSaving = true)
Parameters
Type |
Name |
Description |
System.Byte[] |
bytes |
|
User |
author |
|
UserTextureType |
userTextureType |
|
System.Boolean |
allowEmbedding |
|
System.Boolean |
needSaving |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<UserTexture> |
|
GetFolderPath(Boolean)
Returns folder path to save UserTexture in.
Declaration
public static string GetFolderPath(bool isReviewed = false)
Parameters
Type |
Name |
Description |
System.Boolean |
isReviewed |
|
Returns
Type |
Description |
System.String |
|
GetTexturesToReview(User, TextureReviewState)
If this user is a reviewer - returns list of unreviewed usertextures, called from the client
Declaration
public IEnumerable<UserTexture> GetTexturesToReview(User user, TextureReviewState state)
Parameters
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<UserTexture> |
|
Initialize()
Declaration
IsReviewer(User)
Declaration
public bool IsReviewer(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
Type |
Description |
System.Boolean |
|
MoveApprovedTexture(UserTexture)
Moves texture from unreviewed folder to reviewed folder.
Declaration
public void MoveApprovedTexture(UserTexture tex)
Parameters
ReadTextureFromStorage(UserTexture)
Declaration
public byte[] ReadTextureFromStorage(UserTexture texture)
Parameters
Returns
Type |
Description |
System.Byte[] |
|
RemoveReviewer(User, User)
Removes the right to review textures from a non admin user.
Declaration
public void RemoveReviewer(User authorizer, User recipient)
Parameters
Type |
Name |
Description |
User |
authorizer |
User that is removing the right to review textures.
|
User |
recipient |
User that will stop being a reviewer.
|
RemoveTextureFromRegistrar(UserTexture)
Declaration
public void RemoveTextureFromRegistrar(UserTexture textureToDelete)
Parameters
SavePortraitTextureToStorage(UserTexture, Byte[])
Handles modifications to UserTexture as setting a new avatar portrait doesn't replace the old one, it only modifies the data.
Declaration
public Task SavePortraitTextureToStorage(UserTexture userTexture, byte[] textureData)
Parameters
Type |
Name |
Description |
UserTexture |
userTexture |
|
System.Byte[] |
textureData |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
SetReviewers(User, List<Object>)
Directly sets additional reviewers from provided list, used by MultiSelectorPopup on the client.
Declaration
public void SetReviewers(User authorizer, List<object> users)
Parameters
Type |
Name |
Description |
User |
authorizer |
|
System.Collections.Generic.List<System.Object> |
users |
List of users that will become reviewers, Empty if removing all reviewers.
|
UpdateUnreviewedTextureCount()
Declaration
public void UpdateUnreviewedTextureCount()
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
Description |
System.ComponentModel.PropertyChangedEventHandler |
|
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods