diff options
author | MW | 2007-06-24 15:24:02 +0000 |
---|---|---|
committer | MW | 2007-06-24 15:24:02 +0000 |
commit | 38a800400ae8c61eef0770b8c49aa6e637478e58 (patch) | |
tree | 2d53e3c67a0990bf199e8594240cdee8dc1a8494 /OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs | |
parent | More work on CAPS handler. (diff) | |
download | opensim-SC_OLD-38a800400ae8c61eef0770b8c49aa6e637478e58.zip opensim-SC_OLD-38a800400ae8c61eef0770b8c49aa6e637478e58.tar.gz opensim-SC_OLD-38a800400ae8c61eef0770b8c49aa6e637478e58.tar.bz2 opensim-SC_OLD-38a800400ae8c61eef0770b8c49aa6e637478e58.tar.xz |
Disabled the CheckSum Server as it seems that isn't used by viewer 1.18.
Started to add support for asset uploads over CAPS (the asset is uploaded but seems to come out corrupt).
Started to cleanup/rewrite the AssetCache.
Fixed bug in MapBlock requests, where data for some regions wasn't being sent.
Renamed PrimData's Texture to TextureEntry.
most likely a few other small changes.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs b/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs index 31749d8..1b01f24 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Text; | 30 | using System.Text; |
31 | using OpenSim.Assets; | 31 | using OpenSim.Assets; |
32 | using OpenSim.Framework.Types; | 32 | using OpenSim.Framework.Types; |
33 | using OpenSim.Framework.Interfaces; | ||
33 | using OpenSim.Framework.Utilities; | 34 | using OpenSim.Framework.Utilities; |
34 | using OpenSim.Caches; | 35 | using OpenSim.Caches; |
35 | using libsecondlife; | 36 | using libsecondlife; |
@@ -258,6 +259,99 @@ namespace OpenSim | |||
258 | 259 | ||
259 | } | 260 | } |
260 | } | 261 | } |
262 | |||
263 | //new class , not currently used. | ||
264 | public class AssetXferUploader | ||
265 | { | ||
266 | private IClientAPI ourClient; | ||
267 | |||
268 | public bool UploadComplete = false; | ||
269 | |||
270 | public bool AddToInventory; | ||
271 | public LLUUID InventFolder = LLUUID.Zero; | ||
272 | |||
273 | public uint XferID; | ||
274 | public AssetBase Asset; | ||
275 | public LLUUID TransactionID = LLUUID.Zero; | ||
276 | |||
277 | |||
278 | public AssetXferUploader(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data) | ||
279 | { | ||
280 | ourClient = remoteClient; | ||
281 | Asset = new AssetBase(); | ||
282 | Asset.FullID = assetID; | ||
283 | Asset.InvType = type; | ||
284 | Asset.Type = type; | ||
285 | Asset.Data = data; | ||
286 | Asset.Name = "blank"; | ||
287 | Asset.Description = "empty"; | ||
288 | TransactionID = transaction; | ||
289 | |||
290 | if (Asset.Data.Length > 2) | ||
291 | { | ||
292 | this.SendCompleteMessage(); | ||
293 | } | ||
294 | else | ||
295 | { | ||
296 | this.ReqestStartXfer(); | ||
297 | } | ||
298 | } | ||
299 | |||
300 | protected void SendCompleteMessage() | ||
301 | { | ||
302 | UploadComplete = true; | ||
303 | AssetUploadCompletePacket response = new AssetUploadCompletePacket(); | ||
304 | response.AssetBlock.Type = Asset.Type; | ||
305 | response.AssetBlock.Success = true; | ||
306 | response.AssetBlock.UUID = Asset.FullID; | ||
307 | this.ourClient.OutPacket(response); | ||
308 | |||
309 | //TODO trigger event | ||
310 | } | ||
311 | |||
312 | protected void ReqestStartXfer() | ||
313 | { | ||
314 | UploadComplete = false; | ||
315 | XferID = Util.GetNextXferID(); | ||
316 | RequestXferPacket xfer = new RequestXferPacket(); | ||
317 | xfer.XferID.ID = XferID; | ||
318 | xfer.XferID.VFileType = Asset.Type; | ||
319 | xfer.XferID.VFileID = Asset.FullID; | ||
320 | xfer.XferID.FilePath = 0; | ||
321 | xfer.XferID.Filename = new byte[0]; | ||
322 | this.ourClient.OutPacket(xfer); | ||
323 | } | ||
324 | |||
325 | public void HandleXferPacket(uint xferID, uint packetID, byte[] data) | ||
326 | { | ||
327 | if (XferID == xferID) | ||
328 | { | ||
329 | if (Asset.Data.Length > 1) | ||
330 | { | ||
331 | byte[] newArray = new byte[Asset.Data.Length + data.Length]; | ||
332 | Array.Copy(Asset.Data, 0, newArray, 0, Asset.Data.Length); | ||
333 | Array.Copy(data, 0, newArray, Asset.Data.Length, data.Length); | ||
334 | Asset.Data = newArray; | ||
335 | } | ||
336 | else | ||
337 | { | ||
338 | byte[] newArray = new byte[data.Length - 4]; | ||
339 | Array.Copy(data, 4, newArray, 0, data.Length - 4); | ||
340 | Asset.Data = newArray; | ||
341 | } | ||
342 | |||
343 | ConfirmXferPacketPacket confirmXfer = new ConfirmXferPacketPacket(); | ||
344 | confirmXfer.XferID.ID = xferID; | ||
345 | confirmXfer.XferID.Packet = packetID; | ||
346 | this.ourClient.OutPacket(confirmXfer); | ||
347 | |||
348 | if ((packetID & 2147483648) != 0) | ||
349 | { | ||
350 | this.SendCompleteMessage(); | ||
351 | } | ||
352 | } | ||
353 | } | ||
354 | } | ||
261 | } | 355 | } |
262 | } | 356 | } |
263 | } | 357 | } |