metaverse_messages 0.3.0

packet definitions for the open metaverse
Documentation
/// # Disable Simulator
/// <https://wiki.secondlife.com/wiki/DisableSimulator>
///
/// A packet sent by the server to inform the viewer of disconnection. This packet has no body, and
/// is functionally just a header.
///
/// ## Header
/// | DisableSimulator   |       |                |                   |                     |
/// |--------------|-------------|----------------|-------------------|---------------------|
/// | Packet Header| id:152      | reliable: false| zerocoded: false  |     frequency: Low  |
pub mod disable_simulator;
/// # Logout Request
/// <https://wiki.secondlife.com/wiki/LogoutRequest>
///
/// Logs out user from the simulator and ends the session
///
/// ## Header
/// |CompleteAgentMovement |||||
/// |----------------------|---------|-----------------|------------------|-----------------|
/// | Packet Header        | id: 252 | reliable: true  | zerocoded: false | frequency: Low  |
///
/// ## Packet Structure
/// | LogoutRequest         |          |                    |                                 |
/// |-----------------------|----------|--------------------|---------------------------------|
/// | AgentID               | 16 bytes | [Uuid](uuid::Uuid) | The ID of the user agent        |  
/// | SessionID             | 16 bytes | [Uuid](uuid::Uuid) | The ID of the current session   |  
///
pub mod logout_request;
/// # Packet Ack
/// <https://wiki.secondlife.com/wiki/PacketAck>
///
/// The acknowledgement packet sent from the viewer to verify receiving reliable packets.
///
/// ## Header
/// | PacketAck    |             |                |                   |                     |
/// |--------------|-------------|----------------|-------------------|---------------------|
/// | Packet Header| id:251      | reliable: false| zerocoded: false  | frequency: Fixed    |
///
///
/// ## Packet Structure
/// | PacketAck ||||
/// |--------|--------|------|-----|
/// | count  | 1 byte  | [u8]  | number of ack IDs contained in the packet|
/// | Packet Ids| variable bytes | ID | List of IDs that need to be acked |  
/// | ID     | 4 bytes | [u32] | Sequence numbers of packets to be acked  |
pub mod packet_ack;

/// # Region Handshake
/// <https://wiki.secondlife.com/wiki/RegionHandshake>
///
/// The packet sent from the server in response to CompleteAgentMovement. The viewer responds to
/// this with RegionHandshakeReply, which finishes the handshakes and begins object updats with
/// CoarseLocationUpdate.
///
/// ## Header
/// | Region Handshake   |       |                |                   |                     |
/// |--------------|-------------|----------------|-------------------|---------------------|
/// | Packet Header| id:80       | reliable: false| zerocoded: false  |     frequency: Low  |
///
/// ## Packet Structure
/// | Region Handshake     |         |       |              |
/// |----------------------|---------|-------|--------------|
/// | RegionFlags          | 4 bytes | [u32] | Region flags |
/// | Unused byte          | 1 byte  |       | unknown, but must be read to keep alignment |
/// | SimAccess            | 1 byte  | [u8]  | The access level of the viewer |
/// | NameLength           | 1 byte  | [u8]  | the length in bytes of the sim name |
/// | SimName              | variable bytes| [String] | The name of the simulator |
/// | SimOwner             | 4 bytes | [Uuid](uuid::Uuid) | The user ID of the owner of the sim|
/// | IsEstateManager      | 4 bytes | [bool]| is the user an estate manager of this sim |
/// | WaterHeight          | 4 bytes | [f32] | the height of the water in the sim |
/// | Billablefactor       | 4 bytes | [f32] | undocumented |
/// | CacheID              | 16 bytes | [Uuid](uuid::Uuid) | undocumented |
/// | TerrainBase0         | 16 bytes | [Uuid](uuid::Uuid) | undocumented |
/// | TerrainBase1         | 16 bytes | [Uuid](uuid::Uuid) | undocumented |
/// | TerrainBase2         | 16 bytes | [Uuid](uuid::Uuid) | undocumented |
/// | TerrainBase3         | 16 btyes | [Uuid](uuid::Uuid) | undocumented |
/// | TerrainDetail0       | 16 bytes | [Uuid](uuid::Uuid) | undocumented |
/// | TerrainDetail1       | 16 bytes | [Uuid](uuid::Uuid) | undocumented |
/// | TerrainDetail2       | 16 bytes | [Uuid](uuid::Uuid) | undocumented |
/// | TerrainDetail3       | 16 bytes | [Uuid](uuid::Uuid) | undocumented |
/// | TerrainStartHeight0  | 4 bytes | [f32] | undocumented |
/// | TerrainStartheight1  | 4 bytes | [f32] | undocumented |
/// | TerrainStartheight2  | 4 bytes | [f32] | undocumented |
/// | TerrainStartheight3  | 4 bytes | [f32] | undocumented |
/// | TerrainHeightRange0  | 4 bytes | [f32] | undocumented |
/// | TerrainHeightRange1  | 4 bytes | [f32] | undocumented |
/// | TerrainHeightRange2  | 4 bytes | [f32] | undocumented |
/// | TerrainHeightRange3  | 4 bytes | [f32] | undocumented |
pub mod region_handshake;

