C# 클래스 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.
파일 보기 프로젝트 열기: 3di/3di-viewer-rei-libs 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
AssetServerUri String
LoginSeedCapability string
SecureSessionID UUID
Simulators List

공개 메소드들

메소드 설명
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

비공개 메소드들

메소드 설명
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

메소드 상세

Begin3DiLogin() 공개 메소드

public Begin3DiLogin ( LoginParams loginParams ) : void
loginParams LoginParams
리턴 void

BeginLogin() 공개 메소드

public BeginLogin ( LoginParams loginParams ) : void
loginParams LoginParams
리턴 void

Connect() 공개 메소드

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
리턴 Simulator

Connect() 공개 메소드

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
리턴 Simulator

DefaultLoginParams() 공개 메소드

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
리턴 LoginParams

DisconnectSim() 공개 메소드

public DisconnectSim ( Simulator sim, bool sendCloseCircuit ) : void
sim Simulator
sendCloseCircuit bool
리턴 void

FindSimulator() 공개 메소드

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
리턴 Simulator

Login() 공개 메소드

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
리턴 bool

Login() 공개 메소드

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
리턴 bool

Login() 공개 메소드

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
리턴 bool

Login3Di() 공개 메소드

public Login3Di ( LoginParams loginParams ) : bool
loginParams LoginParams
리턴 bool

Logout() 공개 메소드

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
리턴 void

NetworkManager() 공개 메소드

public NetworkManager ( GridClient client ) : System
client GridClient
리턴 System

NetworkManager() 공개 메소드

Default constructor
public NetworkManager ( GridClient client, SmartThreadPool threadPool ) : System
client GridClient Reference to the GridClient object
threadPool SmartThreadPool
리턴 System

RegisterCallback() 공개 메소드

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
리턴 void

RegisterEventCallback() 공개 메소드

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
리턴 void

RegisterLoginResponseCallback() 공개 메소드

public RegisterLoginResponseCallback ( LoginResponseCallback callback ) : void
callback LoginResponseCallback
리턴 void

RegisterLoginResponseCallback() 공개 메소드

public RegisterLoginResponseCallback ( LoginResponseCallback callback, string options ) : void
callback LoginResponseCallback
options string
리턴 void

RequestLogout() 공개 메소드

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
리턴 void

SendPacket() 공개 메소드

Send a packet to the simulator the avatar is currently occupying
public SendPacket ( Packet packet ) : void
packet Packet Packet to send
리턴 void

SendPacket() 공개 메소드

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
리턴 void

Shutdown() 공개 메소드

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
리턴 void

StartLocation() 공개 정적인 메소드

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
리턴 string

UnregisterCallback() 공개 메소드

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
리턴 void

UnregisterEventCallback() 공개 메소드

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
리턴 void

UnregisterLoginResponseCallback() 공개 메소드

public UnregisterLoginResponseCallback ( LoginResponseCallback callback ) : void
callback LoginResponseCallback
리턴 void

프로퍼티 상세

AssetServerUri 공개적으로 프로퍼티

public String AssetServerUri
리턴 String

LoginSeedCapability 공개적으로 프로퍼티

Seed CAPS URL returned from the login server
public string LoginSeedCapability
리턴 string

SecureSessionID 공개적으로 프로퍼티

public UUID SecureSessionID
리턴 UUID

Simulators 공개적으로 프로퍼티

All of the simulators we are currently connected to
public List Simulators
리턴 List