Skip to main content

MethodSyncStruct<T>

A class in Root.Township, Alta.Networking.

A Sync for struct values that hands the read or write to a method you pass in. Optionally resets the value to a new struct before each read.

Constructors​

MemberWhat it is
MethodSyncStruct(NetworkEntity entity, EntityMessageType messageType, SerializeMethod<T> method, bool isAlwaysRecreating = false)Creates a MethodSyncStruct from entity, messageType, method and isAlwaysRecreating.

Fields​

2 private and internal fields
MemberWhat it is
private bool isAlwaysRecreatingWhen true, the value is reset to a new T before each read.
private SerializeMethod<T> methodThe serialize method the message forwards to.

Properties​

MemberWhat it is
override SerializeMethod Handler { get; }The serialize method the sync system calls. It resets the value first when reading with isAlwaysRecreating, then calls your method with the current value.

Methods​

1 private and internal method
MemberWhat it is
private void Forward(IPlayer player, Stream stream)Calls the stored method with the player, stream and current value; resets the value to default first when reading and isAlwaysRecreating is set.

Used in​

Members of other types that take, return or hold a MethodSyncStruct&lt;T>:

ActionItem.syncEffect, PlayerEffectController.remoteTeleportEffect, ForgedModel<TB, TA>.syncComplete, Recycler.syncOutputEffect, RecyclerOutputSlot.Setup, RecyclerOutputSlot.syncMethod, Smelter.syncEffects, TimberBlock.syncPickup, TimberBlock.syncPieceEffects, TimberBlock.syncStatus, TimberBlockSpawner.syncRotation, CaveTeleporterManager.syncEffect, CaveTeleporterManager.syncProxy, GenerationBase.clientSpawn, CaveLayerStreamer.syncLayerSetup, PlayerEntitySync.syncLoaded, Cookable.syncEffect, StewManager.syncFadeOutIngredient, ConfirmationCraftingPart.syncAttemptCraft, ConfirmationCraftingPart.syncClientNailHit, ConfirmationCraftingPart.syncNail, CraftingPart.attemptCraft, DecraftingComponent.syncDecraftingHit, GenericCraftingStation.syncClientNailHit, GenericCraftingStation.syncDestroyEffect, GenericCraftingStation.syncNailHit, GenericCraftingStation.syncPiece, GenericCraftingStation.syncPieceGrab, GenericCraftingStation.syncProjectStatus, JointSlot.syncInsert, GrassManager.sync, HitModifierEffect.syncHit, ImpactDetector.syncImpact, ImpactDetectorCentral.syncImpact, SparkSecondaryDetector.syncSpark, Agent.syncEvent, FireBug.syncDrag, SeedSpray.syncBasicImpact, Wyrm.syncGameObjects, PickupDocker.requestDock, RejectDockArea.syncEffect, LiquidContainerLid.syncOpen, MapManager.syncPieceDiscovery, PullAway.syncPull, ModifiableStaticManager.syncModification, NetworkColliderGroup.syncEnabled, NetworkColliderGroup.syncIgnore, NetworkRotation.syncStatus, Book.removePage, Book.serverFlipPage, Book.setHighlight, Book.setOpen, PositionRestrictor.resetLocation, PositionRestrictor.setHaptic, PositionRestrictor.syncItem, DownedState.syncTimerIncreaseToDownedPlayer, PlayerStateBase.requestStateChange, PlayerStateManager.syncStateChange, ActionItemsManager.syncSpawnedToClient, ActionItemsManager.syncSpawnRequestToServer and 85 more.