C# Class OpenMetaverse.NetworkManager

NetworkManager is responsible for managing the network layer of OpenMetaverse. It tracks all the server connections, serializes outgoing traffic and deserializes incoming traffic, and provides instances of delegates for network-related events.
Afficher le fichier Open project: 3di/3di-viewer-rei-libs Class Usage Examples

Méthodes publiques

Свойство Type Description
AssetServerUri String
LoginSeedCapability string
SecureSessionID UUID
Simulators List

Méthodes publiques

Méthode Description
Begin3DiLogin ( LoginParams loginParams ) : void
BeginLogin ( LoginParams loginParams ) : void
Connect ( IPAddress ip, ushort port, ulong handle, bool setDefault, string seedcaps ) : Simulator

Connect to a simulator

Connect ( IPEndPoint endPoint, ulong handle, bool setDefault, string seedcaps ) : Simulator

Connect to a simulator

DefaultLoginParams ( string firstName, string lastName, string password, string userAgent, string userVersion ) : LoginParams

DisconnectSim ( Simulator sim, bool sendCloseCircuit ) : void

FindSimulator ( IPEndPoint endPoint ) : Simulator

Searches through the list of currently connected simulators to find one attached to the given IPEndPoint

Login ( LoginParams loginParams ) : bool

Login that takes a struct of all the values that will be passed to the login server

Login ( string firstName, string lastName, string password, string userAgent, string userVersion ) : bool

Simplified login that takes the most common and required fields

Login ( string firstName, string lastName, string password, string userAgent, string start, string userVersion ) : bool

Simplified login that takes the most common fields along with a starting location URI, and can accept an MD5 string instead of a plaintext password

Login3Di ( LoginParams loginParams ) : bool
Logout ( ) : void

Initiate a blocking logout request. This will return when the logout handshake has completed or when Settings.LOGOUT_TIMEOUT has expired and the network layer is manually shut down

NetworkManager ( GridClient client ) : System
NetworkManager ( GridClient client, SmartThreadPool threadPool ) : System

Default constructor

RegisterCallback ( PacketType type, PacketCallback callback ) : void

Register an event handler for a packet. This is a low level event interface and should only be used if you are doing something not supported in the library

RegisterEventCallback ( string capsEvent, Caps callback ) : void

Register a CAPS event handler. This is a low level event interface and should only be used if you are doing something not supported in the library

RegisterLoginResponseCallback ( LoginResponseCallback callback ) : void
RegisterLoginResponseCallback ( LoginResponseCallback callback, string options ) : void
RequestLogout ( ) : void

Initiate the logout process. Check if logout succeeded with the OnLogoutReply event, and if this does not fire the Shutdown() function needs to be manually called

SendPacket ( Packet packet ) : void

Send a packet to the simulator the avatar is currently occupying

SendPacket ( Packet packet, Simulator simulator ) : void

Send a packet to a specified simulator

Shutdown ( DisconnectType type ) : void

Shutdown will disconnect all the sims except for the current sim first, and then kill the connection to CurrentSim. This should only be called if the logout process times out on RequestLogout

StartLocation ( string sim, int x, int y, int z ) : string

Build a start location URI for passing to the Login function

UnregisterCallback ( PacketType type, PacketCallback callback ) : void

Unregister an event handler for a packet. This is a low level event interface and should only be used if you are doing something not supported in the library

UnregisterEventCallback ( string capsEvent, Caps callback ) : void

Unregister a CAPS event handler. This is a low level event interface and should only be used if you are doing something not supported in the library

UnregisterLoginResponseCallback ( LoginResponseCallback callback ) : void

Private Methods

Méthode Description
Begin3DiLogin ( ) : void
BeginLogin ( ) : void
DisableSimulatorHandler ( Packet packet, Simulator simulator ) : void
DisconnectTimer_Elapsed ( object obj ) : void
EnableSimulatorHandler ( string capsKey, OSD osd, Simulator simulator ) : void

Handler for EnableSimulator packet

Get3DiChallengeCode ( LoginParams loginParams ) : string
GetLoginServerVersion ( string loginServerURI ) : string
GetMAC ( ) : string

