diff options
author | Melanie | 2013-04-28 19:03:39 +0200 |
---|---|---|
committer | Melanie | 2013-04-28 19:03:39 +0200 |
commit | 4275d7a839d7380ee50aeadc38a31dd467bd891e (patch) | |
tree | 1e589fc3b448b580d1cc25b52215ef5ce2d7ae78 /OpenSim/Services/AssetService/AssetService.cs | |
parent | Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff) | |
parent | Controller module for dynamic floaters (WIP) (diff) | |
download | opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.zip opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.tar.gz opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.tar.bz2 opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.tar.xz |
Merge branch 'avination-current' of ssh://3dhosting.de/var/git/careminster into avination-current
Conflicts:
bin/Regions/Regions.ini.example
Diffstat (limited to 'OpenSim/Services/AssetService/AssetService.cs')
-rw-r--r-- | OpenSim/Services/AssetService/AssetService.cs | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index f1bffa4..90c30c8 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs | |||
@@ -123,46 +123,32 @@ namespace OpenSim.Services.AssetService | |||
123 | public virtual AssetMetadata GetMetadata(string id) | 123 | public virtual AssetMetadata GetMetadata(string id) |
124 | { | 124 | { |
125 | // m_log.DebugFormat("[ASSET SERVICE]: Get asset metadata for {0}", id); | 125 | // m_log.DebugFormat("[ASSET SERVICE]: Get asset metadata for {0}", id); |
126 | |||
127 | UUID assetID; | ||
128 | 126 | ||
129 | if (!UUID.TryParse(id, out assetID)) | 127 | AssetBase asset = Get(id); |
130 | return null; | ||
131 | 128 | ||
132 | AssetBase asset = m_Database.GetAsset(assetID); | ||
133 | if (asset != null) | 129 | if (asset != null) |
134 | return asset.Metadata; | 130 | return asset.Metadata; |
135 | 131 | else | |
136 | return null; | 132 | return null; |
137 | } | 133 | } |
138 | 134 | ||
139 | public virtual byte[] GetData(string id) | 135 | public virtual byte[] GetData(string id) |
140 | { | 136 | { |
141 | // m_log.DebugFormat("[ASSET SERVICE]: Get asset data for {0}", id); | 137 | // m_log.DebugFormat("[ASSET SERVICE]: Get asset data for {0}", id); |
142 | |||
143 | UUID assetID; | ||
144 | 138 | ||
145 | if (!UUID.TryParse(id, out assetID)) | 139 | AssetBase asset = Get(id); |
146 | return null; | ||
147 | 140 | ||
148 | AssetBase asset = m_Database.GetAsset(assetID); | 141 | if (asset != null) |
149 | return asset.Data; | 142 | return asset.Data; |
143 | else | ||
144 | return null; | ||
150 | } | 145 | } |
151 | 146 | ||
152 | public virtual bool Get(string id, Object sender, AssetRetrieved handler) | 147 | public virtual bool Get(string id, Object sender, AssetRetrieved handler) |
153 | { | 148 | { |
154 | //m_log.DebugFormat("[AssetService]: Get asset async {0}", id); | 149 | //m_log.DebugFormat("[AssetService]: Get asset async {0}", id); |
155 | |||
156 | UUID assetID; | ||
157 | 150 | ||
158 | if (!UUID.TryParse(id, out assetID)) | 151 | handler(id, sender, Get(id)); |
159 | return false; | ||
160 | |||
161 | AssetBase asset = m_Database.GetAsset(assetID); | ||
162 | |||
163 | //m_log.DebugFormat("[AssetService]: Got asset {0}", asset); | ||
164 | |||
165 | handler(id, sender, asset); | ||
166 | 152 | ||
167 | return true; | 153 | return true; |
168 | } | 154 | } |