Skip to main content

Session

Struct Session 

Source
pub struct Session<Capability, Avatar, Land, UdpSocket> {
Show 13 fields pub address: String, pub agent_id: Uuid, pub session_id: Uuid, pub socket: Option<Arc<UdpSocket>>, pub sequence_number: u16, pub local_ip: IpAddr, pub seed_capability_url: String, pub capability_urls: HashMap<Capability, String>, pub inventory_data: InventoryData, pub environment_cache: EnvironmentCache<Land>, pub avatars: HashMap<Uuid, Avatar>, pub region_data: RegionData, pub inventory_db_connection: Pool<Sqlite>,
}
Expand description

Message and struct for the current user’s session.

This includes all data that will be used throughout the session, and much of it is populated by the LoginResponse packet. This sets the active session for the Mailbox, and ensures the UDP socket doesn’t close.

§Cause

  • A login is triggered by the UI, and the handle_login function is called

§Effects

  • Starts UDP read between client and server

Fields§

§address: String

address of the server the client is connected to. formatted http://Url:Socket

§agent_id: Uuid

agent ID of the user

§session_id: Uuid

session ID of the user

§socket: Option<Arc<UdpSocket>>

the running UDP socket attached to the session

§sequence_number: u16

The sequence number of the packets sent. Created as a simple count from the core to the server.

§local_ip: IpAddr

The local IP that the login is sent from. This is stored to ensure the IP of the UseCircuitCode packet is sent from the same IP as the login, to prevent server errors.

§seed_capability_url: String

The URL endpoint to request more capabilities

§capability_urls: HashMap<Capability, String>

The HashMap for storing capability URLs

§inventory_data: InventoryData

inventory details retrieved from initial login

§environment_cache: EnvironmentCache<Land>

The environment cache. Contains things for handling and generating the environment.

§avatars: HashMap<Uuid, Avatar>

The agent list. Contains information about the appearances of all loaded agents

§region_data: RegionData

data about the region the user is currently in

§inventory_db_connection: Pool<Sqlite>

the connection to the inventory sqlite DB this stores folder data and inventory metadata

Trait Implementations§

Source§

impl<Capability: Debug, Avatar: Debug, Land: Debug, UdpSocket: Debug> Debug for Session<Capability, Avatar, Land, UdpSocket>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Capability, Avatar, Land, UdpSocket> !RefUnwindSafe for Session<Capability, Avatar, Land, UdpSocket>

§

impl<Capability, Avatar, Land, UdpSocket> !UnwindSafe for Session<Capability, Avatar, Land, UdpSocket>

§

impl<Capability, Avatar, Land, UdpSocket> Freeze for Session<Capability, Avatar, Land, UdpSocket>
where Option<Arc<UdpSocket>>: Freeze, HashMap<Capability, String>: Freeze, EnvironmentCache<Land>: Freeze, HashMap<Uuid, Avatar>: Freeze,

§

impl<Capability, Avatar, Land, UdpSocket> Send for Session<Capability, Avatar, Land, UdpSocket>
where Option<Arc<UdpSocket>>: Send, HashMap<Capability, String>: Send, EnvironmentCache<Land>: Send, HashMap<Uuid, Avatar>: Send,

§

impl<Capability, Avatar, Land, UdpSocket> Sync for Session<Capability, Avatar, Land, UdpSocket>
where Option<Arc<UdpSocket>>: Sync, HashMap<Capability, String>: Sync, EnvironmentCache<Land>: Sync, HashMap<Uuid, Avatar>: Sync,

§

impl<Capability, Avatar, Land, UdpSocket> Unpin for Session<Capability, Avatar, Land, UdpSocket>
where Option<Arc<UdpSocket>>: Unpin, HashMap<Capability, String>: Unpin, EnvironmentCache<Land>: Unpin, HashMap<Uuid, Avatar>: Unpin,

§

impl<Capability, Avatar, Land, UdpSocket> UnsafeUnpin for Session<Capability, Avatar, Land, UdpSocket>
where Option<Arc<UdpSocket>>: UnsafeUnpin, HashMap<Capability, String>: UnsafeUnpin, EnvironmentCache<Land>: UnsafeUnpin, HashMap<Uuid, Avatar>: UnsafeUnpin,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more