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/Modules/Agent | |
parent | * Add another object to the existing save oar test (diff) | |
download | opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.zip opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.gz opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.bz2 opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.xz |
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Agent')
3 files changed, 39 insertions, 39 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 689b4d5..7f4bb0b 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |||
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
72 | } | 72 | } |
73 | 73 | ||
74 | public void HandleXfer(ulong xferID, uint packetID, byte[] data) | 74 | public void HandleXfer(ulong xferID, uint packetID, byte[] data) |
75 | { | 75 | { |
76 | lock (XferUploaders) | 76 | lock (XferUploaders) |
77 | { | 77 | { |
78 | foreach (AssetXferUploader uploader in XferUploaders.Values) | 78 | foreach (AssetXferUploader uploader in XferUploaders.Values) |
@@ -97,8 +97,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
97 | wearableType, nextOwnerMask); | 97 | wearableType, nextOwnerMask); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
102 | 102 | ||
103 | /// <summary> | 103 | /// <summary> |
104 | /// Get an uploaded asset. If the data is successfully retrieved, the transaction will be removed. | 104 | /// Get an uploaded asset. If the data is successfully retrieved, the transaction will be removed. |
@@ -171,10 +171,10 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
171 | "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", | 171 | "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", |
172 | item.Name, part.Name, transactionID); | 172 | item.Name, part.Name, transactionID); |
173 | 173 | ||
174 | asset.Name = item.Name; | 174 | asset.Metadata.Name = item.Name; |
175 | asset.Description = item.Description; | 175 | asset.Metadata.Description = item.Description; |
176 | asset.Type = (sbyte)item.Type; | 176 | asset.Metadata.Type = (sbyte)item.Type; |
177 | item.AssetID = asset.FullID; | 177 | item.AssetID = asset.Metadata.FullID; |
178 | 178 | ||
179 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); | 179 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); |
180 | 180 | ||
@@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
206 | asset = GetTransactionAsset(transactionID); | 206 | asset = GetTransactionAsset(transactionID); |
207 | } | 207 | } |
208 | 208 | ||
209 | if (asset != null && asset.FullID == assetID) | 209 | if (asset != null && asset.Metadata.FullID == assetID) |
210 | { | 210 | { |
211 | // Assets never get updated, new ones get created | 211 | // Assets never get updated, new ones get created |
212 | asset.FullID = UUID.Random(); | 212 | asset.Metadata.FullID = UUID.Random(); |
213 | asset.Name = item.Name; | 213 | asset.Metadata.Name = item.Name; |
214 | asset.Description = item.Description; | 214 | asset.Metadata.Description = item.Description; |
215 | asset.Type = (sbyte)item.AssetType; | 215 | asset.Metadata.Type = (sbyte)item.AssetType; |
216 | item.AssetID = asset.FullID; | 216 | item.AssetID = asset.Metadata.FullID; |
217 | 217 | ||
218 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); | 218 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); |
219 | } | 219 | } |
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs index 6dcbe83..5387165 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs | |||
@@ -113,17 +113,17 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
113 | { | 113 | { |
114 | ourClient = remoteClient; | 114 | ourClient = remoteClient; |
115 | m_asset = new AssetBase(); | 115 | m_asset = new AssetBase(); |
116 | m_asset.FullID = assetID; | 116 | m_asset.Metadata.FullID = assetID; |
117 | m_asset.Type = type; | 117 | m_asset.Metadata.Type = type; |
118 | m_asset.Data = data; | 118 | m_asset.Data = data; |
119 | m_asset.Name = "blank"; | 119 | m_asset.Metadata.Name = "blank"; |
120 | m_asset.Description = "empty"; | 120 | m_asset.Metadata.Description = "empty"; |
121 | m_asset.Local = storeLocal; | 121 | m_asset.Metadata.Local = storeLocal; |
122 | m_asset.Temporary = tempFile; | 122 | m_asset.Metadata.Temporary = tempFile; |
123 | 123 | ||
124 | TransactionID = transaction; | 124 | TransactionID = transaction; |
125 | m_storeLocal = storeLocal; | 125 | m_storeLocal = storeLocal; |
126 | 126 | ||
127 | if (m_asset.Data.Length > 2) | 127 | if (m_asset.Data.Length > 2) |
128 | { | 128 | { |
129 | SendCompleteMessage(); | 129 | SendCompleteMessage(); |
@@ -140,12 +140,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
140 | protected void RequestStartXfer() | 140 | protected void RequestStartXfer() |
141 | { | 141 | { |
142 | XferID = Util.GetNextXferID(); | 142 | XferID = Util.GetNextXferID(); |
143 | ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); | 143 | ourClient.SendXferRequest(XferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, new byte[0]); |
144 | } | 144 | } |
145 | 145 | ||
146 | protected void SendCompleteMessage() | 146 | protected void SendCompleteMessage() |
147 | { | 147 | { |
148 | ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID); | 148 | ourClient.SendAssetUploadCompleteMessage(m_asset.Metadata.Type, true, m_asset.Metadata.FullID); |
149 | 149 | ||
150 | m_finished = true; | 150 | m_finished = true; |
151 | if (m_createItem) | 151 | if (m_createItem) |
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
164 | DateTime now = DateTime.Now; | 164 | DateTime now = DateTime.Now; |
165 | string filename = | 165 | string filename = |
166 | String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, | 166 | String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, |
167 | now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type); | 167 | now.Hour, now.Minute, now.Second, m_asset.Metadata.Name, m_asset.Metadata.Type); |
168 | SaveAssetToFile(filename, m_asset.Data); | 168 | SaveAssetToFile(filename, m_asset.Data); |
169 | } | 169 | } |
170 | } | 170 | } |
@@ -196,9 +196,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
196 | this.invType = invType; | 196 | this.invType = invType; |
197 | this.wearableType = wearableType; | 197 | this.wearableType = wearableType; |
198 | nextPerm = nextOwnerMask; | 198 | nextPerm = nextOwnerMask; |
199 | m_asset.Name = name; | 199 | m_asset.Metadata.Name = name; |
200 | m_asset.Description = description; | 200 | m_asset.Metadata.Description = description; |
201 | m_asset.Type = type; | 201 | m_asset.Metadata.Type = type; |
202 | 202 | ||
203 | if (m_finished) | 203 | if (m_finished) |
204 | { | 204 | { |
@@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
211 | } | 211 | } |
212 | } | 212 | } |
213 | 213 | ||
214 | 214 | ||
215 | private void DoCreateItem() | 215 | private void DoCreateItem() |
216 | { | 216 | { |
217 | m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); | 217 | m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); |
@@ -225,7 +225,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
225 | item.Owner = ourClient.AgentId; | 225 | item.Owner = ourClient.AgentId; |
226 | item.Creator = ourClient.AgentId; | 226 | item.Creator = ourClient.AgentId; |
227 | item.ID = UUID.Random(); | 227 | item.ID = UUID.Random(); |
228 | item.AssetID = m_asset.FullID; | 228 | item.AssetID = m_asset.Metadata.FullID; |
229 | item.Description = m_description; | 229 | item.Description = m_description; |
230 | item.Name = m_name; | 230 | item.Name = m_name; |
231 | item.AssetType = type; | 231 | item.AssetType = type; |
@@ -245,9 +245,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
245 | else | 245 | else |
246 | { | 246 | { |
247 | m_log.ErrorFormat( | 247 | m_log.ErrorFormat( |
248 | "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation", | 248 | "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation", |
249 | ourClient.AgentId); | 249 | ourClient.AgentId); |
250 | } | 250 | } |
251 | } | 251 | } |
252 | 252 | ||
253 | /// <summary> | 253 | /// <summary> |
@@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
260 | { | 260 | { |
261 | return m_asset; | 261 | return m_asset; |
262 | } | 262 | } |
263 | 263 | ||
264 | return null; | 264 | return null; |
265 | } | 265 | } |
266 | } | 266 | } |
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs index a6901b6..f9a10bf 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
55 | /// </summary> | 55 | /// </summary> |
56 | private AssetBase m_asset; | 56 | private AssetBase m_asset; |
57 | 57 | ||
58 | //public UUID assetID { get { return m_asset.FullID; } } | 58 | //public UUID assetID { get { return m_asset.Metadata.FullID; } } |
59 | 59 | ||
60 | // private bool m_cancel = false; | 60 | // private bool m_cancel = false; |
61 | 61 | ||
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
93 | get { return false; } | 93 | get { return false; } |
94 | set | 94 | set |
95 | { | 95 | { |
96 | // m_cancel = value; | 96 | // m_cancel = value; |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
@@ -102,7 +102,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
102 | get { return false; } | 102 | get { return false; } |
103 | set | 103 | set |
104 | { | 104 | { |
105 | // m_sending = value; | 105 | // m_sending = value; |
106 | } | 106 | } |
107 | } | 107 | } |
108 | 108 | ||
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
117 | // See ITextureSender | 117 | // See ITextureSender |
118 | public bool SendTexturePacket() | 118 | public bool SendTexturePacket() |
119 | { | 119 | { |
120 | //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.FullID); | 120 | //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.Metadata.FullID); |
121 | 121 | ||
122 | SendPacket(); | 122 | SendPacket(); |
123 | counter++; | 123 | counter++; |
@@ -154,7 +154,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
154 | { | 154 | { |
155 | if (NumPackets == 0) | 155 | if (NumPackets == 0) |
156 | { | 156 | { |
157 | RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); | 157 | RequestUser.SendImageFirstPart(1, m_asset.Metadata.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); |
158 | PacketCounter++; | 158 | PacketCounter++; |
159 | } | 159 | } |
160 | else | 160 | else |
@@ -163,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
163 | Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); | 163 | Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); |
164 | 164 | ||
165 | RequestUser.SendImageFirstPart( | 165 | RequestUser.SendImageFirstPart( |
166 | (ushort)(NumPackets), m_asset.FullID, (uint)m_asset.Data.Length, ImageData1, 2); | 166 | (ushort)(NumPackets), m_asset.Metadata.FullID, (uint)m_asset.Data.Length, ImageData1, 2); |
167 | PacketCounter++; | 167 | PacketCounter++; |
168 | } | 168 | } |
169 | } | 169 | } |
@@ -179,11 +179,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
179 | catch (ArgumentOutOfRangeException) | 179 | catch (ArgumentOutOfRangeException) |
180 | { | 180 | { |
181 | m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + | 181 | m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + |
182 | m_asset.FullID.ToString()); | 182 | m_asset.Metadata.ID); |
183 | return; | 183 | return; |
184 | } | 184 | } |
185 | 185 | ||
186 | RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.FullID, imageData); | 186 | RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.Metadata.FullID, imageData); |
187 | PacketCounter++; | 187 | PacketCounter++; |
188 | } | 188 | } |
189 | } | 189 | } |