Esempio n. 1
0
 public override void FromOSD(OpenMetaverse.StructuredData.OSDMap map)
 {
     GlobalPosX = map["GlobalPosX"];
     GlobalPosY = map["GlobalPosY"];
     LandData = new LandData();
     LandData.FromOSD((OSDMap) map["LandData"]);
     RegionName = map["RegionName"];
     RegionType = map["RegionType"];
 }
Esempio n. 2
0
 static OSDMap LandData2WebOSD (LandData parcel)
 {
     var parcelOSD = parcel.ToOSD ();
     parcelOSD ["GenericData"] = parcelOSD.ContainsKey ("GenericData") 
                                          ? (parcelOSD ["GenericData"].Type == OSDType.Map 
                                             ? parcelOSD ["GenericData"] 
                                             : (OSDMap)OSDParser.DeserializeLLSDXml (parcelOSD ["GenericData"].ToString ())) 
                                          : new OSDMap ();
     parcelOSD ["Bitmap"] = OSD.FromBinary (parcelOSD ["Bitmap"]).ToString ();
     return parcelOSD;
 }
        public override void FromOSD(OSDMap map)
        {
            GlobalPosX = (float)Convert.ToDecimal (map ["GlobalPosX"].AsString (), Culture.NumberFormatInfo);
            GlobalPosY = (float)Convert.ToDecimal (map ["GlobalPosY"].AsString (), Culture.NumberFormatInfo);
//            GlobalPosX = map["GlobalPosX"];
//            GlobalPosY = map["GlobalPosY"];
            LandData = new LandData();
            LandData.FromOSD((OSDMap) map["LandData"]);
            RegionName = map["RegionName"];
            RegionType = map["RegionType"];
            RegionTerrain = map["RegionTerrain"];
            RegionArea = map["RegionArea"];
        }
 bool ContainsPoint(LandData data, int checkx, int checky)
 {
     int x = 0, y = 0, i = 0;
     for (i = 0; i < data.Bitmap.Length; i++)
     {
         byte tempByte = 0;
         if (i < data.Bitmap.Length)
             tempByte = data.Bitmap[i];
         else
             break; //All the rest are false then
         int bitNum = 0;
         for (bitNum = 0; bitNum < 8; bitNum++)
         {
             if (x == checkx/4 && y == checky/4)
                 return Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & 1);
             x++;
             //Remove the offset so that we get a calc from the beginning of the array, not the offset array
             if (x > ((m_scene.RegionInfo.RegionSizeX/4) - 1))
             {
                 x = 0; //Back to the beginning
                 y++;
             }
         }
     }
     return false;
 }
Esempio n. 5
0
 private void OnLandObjectAdded(LandData newParcel)
 {
     //If a new land object is added or updated, we need to redo the check for the avatars invulnerability
     m_scene.ForEachScenePresence(sp => AvatarEnteringParcel(sp, null));
 }