Get clients default Mac Address

GetPlatform ( ) : string

Get current OS

IncomingPacketHandler ( object args ) : object
IncomingPacketHandler ( ) : void
KickUserHandler ( Packet packet, Simulator simulator ) : void
LoginReplyHandler ( CapsClient client, OSD result, Exception error ) : void
LogoutReplyHandler ( Packet packet, Simulator simulator ) : void

Called to deal with LogoutReply packet and fires off callback

OutgoingPacketHandler ( object args ) : object
OutgoingPacketHandler ( ) : void
PongHandler ( Packet packet, Simulator simulator ) : void
RaiseConnectedEvent ( Simulator simulator ) : void

Fire an event when an event queue connects for capabilities

RegionHandshakeHandler ( Packet packet, Simulator simulator ) : void
SetCurrentSim ( Simulator simulator, string seedcaps ) : void
SimStatsHandler ( Packet packet, Simulator simulator ) : void
StartPingCheckHandler ( Packet packet, Simulator simulator ) : void
UpdateLoginStatus ( LoginStatus status, string message ) : void
myMD5 ( string input ) : string

Method Details

Begin3DiLogin() public méthode

public Begin3DiLogin ( LoginParams loginParams ) : void
loginParams LoginParams
Résultat void

BeginLogin() public méthode

public BeginLogin ( LoginParams loginParams ) : void
loginParams LoginParams
Résultat void

Connect() public méthode

Connect to a simulator
public Connect ( IPAddress ip, ushort port, ulong handle, bool setDefault, string seedcaps ) : Simulator
ip System.Net.IPAddress IP address to connect to
port ushort Port to connect to
handle ulong Handle for this simulator, to identify its /// location in the grid
setDefault bool Whether to set CurrentSim to this new /// connection, use this if the avatar is moving in to this simulator
seedcaps string URL of the capabilities server to use for /// this sim connection
Résultat Simulator

Connect() public méthode

Connect to a simulator
public Connect ( IPEndPoint endPoint, ulong handle, bool setDefault, string seedcaps ) : Simulator
endPoint System.Net.IPEndPoint IP address and port to connect to
handle ulong Handle for this simulator, to identify its /// location in the grid
setDefault bool Whether to set CurrentSim to this new /// connection, use this if the avatar is moving in to this simulator
seedcaps string URL of the capabilities server to use for /// this sim connection
Résultat Simulator

DefaultLoginParams() public méthode

public DefaultLoginParams ( string firstName, string lastName, string password, string userAgent, string userVersion ) : LoginParams
firstName string Account first name
lastName string Account last name
password string Account password
userAgent string Client application name
userVersion string Client application version
Résultat LoginParams

DisconnectSim() public méthode

public DisconnectSim ( Simulator sim, bool sendCloseCircuit ) : void
sim Simulator
sendCloseCircuit bool
Résultat void

FindSimulator() public méthode

Searches through the list of currently connected simulators to find one attached to the given IPEndPoint
public FindSimulator ( IPEndPoint endPoint ) : Simulator
endPoint IPEndPoint IPEndPoint of the Simulator to search for
Résultat Simulator

Login() public méthode

Login that takes a struct of all the values that will be passed to the login server
public Login ( LoginParams loginParams ) : bool
loginParams LoginParams The values that will be passed to the login /// server, all fields must be set even if they are String.Empty
Résultat bool

Login() public méthode

Simplified login that takes the most common and required fields
public Login ( string firstName, string lastName, string password, string userAgent, string userVersion ) : bool
firstName string Account first name
lastName string Account last name
password string Account password
userAgent string Client application name
userVersion string Client application version
Résultat bool

Login() public méthode

Simplified login that takes the most common fields along with a starting location URI, and can accept an MD5 string instead of a plaintext password
public Login ( string firstName, string lastName, string password, string userAgent, string start, string userVersion ) : bool
firstName string Account first name
lastName string Account last name
password string Account password or MD5 hash of the password /// such as $1$1682a1e45e9f957dcdf0bb56eb43319c
userAgent string Client application name
start string Starting location URI that can be built with /// StartLocation()
userVersion string Client application version
Résultat bool

