Show / Hide Table of Contents

Namespace Eco.Core.Controller

Classes

AccessNotNeeded

ActiveContractOnlyAttribute

ActiveOnly

AdminEdtiableOnly

Advanced

AliasContainsPlayer

AllowEmpty

AllowNullInView

AutogenAttribute

Can pass in the name of the UI that will be used on the client, if you want to override the default.

AutogenClassAttribute

A class that has its view autogennerated. Applying this attribute will prevent it from generating a view class in the view autogen file.

BlobController

The whole point of this class is to avoid sending same heavy data. Currently its used to avoid sending repeated strings and LocStrings that are ofter sent several times. Instead of sending same string again and again, it will save it as a byte[] and send just an id of that byte array. This way there are will be no need to send same data twice.

BsonCachedPropertyAttribute

Should be used with property having ServerRAMCached, specifies which property used as a cached counterpart of the attributed property. May be set manually or will be automatically added by Eco.Fody.SyncToViewCacheWeaving for every property with the flag. Then the getter of the cached property will be used by Eco.Core.Controller.SyncPropertyInfo instead of the property getter. When added manually then user code is responsible for cached value invalidation. May be preferred over auto-weaving when cached value is immutable or class doesn't match auto-weaving conditions.

public class Foo
{
    BSONCachedValue CachedItems { get; set; }
    [SyncToView(SyncFlags.Cached), BsonCachedProperty("CachedItems")] public List<Item> Items { get; }
    public Foo(IEnumerable<Item> items)
    {
       this.Items = items.ToList();
       this.CachedItems = BSONCachedValue.Cache(this.Items.ToBson());
    }
}
Read more details about auto-caching in Eco.Fody/README.md.

CachedAttribute

Can be used to enable caching for property. Once evaluated the property won't be recalculated until receive PropertyChanged event. It uses Fody weaving for property body replacement generation.

ClientInterfacePropertyAttribute

Specially tag interface members that should be created on the client. We cant mark them synctoview because the view system doesn't handle inherited properties well.

ClientNotification

This is used to notify several clients at same time. It saves shared value which will be converted to network packet and send to all of Related Clients via broadcasting.

ConstantViewAttribute

By applying this attribute to a controller you are assuming that it will never change and its fine to cache at first access and directly send it any future time. It also will pack to the client all related views to ensure that he can refer these views.

ControllerExtensions

ControllerManager

Manages all controllers on server-side. Controllers are server objects which has view on the client. See ContorllerPacking.md for details.

ControllerMarshaler

ControllerMarshaler helps to convert controller to client view.

ControllerMarshalerService

Service for managing IControllerMarshaler creation and providing marshaling info for ControllerManager and ViewCodeGenerator. Marshaling info then used for generating views for the client and syncing view data using ISyncMemberInfo members.

ControllerPacker

Manages all controllers on server-side. Controllers are server objects which has view on the client.

ControllerPropertyNameAttribute

Attribute marking a parameter as a controller property name for static analysis (i.e. ControllerSubscribeAnalyzer). Requires controller passed as an another parameter of same method. By default uses previous parameter as controller, but the controller parameter may be explicitly specified with optional ControllerParameterName property. A property with the attribute should exists on subject and have sync attributes like [SyncToView] or [Eco]. If property isn't constant (string literal) then it should be either parameter reference for a parameter with ControllerPropertyNameAttribute or should be suppressed with disable warning or SuppressMessage attribute.

CopyConfigsToClient

CoreAttributeExtensions

CreateComponentTabLoc

For WorldObjectComponents, ensures that a tab is created in the UI for it. The client looks for a property named ComponentTabName to determine the name. If not available then it will use class DisplayName.

DependsOnControllerAttribute

This attribute says that this view value depends on another's, so send that result as well when it changes. Note that dependencies which are not 'synctoview' will not be found. NOTE: There is another [DependeOn] attribute that is similar, but uses fody property change detection instead. That one is faster, doing it when the change occurs, while this one will queue it up for a later change call.

DerivedMustDefineIcon

THis attribute requires all children to have a [HasIcon] or [NoIcon]. Implement check on Initialization of a class it is applied to.

DontCloneAttribute

Tag properties that should not be cloned.

DontGetContext

DynamicFlags

DynamicTitleAttribute

Override the UI that is used to autogenerate the list that contains this view. Define a parameter that we query to get the name of this element.

EnabledParamAttribute