Esempio n. 6
0
        /// <summary>
        ///     Make a new copy of the land data
        /// </summary>
        /// <returns></returns>
        public LandData Copy()
        {
            LandData landData = new LandData {
                _AABBMax          = _AABBMax,
                _AABBMin          = _AABBMin,
                _area             = _area,
                _auctionID        = _auctionID,
                _authBuyerID      = _authBuyerID,
                _category         = _category,
                _claimDate        = _claimDate,
                _claimPrice       = _claimPrice,
                _globalID         = _globalID,
                _groupID          = _groupID,
                _isGroupOwned     = _isGroupOwned,
                _localID          = _localID,
                _landingType      = _landingType,
                _mediaAutoScale   = _mediaAutoScale,
                _mediaID          = _mediaID,
                _mediaURL         = _mediaURL,
                _musicURL         = _musicURL,
                _ownerID          = _ownerID,
                _bitmap           = (byte[])_bitmap.Clone(),
                _description      = _description,
                _flags            = _flags,
                _name             = _name,
                _status           = _status,
                _passHours        = _passHours,
                _passPrice        = _passPrice,
                _salePrice        = _salePrice,
                _snapshotID       = _snapshotID,
                _userLocation     = _userLocation,
                _userLookAt       = _userLookAt,
                _otherCleanTime   = _otherCleanTime,
                _dwell            = _dwell,
                _mediaType        = _mediaType,
                _mediaDescription = _mediaDescription,
                _mediaWidth       = _mediaWidth,
                _mediaHeight      = _mediaHeight,
                _mediaLoop        = _mediaLoop,
                _MediaLoopSet     = _MediaLoopSet,
                _obscureMusic     = _obscureMusic,
                _obscureMedia     = _obscureMedia,
                // 25062016 LibOMV update
                _seeAVs        = _seeAVs,
                _anyAVSounds   = _anyAVSounds,
                _groupAVSounds = _groupAVSounds,
                // End
                _regionID     = _regionID,
                _regionHandle = _regionHandle,
                _Maturity     = _Maturity,
                _private      = _private
            };


            landData._parcelAccessList.Clear();

            foreach (
                ParcelManager.ParcelAccessEntry newEntry in
                _parcelAccessList.Select(entry => new ParcelManager.ParcelAccessEntry
            {
                AgentID = entry.AgentID,
                Flags = entry.Flags,
                Time = entry.Time
            }))
            {
                landData._parcelAccessList.Add(newEntry);
            }

            return(landData);
        }
        /// <summary>
        ///     Reify/deserialize landData
        /// </summary>
        /// <param name="serializedLandData"></param>
        /// <returns></returns>
        /// <exception cref="System.Xml.XmlException"></exception>
        public static LandData Deserialize(string serializedLandData)
        {
            LandData landData = new LandData();

            StringReader sr = new StringReader(serializedLandData);
            XmlTextReader xtr = new XmlTextReader(sr);

            xtr.ReadStartElement("LandData");

            landData.Area = Convert.ToInt32(xtr.ReadElementString("Area"));
            landData.AuctionID = Convert.ToUInt32(xtr.ReadElementString("AuctionID"));
            landData.AuthBuyerID = UUID.Parse(xtr.ReadElementString("AuthBuyerID"));
            landData.Category = (ParcelCategory) Convert.ToSByte(xtr.ReadElementString("Category"));
            landData.ClaimDate = Convert.ToInt32(xtr.ReadElementString("ClaimDate"));
            landData.ClaimPrice = Convert.ToInt32(xtr.ReadElementString("ClaimPrice"));
            landData.GlobalID = UUID.Parse(xtr.ReadElementString("GlobalID"));
            landData.GroupID = UUID.Parse(xtr.ReadElementString("GroupID"));
            landData.IsGroupOwned = Convert.ToBoolean(xtr.ReadElementString("IsGroupOwned"));
            landData.Bitmap = Convert.FromBase64String(xtr.ReadElementString("Bitmap"));
            landData.Description = xtr.ReadElementString("Description");
            landData.Flags = Convert.ToUInt32(xtr.ReadElementString("Flags"));
            landData.LandingType = Convert.ToByte(xtr.ReadElementString("LandingType"));
            landData.Name = xtr.ReadElementString("Name");
            landData.Status = (ParcelStatus) Convert.ToSByte(xtr.ReadElementString("Status"));
            landData.LocalID = Convert.ToInt32(xtr.ReadElementString("LocalID"));
            landData.MediaAutoScale = Convert.ToByte(xtr.ReadElementString("MediaAutoScale"));
            landData.MediaID = UUID.Parse(xtr.ReadElementString("MediaID"));
            landData.MediaURL = xtr.ReadElementString("MediaURL");
            landData.MusicURL = xtr.ReadElementString("MusicURL");
            landData.OwnerID = UUID.Parse(xtr.ReadElementString("OwnerID"));

            landData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
            xtr.Read();
            if (xtr.Name != "ParcelAccessList")
                throw new XmlException(String.Format("Expected \"ParcelAccessList\" element but got \"{0}\"", xtr.Name));

            if (!xtr.IsEmptyElement)
            {
                while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
                {
                    ParcelManager.ParcelAccessEntry pae = new ParcelManager.ParcelAccessEntry();

                    xtr.ReadStartElement("ParcelAccessEntry");
                    pae.AgentID = UUID.Parse(xtr.ReadElementString("AgentID"));
                    xtr.ReadElementString("Time");
                    pae.Flags = (AccessList) Convert.ToUInt32(xtr.ReadElementString("AccessList"));
                    pae.Time = DateTime.UtcNow;
                    xtr.ReadEndElement();

                    landData.ParcelAccessList.Add(pae);
                }
            }
            xtr.Read();

            landData.PassHours = Convert.ToSingle(xtr.ReadElementString("PassHours"));
            landData.PassPrice = Convert.ToInt32(xtr.ReadElementString("PassPrice"));
            landData.SalePrice = Convert.ToInt32(xtr.ReadElementString("SalePrice"));
            landData.SnapshotID = UUID.Parse(xtr.ReadElementString("SnapshotID"));
            landData.UserLocation = Vector3.Parse(xtr.ReadElementString("UserLocation"));
            landData.UserLookAt = Vector3.Parse(xtr.ReadElementString("UserLookAt"));
            // No longer used here
            xtr.ReadElementString("Dwell");
            landData.OtherCleanTime = Convert.ToInt32(xtr.ReadElementString("OtherCleanTime"));

            xtr.ReadEndElement();

            xtr.Close();
            sr.Close();

            return landData;
        }
        public static string Serialize(LandData landData)
        {
            StringWriter sw = new StringWriter();
            XmlTextWriter xtw = new XmlTextWriter(sw) {Formatting = Formatting.Indented};

            xtw.WriteStartDocument();
            xtw.WriteStartElement("LandData");

            xtw.WriteElementString("Area", Convert.ToString(landData.Area));
            xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID));
            xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString());
            xtw.WriteElementString("Category", Convert.ToString((sbyte) landData.Category));
            xtw.WriteElementString("ClaimDate", Convert.ToString(landData.ClaimDate));
            xtw.WriteElementString("ClaimPrice", Convert.ToString(landData.ClaimPrice));
            xtw.WriteElementString("GlobalID", landData.GlobalID.ToString());
            xtw.WriteElementString("GroupID", landData.GroupID.ToString());
            xtw.WriteElementString("IsGroupOwned", Convert.ToString(landData.IsGroupOwned));
            xtw.WriteElementString("Bitmap", Convert.ToBase64String(landData.Bitmap));
            xtw.WriteElementString("Description", landData.Description);
            xtw.WriteElementString("Flags", Convert.ToString(landData.Flags));
            xtw.WriteElementString("LandingType", Convert.ToString(landData.LandingType));
            xtw.WriteElementString("Name", landData.Name);
            xtw.WriteElementString("Status", Convert.ToString((sbyte) landData.Status));
            xtw.WriteElementString("LocalID", landData.LocalID.ToString());
            xtw.WriteElementString("MediaAutoScale", Convert.ToString(landData.MediaAutoScale));
            xtw.WriteElementString("MediaID", landData.MediaID.ToString());
            xtw.WriteElementString("MediaURL", landData.MediaURL);
            xtw.WriteElementString("MusicURL", landData.MusicURL);
            xtw.WriteElementString("OwnerID", landData.OwnerID.ToString());

            xtw.WriteStartElement("ParcelAccessList");
            foreach (ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList)
            {
                xtw.WriteStartElement("ParcelAccessEntry");
                xtw.WriteElementString("AgentID", pal.AgentID.ToString());
                xtw.WriteElementString("Time", pal.Time.ToString("s"));
                xtw.WriteElementString("AccessList", Convert.ToString((uint) pal.Flags));
                xtw.WriteEndElement();
            }
            xtw.WriteEndElement();

            xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours));
            xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice));
            xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice));
            xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString());
            xtw.WriteElementString("UserLocation", landData.UserLocation.ToString());
            xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString());
            xtw.WriteElementString("Dwell", "0");
            xtw.WriteElementString("OtherCleanTime", Convert.ToString(landData.OtherCleanTime));

            xtw.WriteEndElement();

            xtw.Close();
            sw.Close();

            return sw.ToString();
        }
 private void OnLandObjectAdded(LandData newParcel)
 {
     //Taint it!
     TaintPrimCount(m_Scene.RequestModuleInterface<IParcelManagementModule>().GetLandObject(newParcel.GlobalID));
 }
