Struct aws_sdk_gamelift::types::PlayerSession
source · #[non_exhaustive]pub struct PlayerSession {
pub player_session_id: Option<String>,
pub player_id: Option<String>,
pub game_session_id: Option<String>,
pub fleet_id: Option<String>,
pub fleet_arn: Option<String>,
pub creation_time: Option<DateTime>,
pub termination_time: Option<DateTime>,
pub status: Option<PlayerSessionStatus>,
pub ip_address: Option<String>,
pub dns_name: Option<String>,
pub port: Option<i32>,
pub player_data: Option<String>,
}
Expand description
Represents a player session. Player sessions are created either for a specific game session, or as part of a game session placement or matchmaking request. A player session can represents a reserved player slot in a game session (when status is RESERVED
) or actual player activity in a game session (when status is ACTIVE
). A player session object, including player data, is automatically passed to a game session when the player connects to the game session and is validated. After the game session ends, player sessions information is retained for 30 days and then removed.
Related actions
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.player_session_id: Option<String>
A unique identifier for a player session.
player_id: Option<String>
A unique identifier for a player that is associated with this player session.
game_session_id: Option<String>
A unique identifier for the game session that the player session is connected to.
fleet_id: Option<String>
A unique identifier for the fleet that the player's game session is running on.
fleet_arn: Option<String>
The Amazon Resource Name (ARN) associated with the GameLift fleet that the player's game session is running on.
creation_time: Option<DateTime>
A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057"
).
termination_time: Option<DateTime>
A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057"
).
status: Option<PlayerSessionStatus>
Current status of the player session.
Possible player session statuses include the following:
-
RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.
-
ACTIVE -- The player has been validated by the server process and is currently connected.
-
COMPLETED -- The player connection has been dropped.
-
TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).
ip_address: Option<String>
The IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.
dns_name: Option<String>
The DNS identifier assigned to the instance that is running the game session. Values have the following format:
-
TLS-enabled fleets:
.. .amazongamelift.com -
Non-TLS-enabled fleets:
ec2-
. (See Amazon EC2 Instance IP Addressing.).compute.amazonaws.com
When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.
port: Option<i32>
Port number for the game session. To connect to a Amazon GameLift server process, an app needs both the IP address and port number.
player_data: Option<String>
Developer-defined information related to a player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game.
Implementations§
source§impl PlayerSession
impl PlayerSession
sourcepub fn player_session_id(&self) -> Option<&str>
pub fn player_session_id(&self) -> Option<&str>
A unique identifier for a player session.
sourcepub fn player_id(&self) -> Option<&str>
pub fn player_id(&self) -> Option<&str>
A unique identifier for a player that is associated with this player session.
sourcepub fn game_session_id(&self) -> Option<&str>
pub fn game_session_id(&self) -> Option<&str>
A unique identifier for the game session that the player session is connected to.
sourcepub fn fleet_id(&self) -> Option<&str>
pub fn fleet_id(&self) -> Option<&str>
A unique identifier for the fleet that the player's game session is running on.
sourcepub fn fleet_arn(&self) -> Option<&str>
pub fn fleet_arn(&self) -> Option<&str>
The Amazon Resource Name (ARN) associated with the GameLift fleet that the player's game session is running on.
sourcepub fn creation_time(&self) -> Option<&DateTime>
pub fn creation_time(&self) -> Option<&DateTime>
A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057"
).
sourcepub fn termination_time(&self) -> Option<&DateTime>
pub fn termination_time(&self) -> Option<&DateTime>
A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057"
).
sourcepub fn status(&self) -> Option<&PlayerSessionStatus>
pub fn status(&self) -> Option<&PlayerSessionStatus>
Current status of the player session.
Possible player session statuses include the following:
-
RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.
-
ACTIVE -- The player has been validated by the server process and is currently connected.
-
COMPLETED -- The player connection has been dropped.
-
TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).
sourcepub fn ip_address(&self) -> Option<&str>
pub fn ip_address(&self) -> Option<&str>
The IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.
sourcepub fn dns_name(&self) -> Option<&str>
pub fn dns_name(&self) -> Option<&str>
The DNS identifier assigned to the instance that is running the game session. Values have the following format:
-
TLS-enabled fleets:
.. .amazongamelift.com -
Non-TLS-enabled fleets:
ec2-
. (See Amazon EC2 Instance IP Addressing.).compute.amazonaws.com
When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.
sourcepub fn port(&self) -> Option<i32>
pub fn port(&self) -> Option<i32>
Port number for the game session. To connect to a Amazon GameLift server process, an app needs both the IP address and port number.
sourcepub fn player_data(&self) -> Option<&str>
pub fn player_data(&self) -> Option<&str>
Developer-defined information related to a player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game.
source§impl PlayerSession
impl PlayerSession
sourcepub fn builder() -> PlayerSessionBuilder
pub fn builder() -> PlayerSessionBuilder
Creates a new builder-style object to manufacture PlayerSession
.
Trait Implementations§
source§impl Clone for PlayerSession
impl Clone for PlayerSession
source§fn clone(&self) -> PlayerSession
fn clone(&self) -> PlayerSession
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PlayerSession
impl Debug for PlayerSession
source§impl PartialEq for PlayerSession
impl PartialEq for PlayerSession
source§fn eq(&self, other: &PlayerSession) -> bool
fn eq(&self, other: &PlayerSession) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for PlayerSession
Auto Trait Implementations§
impl Freeze for PlayerSession
impl RefUnwindSafe for PlayerSession
impl Send for PlayerSession
impl Sync for PlayerSession
impl Unpin for PlayerSession
impl UnwindSafe for PlayerSession
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more