Interface IMigrationDataHandler
An interface that can be used by a client to provide custom migration data generation and apply.
Namespace: Unity.Services.Multiplayer
Assembly: Unity.Services.Multiplayer.dll
Syntax
public interface IMigrationDataHandler
Methods
Apply(byte[])
Applies the migration data to a host player.
Declaration
void Apply(byte[] migrationData)
Parameters
Type | Name | Description |
---|---|---|
byte[] | migrationData | The bytes representing the session state. |
Remarks
This method will be called during host migration on the player selected as the new host. The data might have been Generated on any player that was previously a host, including players that have already left.
Generate()
Generate the migration data from a host player.
Declaration
byte[] Generate()
Returns
Type | Description |
---|---|
byte[] | An array of bytes representing the session state. |
Remarks
This method will be called periodically and the data will be stored in case of a host migration is triggered. The data generated should be acceptable to the Apply on any player selected as host during migration.