22
33namespace Improbable . Gdk . PlayerLifecycle
44{
5+ /// <summary>
6+ /// Signature of the function called to get a player <see cref="EntityTemplate"/> instance.
7+ /// </summary>
8+ /// <param name="clientWorkerId">
9+ /// The worker ID of a client-worker that sent a player creation request.
10+ /// </param>
11+ /// <param name="serializedArguments">
12+ /// A serialized byte array of arbitrary data. By default this is null unless you provided
13+ /// the serialized data when calling `RequestPlayerCreation` manually.
14+ /// </param>
15+ /// <remarks>
16+ /// The `CreatePlayerEntityTemplate` method in the <see cref="PlayerLifecycleConfig"/>, called by the
17+ /// <see cref="HandleCreatePlayerRequestSystem"/>, must match this signature.
18+ /// </remarks>
19+ /// <returns>
20+ /// An <see cref="EntityTemplate"/> to create a SpatialOS player entity from.
21+ /// </returns>
522 public delegate EntityTemplate GetPlayerEntityTemplateDelegate (
623 string clientWorkerId ,
724 byte [ ] serializedArguments ) ;
@@ -11,28 +28,57 @@ public static class PlayerLifecycleConfig
1128 /// <summary>
1229 /// The time in seconds between player heartbeat requests.
1330 /// </summary>
31+ /// <remarks>
32+ /// This is used by the <see cref="SendPlayerHeartbeatRequestSystem"/> on the server-worker to determine
33+ /// how often to send a `PlayerHeartbeat` request to client-workers.
34+ /// </remarks>
1435 public static float PlayerHeartbeatIntervalSeconds = 5f ;
1536
1637 /// <summary>
1738 /// The maximum number of failed heartbeats before a player is disconnected.
1839 /// </summary>
40+ /// <remarks>
41+ /// The <see cref="HandlePlayerHeartbeatResponseSystem"/> deletes a player entity if the corresponding client-worker
42+ /// fails to respond successfully to this number of consecutive `PlayerHeartbeat` requests.
43+ /// </remarks>
1944 public static int MaxNumFailedPlayerHeartbeats = 2 ;
2045
46+ /// <summary>
47+ /// The maximum number of retries for player creation requests.
48+ /// </summary>
49+ /// <remarks>
50+ /// The number of times a player creation request is retried after the first attempt. Setting this
51+ /// to 0 disables retrying player creation after calling `RequestPlayerCreation`.
52+ /// </remarks>
2153 public static int MaxPlayerCreationRetries = 5 ;
2254
2355 /// <summary>
2456 /// The maximum number of retries for finding player creator entities, before any player creation occurs.
2557 /// </summary>
58+ /// <remarks>
59+ /// All player creation requests must be sent to a player creator entity, which are initially queried for when
60+ /// the <see cref="SendCreatePlayerRequestSystem"/> starts. This field indicates the maximum number of retries for the
61+ // initial entity query to find the player creator entities.
62+ /// </remarks>
2663 public static int MaxPlayerCreatorQueryRetries = 5 ;
2764
2865 /// <summary>
2966 /// This indicates whether a player should be created automatically upon a worker connecting to SpatialOS.
3067 /// </summary>
68+ /// <remarks>
69+ /// If `true`, a Player entity is automatically created upon a client-worker connecting to SpatialOS. However,
70+ /// to be able to send arbitrary serialized data in the player creation request, or to provide a callback to be
71+ /// invoked upon receiving a player creation response, this field must be set to `false`.
72+ /// </remarks>
3173 public static bool AutoRequestPlayerCreation = true ;
3274
3375 /// <summary>
34- /// The delegate responsible for returning a player entity template when creating a player.
76+ /// The delegate responsible for returning a player <see cref="EntityTemplate"/> when creating a player.
3577 /// </summary>
78+ /// <remarks>
79+ /// This must be set before initiating any player creation because it is called by the <see cref="HandleCreatePlayerRequestSystem"/>.
80+ /// The system uses this delegate to request a new player entity based on the returned <see cref="EntityTemplate"/>.
81+ /// </remarks>
3682 public static GetPlayerEntityTemplateDelegate CreatePlayerEntityTemplate ;
3783 }
3884}
0 commit comments