OpenMetaverse.GridManager.MapLayerResponseHandler C# (CSharp) Метод

MapLayerResponseHandler() приватный Метод

private MapLayerResponseHandler ( CapsClient client, OSD result, Exception error ) : void
client OpenMetaverse.Http.CapsClient
result OSD
error System.Exception
Результат void
        private void MapLayerResponseHandler(CapsClient client, OSD result, Exception error)
        {
            OSDMap body = null;
            try
            {
                body = (OSDMap)result;
            }
            catch (Exception e)
            {
                Logger.Log("[MapLayer] Error handling map layer request.", Helpers.LogLevel.Warning);
                return;
            }
            OSDArray layerData = (OSDArray)body["LayerData"];

            if (OnGridLayer != null)
            {
                for (int i = 0; i < layerData.Count; i++)
                {
                    OSDMap thisLayerData = (OSDMap)layerData[i];

                    GridLayer layer;
                    layer.Bottom = thisLayerData["Bottom"].AsInteger();
                    layer.Left = thisLayerData["Left"].AsInteger();
                    layer.Top = thisLayerData["Top"].AsInteger();
                    layer.Right = thisLayerData["Right"].AsInteger();
                    layer.ImageID = thisLayerData["ImageID"].AsUUID();

                    try { OnGridLayer(layer); }
                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                }
            }

            if (body.ContainsKey("MapBlocks"))
            {
                // TODO: At one point this will become activated
                Logger.Log("Got MapBlocks through CAPS, please finish this function!", Helpers.LogLevel.Error, Client);
            }
        }