ServerStepInstance
A class in Root.Township, ATT.MicroTutorial.
Server-side run of one micro tutorial step: spawns its content, tells the client to spawn it, listens for player events and completes the step.
- Listed in ATT, Features and other game namespaces
- Inherits or implements
StepInstance,IServerStepInstance,IStepInstance
Constructors
| Member | What it is |
|---|---|
ServerStepInstance(IMicroTutorial tutorial, MicroTutorialStep step, IMicroTutorialSystem microTutorialSystem) | Creates a ServerStepInstance from tutorial, step and microTutorialSystem. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private readonly PlayerEventBuffer eventBuffer | Buffers player events until the step has spawned, then passes them through. |
private readonly IEventBus eventBus | The township event bus. |
private bool isCompleted | Whether the step has completed. |
private static readonly MicroTutorialLogger logger | Micro tutorial logger for this class. |
private readonly IMicroTutorialSystem tutorialSystem | The micro tutorial system, used for its sync controller. |
Properties
| Member | What it is |
|---|---|
IMicroTutorial Tutorial { get; } | The tutorial this step belongs to. |
Events
| Member | What it is |
|---|---|
event Action<IServerStepInstance> StepCompleted | Raised from Stop once the step is completed. |
Methods
10 private and internal methods
| Member | What it is |
|---|---|
private void DespawnDynamicContent() | Scene-destroys every network entity under the dynamic content transform. |
private async Task ExecuteStepLogic() | Runs the step settings' RunForInstance. |
private void ListenToForceCompleteStepEvents() | Listens for ForceCompleteTutorialStepEvent. The handler doesn't check the player, so the event completes every listening step. |
private void NotifyPlayerToSpawnStep() | Sends the spawn step command to the tutorial's player. |
private void OnForceComplete(IPlayerEvent eventInfo) | Completes the step when a force-complete event arrives. |
private void ProcessBufferedEvents() | Switches the event buffer to passthrough and checks the events buffered so far, stopping once the step completes. |
private void ProcessPlayerEvent(IPlayerEvent playerEvent) | Completes the step if the step settings say the event does. |
private async Task SpawnDynamicStepContent() | Loads the step's dynamic save data into the tutorial entity, instantiates additional static content, syncs positions and tells the client. |
private async Task SpawnStepContent() | Builds the hierarchy, spawns static content, notifies the client and spawns dynamic content. |
private void SyncTutorialEntityPositions() | Forces a position sync for every network entity in the tutorial chunk, waiting for ones not yet initialized. |