Show / Hide Table of Contents

Class UserTextureManagerServer

Holds user texture registrar and texture saving/conversion logic.

Inheritance
System.Object
UserTextureManagerServer
Implements
IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged
Namespace: Eco.Gameplay.Systems.UserTextures
Assembly: Eco.Gameplay.dll
Syntax
public class UserTextureManagerServer : Singleton<UserTextureManagerServer>, IController, IViewController, IHasUniversalID, INotifyPropertyChanged

Constructors

UserTextureManagerServer()

Declaration
public UserTextureManagerServer()

Fields

Init

Declaration
public Initializer Init
Field Value
Type Description
Initializer

UserTextures

Declaration
public Registrar<UserTexture> UserTextures
Field Value
Type Description
Registrar<UserTexture>

Properties

AdditionalReviewers

Declaration
public ControllerList<User> AdditionalReviewers { get; set; }
Property Value
Type Description
ControllerList<User>

Config

Declaration
public UserTextureConfig Config { get; }
Property Value
Type Description
UserTextureConfig

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.

Remarks

Only Admins or Devs can do this action.

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
Type Name Description
User user
TextureReviewState state
Returns
Type Description
System.Collections.Generic.IEnumerable<UserTexture>

Initialize()

Declaration
public void Initialize()

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
Type Name Description
UserTexture tex

ReadTextureFromStorage(UserTexture)

Declaration
public byte[] ReadTextureFromStorage(UserTexture texture)
Parameters
Type Name Description
UserTexture texture
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.

Remarks

Only Admins or Devs can do this action.

RemoveTextureFromRegistrar(UserTexture)

Declaration
public void RemoveTextureFromRegistrar(UserTexture textureToDelete)
Parameters
Type Name Description
UserTexture textureToDelete

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

IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