aws_gamelift_server_sdk_rs/process_parameters.rs
1pub type OnStartGameSessionOutputType =
2 std::pin::Pin<Box<dyn std::future::Future<Output = ()> + std::marker::Send>>;
3pub type OnStartGameSessionType = dyn Fn(crate::entity::GameSession) -> OnStartGameSessionOutputType
4 + std::marker::Send
5 + std::marker::Sync;
6
7pub type OnUpdateGameSessionOutputType =
8 std::pin::Pin<Box<dyn std::future::Future<Output = ()> + std::marker::Send>>;
9pub type OnUpdateGameSessionType = dyn Fn(crate::entity::UpdateGameSession) -> OnUpdateGameSessionOutputType
10 + std::marker::Send
11 + std::marker::Sync;
12
13pub type OnProcessTerminateOutputType =
14 std::pin::Pin<Box<dyn std::future::Future<Output = ()> + std::marker::Send>>;
15pub type OnProcessTerminateType =
16 dyn Fn() -> OnProcessTerminateOutputType + std::marker::Send + std::marker::Sync;
17
18pub type HealthCheckOutputType =
19 std::pin::Pin<Box<dyn std::future::Future<Output = bool> + std::marker::Send>>;
20pub type OnHealthCheckType =
21 dyn Fn() -> HealthCheckOutputType + std::marker::Send + std::marker::Sync;
22
23/// This data type contains the set of parameters sent to the GameLift service
24/// in a [ProcessReady](crate::api::Api::process_ready) call.
25pub struct ProcessParameters {
26 /// Name of callback function that the GameLift service invokes to activate
27 /// a new game session. GameLift calls this function in response to the
28 /// client request CreateGameSession. The callback function takes a
29 /// GameSession object (defined in the GameLift Service API Reference).
30 pub on_start_game_session: Box<OnStartGameSessionType>,
31
32 /// Name of callback function that the GameLift service invokes to pass an
33 /// updated game session object to the server process. GameLift calls this
34 /// function when a match backfill request has been processed in order to
35 /// provide updated matchmaker data. It passes a GameSession object, a
36 /// status update (updateReason), and the match backfill ticket ID.
37 pub on_update_game_session: Box<OnUpdateGameSessionType>,
38
39 /// Name of callback function that the GameLift service invokes to force the
40 /// server process to shut down. After calling this function, GameLift waits
41 /// five minutes for the server process to shut down and respond with a
42 /// ProcessEnding() call before it shuts down the server process.
43 pub on_process_terminate: Box<OnProcessTerminateType>,
44
45 /// Name of callback function that the GameLift service invokes to request a
46 /// health status report from the server process. GameLift calls this
47 /// function every 60 seconds. After calling this function GameLift waits 60
48 /// seconds for a response, and if none is received. records the server
49 /// process as unhealthy.
50 pub on_health_check: Box<OnHealthCheckType>,
51
52 /// Port number the server process will listen on for new player
53 /// connections. The value must fall into the port range configured for any
54 /// fleet deploying this game server build. This port number is included in
55 /// game session and player session objects, which game sessions use when
56 /// connecting to a server process.
57 pub port: i32,
58
59 /// Object with a list of directory paths to game session log files.
60 pub log_parameters: crate::log_parameters::LogParameters,
61}