Ejemplo n.º 1
0
        private void SeedRequestCompleteHandler(CapsClient client, OSD result, Exception error)
        {
            if (result != null && result.Type == OSDType.Map)
            {
                OSDMap respTable = (OSDMap)result;

                foreach (string cap in respTable.Keys)
                {
                    _Caps[cap] = respTable[cap].AsUri();
                }

                if (_Caps.ContainsKey("EventQueueGet"))
                {
                    Logger.DebugLog("Starting event queue for " + Simulator.ToString(), Simulator.Client);

                    _EventQueueCap              = new EventQueueClient(_Caps["EventQueueGet"]);
                    _EventQueueCap.OnConnected += EventQueueConnectedHandler;
                    _EventQueueCap.OnEvent     += EventQueueEventHandler;
                    _EventQueueCap.Start();
                }
            }
            else
            {
                // The initial CAPS connection failed, try again
                MakeSeedRequest();
            }
        }
Ejemplo n.º 2
0
        private void SeedRequestCompleteHandler(CapsClient client, LLSD result, Exception error)
        {
            if (result != null && result.Type == LLSDType.Map)
            {
                LLSDMap respTable = (LLSDMap)result;

                StringBuilder capsList = new StringBuilder();

                foreach (string cap in respTable.Keys)
                {
                    capsList.Append(cap);
                    capsList.Append(' ');

                    _Caps[cap] = respTable[cap].AsUri();
                }

                Logger.DebugLog("Got capabilities: " + capsList.ToString(), Simulator.Client);

                if (_Caps.ContainsKey("EventQueueGet"))
                {
                    Logger.DebugLog("Starting event queue for " + Simulator.ToString(), Simulator.Client);

                    _EventQueueCap              = new EventQueueClient(_Caps["EventQueueGet"]);
                    _EventQueueCap.OnConnected += new EventQueueClient.ConnectedCallback(EventQueueConnectedHandler);
                    _EventQueueCap.OnEvent     += new EventQueueClient.EventCallback(EventQueueEventHandler);
                    _EventQueueCap.Start();
                }
            }
            else
            {
                // The initial CAPS connection failed, try again
                MakeSeedRequest();
            }
        }
Ejemplo n.º 3
0
        private void SeedRequestCompleteHandler(CapsClient client, OSD result, Exception error)
        {
            if (result != null && result.Type == OSDType.Map)
            {
                OSDMap respTable = (OSDMap)result;

                foreach (string cap in respTable.Keys)
                {
                    _Caps[cap] = respTable[cap].AsUri();
                }

                if (_Caps.ContainsKey("EventQueueGet"))
                {
                    Logger.DebugLog("Starting event queue for " + Simulator, Simulator.Client);

                    _EventQueueCap              = new EventQueueClient(_Caps["EventQueueGet"]);
                    _EventQueueCap.OnConnected += EventQueueConnectedHandler;
                    _EventQueueCap.OnEvent     += EventQueueEventHandler;
                    _EventQueueCap.Start();
                }

                OnCapabilitiesReceived(Simulator);
            }
            else if (
                error != null &&
                error is WebException exception &&
                exception.Response != null &&
                ((HttpWebResponse)exception.Response).StatusCode == HttpStatusCode.NotFound)
            {
                // 404 error
                Logger.Log("Seed capability returned a 404, capability system is aborting",
                           Helpers.LogLevel.Error);
            }
Ejemplo n.º 4
0
        private void SeedRequestCompleteHandler(CapsClient client, LLSD result, Exception error)
        {
            if (result != null && result.Type == LLSDType.Map)
            {
                LLSDMap respTable = (LLSDMap)result;

                StringBuilder capsList = new StringBuilder();

                foreach (string cap in respTable.Keys)
                {
                    capsList.Append(cap);
                    capsList.Append(' ');

                    _Caps[cap] = respTable[cap].AsUri();
                }

                Logger.DebugLog("Got capabilities: " + capsList.ToString(), Simulator.Client);

                if (_Caps.ContainsKey("EventQueueGet"))
                {
                    Logger.DebugLog("Starting event queue for " + Simulator.ToString(), Simulator.Client);

                    _EventQueueCap = new EventQueueClient(_Caps["EventQueueGet"]);
                    _EventQueueCap.OnConnected += new EventQueueClient.ConnectedCallback(EventQueueConnectedHandler);
                    _EventQueueCap.OnEvent += new EventQueueClient.EventCallback(EventQueueEventHandler);
                    _EventQueueCap.Start();
                }
            }
            else
            {
                // The initial CAPS connection failed, try again
                MakeSeedRequest();
            }
        }