diff options
author | Mike Mazur | 2009-02-04 00:01:36 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-04 00:01:36 +0000 |
commit | 0c03a48fb2060eda4d288e2d2ca4e650ce000b4b (patch) | |
tree | a90465075960c92367b0a5e62db3121e4e3a139d /OpenSim/Region/Environment/Scenes/Hypergrid | |
parent | * Add another object to the existing save oar test (diff) | |
download | opensim-SC_OLD-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.zip opensim-SC_OLD-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.gz opensim-SC_OLD-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.bz2 opensim-SC_OLD-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.xz |
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Hypergrid')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs index 3acaa21..73a5a3a 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs | |||
@@ -1,29 +1,29 @@ | |||
1 | /** | 1 | /** |
2 | * Copyright (c) 2008, Contributors. All rights reserved. | 2 | * Copyright (c) 2008, Contributors. All rights reserved. |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without modification, | 5 | * Redistribution and use in source and binary forms, with or without modification, |
6 | * are permitted provided that the following conditions are met: | 6 | * are permitted provided that the following conditions are met: |
7 | * | 7 | * |
8 | * * Redistributions of source code must retain the above copyright notice, | 8 | * * Redistributions of source code must retain the above copyright notice, |
9 | * this list of conditions and the following disclaimer. | 9 | * this list of conditions and the following disclaimer. |
10 | * * Redistributions in binary form must reproduce the above copyright notice, | 10 | * * Redistributions in binary form must reproduce the above copyright notice, |
11 | * this list of conditions and the following disclaimer in the documentation | 11 | * this list of conditions and the following disclaimer in the documentation |
12 | * and/or other materials provided with the distribution. | 12 | * and/or other materials provided with the distribution. |
13 | * * Neither the name of the Organizations nor the names of Individual | 13 | * * Neither the name of the Organizations nor the names of Individual |
14 | * Contributors may be used to endorse or promote products derived from | 14 | * Contributors may be used to endorse or promote products derived from |
15 | * this software without specific prior written permission. | 15 | * this software without specific prior written permission. |
16 | * | 16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
20 | * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 20 | * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE | 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
22 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 22 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
25 | * OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
@@ -48,7 +48,7 @@ using OpenSim.Region.Environment.Scenes; | |||
48 | 48 | ||
49 | namespace OpenSim.Region.Environment.Scenes.Hypergrid | 49 | namespace OpenSim.Region.Environment.Scenes.Hypergrid |
50 | { | 50 | { |
51 | public class HGAssetMapper | 51 | public class HGAssetMapper |
52 | { | 52 | { |
53 | #region Fields | 53 | #region Fields |
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -128,12 +128,12 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
128 | 128 | ||
129 | if (m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset) && (asset != null)) | 129 | if (m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset) && (asset != null)) |
130 | { | 130 | { |
131 | m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Name + " " + assetID); | 131 | m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Metadata.Name + " " + assetID); |
132 | // I think I need to store it in the asset DB too. | 132 | // I think I need to store it in the asset DB too. |
133 | // For now, let me just do it for textures and scripts | 133 | // For now, let me just do it for textures and scripts |
134 | if (((AssetType)asset.Type == AssetType.Texture) || | 134 | if (((AssetType)asset.Metadata.Type == AssetType.Texture) || |
135 | ((AssetType)asset.Type == AssetType.LSLBytecode) || | 135 | ((AssetType)asset.Metadata.Type == AssetType.LSLBytecode) || |
136 | ((AssetType)asset.Type == AssetType.LSLText)) | 136 | ((AssetType)asset.Metadata.Type == AssetType.LSLText)) |
137 | { | 137 | { |
138 | AssetBase asset1 = new AssetBase(); | 138 | AssetBase asset1 = new AssetBase(); |
139 | Copy(asset, asset1); | 139 | Copy(asset, asset1); |
@@ -157,9 +157,9 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
157 | if (asset1 != null) | 157 | if (asset1 != null) |
158 | { | 158 | { |
159 | // See long comment in AssetCache.AddAsset | 159 | // See long comment in AssetCache.AddAsset |
160 | if (!asset1.Temporary || asset1.Local) | 160 | if (!asset1.Metadata.Temporary || asset1.Metadata.Local) |
161 | { | 161 | { |
162 | // The asset cache returns instances of subclasses of AssetBase: | 162 | // The asset cache returns instances of subclasses of AssetBase: |
163 | // TextureImage or AssetInfo. So in passing them to the remote | 163 | // TextureImage or AssetInfo. So in passing them to the remote |
164 | // server we first need to convert this to instances of AssetBase, | 164 | // server we first need to convert this to instances of AssetBase, |
165 | // which is the serializable class for assets. | 165 | // which is the serializable class for assets. |
@@ -179,14 +179,14 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
179 | private void Copy(AssetBase from, AssetBase to) | 179 | private void Copy(AssetBase from, AssetBase to) |
180 | { | 180 | { |
181 | to.Data = from.Data; | 181 | to.Data = from.Data; |
182 | to.Description = from.Description; | 182 | to.Metadata.Description = from.Metadata.Description; |
183 | to.FullID = from.FullID; | 183 | to.Metadata.FullID = from.Metadata.FullID; |
184 | to.ID = from.ID; | 184 | to.Metadata.ID = from.Metadata.ID; |
185 | to.Local = from.Local; | 185 | to.Metadata.Local = from.Metadata.Local; |
186 | to.Name = from.Name; | 186 | to.Metadata.Name = from.Metadata.Name; |
187 | to.Temporary = from.Temporary; | 187 | to.Metadata.Temporary = from.Metadata.Temporary; |
188 | to.Type = from.Type; | 188 | to.Metadata.Type = from.Metadata.Type; |
189 | 189 | ||
190 | } | 190 | } |
191 | 191 | ||
192 | private void _guardedAdd(Dictionary<UUID, bool> lst, UUID obj, bool val) | 192 | private void _guardedAdd(Dictionary<UUID, bool> lst, UUID obj, bool val) |
@@ -243,7 +243,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
243 | private Dictionary<UUID, bool> SniffUUIDs(AssetBase asset) | 243 | private Dictionary<UUID, bool> SniffUUIDs(AssetBase asset) |
244 | { | 244 | { |
245 | Dictionary<UUID, bool> uuids = new Dictionary<UUID, bool>(); | 245 | Dictionary<UUID, bool> uuids = new Dictionary<UUID, bool>(); |
246 | if ((asset != null) && ((AssetType)asset.Type == AssetType.Object)) | 246 | if ((asset != null) && ((AssetType)asset.Metadata.Type == AssetType.Object)) |
247 | { | 247 | { |
248 | string ass_str = Utils.BytesToString(asset.Data); | 248 | string ass_str = Utils.BytesToString(asset.Data); |
249 | SceneObjectGroup sog = new SceneObjectGroup(ass_str, true); | 249 | SceneObjectGroup sog = new SceneObjectGroup(ass_str, true); |