Esempio n. 10
0
        /// <summary>
        ///     Make a new copy of the land data
        /// </summary>
        /// <returns></returns>
        public LandData Copy ()
        {
            LandData landData = new LandData {
                _AABBMax = _AABBMax,
                _AABBMin = _AABBMin,
                _area = _area,
                _auctionID = _auctionID,
                _authBuyerID = _authBuyerID,
                _category = _category,
                _claimDate = _claimDate,
                _claimPrice = _claimPrice,
                _globalID = _globalID,
                _groupID = _groupID,
                _isGroupOwned = _isGroupOwned,
                _localID = _localID,
                _landingType = _landingType,
                _mediaAutoScale = _mediaAutoScale,
                _mediaID = _mediaID,
                _mediaURL = _mediaURL,
                _musicURL = _musicURL,
                _ownerID = _ownerID,
                _bitmap = (byte[])_bitmap.Clone (),
                _description = _description,
                _flags = _flags,
                _name = _name,
                _status = _status,
                _passHours = _passHours,
                _passPrice = _passPrice,
                _salePrice = _salePrice,
                _snapshotID = _snapshotID,
                _userLocation = _userLocation,
                _userLookAt = _userLookAt,
                _otherCleanTime = _otherCleanTime,
                _dwell = _dwell,
                _mediaType = _mediaType,
                _mediaDescription = _mediaDescription,
                _mediaWidth = _mediaWidth,
                _mediaHeight = _mediaHeight,
                _mediaLoop = _mediaLoop,
                _MediaLoopSet = _MediaLoopSet,
                _obscureMusic = _obscureMusic,
                _obscureMedia = _obscureMedia,
                // 25062016 LibOMV update
                _seeAVs = _seeAVs,
                _anyAVSounds = _anyAVSounds,
                _groupAVSounds = _groupAVSounds,
                // End
                _regionID = _regionID,
                _regionHandle = _regionHandle,
                _Maturity = _Maturity,
                _private = _private
            };


            landData._parcelAccessList.Clear ();

            foreach (
                ParcelManager.ParcelAccessEntry newEntry in
                    _parcelAccessList.Select(entry => new ParcelManager.ParcelAccessEntry
                                                          {
                                                              AgentID = entry.AgentID,
                                                              Flags = entry.Flags,
                                                              Time = entry.Time
                                                          }))
            {
                landData._parcelAccessList.Add (newEntry);
            }

            return landData;
        }
 public bool PreprocessIncomingLandObjectFromStorage(LandData data, Vector2 parcelOffset)
 {
     ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene);
     new_land.LandData = data;
     return SetLandBitmapFromByteArray(new_land, false, parcelOffset);
 }
        static List<LandData> Query2LandData(List<string> Query)
        {
            List<LandData> Lands = new List<LandData>();

            for (int i = 0; i < Query.Count; i += 24)
            {
                LandData landData = new LandData ();

                landData.RegionID = UUID.Parse (Query [i]);
                landData.GlobalID = UUID.Parse (Query [i + 1]);
                landData.LocalID = int.Parse (Query [i + 2]);

                // be aware of culture differences here...
                var posX = (float)Convert.ToDecimal (Query[i + 3], Culture.NumberFormatInfo);
                var posY = (float)Convert.ToDecimal (Query[i + 4], Culture.NumberFormatInfo);
                var posZ = (float)Convert.ToDecimal (Query[i + 5], Culture.NumberFormatInfo);
                landData.UserLocation = new Vector3 (posX, posY, posZ);

                // UserLocation =
                //     new Vector3(float.Parse(Query[i + 3]), float.Parse(Query[i + 4]), float.Parse(Query[i + 5])),
                landData.Name = Query[i + 6];
                landData.Description = Query[i + 7];
                landData.Flags = uint.Parse(Query[i + 8]);
                landData.Dwell = int.Parse(Query[i + 9]);
                //landData.InfoUUID = UUID.Parse(Query[i + 10]);
                landData.SalePrice = int.Parse(Query[i + 12]);
                landData.AuctionID = uint.Parse(Query[i + 13]);
                landData.Area = int.Parse(Query[i + 14]);
                landData.Maturity = int.Parse(Query[i + 16]);
                landData.OwnerID = UUID.Parse(Query[i + 17]);
                landData.GroupID = UUID.Parse(Query[i + 18]);
                landData.SnapshotID = UUID.Parse(Query[i + 20]);
                     
                try
                {
                    landData.Bitmap = OSDParser.DeserializeLLSDXml(Query[i + 21]);
                }
                catch
                {
                }

                // set some flags
                if (uint.Parse (Query [i + 11]) != 0)
                    landData.Flags |= (uint) ParcelFlags.ForSale;
                
                if (uint.Parse (Query [i + 19]) != 0)
                    landData.Flags |= (uint) ParcelFlags.ShowDirectory;

                landData.Category = (string.IsNullOrEmpty(Query[i + 22]))
                                        ? ParcelCategory.None
                                        : (ParcelCategory) int.Parse(Query[i + 22]);
                landData.ScopeID = UUID.Parse(Query[i + 23]);

                Lands.Add(landData);
            }
            return Lands;
        }
