diff options
10 files changed, 216 insertions, 38 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 3d31ba6..3f594af 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -212,41 +212,41 @@ namespace OpenSim.Framework.Communications.Caches | |||
212 | while (true) | 212 | while (true) |
213 | { | 213 | { |
214 | TextureSender sender = this.QueueTextures.Dequeue(); | 214 | TextureSender sender = this.QueueTextures.Dequeue(); |
215 | if (TimesTextureSent.ContainsKey(sender.request.RequestUser.AgentId)) | 215 | /* if (TimesTextureSent.ContainsKey(sender.request.RequestUser.AgentId)) |
216 | { | 216 | { |
217 | if (TimesTextureSent[sender.request.RequestUser.AgentId].ContainsKey(sender.request.ImageInfo.FullID)) | 217 | if (TimesTextureSent[sender.request.RequestUser.AgentId].ContainsKey(sender.request.ImageInfo.FullID)) |
218 | { | 218 | { |
219 | TimesTextureSent[sender.request.RequestUser.AgentId][sender.request.ImageInfo.FullID]++; | 219 | TimesTextureSent[sender.request.RequestUser.AgentId][sender.request.ImageInfo.FullID]++; |
220 | } | 220 | } |
221 | else | 221 | else |
222 | { | 222 | { |
223 | TimesTextureSent[sender.request.RequestUser.AgentId].Add(sender.request.ImageInfo.FullID, 1); | 223 | TimesTextureSent[sender.request.RequestUser.AgentId].Add(sender.request.ImageInfo.FullID, 1); |
224 | } | 224 | } |
225 | } | 225 | } |
226 | else | 226 | else |
227 | { | 227 | { |
228 | Dictionary<LLUUID, int> UsersSent = new Dictionary<LLUUID,int>(); | 228 | Dictionary<LLUUID, int> UsersSent = new Dictionary<LLUUID,int>(); |
229 | TimesTextureSent.Add(sender.request.RequestUser.AgentId, UsersSent ); | 229 | TimesTextureSent.Add(sender.request.RequestUser.AgentId, UsersSent ); |
230 | UsersSent.Add(sender.request.ImageInfo.FullID, 1); | 230 | UsersSent.Add(sender.request.ImageInfo.FullID, 1); |
231 | 231 | ||
232 | } | 232 | } |
233 | if (TimesTextureSent[sender.request.RequestUser.AgentId][sender.request.ImageInfo.FullID] < 1000) | 233 | if (TimesTextureSent[sender.request.RequestUser.AgentId][sender.request.ImageInfo.FullID] < 1000) |
234 | {*/ | ||
235 | bool finished = sender.SendTexture(); | ||
236 | if (finished) | ||
234 | { | 237 | { |
235 | bool finished = sender.SendTexture(); | 238 | this.TextureSent(sender); |
236 | if (finished) | ||
237 | { | ||
238 | this.TextureSent(sender); | ||
239 | } | ||
240 | else | ||
241 | { | ||
242 | // Console.WriteLine("readding texture"); | ||
243 | this.QueueTextures.Enqueue(sender); | ||
244 | } | ||
245 | } | 239 | } |
246 | else | 240 | else |
247 | { | 241 | { |
248 | this.TextureSent(sender); | 242 | // Console.WriteLine("readding texture"); |
243 | this.QueueTextures.Enqueue(sender); | ||
249 | } | 244 | } |
245 | /* } | ||
246 | else | ||
247 | { | ||
248 | this.TextureSent(sender); | ||
249 | }*/ | ||
250 | } | 250 | } |
251 | } | 251 | } |
252 | 252 | ||
@@ -336,7 +336,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
336 | ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); | 336 | ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); |
337 | notFound.ImageID.ID = assetID; | 337 | notFound.ImageID.ID = assetID; |
338 | req.RequestUser.OutPacket(notFound); | 338 | req.RequestUser.OutPacket(notFound); |
339 | //Console.WriteLine("sending image not found for " + assetID); | 339 | //Console.WriteLine("sending image not found for " + assetID); |
340 | 340 | ||
341 | this.RequestedTextures.Remove(assetID); | 341 | this.RequestedTextures.Remove(assetID); |
342 | } | 342 | } |
@@ -532,9 +532,9 @@ namespace OpenSim.Framework.Communications.Caches | |||
532 | /// </summary> | 532 | /// </summary> |
533 | /// <param name="userInfo"></param> | 533 | /// <param name="userInfo"></param> |
534 | /// <param name="imageID"></param> | 534 | /// <param name="imageID"></param> |
535 | public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID, uint packetNumber) | 535 | public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID, uint packetNumber, int discard) |
536 | { | 536 | { |
537 | //Console.WriteLine("texture request for " + imageID.ToStringHyphenated() + " packetnumber= " + packetNumber); | 537 | //Console.WriteLine("texture request for " + imageID.ToStringHyphenated() + " packetnumber= " + packetNumber); |
538 | //check to see if texture is in local cache, if not request from asset server | 538 | //check to see if texture is in local cache, if not request from asset server |
539 | if (!this.AvatarRecievedTextures.ContainsKey(userInfo.AgentId)) | 539 | if (!this.AvatarRecievedTextures.ContainsKey(userInfo.AgentId)) |
540 | { | 540 | { |
@@ -554,6 +554,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
554 | request.RequestUser = userInfo; | 554 | request.RequestUser = userInfo; |
555 | request.RequestAssetID = imageID; | 555 | request.RequestAssetID = imageID; |
556 | request.IsTextureRequest = true; | 556 | request.IsTextureRequest = true; |
557 | request.DiscardLevel = discard; | ||
557 | this.RequestedTextures.Add(imageID, request); | 558 | this.RequestedTextures.Add(imageID, request); |
558 | this._assetServer.RequestAsset(imageID, true); | 559 | this._assetServer.RequestAsset(imageID, true); |
559 | } | 560 | } |
@@ -567,6 +568,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
567 | req.RequestAssetID = imageID; | 568 | req.RequestAssetID = imageID; |
568 | req.IsTextureRequest = true; | 569 | req.IsTextureRequest = true; |
569 | req.ImageInfo = imag; | 570 | req.ImageInfo = imag; |
571 | req.DiscardLevel = discard; | ||
570 | 572 | ||
571 | if (imag.Data.LongLength > 600) | 573 | if (imag.Data.LongLength > 600) |
572 | { | 574 | { |
@@ -641,6 +643,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
641 | public byte[] Params = null; | 643 | public byte[] Params = null; |
642 | //public bool AssetInCache; | 644 | //public bool AssetInCache; |
643 | //public int TimeRequested; | 645 | //public int TimeRequested; |
646 | public int DiscardLevel = -1; | ||
644 | 647 | ||
645 | public AssetRequest() | 648 | public AssetRequest() |
646 | { | 649 | { |
@@ -700,7 +703,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
700 | SendPacket(); | 703 | SendPacket(); |
701 | counter++; | 704 | counter++; |
702 | 705 | ||
703 | if ((request.PacketCounter >= request.NumPackets) | counter > 100 | (request.NumPackets == 1)) | 706 | if ((request.PacketCounter >= request.NumPackets) | counter > 100 | (request.NumPackets == 1) | (request.DiscardLevel == -1)) |
704 | { | 707 | { |
705 | return true; | 708 | return true; |
706 | } | 709 | } |
@@ -746,7 +749,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
746 | req.PacketCounter++; | 749 | req.PacketCounter++; |
747 | //req.ImageInfo.last_used = time; | 750 | //req.ImageInfo.last_used = time; |
748 | //System.Console.WriteLine("sent first packet of texture: " + req.ImageInfo.FullID); | 751 | //System.Console.WriteLine("sent first packet of texture: " + req.ImageInfo.FullID); |
749 | //Console.WriteLine("sending packet 1 for " + req.ImageInfo.FullID.ToStringHyphenated()); | 752 | //Console.WriteLine("sending packet 1 for " + req.ImageInfo.FullID.ToStringHyphenated()); |
750 | } | 753 | } |
751 | } | 754 | } |
752 | else | 755 | else |
@@ -758,11 +761,11 @@ namespace OpenSim.Framework.Communications.Caches | |||
758 | im.Header.Reliable = false; | 761 | im.Header.Reliable = false; |
759 | im.ImageID.Packet = (ushort)(req.PacketCounter); | 762 | im.ImageID.Packet = (ushort)(req.PacketCounter); |
760 | im.ImageID.ID = req.ImageInfo.FullID; | 763 | im.ImageID.ID = req.ImageInfo.FullID; |
761 | int size = req.ImageInfo.Data.Length - 600 - (1000 * (req.PacketCounter-1)); | 764 | int size = req.ImageInfo.Data.Length - 600 - (1000 * (req.PacketCounter - 1)); |
762 | if (size > 1000) size = 1000; | 765 | if (size > 1000) size = 1000; |
763 | //Console.WriteLine("length= {0} counter= {1} size= {2}",req.ImageInfo.Data.Length, req.PacketCounter, size); | 766 | //Console.WriteLine("length= {0} counter= {1} size= {2}",req.ImageInfo.Data.Length, req.PacketCounter, size); |
764 | im.ImageData.Data = new byte[size]; | 767 | im.ImageData.Data = new byte[size]; |
765 | Array.Copy(req.ImageInfo.Data, 600 + (1000 * (req.PacketCounter-1)), im.ImageData.Data, 0, size); | 768 | Array.Copy(req.ImageInfo.Data, 600 + (1000 * (req.PacketCounter - 1)), im.ImageData.Data, 0, size); |
766 | req.RequestUser.OutPacket(im); | 769 | req.RequestUser.OutPacket(im); |
767 | req.PacketCounter++; | 770 | req.PacketCounter++; |
768 | //req.ImageInfo.last_used = time; | 771 | //req.ImageInfo.last_used = time; |
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 1a63b98..ba5503e 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -127,6 +127,7 @@ namespace OpenSim.Region.Capabilities | |||
127 | LLSDCapsDetails caps = new LLSDCapsDetails(); | 127 | LLSDCapsDetails caps = new LLSDCapsDetails(); |
128 | string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; | 128 | string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; |
129 | caps.MapLayer = capsBaseUrl + m_mapLayerPath; | 129 | caps.MapLayer = capsBaseUrl + m_mapLayerPath; |
130 | // caps.RequestTextureDownload = capsBaseUrl + m_requestTexture; | ||
130 | caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; | 131 | caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; |
131 | caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath; | 132 | caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath; |
132 | caps.UpdateScriptAgentInventory = capsBaseUrl + m_notecardUpdatePath; | 133 | caps.UpdateScriptAgentInventory = capsBaseUrl + m_notecardUpdatePath; |
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 5d0d2b5..17f360f 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -102,6 +102,7 @@ namespace OpenSim | |||
102 | } | 102 | } |
103 | 103 | ||
104 | ReadConfigSettings(startupSource); | 104 | ReadConfigSettings(startupSource); |
105 | |||
105 | } | 106 | } |
106 | 107 | ||
107 | protected void ReadConfigSettings(IConfigSource configSource) | 108 | protected void ReadConfigSettings(IConfigSource configSource) |
@@ -124,6 +125,7 @@ namespace OpenSim | |||
124 | m_networkServersInfo.loadFromConfiguration(configSource); | 125 | m_networkServersInfo.loadFromConfiguration(configSource); |
125 | } | 126 | } |
126 | 127 | ||
128 | |||
127 | /// <summary> | 129 | /// <summary> |
128 | /// Performs initialisation of the scene, such as loading configuration from disk. | 130 | /// Performs initialisation of the scene, such as loading configuration from disk. |
129 | /// </summary> | 131 | /// </summary> |
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 5e185ed..a35666d 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | |||
@@ -197,7 +197,7 @@ namespace OpenSim.Region.ClientStack | |||
197 | { | 197 | { |
198 | if (AgentAni.AnimationList[i].StartAnim) | 198 | if (AgentAni.AnimationList[i].StartAnim) |
199 | { | 199 | { |
200 | 200 | ||
201 | if (OnStartAnim != null) | 201 | if (OnStartAnim != null) |
202 | { | 202 | { |
203 | OnStartAnim(this, AgentAni.AnimationList[i].AnimID, 1); | 203 | OnStartAnim(this, AgentAni.AnimationList[i].AnimID, 1); |
@@ -355,7 +355,9 @@ namespace OpenSim.Region.ClientStack | |||
355 | //Console.WriteLine("image request: " + Pack.ToString()); | 355 | //Console.WriteLine("image request: " + Pack.ToString()); |
356 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) | 356 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) |
357 | { | 357 | { |
358 | m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet); | 358 | |
359 | // Console.WriteLine("image request of "+ imageRequest.RequestImage[i].Image+ " at discard level " + imageRequest.RequestImage[i].DiscardLevel); | ||
360 | m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet, imageRequest.RequestImage[i].DiscardLevel); | ||
359 | } | 361 | } |
360 | break; | 362 | break; |
361 | case PacketType.TransferRequest: | 363 | case PacketType.TransferRequest: |
diff --git a/OpenSim/Region/Environment/Interfaces/ITerrain.cs b/OpenSim/Region/Environment/Interfaces/ITerrain.cs new file mode 100644 index 0000000..a07168e --- /dev/null +++ b/OpenSim/Region/Environment/Interfaces/ITerrain.cs | |||
@@ -0,0 +1,46 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.Framework.Interfaces; | ||
5 | |||
6 | namespace OpenSim.Region.Environment.Interfaces | ||
7 | { | ||
8 | public interface ITerrain | ||
9 | { | ||
10 | bool Tainted(); | ||
11 | bool Tainted(int x, int y); | ||
12 | void ResetTaint(); | ||
13 | void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west, IClientAPI remoteUser); | ||
14 | void CheckHeightValues(); | ||
15 | float[] GetHeights1D(); | ||
16 | float[,] GetHeights2D(); | ||
17 | double[,] GetHeights2DD(); | ||
18 | void GetHeights1D(float[] heights); | ||
19 | void SetHeights2D(float[,] heights); | ||
20 | void SetHeights2D(double[,] heights); | ||
21 | void SwapRevertMaps(); | ||
22 | void SaveRevertMap(); | ||
23 | bool RunTerrainCmd(string[] args, ref string resultText, string simName); | ||
24 | void SetRange(float min, float max); | ||
25 | void LoadFromFileF64(string filename); | ||
26 | void LoadFromFileF32(string filename); | ||
27 | void LoadFromFileF32(string filename, int dimensionX, int dimensionY, int lowerboundX, int lowerboundY); | ||
28 | void LoadFromFileIMG(string filename, int dimensionX, int dimensionY, int lowerboundX, int lowerboundY); | ||
29 | void LoadFromFileSLRAW(string filename); | ||
30 | void WriteToFileF64(string filename); | ||
31 | void WriteToFileF32(string filename); | ||
32 | void WriteToFileRAW(string filename); | ||
33 | void WriteToFileHiRAW(string filename); | ||
34 | void SetSeed(int val); | ||
35 | void RaiseTerrain(double rx, double ry, double size, double amount); | ||
36 | void LowerTerrain(double rx, double ry, double size, double amount); | ||
37 | void FlattenTerrain(double rx, double ry, double size, double amount); | ||
38 | void NoiseTerrain(double rx, double ry, double size, double amount); | ||
39 | void RevertTerrain(double rx, double ry, double size, double amount); | ||
40 | void SmoothTerrain(double rx, double ry, double size, double amount); | ||
41 | void HillsGenerator(); | ||
42 | double GetHeight(int x, int y); | ||
43 | void ExportImage(string filename, string gradientmap); | ||
44 | byte[] ExportJpegImage(string gradientmap); | ||
45 | } | ||
46 | } | ||
diff --git a/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs new file mode 100644 index 0000000..5d7e6a6 --- /dev/null +++ b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs | |||
@@ -0,0 +1,45 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using libsecondlife; | ||
5 | using OpenSim.Framework.Interfaces; | ||
6 | using OpenSim.Region.Environment.Scenes; | ||
7 | using OpenSim.Region.Environment.Interfaces; | ||
8 | |||
9 | |||
10 | namespace OpenSim.Region.Environment.Modules | ||
11 | { | ||
12 | public class AssetDownloadModule : IRegionModule | ||
13 | { | ||
14 | private Scene m_scene; | ||
15 | |||
16 | public AssetDownloadModule() | ||
17 | { | ||
18 | |||
19 | } | ||
20 | |||
21 | public void Initialise(Scene scene) | ||
22 | { | ||
23 | m_scene = scene; | ||
24 | m_scene.EventManager.OnNewClient += NewClient; | ||
25 | } | ||
26 | |||
27 | public void PostInitialise() | ||
28 | { | ||
29 | |||
30 | } | ||
31 | |||
32 | public void CloseDown() | ||
33 | { | ||
34 | } | ||
35 | |||
36 | public string GetName() | ||
37 | { | ||
38 | return "AssetDownloadModule"; | ||
39 | } | ||
40 | |||
41 | public void NewClient(IClientAPI client) | ||
42 | { | ||
43 | } | ||
44 | } | ||
45 | } | ||
diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs new file mode 100644 index 0000000..960d68f --- /dev/null +++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs | |||
@@ -0,0 +1,10 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Region.Environment.Modules | ||
6 | { | ||
7 | public class FriendsModule | ||
8 | { | ||
9 | } | ||
10 | } | ||
diff --git a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs new file mode 100644 index 0000000..ef2f224 --- /dev/null +++ b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs | |||
@@ -0,0 +1,10 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Region.Environment.Modules | ||
6 | { | ||
7 | public class InstantMessageModule | ||
8 | { | ||
9 | } | ||
10 | } | ||
diff --git a/OpenSim/Region/Environment/Modules/InventoryModule.cs b/OpenSim/Region/Environment/Modules/InventoryModule.cs new file mode 100644 index 0000000..3659292 --- /dev/null +++ b/OpenSim/Region/Environment/Modules/InventoryModule.cs | |||
@@ -0,0 +1,10 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Region.Environment.Modules | ||
6 | { | ||
7 | public class InventoryModule | ||
8 | { | ||
9 | } | ||
10 | } | ||
diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs new file mode 100644 index 0000000..a92566d --- /dev/null +++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs | |||
@@ -0,0 +1,49 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using libsecondlife; | ||
5 | using OpenSim.Framework.Interfaces; | ||
6 | using OpenSim.Region.Environment.Scenes; | ||
7 | using OpenSim.Region.Environment.Interfaces; | ||
8 | |||
9 | namespace OpenSim.Region.Environment.Modules | ||
10 | { | ||
11 | public class TextureDownloadModule :IRegionModule | ||
12 | { | ||
13 | private Scene m_scene; | ||
14 | |||
15 | public TextureDownloadModule() | ||
16 | { | ||
17 | |||
18 | } | ||
19 | |||
20 | public void Initialise(Scene scene) | ||
21 | { | ||
22 | m_scene = scene; | ||
23 | m_scene.EventManager.OnNewClient += NewClient; | ||
24 | } | ||
25 | |||
26 | public void PostInitialise() | ||
27 | { | ||
28 | |||
29 | } | ||
30 | |||
31 | public void CloseDown() | ||
32 | { | ||
33 | } | ||
34 | |||
35 | public string GetName() | ||
36 | { | ||
37 | return "TextureDownloadModule"; | ||
38 | } | ||
39 | |||
40 | public void NewClient(IClientAPI client) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | public void TextureAssetCallback(LLUUID texture, byte[] data) | ||
45 | { | ||
46 | |||
47 | } | ||
48 | } | ||
49 | } | ||