diff options
author | MW | 2007-03-25 20:23:06 +0000 |
---|---|---|
committer | MW | 2007-03-25 20:23:06 +0000 |
commit | 84c2a72140822fc28da3590b48db392d132ef0ea (patch) | |
tree | f7060653bc50070a48cd86f6940381dbde32c910 /OpenSim.RegionServer | |
parent | * Hopefully it builds again... (diff) | |
download | opensim-SC_OLD-84c2a72140822fc28da3590b48db392d132ef0ea.zip opensim-SC_OLD-84c2a72140822fc28da3590b48db392d132ef0ea.tar.gz opensim-SC_OLD-84c2a72140822fc28da3590b48db392d132ef0ea.tar.bz2 opensim-SC_OLD-84c2a72140822fc28da3590b48db392d132ef0ea.tar.xz |
Hopefully fixed the texture uploading and the crashing when a prim with a uploaded texture on it is moved.
Diffstat (limited to '')
-rw-r--r-- | OpenSim.RegionServer/AgentAssetUpload.cs | 6 | ||||
-rw-r--r-- | OpenSim.RegionServer/Assets/AssetCache.cs | 18 | ||||
-rw-r--r-- | OpenSim.RegionServer/Assets/InventoryCache.cs | 6 | ||||
-rw-r--r-- | OpenSim.RegionServer/SimClient.cs | 16 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/Primitive.cs | 8 |
5 files changed, 30 insertions, 24 deletions
diff --git a/OpenSim.RegionServer/AgentAssetUpload.cs b/OpenSim.RegionServer/AgentAssetUpload.cs index 2b4d78f..5d40c88 100644 --- a/OpenSim.RegionServer/AgentAssetUpload.cs +++ b/OpenSim.RegionServer/AgentAssetUpload.cs | |||
@@ -20,7 +20,6 @@ namespace OpenSim | |||
20 | 20 | ||
21 | public void AddUpload(LLUUID transactionID, AssetBase asset) | 21 | public void AddUpload(LLUUID transactionID, AssetBase asset) |
22 | { | 22 | { |
23 | Console.WriteLine("adding upload asset"); | ||
24 | AssetTransaction upload = new AssetTransaction(); | 23 | AssetTransaction upload = new AssetTransaction(); |
25 | lock (this.transactions) | 24 | lock (this.transactions) |
26 | { | 25 | { |
@@ -40,7 +39,6 @@ namespace OpenSim | |||
40 | } | 39 | } |
41 | else | 40 | else |
42 | { | 41 | { |
43 | Console.WriteLine(" no data in upload request so use xfer system"); | ||
44 | upload.UploadComplete = false; | 42 | upload.UploadComplete = false; |
45 | upload.XferID = Util.GetNextXferID(); | 43 | upload.XferID = Util.GetNextXferID(); |
46 | RequestXferPacket xfer = new RequestXferPacket(); | 44 | RequestXferPacket xfer = new RequestXferPacket(); |
@@ -155,7 +153,7 @@ namespace OpenSim | |||
155 | OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset); | 153 | OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset); |
156 | } | 154 | } |
157 | 155 | ||
158 | Console.WriteLine(Helpers.FieldToString(trans.Asset.Data)); | 156 | |
159 | } | 157 | } |
160 | break; | 158 | break; |
161 | } | 159 | } |
@@ -183,7 +181,7 @@ namespace OpenSim | |||
183 | { | 181 | { |
184 | //already complete so we can add it to the inventory | 182 | //already complete so we can add it to the inventory |
185 | OpenSimRoot.Instance.AssetCache.AddAsset(trans.Asset); | 183 | OpenSimRoot.Instance.AssetCache.AddAsset(trans.Asset); |
186 | OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset); | 184 | Console.WriteLine( "ITem created is " +OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset).ToStringHyphenated()); |
187 | } | 185 | } |
188 | else | 186 | else |
189 | { | 187 | { |
diff --git a/OpenSim.RegionServer/Assets/AssetCache.cs b/OpenSim.RegionServer/Assets/AssetCache.cs index c1b3472..3c28e1c 100644 --- a/OpenSim.RegionServer/Assets/AssetCache.cs +++ b/OpenSim.RegionServer/Assets/AssetCache.cs | |||
@@ -139,17 +139,23 @@ namespace OpenSim.Assets | |||
139 | 139 | ||
140 | public void AddAsset(AssetBase asset) | 140 | public void AddAsset(AssetBase asset) |
141 | { | 141 | { |
142 | this._assetServer.UploadNewAsset(asset); | ||
143 | if (asset.Type == 0) | 142 | if (asset.Type == 0) |
144 | { | 143 | { |
145 | //texture | 144 | if (!this.Textures.ContainsKey(asset.FullID)) |
146 | TextureImage textur = new TextureImage(asset); | 145 | { //texture |
147 | this.Textures.Add(textur.FullID, textur); | 146 | TextureImage textur = new TextureImage(asset); |
147 | this.Textures.Add(textur.FullID, textur); | ||
148 | this._assetServer.UploadNewAsset(asset); | ||
149 | } | ||
148 | } | 150 | } |
149 | else | 151 | else |
150 | { | 152 | { |
151 | AssetInfo assetInf = new AssetInfo(asset); | 153 | if (!this.Assets.ContainsKey(asset.FullID)) |
152 | this.Assets.Add(assetInf.FullID, assetInf); | 154 | { |
155 | AssetInfo assetInf = new AssetInfo(asset); | ||
156 | this.Assets.Add(assetInf.FullID, assetInf); | ||
157 | this._assetServer.UploadNewAsset(asset); | ||
158 | } | ||
153 | } | 159 | } |
154 | } | 160 | } |
155 | 161 | ||
diff --git a/OpenSim.RegionServer/Assets/InventoryCache.cs b/OpenSim.RegionServer/Assets/InventoryCache.cs index 9e73fe5..f50047a 100644 --- a/OpenSim.RegionServer/Assets/InventoryCache.cs +++ b/OpenSim.RegionServer/Assets/InventoryCache.cs | |||
@@ -191,10 +191,10 @@ namespace OpenSim.Assets | |||
191 | InventoryReply.InventoryData[0].AssetID = Item.AssetID; | 191 | InventoryReply.InventoryData[0].AssetID = Item.AssetID; |
192 | InventoryReply.InventoryData[0].CreatorID = Item.CreatorID; | 192 | InventoryReply.InventoryData[0].CreatorID = Item.CreatorID; |
193 | InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS; | 193 | InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS; |
194 | InventoryReply.InventoryData[0].CreationDate = 1000; | 194 | InventoryReply.InventoryData[0].CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; |
195 | InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0"); | 195 | InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0"); |
196 | InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS; | 196 | InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS; |
197 | InventoryReply.InventoryData[0].Flags = 1; | 197 | InventoryReply.InventoryData[0].Flags = 0; |
198 | InventoryReply.InventoryData[0].FolderID = Item.FolderID; | 198 | InventoryReply.InventoryData[0].FolderID = Item.FolderID; |
199 | InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); | 199 | InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); |
200 | InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS; | 200 | InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS; |
@@ -228,7 +228,7 @@ namespace OpenSim.Assets | |||
228 | InventoryReply.InventoryData[0].CreationDate = 1000; | 228 | InventoryReply.InventoryData[0].CreationDate = 1000; |
229 | InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0"); | 229 | InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0"); |
230 | InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS; | 230 | InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS; |
231 | InventoryReply.InventoryData[0].Flags = 1; | 231 | InventoryReply.InventoryData[0].Flags = 0; |
232 | InventoryReply.InventoryData[0].FolderID = Item.FolderID; | 232 | InventoryReply.InventoryData[0].FolderID = Item.FolderID; |
233 | InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); | 233 | InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); |
234 | InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS; | 234 | InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS; |
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index 9ae1baf..dea385c 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs | |||
@@ -281,15 +281,15 @@ namespace OpenSim | |||
281 | case PacketType.AssetUploadRequest: | 281 | case PacketType.AssetUploadRequest: |
282 | //this.debug = true; | 282 | //this.debug = true; |
283 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | 283 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; |
284 | Console.WriteLine(Pack.ToString()); | 284 | // Console.WriteLine(Pack.ToString()); |
285 | if (request.AssetBlock.Type == 0) | 285 | // if (request.AssetBlock.Type == 0) |
286 | { | 286 | // { |
287 | this.UploadAssets.HandleUploadPacket(request, LLUUID.Random()); | 287 | //this.UploadAssets.HandleUploadPacket(request, LLUUID.Random()); |
288 | } | 288 | //} |
289 | else | 289 | //else |
290 | { | 290 | //{*/ |
291 | this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); | 291 | this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); |
292 | } | 292 | //} |
293 | break; | 293 | break; |
294 | case PacketType.SendXferPacket: | 294 | case PacketType.SendXferPacket: |
295 | Console.WriteLine(Pack.ToString()); | 295 | Console.WriteLine(Pack.ToString()); |
diff --git a/OpenSim.RegionServer/world/Primitive.cs b/OpenSim.RegionServer/world/Primitive.cs index b190d81..6ff66a3 100644 --- a/OpenSim.RegionServer/world/Primitive.cs +++ b/OpenSim.RegionServer/world/Primitive.cs | |||
@@ -220,7 +220,8 @@ namespace OpenSim.world | |||
220 | 220 | ||
221 | public void UpdateTexture(byte[] tex) | 221 | public void UpdateTexture(byte[] tex) |
222 | { | 222 | { |
223 | this.primData.Texture = this.OurPacket.ObjectData[0].TextureEntry = tex; | 223 | this.OurPacket.ObjectData[0].TextureEntry = tex; |
224 | this.primData.Texture = tex; | ||
224 | this.dirtyFlag = true; | 225 | this.dirtyFlag = true; |
225 | } | 226 | } |
226 | 227 | ||
@@ -401,8 +402,9 @@ namespace OpenSim.world | |||
401 | 402 | ||
402 | int i = 0; | 403 | int i = 0; |
403 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); | 404 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); |
404 | dat.TextureEntry = this.OurPacket.ObjectData[0].TextureEntry; | 405 | //dat.TextureEntry = this.OurPacket.ObjectData[0].TextureEntry; |
405 | 406 | dat.TextureEntry = new byte[0]; | |
407 | //Console.WriteLine("texture-entry length in improvedterse block is " + this.OurPacket.ObjectData[0].TextureEntry.Length); | ||
406 | bytes[i++] = (byte)(ID % 256); | 408 | bytes[i++] = (byte)(ID % 256); |
407 | bytes[i++] = (byte)((ID >> 8) % 256); | 409 | bytes[i++] = (byte)((ID >> 8) % 256); |
408 | bytes[i++] = (byte)((ID >> 16) % 256); | 410 | bytes[i++] = (byte)((ID >> 16) % 256); |