跳到主要内容
版本:Next

ReadyM.SDK.Attributes

Classes​

ArchetypeAttribute

Declares a struct as an archetype.

ArchetypeMixinAttribute

Declares a struct as an archetype mixin.

AreaAttribute

Marks the member naming the area a networked event is in, an AreaId or an Area. A Area event goes to it rather than to the subject's area, and a AreaMaster event is checked against its master.

CellAttribute

Marks the member naming the cell an event is in, a FullCellId or a Cell. A Cell event goes to it rather than to the subject's cell, and a CellMaster event is checked against its master.

ClientToClientsAttribute

Generates a Send(...) and an On(...) handler on the client.

ClientToServerAttribute

Generates a Send(...) on the client and an On(...) handler on the server.

CreateHandlerAttribute

Runs this method on an entity right after it is created.

DeleteHandlerAttribute

Runs this method on an entity just before it is deleted.

EventHandlerAttribute

Declares a method as a network event handler. The project it is compiled into says which side runs it - game or server.

ExtendsAttribute

Adds this mixin to every entity created as the named archetype.

IncludeArchetypeAttribute

Builds this archetype on another one, taking all of its fields. Including an archetype is inheritance, so there is one at most; combine data with IncludeAttribute and mixins instead.

IncludeAttribute

Include a mixin into this archetype. Only a mixin: to build on another archetype, use IncludeArchetypeAttribute.

IndexAttribute

Indexes the shape by this property, so an entity can be found by its value. One property per shape may carry it, and writing it keeps the index current.

ModConfigAttribute

Declares a class the SDK fills from a JSON file in the mod's own folder and registers as injectable.

ModEntryAttribute

Indicates the entry point of a mod. The annotated class may declare a private void Init() method, which will be called when the mod is loaded.

NetworkedEventAttribute

Declares a struct as a network event: a message sent to the server or other players, which any mod may validate, change, cancel, or observe.

PredictableAttribute

Lets a client predict this value locally while it waits for the server confirmation of a networked event. The getter reads the guess until it is confirmed by the server or rolled back.

RpcContractsAttribute

Marks the class as containing RPC contracts. Each must be a public static partial void method with serializable parameters. Each must be annotated with one of the direction attributes:

  • ClientToServerAttribute
  • ServerToClientAttribute
  • ClientToClientsAttribute

RpcHandlersForAttribute

Binds a class to the [RpcContracts] set it implements.

ServerToClientAttribute

Generates a Send(...) on the server and an On(...) handler on the client.

ServiceAttribute

Declares a service class.

SubjectAttribute

Marks the member holding the entity a network event is about. SubjectOwner checks it, and Area and Cell take their audience from it when the event names no area or cell of its own.

TagAttribute

Puts a tag on every entity created as this archetype.

TargetAttribute

Marks the member naming the one player a Single event goes to.

UpdateOrderAttribute

Specifies when a service's update runs relative to the others.

Enums​

Delivery

How a replicated shape's changes reach the other side.

EventScope

Who receives a networked event.

Policy

Declares who can raise a network event. The server may always raise, so this applies only to clients.

RelayMode

Indicates how a ClientToClientsAttribute message is relayed to other players in the game.

Replication

Whether a shape's values are sent to the other players, and if so, which way they travel between the game and the ECS and who may write them.

Stage

When a networked event handler runs. Stages run in this order and stopping one skips every later stage; Only one of Observe and Rejected runs, based on whether the event was cancelled or not.