Exemplo n.º 1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="client">Reference to the SecondLife client</param>
        public NetworkManager(SecondLife client)
        {
            Client = client;

            PacketEvents = new PacketEventDictionary(client);
            CapsEvents   = new CapsEventDictionary(client);

            // Register the internal callbacks
            RegisterCallback(PacketType.RegionHandshake, new PacketCallback(RegionHandshakeHandler));
            RegisterCallback(PacketType.StartPingCheck, new PacketCallback(StartPingCheckHandler));
            RegisterCallback(PacketType.ParcelOverlay, new PacketCallback(ParcelOverlayHandler));
            RegisterCallback(PacketType.EnableSimulator, new PacketCallback(EnableSimulatorHandler));
            RegisterCallback(PacketType.DisableSimulator, new PacketCallback(DisableSimulatorHandler));
            RegisterCallback(PacketType.KickUser, new PacketCallback(KickUserHandler));
            RegisterCallback(PacketType.LogoutReply, new PacketCallback(LogoutReplyHandler));
            RegisterCallback(PacketType.CompletePingCheck, new PacketCallback(PongHandler));
            RegisterCallback(PacketType.SimStats, new PacketCallback(SimStatsHandler));

            // GLOBAL SETTING: Don't force Expect-100: Continue headers on HTTP POST calls
            ServicePointManager.Expect100Continue = false;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="client">Reference to the SecondLife client</param>
        public NetworkManager(SecondLife client)
        {
            Client = client;

            PacketEvents = new PacketEventDictionary(client);
            CapsEvents = new CapsEventDictionary(client);
            
            // Register the internal callbacks
            RegisterCallback(PacketType.RegionHandshake, new PacketCallback(RegionHandshakeHandler));
            RegisterCallback(PacketType.StartPingCheck, new PacketCallback(StartPingCheckHandler));
            RegisterCallback(PacketType.ParcelOverlay, new PacketCallback(ParcelOverlayHandler));
            RegisterCallback(PacketType.EnableSimulator, new PacketCallback(EnableSimulatorHandler));
            RegisterCallback(PacketType.DisableSimulator, new PacketCallback(DisableSimulatorHandler));
            RegisterCallback(PacketType.KickUser, new PacketCallback(KickUserHandler));
            RegisterCallback(PacketType.LogoutReply, new PacketCallback(LogoutReplyHandler));
            RegisterCallback(PacketType.CompletePingCheck, new PacketCallback(PongHandler));
			RegisterCallback(PacketType.SimStats, new PacketCallback(SimStatsHandler));
			
            // The proper timeout for this will get set again at Login
            DisconnectTimer = new System.Timers.Timer();
            DisconnectTimer.Elapsed += new ElapsedEventHandler(DisconnectTimer_Elapsed);

            // GLOBAL SETTING: Don't force Expect-100: Continue headers on HTTP POST calls
            ServicePointManager.Expect100Continue = false;
        }