/// # Region Handshake Reply
/// <https://wiki.secondlife.com/wiki/RegionHandshakeReply>
///
/// The viewer sends this in response to RegionHandshake, which begins object updates via
/// CoarseLocationUpdate. This finishes the login handshake.
///
/// ## Header
/// | Region Handshake Reply |   |                |                   |                     |
/// |--------------|-------------|----------------|-------------------|---------------------|
/// | Packet Header| id:149      | reliable: false| zerocoded: false  |     frequency: Low  |
///
/// ## Packet Structure
/// | Region Handshake |          |       |              |
/// |------------------|----------|-------|--------------|
/// | AgentID          | 16 bytes | [Uuid](uuid::Uuid) | user's agent ID |
/// | SessionID        | 16 bytes | [Uuid](uuid::Uuid) | User's session ID |
/// | Flags            | 4 bytes  | [u32] | undocumented |
pub mod region_handshake_reply;

/// # Start Ping Check
/// <https://wiki.secondlife.com/wiki/StartPingCheck>
///
/// Used to emasure ping times. PingId is increased by 1 each time StartPingCheck is sent. at 255
/// it rolls over to 0.
///
/// ## Header
/// | StartPingCheck  |          |                |                   |                     |
/// |--------------|-------------|----------------|-------------------|---------------------|
/// | Packet Header| id:1        | reliable: false| zerocoded: false  |     frequency: High |
///
/// ## Packet Structure
/// | PingCheck ||||
/// |--------|--------|------|-----|
/// | PingID | 1 byte | [u8] | the ID of the ping being sent. Used by complete ping check to verify it was received.|
/// | OldestUnacked | 4 bytes | [u32] | The sequence number of the most recent message sent by the source, stored as little-endian |
pub mod start_ping_check;

/// # Complete Ping Check
/// <https://wiki.secondlife.com/wiki/CompletePingCheck>
///
/// The response sent by the viewer when receiving a ping check packet from the server.
/// Completes the check started by the viewer.
///
/// ## Header
/// | CompletePingCheck  |       |                |                   |                     |
/// |--------------|-------------|----------------|-------------------|---------------------|
/// | Packet Header| id:2        | reliable: false| zerocoded: false  |     frequency: High |
///
///
/// ## Packet Structure
/// | PingCheck ||||
/// |--------|--------|------|-----|
/// | PingID | 1 byte | [u8] | the value received during StartPingCheck. Lets server know which ping was completed. |
pub mod complete_ping_check;

