pub struct CreatePlayerSession { /* private fields */ }
Expand description
Fluent builder constructing a request to CreatePlayerSession
.
Reserves an open player slot in a game session for a player. 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
. You can add a group of players to a game session with CreatePlayerSessions
.
To create a player session, specify a game session ID, player ID, and optionally a set of player data.
If successful, a slot is reserved in the game session for the player and a new PlayerSession
object is returned with a player session ID. The player references the 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 CreatePlayerSession
impl CreatePlayerSession
sourcepub async fn send(
self
) -> Result<CreatePlayerSessionOutput, SdkError<CreatePlayerSessionError>>
pub async fn send(
self
) -> Result<CreatePlayerSessionOutput, SdkError<CreatePlayerSessionError>>
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 a player 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 a player to.
sourcepub fn player_id(self, input: impl Into<String>) -> Self
pub fn player_id(self, input: impl Into<String>) -> Self
A unique identifier for a player. Player IDs are developer-defined.
sourcepub fn set_player_id(self, input: Option<String>) -> Self
pub fn set_player_id(self, input: Option<String>) -> Self
A unique identifier for a player. Player IDs are developer-defined.
sourcepub fn player_data(self, input: impl Into<String>) -> Self
pub fn player_data(self, input: impl Into<String>) -> Self
Developer-defined information related to a player. GameLift does not use this data, so it can be formatted as needed for use in the game.
sourcepub fn set_player_data(self, input: Option<String>) -> Self
pub fn set_player_data(self, input: Option<String>) -> Self
Developer-defined information related to a player. GameLift does not use this data, so it can be formatted as needed for use in the game.
Trait Implementations
sourceimpl Clone for CreatePlayerSession
impl Clone for CreatePlayerSession
sourcefn clone(&self) -> CreatePlayerSession
fn clone(&self) -> CreatePlayerSession
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 CreatePlayerSession
impl Send for CreatePlayerSession
impl Sync for CreatePlayerSession
impl Unpin for CreatePlayerSession
impl !UnwindSafe for CreatePlayerSession
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