Specifies the name of another property on this same object that determines if this UI should be enabled or not. If the property using this is a list, its expcted the property pointed to is also a list.

ForceCreateViewAllDerivedAttribute

Tag for the view system to create a view even if there are no synctoview properties in the class, affects all derived classes too.

ForceCreateViewAttribute

Tag for the view system to create a view even if there are no synctoview properties in the class.

ForceSelectType

GovernmentAccountsOnly

GuestEditableAttribute

GuestHiddenAttribute

HasIconAttribute

This class has an icon to represent it on the client.

HasStaticIconAttribute

Set this when theres a custom icon name built from a static call. Function should take a type and return a string.

HasTypeLimiter

HideBooleanElections

HideDescription

HidePermanentAccounts

HideRoot

HideRootListEntry

ImmutablePropertySubscription

Immutable implementation of IPropertySubscription used by controller to prevent concurrent modifications (i.e. Eco.Shared.View.PropertySubscription may be recycled and destroy it's state).

InheritParentScanProps

InJurisdiction

LargeUI

Locked

NegatedNameAttribute

For boolean properties that serve as context, this will be the negated name that we also add to context (so the bool 'Bought' can have a negated context name 'Sold' that is shown to the player). Note: if you want a dynamic name for the tab, create a property named ComponentTabName in the class and make it synctoview.

NegativeAllowedAttribute

NoAutogenCodeAttribute

NoIconAttribute

If a parent has HasIcon and we want to override and block that, apply this tag.

NotifyAttribute

Attribute which may be used to mark a property/method as controller property which may be used in Subscribe/Changed methods. By default only properties with Eco, SyncToViewAttribute and ClientInterfacePropertyAttribute notified, but if you still need to subscribe to property without syncing to client then the attribute may be used.

OnlyHigherTierSettlements

OnlyLowerTierSettlements

OnlySettlementsAtLocation

OwnerHiddenAttribute

OwnerReadOnlyAttribute

PackageFlags

PropReadOnlyAttribute

ReadOnlyControllerAttribute

Marks when a controller is read-only, which prevents recursive subscriptions from delving into it.

RelatedFeatureAttribute

Used to highlight that the class/member is dependant on one of the features and hide/show it from client

RequiredTagAttribute

Only allow selection of this parameter among things with this tag.

SettlementChildrenAndSelf

SettlementCurrentAndCandidatesChildren

SettlementCurrentAndCandidatesParents

SettlementOnly

SettlementParentsAndSelf

ShowFullObjectAttribute

Apply this when you want to not display the reference selector, and just show the contents itself.

SortAttribute

SubscriptionUtils

SyncMemberInfoBase

Base class for ISyncMemberInfo implementations with shared logic.

SyncMethodInfo

ISyncMemberInfo for [SyncToView] methods.

SyncToViewAttribute

SyncToView denotes a property or method result as a value that exists in the view on the client. This is used on classes inheriting from IController, and will individually sync the tagged properties to the client. Important Notes:

  • If the properties never change apart from the parent, you can leave the class not derived from IController, and it will sync all [Serialized] properties. If none are tagged Serializsed, it will sync all of them. The class will need to defined in shared code in this case, as only classes deriving IController get autogenned.
  • Structs will also sync this way, syncing everything inside.

UIListTypeNameAttribute

Override the UI that is used to autogenerate the list that contains this view.

UITypeNameAttribute

Override the UI that is used to autogenerate this view.

UseDiscoveryFilter

ViewClassAttribute

Flags on view classes.

ViewCodeGenerator

ViewMemberAttribute

Flags on members of synced classes that can inform the client about how the member can be displayed and used.

ViewSelectorAttribute

Additional set of flags since ViewMemberAttribute doesn't have much free space.

ViewTypeAttribute

Defines View Type which should be used on client side instead of that type. Should be used when server and client side have same BSON serialization format, but different classes on server side and on the client. That type won't be generated and should be manually created on the client.

ViewTypeData

VisibilityParamAttribute

Specifies the name of another property on this same object that determines the bool visbility state of this property.

Interfaces

IController

  1. Needs this block to implement the interfaces int IHasUniversalID.ControllerID { get; set; }
  2. Add [SyncToView] to properties/methods you wish to synchronize with the view.

IControllerMarshaler

Base interface for all controller marshalers (enums, IController classes, primitive types).

IMvcNetClient

IParentedController

ISyncMemberInfo

Interface for SyncToViewAttribute members info. Used by ControllerManager for serialization.

☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