Esempio n. 13
0
        public RegionData LoadBackup(string file)
        {
            if (!File.Exists(file))
                return null;

            var stream = ArchiveHelpers.GetStream(file);
            if (stream == null)
                return null;

            MainConsole.Instance.Warn("[TarRegionDataLoader]: loading region data: " + file);

            GZipStream m_loadStream = new GZipStream(stream, CompressionMode.Decompress);
            TarArchiveReader reader = new TarArchiveReader(m_loadStream);
            List<uint> foundLocalIDs = new List<uint>();
            RegionData regiondata = new RegionData();
            regiondata.Init();

            byte[] data;
            string filePath;
            TarArchiveReader.TarEntryType entryType;
            System.Collections.Concurrent.ConcurrentQueue<byte[]> groups =
                new System.Collections.Concurrent.ConcurrentQueue<byte[]>();
            //Load the archive data that we need
            while ((data = reader.ReadEntry(out filePath, out entryType)) != null)
            {
                MainConsole.Instance.Warn(".");
               	if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType)
                    continue;

                if (filePath.StartsWith("parcels/"))
                {
                    //Only use if we are not merging
                    LandData parcel = new LandData();
                    OSD parcelData = OSDParser.DeserializeLLSDBinary(data);
                    parcel.FromOSD((OSDMap) parcelData);
                    if (parcel.OwnerID != UUID.Parse("05948863-b678-433e-87a4-e44d17678d1d"))
                        //The default owner of the 'default' region
                        regiondata.Parcels.Add(parcel);
                }
                else if (filePath.StartsWith("newstyleterrain/"))
                {
                    regiondata.Terrain = data;
                }
                else if (filePath.StartsWith("newstylerevertterrain/"))
                {
                    regiondata.RevertTerrain = data;
                }
                else if (filePath.StartsWith("newstylewater/"))
                {
                    regiondata.Water = data;
                }
                else if (filePath.StartsWith("newstylerevertwater/"))
                {
                    regiondata.RevertWater = data;
                }
                else if (filePath.StartsWith("entities/"))
                {
                    groups.Enqueue(data);
                }
                else if (filePath.StartsWith("regioninfo/"))
                {
                    RegionInfo info = new RegionInfo();
                    info.FromOSD((OSDMap) OSDParser.DeserializeLLSDBinary(data));
                    regiondata.RegionInfo = info;
                }
                data = null;
            }
            m_loadStream.Close();
            m_loadStream = null;

            int threadCount = groups.Count > 16 ? 16 : groups.Count;
            System.Threading.Thread[] threads = new System.Threading.Thread[threadCount];
            for (int i = 0; i < threadCount; i++)
            {
                threads[i] = new System.Threading.Thread(() =>
                                                             {
                                                                 byte[] groupData;
                                                                 while (groups.TryDequeue(out groupData))
                                                                 {
                                                                     MemoryStream ms = new MemoryStream(groupData);
                                                                     ISceneEntity sceneObject =
                                                                         SceneEntitySerializer.SceneObjectSerializer
                                                                                              .FromXml2Format(ref ms,
                                                                                                              null);
                                                                     ms.Close();
                                                                     ms = null;
                                                                     data = null;
                                                                     if (sceneObject != null)
                                                                     {
                                                                         foreach (
                                                                             ISceneChildEntity part in
                                                                                 sceneObject.ChildrenEntities())
                                                                         {
                                                                             lock (foundLocalIDs)
                                                                             {
                                                                                 if (
                                                                                     !foundLocalIDs.Contains(
                                                                                         part.LocalId))
                                                                                     foundLocalIDs.Add(part.LocalId);
                                                                                 else
                                                                                     part.LocalId = 0;
                                                                                         //Reset it! Only use it once!
                                                                             }
                                                                         }
                                                                         regiondata.Groups.Add(
                                                                             sceneObject as SceneObjectGroup);
                                                                     }
                                                                 }
                                                             });
                threads[i].Start();
            }
            for (int i = 0; i < threadCount; i++)
                threads[i].Join();

            foundLocalIDs.Clear();

            MainConsole.Instance.Warn("[TarRegionDataLoader]: completed: ");

            return regiondata;
        }