Login3Di() public méthode

public Login3Di ( LoginParams loginParams ) : bool
loginParams LoginParams
Résultat bool

Logout() public méthode

Initiate a blocking logout request. This will return when the logout handshake has completed or when Settings.LOGOUT_TIMEOUT has expired and the network layer is manually shut down
public Logout ( ) : void
Résultat void

NetworkManager() public méthode

public NetworkManager ( GridClient client ) : System
client GridClient
Résultat System

NetworkManager() public méthode

Default constructor
public NetworkManager ( GridClient client, SmartThreadPool threadPool ) : System
client GridClient Reference to the GridClient object
threadPool SmartThreadPool
Résultat System

RegisterCallback() public méthode

Register an event handler for a packet. This is a low level event interface and should only be used if you are doing something not supported in the library
public RegisterCallback ( PacketType type, PacketCallback callback ) : void
type PacketType Packet type to trigger events for
callback PacketCallback Callback to fire when a packet of this type /// is received
Résultat void

RegisterEventCallback() public méthode

Register a CAPS event handler. This is a low level event interface and should only be used if you are doing something not supported in the library
public RegisterEventCallback ( string capsEvent, Caps callback ) : void
capsEvent string Name of the CAPS event to register a handler for
callback Caps Callback to fire when a CAPS event is received
Résultat void

RegisterLoginResponseCallback() public méthode

public RegisterLoginResponseCallback ( LoginResponseCallback callback ) : void
callback LoginResponseCallback
Résultat void

RegisterLoginResponseCallback() public méthode

public RegisterLoginResponseCallback ( LoginResponseCallback callback, string options ) : void
callback LoginResponseCallback
options string
Résultat void

RequestLogout() public méthode

Initiate the logout process. Check if logout succeeded with the OnLogoutReply event, and if this does not fire the Shutdown() function needs to be manually called
public RequestLogout ( ) : void
Résultat void

SendPacket() public méthode

Send a packet to the simulator the avatar is currently occupying
public SendPacket ( Packet packet ) : void
packet Packet Packet to send
Résultat void

SendPacket() public méthode

Send a packet to a specified simulator
public SendPacket ( Packet packet, Simulator simulator ) : void
packet Packet Packet to send
simulator Simulator Simulator to send the packet to
Résultat void

Shutdown() public méthode

Shutdown will disconnect all the sims except for the current sim first, and then kill the connection to CurrentSim. This should only be called if the logout process times out on RequestLogout
public Shutdown ( DisconnectType type ) : void
type DisconnectType
Résultat void

StartLocation() public static méthode

Build a start location URI for passing to the Login function
public static StartLocation ( string sim, int x, int y, int z ) : string
sim string Name of the simulator to start in
x int X coordinate to start at
y int Y coordinate to start at
z int Z coordinate to start at
Résultat string

UnregisterCallback() public méthode

Unregister an event handler for a packet. This is a low level event interface and should only be used if you are doing something not supported in the library
public UnregisterCallback ( PacketType type, PacketCallback callback ) : void
type PacketType Packet type this callback is registered with
callback PacketCallback Callback to stop firing events for
Résultat void

UnregisterEventCallback() public méthode

Unregister a CAPS event handler. This is a low level event interface and should only be used if you are doing something not supported in the library
public UnregisterEventCallback ( string capsEvent, Caps callback ) : void
capsEvent string Name of the CAPS event this callback is /// registered with
callback Caps Callback to stop firing events for
Résultat void

UnregisterLoginResponseCallback() public méthode

public UnregisterLoginResponseCallback ( LoginResponseCallback callback ) : void
callback LoginResponseCallback
Résultat void

Property Details

AssetServerUri public_oe property

public String AssetServerUri
Résultat String

LoginSeedCapability public_oe property

Seed CAPS URL returned from the login server
public string LoginSeedCapability
Résultat string

SecureSessionID public_oe property

public UUID SecureSessionID
Résultat UUID

Simulators public_oe property

All of the simulators we are currently connected to
public List Simulators
Résultat List