pub struct CreatePlayerSessions { /* private fields */ }
Expand description
Fluent builder constructing a request to CreatePlayerSessions
.
Reserves open slots in a game session for a group of players. New player sessions can be created in any game session with an open slot that is in ACTIVE
status and has a player creation policy of ACCEPT_ALL
. To add a single player to a game session, use CreatePlayerSession
.
To create player sessions, specify a game session ID and a list of player IDs. Optionally, provide a set of player data for each player ID.
If successful, a slot is reserved in the game session for each player, and new PlayerSession
objects are returned with player session IDs. Each player references their player session ID when sending a connection request to the game session, and the game server can use it to validate the player reservation with the GameLift service. Player sessions cannot be updated.
The maximum number of players per game session is 200. It is not adjustable.
Available in Amazon GameLift Local.
Related actions
CreatePlayerSession
| CreatePlayerSessions
| DescribePlayerSessions
| StartGameSessionPlacement
| DescribeGameSessionPlacement
| All APIs by task
Implementations
sourceimpl CreatePlayerSessions
impl CreatePlayerSessions
sourcepub async fn send(
self
) -> Result<CreatePlayerSessionsOutput, SdkError<CreatePlayerSessionsError>>
pub async fn send(
self
) -> Result<CreatePlayerSessionsOutput, SdkError<CreatePlayerSessionsError>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn game_session_id(self, input: impl Into<String>) -> Self
pub fn game_session_id(self, input: impl Into<String>) -> Self
A unique identifier for the game session to add players to.
sourcepub fn set_game_session_id(self, input: Option<String>) -> Self
pub fn set_game_session_id(self, input: Option<String>) -> Self
A unique identifier for the game session to add players to.
sourcepub fn player_ids(self, input: impl Into<String>) -> Self
pub fn player_ids(self, input: impl Into<String>) -> Self
Appends an item to PlayerIds
.
To override the contents of this collection use set_player_ids
.
List of unique identifiers for the players to be added.
sourcepub fn set_player_ids(self, input: Option<Vec<String>>) -> Self
pub fn set_player_ids(self, input: Option<Vec<String>>) -> Self
List of unique identifiers for the players to be added.
sourcepub fn player_data_map(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn player_data_map(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to PlayerDataMap
.
To override the contents of this collection use set_player_data_map
.
Map of string pairs, each specifying a player ID and a set of developer-defined information related to the player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game. Any player data strings for player IDs that are not included in the PlayerIds
parameter are ignored.
sourcepub fn set_player_data_map(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_player_data_map(self, input: Option<HashMap<String, String>>) -> Self
Map of string pairs, each specifying a player ID and a set of developer-defined information related to the player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game. Any player data strings for player IDs that are not included in the PlayerIds
parameter are ignored.
Trait Implementations
sourceimpl Clone for CreatePlayerSessions
impl Clone for CreatePlayerSessions
sourcefn clone(&self) -> CreatePlayerSessions
fn clone(&self) -> CreatePlayerSessions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for CreatePlayerSessions
impl Send for CreatePlayerSessions
impl Sync for CreatePlayerSessions
impl Unpin for CreatePlayerSessions
impl !UnwindSafe for CreatePlayerSessions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more