/// # Circuit Code
/// <https://wiki.secondlife.com/wiki/UseCircuitCode>
///
/// Sent from the viewer to establish a circuit connection with a simulator. This is necessary
/// before any other circuit commmunication is possible.
/// The simulator will start sending StartPingCheck messages after this is sent
///
/// ## Header
/// | UseCircuitCode |||||
/// |--------------|---------------|----------------|-------------------|---------------------|
/// | Packet Header| id:3          | reliable: false| zerocoded: false  | frequency: Low      |
///
/// ## Packet Structure
/// | CircuitCodeData |         |       |               |
/// |-----------------|---------|-------|---------------|
/// | Code            | 4 bytes | [u32] | The code the server will check against other trusted packets |
/// | SessionID       | 16 bytes| [Uuid](uuid::Uuid) | The ID of the session |
/// | ID              | 16 bytes| [Uuid](uuid::Uuid) | undocumented          |
pub mod circuit_code;
/// # Complete Agent Movement
/// <https://wiki.secondlife.com/wiki/CompleteAgentMovement>
///
/// This establishes the avatar presence in a region. If this packet is not sent, the avatar never
/// appears, and the login does not fully succeed.
///
/// ## Header
/// |CompleteAgentMovement |||||
/// |----------------------|---------|-----------------|------------------|-----------------|
/// | Packet Header        | id: 249 | reliable: false | zerocoded: false | frequency: Low  |
///
/// ## Packet Structure
/// | CompleteAgentMovement |          |                    |                                 |
/// |-----------------------|----------|--------------------|---------------------------------|
/// | agent_id               | 16 bytes | [Uuid](uuid::Uuid) | The ID of the user agent (sent from server to viwer with login)|
/// | session_id             | 16 bytes | [Uuid](uuid::Uuid) | The ID of the user session (sent from server to client with login)|
/// | circuit_code           | 4 bytes  | [u32]              | The CircuitCode (sent from server to client with login) |
pub mod complete_agent_movement;

/// # Agent Throttle
/// <https://wiki.secondlife.com/wiki/AgentThrottle>
///
/// This packet is sent to inform the server of the viewer's maximum bandwidth. If this packet is
/// never sent, the server may be slow to respond, and throttle the amount of data it sends to the
/// viewer, leading to long loading times.
///
/// The maximum and minimum values are:
/// Resend  - Max: 150,000
/// Land    - Max: 170,000
/// Wind    - Max: 34,000
/// Cloud   - Max: 34,000
/// Task    - Max: 446,000
/// Texture - Max: 446,000
/// Asset   - Max: 220,000
///
/// ## Header
/// |AgentThrottle |||||
/// |----------------------|---------|-----------------|------------------|-----------------|
/// | Packet Header        | id: 81 | reliable: false | zerocoded: false | frequency: Low   |
///
///
/// ## Packet Structure
/// | AgentThrottle |          |                    |                                 |
/// |-----------------------|----------|--------------------|---------------------------------|
/// | agent_id     | 16 bytes | [Uuid](uuid::Uuid) | The ID of the user agent        |
/// | session_id   | 16 bytes | [Uuid](uuid::Uuid) | The ID of the user session      |
/// | circuit_code | 4 bytes  | [u32]| The CircuitCode                 |
/// | gen_id       | 4 bytes  | [u32]| label to inform the viewer that one packet is more recent than the other. Can be set to 0. |
/// | resend       | 4 bytes  | [f32]| maximum bytes per second for resent packets |
/// | land         | 4 bytes  | [f32]| maximum bytes per second for land packets |   
/// | wind         | 4 bytes  | [f32]| maximum bytes per second for wind packets |   
/// | cloud        | 4 bytes  | [f32]| maximum bytes per second for cloud packets |   
/// | task         | 4 bytes  | [f32]| maximum bytes per second for task packets |   
/// | texture      | 4 bytes  | [f32]| maximum bytes per second for texture packets |   
/// | asset        | 4 bytes  | [f32]| maximum bytes per second for asset packets |   
pub mod agent_throttle;

/// # Enable Simulator
/// <https://wiki.secondlife.com/wiki/EnableSimulator>
///
/// This packet is sent to tell the server the viewer is ready to retrieve region data.
///
/// ## Header
/// |EnableSimulator |||||
/// |----------------------|---------|-----------------|------------------|-----------------|
/// | Packet Header        | id: 151 | reliable: false | zerocoded: false | frequency: Low   |
///
///
/// ## Packet Structure
/// | AgentThrottle |          |                    |                                 |
/// |-----------------------|----------|--------------------|---------------------------------|
/// | handle       | 8 bytes  | [u64]| ID of the region |
/// | ip           | 4 bytes  | [String] | IP address of the ready viewer |
/// | port        | 2 bytes  | [u16]| port the ready viewer is connected to |   
pub mod enable_simulator;

/// TODO: UNIMPLEMENTED
pub mod agent_movement_complete;
/// TODO: UNIMPLEMENTED
pub mod parcel_overlay;
/// TODO: UNIMPLEMENTED
pub mod sim_stats;
/// TODO: UNIMPLEMENTED
pub mod simulator_viewer_time_message;
/// TODO: UNIMPLEMENTED
pub mod test_packet;
/// TODO: UNIMPLEMENTED
pub mod viewer_effect;