Struct steamworks::User

source ·
pub struct User<Manager> { /* private fields */ }
Expand description

Access to the steam user interface

Implementations§

source§

impl<Manager> User<Manager>

source

pub fn steam_id(&self) -> SteamId

Returns the steam id of the current user

source

pub fn level(&self) -> u32

Returns the level of the current user

source

pub fn logged_on(&self) -> bool

Returns whether the current user’s Steam client is connected to the Steam servers.

source

pub fn authentication_session_ticket_with_steam_id( &self, steam_id: SteamId ) -> (AuthTicket, Vec<u8>)

Retrieve an authentication session ticket that can be sent to an entity that wishes to verify you.

This ticket should not be reused.

When creating ticket for use by the web API you should wait for the AuthSessionTicketResponse event before trying to use the ticket.

When the multiplayer session terminates you must call cancel_authentication_ticket

source

pub fn authentication_session_ticket( &self, network_identity: NetworkingIdentity ) -> (AuthTicket, Vec<u8>)

source

pub fn cancel_authentication_ticket(&self, ticket: AuthTicket)

Cancels an authentication session ticket received from authentication_session_ticket.

This should be called when you are no longer playing with the specified entity.

source

pub fn begin_authentication_session( &self, user: SteamId, ticket: &[u8] ) -> Result<(), AuthSessionError>

Authenticate the ticket from the steam ID to make sure it is valid and not reused.

A ValidateAuthTicketResponse callback will be fired if the entity goes offline or cancels the ticket.

When the multiplayer session terminates you must call end_authentication_session

source

pub fn end_authentication_session(&self, user: SteamId)

Ends an authentication session that was started with begin_authentication_session.

This should be called when you are no longer playing with the specified entity.

source

pub fn authentication_session_ticket_for_webapi( &self, identity: &str ) -> AuthTicket

Retrieve an authentication ticket to be sent to the entity that wishes to authenticate you using the ISteamUserAuth/AuthenticateUserTicket Web API.

The calling application must wait for the TicketForWebApiResponse callback generated
by the API call to access the ticket.

It is best practice to use an identity string for each service that will consume tickets.

This API can not be used to create a ticket for use by the BeginAuthSession/ISteamGameServer::BeginAuthSession. Use the authentication_session_ticket API instead

Auto Trait Implementations§

§

impl<Manager> RefUnwindSafe for User<Manager>
where Manager: RefUnwindSafe,

§

impl<Manager> !Send for User<Manager>

§

impl<Manager> !Sync for User<Manager>

§

impl<Manager> Unpin for User<Manager>

§

impl<Manager> UnwindSafe for User<Manager>
where Manager: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.