Esempio n. 14
0
 public void TriggerLandObjectAdded(LandData newParcel)
 {
     LandObjectAdded handlerLandObjectAdded = OnLandObjectAdded;
     if (handlerLandObjectAdded != null)
     {
         foreach (LandObjectAdded d in handlerLandObjectAdded.GetInvocationList())
         {
             try
             {
                 d(newParcel);
             }
             catch (Exception e)
             {
                 MainConsole.Instance.ErrorFormat(
                     "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing.  {0} {1}",
                     e, e.StackTrace);
             }
         }
     }
 }
        private static List<LandData> Query2LandData(List<string> Query)
        {
            List<LandData> Lands = new List<LandData>();

            for (int i = 0; i < Query.Count; i += 24)
            {
                LandData LandData = new LandData
                                        {
                                            RegionID = UUID.Parse(Query[i]),
                                            GlobalID = UUID.Parse(Query[i + 1]),
                                            LocalID = int.Parse(Query[i + 2]),
                                            UserLocation =
                                                new Vector3(float.Parse(Query[i + 3]), float.Parse(Query[i + 4]),
                                                            float.Parse(Query[i + 5])),
                                            Name = Query[i + 6],
                                            Description = Query[i + 7],
                                            Flags = uint.Parse(Query[i + 8]),
                                            Dwell = int.Parse(Query[i + 9]),
                                            //InfoUUID = UUID.Parse(Query[i + 10]),
                                            AuctionID = uint.Parse(Query[i + 13]),
                                            Area = int.Parse(Query[i + 14]),
                                            Maturity = int.Parse(Query[i + 16]),
                                            OwnerID = UUID.Parse(Query[i + 17]),
                                            GroupID = UUID.Parse(Query[i + 18]),
                                            SnapshotID = UUID.Parse(Query[i + 20])
                                        };
                try
                {
                    LandData.Bitmap = OSDParser.DeserializeLLSDXml(Query[i + 21]);
                }
                catch
                {
                }
                LandData.Category = (string.IsNullOrEmpty(Query[i + 22]))
                                        ? ParcelCategory.None
                                        : (ParcelCategory) int.Parse(Query[i + 22]);
                LandData.ScopeID = UUID.Parse(Query[i + 23]);

                Lands.Add(LandData);
            }
            return Lands;
        }
