SyncController
A class in Root.Township, ATT.MicroTutorial.
Network messages between server and client for micro tutorials: spawn, despawn and clear step content, and the client's load acknowledgement. Built on a sync entity.
- Listed in ATT, Features and other game namespaces
- Inherits or implements
ISyncController
Constructors
| Member | What it is |
|---|---|
SyncController(NetworkEntity syncEntity) | Creates a SyncController from syncEntity. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private static readonly MicroTutorialLogger logger | Micro tutorial logger for this class. |
private readonly MethodSync notifyClientToClearTutorialSteps | Method sync for clearing steps (SyncA). |
private readonly MethodSyncStruct<DespawnStepContentCommand> notifyClientToDespawnTutorial | Struct method sync for despawning step content. |
private readonly MethodSyncStruct<SpawnStepContentCommand> notifyClientToSpawnAdditionalTutorialContentStruct | Struct method sync for spawning additional static content. |
private readonly MethodSyncStruct<SpawnStepContentCommand> notifyClientToSpawnTutorialStruct | Struct method sync for spawning static step content. |
private readonly MethodSync notifyServerClientLoadTutorialComplete | Method sync the client uses to tell the server it has loaded (PlayerMessage). |
Events
| Member | What it is |
|---|---|
event Action<IPlayer> ClientLoadCompleted | Server: raised when a client reports it has spawned the step content. |
event Action<int> ServerClearedTutorialSteps | Client: raised with the player ID when the server says to clear tutorial steps. |
event Action<int, MicroTutorialStep> ServerDespawnedTutorialStepContent | Client: raised with the player ID and step when the server despawns a step's content. |
event Action<int, MicroTutorialStep> ServerSpawnedAdditionalStepContent | Client: raised with the player ID and step when the server asks for additional content. |
event Action<int, MicroTutorialStep, Transform> ServerSpawnedStep | Client: raised with the player ID, step and parent transform when the server spawns a step. |
Methods
| Member | What it is |
|---|---|
void NotifyClientToClearTutorialSteps(IPlayer player) | Server: tells the player to clear their runtime tutorial steps. |
void NotifyClientToDespawnStep(IPlayer player, DespawnStepContentCommand content) | Server: tells the player to despawn a step's content. |
void NotifyClientToSpawnAdditionalStepContent(IPlayer player, SpawnStepContentCommand content) | Server: tells the player to spawn a step's additional static content. |
void NotifyClientToSpawnStep(IPlayer player, SpawnStepContentCommand content) | Server: tells the player to spawn a step's static content under the tutorial entity. |
5 private and internal methods
| Member | What it is |
|---|---|
private void SyncClientLoadTutorialComplete(IPlayer player, Stream stream) | Server, when reading: raises ClientLoadCompleted for the sender (the current player in local test). |
private void SyncNotifyClientToClearRuntimeSteps(IPlayer player, Stream stream) | Sync body for the clear message; raises ServerClearedTutorialSteps on the client. |
private void SyncNotifyPlayerToDespawnTutorial(IPlayer player, Stream stream, DespawnStepContentCommand content) | Sync body for the despawn message; raises ServerDespawnedTutorialStepContent on the client. |
private void SyncNotifyPlayerToSpawnAdditionalTutorialContent(IPlayer player, Stream stream, SpawnStepContentCommand content) | Sync body for the additional content message; raises ServerSpawnedAdditionalStepContent on the client. |
private void SyncNotifyPlayerToSpawnTutorial(IPlayer player, Stream stream, SpawnStepContentCommand content) | Sync body for the spawn message; the client raises ServerSpawnedStep and then sends the load-complete message back. |