Esempio n. 16
0
            public void LoadModuleFromArchive(byte[] data, string filePath, TarArchiveReader.TarEntryType type,
                IScene scene)
            {
                if (filePath.StartsWith("parcels/"))
                {
                    if (!m_merge)
                    {
                        //Only use if we are not merging
                        LandData parcel = new LandData();
                        OSD parcelData = OSDParser.DeserializeLLSDBinary(data);
                        parcel.FromOSD((OSDMap) parcelData);
                        m_parcels.Add(parcel);
                    }
                }
                    #region New Style Terrain Loading

                else if (filePath.StartsWith("newstyleterrain/"))
                {
                    ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
                    terrainModule.TerrainMap = ReadTerrain(data, scene);
                }
                else if (filePath.StartsWith("newstylerevertterrain/"))
                {
                    ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
                    terrainModule.TerrainRevertMap = ReadTerrain(data, scene);
                }
                else if (filePath.StartsWith("newstylewater/"))
                {
                    ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
                    terrainModule.TerrainWaterMap = ReadTerrain(data, scene);
                }
                else if (filePath.StartsWith("newstylerevertwater/"))
                {
                    ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
                    terrainModule.TerrainWaterRevertMap = ReadTerrain(data, scene);
                }
                    #endregion
                    #region Old Style Terrain Loading

                else if (filePath.StartsWith("terrain/"))
                {
                    ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();

                    MemoryStream ms = new MemoryStream(data);
                    terrainModule.LoadFromStream(filePath, ms, 0, 0);
                    ms.Close();
                }
                else if (filePath.StartsWith("revertterrain/"))
                {
                    ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();

                    MemoryStream ms = new MemoryStream(data);
                    terrainModule.LoadRevertMapFromStream(filePath, ms, 0, 0);
                    ms.Close();
                }
                else if (filePath.StartsWith("water/"))
                {
                    ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();

                    MemoryStream ms = new MemoryStream(data);
                    terrainModule.LoadWaterFromStream(filePath, ms, 0, 0);
                    ms.Close();
                }
                else if (filePath.StartsWith("revertwater/"))
                {
                    ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();

                    MemoryStream ms = new MemoryStream(data);
                    terrainModule.LoadWaterRevertMapFromStream(filePath, ms, 0, 0);
                    ms.Close();
                }
                    #endregion

                else if (filePath.StartsWith("entities/"))
                {
                    MemoryStream ms = new MemoryStream(data);
                    ISceneEntity sceneObject = SceneEntitySerializer.SceneObjectSerializer.FromXml2Format(ref ms, scene);
                    ms.Close();
                    ms = null;
                    data = null;
                    m_groups.Add(sceneObject);
                }
                else if (filePath.StartsWith("assets/"))
                {
                    if (m_loadAssets)
                    {
                        AssetBase asset = new AssetBase();
                        asset.Unpack(OSDParser.DeserializeJson(Encoding.UTF8.GetString(data)));
                        scene.AssetService.Store(asset);
                    }
                }
            }
        string ChannelUri(IScene scene, LandData land)
        {
            string channelUri = null;

            string landUUID;
            string landName;

            // Create parcel voice channel. If no parcel exists, then the voice channel ID is the same
            // as the directory ID. Otherwise, it reflects the parcel's ID.

            lock (m_ParcelAddress)
            {
                if (m_ParcelAddress.ContainsKey(land.GlobalID.ToString()))
                {
                    MainConsole.Instance.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}",
                                      land.GlobalID, m_ParcelAddress[land.GlobalID.ToString()]);
                    return m_ParcelAddress[land.GlobalID.ToString()];
                }
            }

            if (land.LocalID != 1 && (land.Flags & (uint)ParcelFlags.UseEstateVoiceChan) == 0)
            {
                landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name);
                landUUID = land.GlobalID.ToString();
                MainConsole.Instance.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
                                  landName, land.LocalID, landUUID);
            }
            else
            {
                landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionName);
                landUUID = scene.RegionInfo.RegionID.ToString();
                MainConsole.Instance.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
                                  landName, land.LocalID, landUUID);
            }
            System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();

            // slvoice handles the sip address differently if it begins with confctl, hiding it from the user in the friends list. however it also disables
            // the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator.
            channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(encoding.GetBytes(landUUID)), m_freeSwitchRealm);

            lock (m_ParcelAddress)
            {
                if (!m_ParcelAddress.ContainsKey(land.GlobalID.ToString()))
                {
                    m_ParcelAddress.Add(land.GlobalID.ToString(), channelUri);
                }
            }

            return channelUri;
        }