aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2007-06-24 15:24:02 +0000
committerMW2007-06-24 15:24:02 +0000
commit38a800400ae8c61eef0770b8c49aa6e637478e58 (patch)
tree2d53e3c67a0990bf199e8594240cdee8dc1a8494 /OpenSim
parentMore work on CAPS handler. (diff)
downloadopensim-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/Examples/SimpleApp/MyWorld.cs2
-rw-r--r--OpenSim/Examples/SimpleApp/Program.cs4
-rw-r--r--OpenSim/OpenSim.Caches/AssetCache.cs191
-rw-r--r--OpenSim/OpenSim.LocalCommunications/LocalBackEndServices.cs2
-rw-r--r--OpenSim/OpenSim.Region/Caps.cs116
-rw-r--r--OpenSim/OpenSim.Region/OpenSim.Region.csproj55
-rw-r--r--OpenSim/OpenSim.Region/RegionManager.cs30
-rw-r--r--OpenSim/OpenSim.Region/Scenes/Primitive.cs4
-rw-r--r--OpenSim/OpenSim.Region/Scenes/Scene.cs8
-rw-r--r--OpenSim/OpenSim.Region/Scenes/ScenePresence.cs27
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.API.cs10
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs94
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs2
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs2
-rw-r--r--OpenSim/OpenSim/OpenSimMain.cs8
15 files changed, 424 insertions, 131 deletions
diff --git a/OpenSim/Examples/SimpleApp/MyWorld.cs b/OpenSim/Examples/SimpleApp/MyWorld.cs
index 477d29d..01e0c59 100644
--- a/OpenSim/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Examples/SimpleApp/MyWorld.cs
@@ -69,7 +69,7 @@ namespace SimpleApp
69 { 69 {
70 client.SendAvatarData(m_regionInfo.RegionHandle, client.FirstName, 70 client.SendAvatarData(m_regionInfo.RegionHandle, client.FirstName,
71 client.LastName, client.AgentId, 0, 71 client.LastName, client.AgentId, 0,
72 pos); 72 pos, null);
73 73
74 client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero ); 74 client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero );
75 }; 75 };
diff --git a/OpenSim/Examples/SimpleApp/Program.cs b/OpenSim/Examples/SimpleApp/Program.cs
index ffcaa52..b56e77e 100644
--- a/OpenSim/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Examples/SimpleApp/Program.cs
@@ -27,8 +27,8 @@ namespace SimpleApp
27 m_log = new LogBase(null, "SimpleApp", this, false); 27 m_log = new LogBase(null, "SimpleApp", this, false);
28 MainLog.Instance = m_log; 28 MainLog.Instance = m_log;
29 29
30 CheckSumServer checksumServer = new CheckSumServer(12036); 30 // CheckSumServer checksumServer = new CheckSumServer(12036);
31 checksumServer.ServerListener(); 31 // checksumServer.ServerListener();
32 32
33 string simAddr = "127.0.0.1"; 33 string simAddr = "127.0.0.1";
34 int simPort = 9000; 34 int simPort = 9000;
diff --git a/OpenSim/OpenSim.Caches/AssetCache.cs b/OpenSim/OpenSim.Caches/AssetCache.cs
index eae0f80..44d22a9 100644
--- a/OpenSim/OpenSim.Caches/AssetCache.cs
+++ b/OpenSim/OpenSim.Caches/AssetCache.cs
@@ -38,6 +38,7 @@ using OpenSim.Framework.Utilities;
38 38
39namespace OpenSim.Caches 39namespace OpenSim.Caches
40{ 40{
41 public delegate void DownloadComplete(AssetCache.TextureSender sender);
41 /// <summary> 42 /// <summary>
42 /// Manages local cache of assets and their sending to viewers. 43 /// Manages local cache of assets and their sending to viewers.
43 /// </summary> 44 /// </summary>
@@ -52,6 +53,7 @@ namespace OpenSim.Caches
52 public Dictionary<LLUUID, AssetRequest> RequestedAssets = new Dictionary<LLUUID, AssetRequest>(); //Assets requested from the asset server 53 public Dictionary<LLUUID, AssetRequest> RequestedAssets = new Dictionary<LLUUID, AssetRequest>(); //Assets requested from the asset server
53 public Dictionary<LLUUID, AssetRequest> RequestedTextures = new Dictionary<LLUUID, AssetRequest>(); //Textures requested from the asset server 54 public Dictionary<LLUUID, AssetRequest> RequestedTextures = new Dictionary<LLUUID, AssetRequest>(); //Textures requested from the asset server
54 55
56 public Dictionary<LLUUID, TextureSender> SendingTextures = new Dictionary<LLUUID, TextureSender>();
55 private IAssetServer _assetServer; 57 private IAssetServer _assetServer;
56 private Thread _assetCacheThread; 58 private Thread _assetCacheThread;
57 private LLUUID[] textureList = new LLUUID[5]; 59 private LLUUID[] textureList = new LLUUID[5];
@@ -155,8 +157,10 @@ namespace OpenSim.Caches
155 157
156 public void AddAsset(AssetBase asset) 158 public void AddAsset(AssetBase asset)
157 { 159 {
160 // Console.WriteLine("adding asset " + asset.FullID.ToStringHyphenated());
158 if (asset.Type == 0) 161 if (asset.Type == 0)
159 { 162 {
163 //Console.WriteLine("which is a texture");
160 if (!this.Textures.ContainsKey(asset.FullID)) 164 if (!this.Textures.ContainsKey(asset.FullID))
161 { //texture 165 { //texture
162 TextureImage textur = new TextureImage(asset); 166 TextureImage textur = new TextureImage(asset);
@@ -186,94 +190,42 @@ namespace OpenSim.Caches
186 return; 190 return;
187 } 191 }
188 int num; 192 int num;
193 num = this.TextureRequests.Count;
189 194
190 if (this.TextureRequests.Count < 5)
191 {
192 //lower than 5 so do all of them
193 num = this.TextureRequests.Count;
194 }
195 else
196 {
197 num = 5;
198 }
199 AssetRequest req; 195 AssetRequest req;
200 for (int i = 0; i < num; i++) 196 for (int i = 0; i < num; i++)
201 { 197 {
202 req = (AssetRequest)this.TextureRequests[i]; 198 req = (AssetRequest)this.TextureRequests[i];
203 if (req.PacketCounter != req.NumPackets) 199 if (!this.SendingTextures.ContainsKey(req.ImageInfo.FullID))
204 { 200 {
205 // if (req.ImageInfo.FullID == new LLUUID("00000000-0000-0000-5005-000000000005")) 201 TextureSender sender = new TextureSender(req);
206 if (req.PacketCounter == 0) 202 sender.OnComplete += this.TextureSent;
203 lock (this.SendingTextures)
207 { 204 {
208 //first time for this request so send imagedata packet 205 this.SendingTextures.Add(req.ImageInfo.FullID, sender);
209 if (req.NumPackets == 1)
210 {
211 //only one packet so send whole file
212 ImageDataPacket im = new ImageDataPacket();
213 im.ImageID.Packets = 1;
214 im.ImageID.ID = req.ImageInfo.FullID;
215 im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
216 im.ImageData.Data = req.ImageInfo.Data;
217 im.ImageID.Codec = 2;
218 req.RequestUser.OutPacket(im);
219 req.PacketCounter++;
220 //req.ImageInfo.l= time;
221 //System.Console.WriteLine("sent texture: "+req.image_info.FullID);
222 }
223 else
224 {
225 //more than one packet so split file up
226 ImageDataPacket im = new ImageDataPacket();
227 im.ImageID.Packets = (ushort)req.NumPackets;
228 im.ImageID.ID = req.ImageInfo.FullID;
229 im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
230 im.ImageData.Data = new byte[600];
231 Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600);
232 im.ImageID.Codec = 2;
233 req.RequestUser.OutPacket(im);
234 req.PacketCounter++;
235 //req.ImageInfo.last_used = time;
236 //System.Console.WriteLine("sent first packet of texture:
237 }
238 }
239 else
240 {
241 //send imagepacket
242 //more than one packet so split file up
243 ImagePacketPacket im = new ImagePacketPacket();
244 im.ImageID.Packet = (ushort)req.PacketCounter;
245 im.ImageID.ID = req.ImageInfo.FullID;
246 int size = req.ImageInfo.Data.Length - 600 - 1000 * (req.PacketCounter - 1);
247 if (size > 1000) size = 1000;
248 im.ImageData.Data = new byte[size];
249 Array.Copy(req.ImageInfo.Data, 600 + 1000 * (req.PacketCounter - 1), im.ImageData.Data, 0, size);
250 req.RequestUser.OutPacket(im);
251 req.PacketCounter++;
252 //req.ImageInfo.last_used = time;
253 //System.Console.WriteLine("sent a packet of texture: "+req.image_info.FullID);
254 } 206 }
255 } 207 }
208
256 } 209 }
257 210
258 //remove requests that have been completed 211 this.TextureRequests.Clear();
259 int count = 0; 212 }
260 for (int i = 0; i < num; i++) 213
214 /// <summary>
215 /// Event handler, called by a TextureSender object to say that texture has been sent
216 /// </summary>
217 /// <param name="sender"></param>
218 public void TextureSent(AssetCache.TextureSender sender)
219 {
220 if (this.SendingTextures.ContainsKey(sender.request.ImageInfo.FullID))
261 { 221 {
262 if (this.TextureRequests.Count > count) 222 lock (this.SendingTextures)
263 { 223 {
264 req = (AssetRequest)this.TextureRequests[count]; 224 this.SendingTextures.Remove(sender.request.ImageInfo.FullID);
265 if (req.PacketCounter == req.NumPackets)
266 {
267 this.TextureRequests.Remove(req);
268 }
269 else
270 {
271 count++;
272 }
273 } 225 }
274 } 226 }
275
276 } 227 }
228
277 public void AssetReceived(AssetBase asset, bool IsTexture) 229 public void AssetReceived(AssetBase asset, bool IsTexture)
278 { 230 {
279 if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server 231 if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server
@@ -343,6 +295,7 @@ namespace OpenSim.Caches
343 { 295 {
344 LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0); 296 LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0);
345 //check to see if asset is in local cache, if not we need to request it from asset server. 297 //check to see if asset is in local cache, if not we need to request it from asset server.
298
346 if (!this.Assets.ContainsKey(requestID)) 299 if (!this.Assets.ContainsKey(requestID))
347 { 300 {
348 //not found asset 301 //not found asset
@@ -481,6 +434,7 @@ namespace OpenSim.Caches
481 /// <param name="imageID"></param> 434 /// <param name="imageID"></param>
482 public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID) 435 public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID)
483 { 436 {
437 //Console.WriteLine("texture request for " + imageID.ToStringHyphenated());
484 //check to see if texture is in local cache, if not request from asset server 438 //check to see if texture is in local cache, if not request from asset server
485 if (!this.Textures.ContainsKey(imageID)) 439 if (!this.Textures.ContainsKey(imageID))
486 { 440 {
@@ -497,6 +451,7 @@ namespace OpenSim.Caches
497 return; 451 return;
498 } 452 }
499 453
454 //Console.WriteLine("texture already in cache");
500 TextureImage imag = this.Textures[imageID]; 455 TextureImage imag = this.Textures[imageID];
501 AssetRequest req = new AssetRequest(); 456 AssetRequest req = new AssetRequest();
502 req.RequestUser = userInfo; 457 req.RequestUser = userInfo;
@@ -611,6 +566,98 @@ namespace OpenSim.Caches
611 Description = aBase.Description; 566 Description = aBase.Description;
612 } 567 }
613 } 568 }
569
570 public class TextureSender
571 {
572 public AssetRequest request;
573 public event DownloadComplete OnComplete;
574
575 public TextureSender(AssetRequest req)
576 {
577 request = req;
578 //Console.WriteLine("creating worker thread for texture " + req.ImageInfo.FullID.ToStringHyphenated());
579 //Console.WriteLine("texture data length is " + req.ImageInfo.Data.Length);
580 // Console.WriteLine("in " + req.NumPackets + " packets");
581 ThreadPool.QueueUserWorkItem(new WaitCallback(SendTexture), new object());
582 }
583
584 public void SendTexture(Object obj)
585 {
586 //Console.WriteLine("starting to send sending texture " + request.ImageInfo.FullID.ToStringHyphenated());
587 while (request.PacketCounter != request.NumPackets)
588 {
589 SendPacket();
590 Thread.Sleep(500);
591 }
592
593 //Console.WriteLine("finished sending texture " + request.ImageInfo.FullID.ToStringHyphenated());
594 if (OnComplete != null)
595 {
596 OnComplete(this);
597 }
598 }
599
600 public void SendPacket()
601 {
602 AssetRequest req = request;
603 // Console.WriteLine("sending " + req.ImageInfo.FullID);
604
605 // if (req.ImageInfo.FullID == new LLUUID("00000000-0000-0000-5005-000000000005"))
606 if (req.PacketCounter == 0)
607 {
608 //first time for this request so send imagedata packet
609 if (req.NumPackets == 1)
610 {
611 //only one packet so send whole file
612 ImageDataPacket im = new ImageDataPacket();
613 im.ImageID.Packets = 1;
614 im.ImageID.ID = req.ImageInfo.FullID;
615 im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
616 im.ImageData.Data = req.ImageInfo.Data;
617 im.ImageID.Codec = 2;
618 req.RequestUser.OutPacket(im);
619 req.PacketCounter++;
620 //req.ImageInfo.l= time;
621 //System.Console.WriteLine("sent texture: " + req.ImageInfo.FullID);
622 // Console.WriteLine("sending packet 1 for " + req.ImageInfo.FullID.ToStringHyphenated());
623 }
624 else
625 {
626 //more than one packet so split file up
627 ImageDataPacket im = new ImageDataPacket();
628 im.ImageID.Packets = (ushort)req.NumPackets;
629 im.ImageID.ID = req.ImageInfo.FullID;
630 im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
631 im.ImageData.Data = new byte[600];
632 Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600);
633 im.ImageID.Codec = 2;
634 req.RequestUser.OutPacket(im);
635 req.PacketCounter++;
636 //req.ImageInfo.last_used = time;
637 //System.Console.WriteLine("sent first packet of texture:
638 // Console.WriteLine("sending packet 1 for " + req.ImageInfo.FullID.ToStringHyphenated());
639 }
640 }
641 else
642 {
643 //Console.WriteLine("sending packet" + req.PacketCounter + "for " + req.ImageInfo.FullID.ToStringHyphenated());
644 //send imagepacket
645 //more than one packet so split file up
646 ImagePacketPacket im = new ImagePacketPacket();
647 im.ImageID.Packet = (ushort)req.PacketCounter;
648 im.ImageID.ID = req.ImageInfo.FullID;
649 int size = req.ImageInfo.Data.Length - 600 - 1000 * (req.PacketCounter - 1);
650 if (size > 1000) size = 1000;
651 im.ImageData.Data = new byte[size];
652 Array.Copy(req.ImageInfo.Data, 600 + 1000 * (req.PacketCounter - 1), im.ImageData.Data, 0, size);
653 req.RequestUser.OutPacket(im);
654 req.PacketCounter++;
655 //req.ImageInfo.last_used = time;
656 //System.Console.WriteLine("sent a packet of texture: "+req.image_info.FullID);
657 }
658
659 }
660 }
614 } 661 }
615} 662}
616 663
diff --git a/OpenSim/OpenSim.LocalCommunications/LocalBackEndServices.cs b/OpenSim/OpenSim.LocalCommunications/LocalBackEndServices.cs
index ebf0fd1..4ca088b 100644
--- a/OpenSim/OpenSim.LocalCommunications/LocalBackEndServices.cs
+++ b/OpenSim/OpenSim.LocalCommunications/LocalBackEndServices.cs
@@ -122,7 +122,7 @@ namespace OpenSim.LocalCommunications
122 List<MapBlockData> mapBlocks = new List<MapBlockData>(); 122 List<MapBlockData> mapBlocks = new List<MapBlockData>();
123 foreach(RegionInfo regInfo in this.regions.Values) 123 foreach(RegionInfo regInfo in this.regions.Values)
124 { 124 {
125 if (((regInfo.RegionLocX > minX) && (regInfo.RegionLocX < maxX)) && ((regInfo.RegionLocY > minY) && (regInfo.RegionLocY < maxY))) 125 if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY)))
126 { 126 {
127 MapBlockData map = new MapBlockData(); 127 MapBlockData map = new MapBlockData();
128 map.Name = regInfo.RegionName; 128 map.Name = regInfo.RegionName;
diff --git a/OpenSim/OpenSim.Region/Caps.cs b/OpenSim/OpenSim.Region/Caps.cs
index c86061f..5be481e 100644
--- a/OpenSim/OpenSim.Region/Caps.cs
+++ b/OpenSim/OpenSim.Region/Caps.cs
@@ -1,23 +1,34 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using System.IO;
4using OpenSim.Servers; 5using OpenSim.Servers;
6using OpenSim.Framework.Utilities;
7using OpenSim.Framework.Types;
8using OpenSim.Caches;
5using libsecondlife; 9using libsecondlife;
6 10
7namespace OpenSim.Region 11namespace OpenSim.Region
8{ 12{
13 public delegate void UpLoadedTexture(LLUUID assetID, LLUUID inventoryItem, byte[] data);
14
9 public class Caps 15 public class Caps
10 { 16 {
17
11 private string httpListenerAddress; 18 private string httpListenerAddress;
12 private uint httpListenPort; 19 private uint httpListenPort;
13 private string capsObjectPath = "00001-"; 20 private string capsObjectPath = "00001-";
14 private string requestPath = "0000/"; 21 private string requestPath = "0000/";
15 private string mapLayerPath = "0001/"; 22 private string mapLayerPath = "0001/";
23 private string newInventory = "0002/";
24 private string requestTexture = "0003/";
16 private BaseHttpServer httpListener; 25 private BaseHttpServer httpListener;
17 private LLUUID agentID; 26 private LLUUID agentID;
27 private AssetCache assetCache;
18 28
19 public Caps(BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, LLUUID agent) 29 public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, LLUUID agent)
20 { 30 {
31 assetCache = assetCach;
21 capsObjectPath = capsPath; 32 capsObjectPath = capsPath;
22 httpListener = httpServer; 33 httpListener = httpServer;
23 httpListenerAddress = httpListen; 34 httpListenerAddress = httpListen;
@@ -31,8 +42,9 @@ namespace OpenSim.Region
31 public void RegisterHandlers() 42 public void RegisterHandlers()
32 { 43 {
33 Console.WriteLine("registering CAPS handlers"); 44 Console.WriteLine("registering CAPS handlers");
34 httpListener.AddRestHandler("POST", "/CAPS/" +capsObjectPath+ requestPath, CapsRequest); 45 httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + requestPath, CapsRequest);
35 httpListener.AddRestHandler("POST", "/CAPS/" +capsObjectPath+ mapLayerPath, MapLayer); 46 httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + mapLayerPath, MapLayer);
47 httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + newInventory, NewAgentInventory);
36 } 48 }
37 49
38 /// <summary> 50 /// <summary>
@@ -44,7 +56,7 @@ namespace OpenSim.Region
44 /// <returns></returns> 56 /// <returns></returns>
45 public string CapsRequest(string request, string path, string param) 57 public string CapsRequest(string request, string path, string param)
46 { 58 {
47 //Console.WriteLine("Caps Request " + request); 59 Console.WriteLine("Caps Request " + request);
48 string result = "<llsd><map>"; 60 string result = "<llsd><map>";
49 result += this.GetCapabilities(); 61 result += this.GetCapabilities();
50 result += "</map></llsd>"; 62 result += "</map></llsd>";
@@ -57,10 +69,11 @@ namespace OpenSim.Region
57 /// <returns></returns> 69 /// <returns></returns>
58 protected string GetCapabilities() 70 protected string GetCapabilities()
59 { 71 {
60 string capURLS=""; 72 string capURLS = "";
61 73
62 capURLS += "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" +capsObjectPath+ mapLayerPath + "</string>"; 74 capURLS += "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + "</string>";
63 75 capURLS += "<key>NewFileAgentInventory</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + "</string>";
76 //capURLS += "<key>RequestTextureDownload</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + "</string>";
64 return capURLS; 77 return capURLS;
65 } 78 }
66 79
@@ -93,15 +106,94 @@ namespace OpenSim.Region
93 int bottom; 106 int bottom;
94 LLUUID image = null; 107 LLUUID image = null;
95 108
96 left = 500; 109 left = 0;
97 bottom = 500; 110 bottom = 0;
98 top = 1500; 111 top = 5000;
99 right = 1500; 112 right = 5000;
100 image = new LLUUID("00000000-0000-0000-9999-000000000006"); 113 image = new LLUUID("00000000-0000-0000-9999-000000000006");
101 114
102 res += "<map><key>Left</key><integer>" + left + "</integer><key>Bottom</key><integer>" + bottom + "</integer><key>Top</key><integer>" + top + "</integer><key>Right</key><integer>" + right + "</integer><key>ImageID</key><uuid>" + image.ToStringHyphenated() + "</uuid></map>"; 115 res += "<map><key>Left</key><integer>" + left + "</integer><key>Bottom</key><integer>" + bottom + "</integer><key>Top</key><integer>" + top + "</integer><key>Right</key><integer>" + right + "</integer><key>ImageID</key><uuid>" + image.ToStringHyphenated() + "</uuid></map>";
103 116
117 return res;
118 }
119
120 public string NewAgentInventory(string request, string path, string param)
121 {
122
123 //Console.WriteLine("received upload request:"+ request);
124 string res = "";
125 LLUUID newAsset = LLUUID.Random();
126 string uploaderPath = capsObjectPath + Util.RandomClass.Next(5000, 7000).ToString("0000");
127 AssetUploader uploader = new AssetUploader(newAsset, uploaderPath, this.httpListener);
128 httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps);
129 string uploaderURL = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath;
130 Console.WriteLine("uploader url is " + uploaderURL);
131 res += "<llsd><map>";
132 res += "<key>uploader</key><string>"+uploaderURL +"</string>";
133 //res += "<key>success</key><boolean>true</boolean>";
134 res += "<key>state</key><string>upload</string>";
135 res += "</map></llsd>";
136 uploader.OnUpLoad += this.UploadHandler;
104 return res; 137 return res;
105 } 138 }
139
140 public void UploadHandler(LLUUID assetID, LLUUID inventoryItem, byte[] data)
141 {
142 // Console.WriteLine("upload handler called");
143 AssetBase asset;
144 asset = new AssetBase();
145 asset.FullID = assetID;
146 asset.Type = 0;
147 asset.InvType = 0;
148 asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000");
149 asset.Data = data;
150 this.assetCache.AddAsset(asset);
151
152 }
153
154 public class AssetUploader
155 {
156 public event UpLoadedTexture OnUpLoad;
157
158 private string uploaderPath = "";
159 private LLUUID newAssetID;
160 //private LLUUID inventoryItemID;
161 private BaseHttpServer httpListener;
162 public AssetUploader(LLUUID assetID, string path,BaseHttpServer httpServer)
163 {
164 newAssetID = assetID;
165 uploaderPath = path;
166 httpListener = httpServer;
167
168 }
169
170 public string uploaderCaps(string request, string path, string param)
171 {
172 Encoding _enc = System.Text.Encoding.UTF8;
173 byte[] data = _enc.GetBytes(request);
174 //Console.WriteLine("recieved upload " + Util.FieldToString(data));
175 LLUUID inv = LLUUID.Random();
176 string res = "";
177 res += "<llsd><map>";
178 res += "<key>new_asset</key><string>" + newAssetID.ToStringHyphenated() + "</string>";
179 res += "<key>new_inventory_item</key><uuid>" + inv.ToStringHyphenated() + "</uuid>";
180 res += "<key>state</key><string>complete</string>";
181 res += "</map></llsd>";
182
183 Console.WriteLine("asset " + newAssetID.ToStringHyphenated() + " , inventory item " + inv.ToStringHyphenated());
184 httpListener.RemoveRestHandler("POST", "/CAPS/"+uploaderPath);
185 if (OnUpLoad != null)
186 {
187 OnUpLoad(newAssetID, inv, data);
188 }
189
190 /*FileStream fs = File.Create("upload.jp2");
191 BinaryWriter bw = new BinaryWriter(fs);
192 bw.Write(data);
193 bw.Close();
194 fs.Close();*/
195 return res;
196 }
197 }
106 } 198 }
107} 199}
diff --git a/OpenSim/OpenSim.Region/OpenSim.Region.csproj b/OpenSim/OpenSim.Region/OpenSim.Region.csproj
index d18bf3f..fd583a9 100644
--- a/OpenSim/OpenSim.Region/OpenSim.Region.csproj
+++ b/OpenSim/OpenSim.Region/OpenSim.Region.csproj
@@ -1,4 +1,4 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup> 2 <PropertyGroup>
3 <ProjectType>Local</ProjectType> 3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion> 4 <ProductVersion>8.0.50727</ProductVersion>
@@ -6,7 +6,8 @@
6 <ProjectGuid>{196916AF-0000-0000-0000-000000000000}</ProjectGuid> 6 <ProjectGuid>{196916AF-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon> 9 <ApplicationIcon>
10 </ApplicationIcon>
10 <AssemblyKeyContainerName> 11 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName> 12 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Region</AssemblyName> 13 <AssemblyName>OpenSim.Region</AssemblyName>
@@ -15,9 +16,11 @@
15 <DefaultTargetSchema>IE50</DefaultTargetSchema> 16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign> 17 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType> 18 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder> 19 <AppDesignerFolder>
20 </AppDesignerFolder>
19 <RootNamespace>OpenSim.Region</RootNamespace> 21 <RootNamespace>OpenSim.Region</RootNamespace>
20 <StartupObject></StartupObject> 22 <StartupObject>
23 </StartupObject>
21 <FileUpgradeFlags> 24 <FileUpgradeFlags>
22 </FileUpgradeFlags> 25 </FileUpgradeFlags>
23 </PropertyGroup> 26 </PropertyGroup>
@@ -28,7 +31,8 @@
28 <ConfigurationOverrideFile> 31 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile> 32 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants> 33 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile> 34 <DocumentationFile>
35 </DocumentationFile>
32 <DebugSymbols>True</DebugSymbols> 36 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment> 37 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize> 38 <Optimize>False</Optimize>
@@ -37,7 +41,8 @@
37 <RemoveIntegerChecks>False</RemoveIntegerChecks> 41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel> 43 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn> 44 <NoWarn>
45 </NoWarn>
41 </PropertyGroup> 46 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks> 48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@@ -46,7 +51,8 @@
46 <ConfigurationOverrideFile> 51 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile> 52 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants> 53 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile> 54 <DocumentationFile>
55 </DocumentationFile>
50 <DebugSymbols>False</DebugSymbols> 56 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment> 57 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize> 58 <Optimize>True</Optimize>
@@ -55,26 +61,28 @@
55 <RemoveIntegerChecks>False</RemoveIntegerChecks> 61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel> 63 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn> 64 <NoWarn>
65 </NoWarn>
59 </PropertyGroup> 66 </PropertyGroup>
60 <ItemGroup> 67 <ItemGroup>
61 <Reference Include="Axiom.MathLib.dll" > 68 <Reference Include="Axiom.MathLib.dll">
62 <HintPath>..\..\bin\Axiom.MathLib.dll</HintPath> 69 <HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
63 <Private>False</Private> 70 <Private>False</Private>
64 </Reference> 71 </Reference>
65 <Reference Include="Db4objects.Db4o.dll" > 72 <Reference Include="Db4objects.Db4o.dll">
66 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath> 73 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
67 <Private>False</Private> 74 <Private>False</Private>
68 </Reference> 75 </Reference>
69 <Reference Include="libsecondlife.dll" > 76 <Reference Include="libsecondlife.dll">
70 <HintPath>..\..\bin\libsecondlife.dll</HintPath> 77 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private> 78 <Private>False</Private>
72 </Reference> 79 </Reference>
73 <Reference Include="System" > 80 <Reference Include="System">
74 <HintPath>System.dll</HintPath> 81 <HintPath>System.dll</HintPath>
75 <Private>False</Private> 82 <Private>False</Private>
76 </Reference> 83 </Reference>
77 <Reference Include="System.Xml" > 84 <Reference Include="System.Data" />
85 <Reference Include="System.Xml">
78 <HintPath>System.Xml.dll</HintPath> 86 <HintPath>System.Xml.dll</HintPath>
79 <Private>False</Private> 87 <Private>False</Private>
80 </Reference> 88 </Reference>
@@ -84,55 +92,55 @@
84 <Name>OpenGrid.Framework.Communications</Name> 92 <Name>OpenGrid.Framework.Communications</Name>
85 <Project>{683344D5-0000-0000-0000-000000000000}</Project> 93 <Project>{683344D5-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 94 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private> 95 <Private>False</Private>
88 </ProjectReference> 96 </ProjectReference>
89 <ProjectReference Include="..\OpenSim.Caches\OpenSim.Caches.csproj"> 97 <ProjectReference Include="..\OpenSim.Caches\OpenSim.Caches.csproj">
90 <Name>OpenSim.Caches</Name> 98 <Name>OpenSim.Caches</Name>
91 <Project>{1938EB12-0000-0000-0000-000000000000}</Project> 99 <Project>{1938EB12-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 100 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private> 101 <Private>False</Private>
94 </ProjectReference> 102 </ProjectReference>
95 <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj"> 103 <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
96 <Name>OpenSim.Framework</Name> 104 <Name>OpenSim.Framework</Name>
97 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> 105 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
98 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 106 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
99 <Private>False</Private> 107 <Private>False</Private>
100 </ProjectReference> 108 </ProjectReference>
101 <ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> 109 <ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
102 <Name>OpenSim.Framework.Console</Name> 110 <Name>OpenSim.Framework.Console</Name>
103 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> 111 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
104 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 112 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
105 <Private>False</Private> 113 <Private>False</Private>
106 </ProjectReference> 114 </ProjectReference>
107 <ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj"> 115 <ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
108 <Name>OpenSim.GenericConfig.Xml</Name> 116 <Name>OpenSim.GenericConfig.Xml</Name>
109 <Project>{E88EF749-0000-0000-0000-000000000000}</Project> 117 <Project>{E88EF749-0000-0000-0000-000000000000}</Project>
110 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 118 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
111 <Private>False</Private> 119 <Private>False</Private>
112 </ProjectReference> 120 </ProjectReference>
113 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> 121 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
114 <Name>OpenSim.Physics.Manager</Name> 122 <Name>OpenSim.Physics.Manager</Name>
115 <Project>{8BE16150-0000-0000-0000-000000000000}</Project> 123 <Project>{8BE16150-0000-0000-0000-000000000000}</Project>
116 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 124 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
117 <Private>False</Private> 125 <Private>False</Private>
118 </ProjectReference> 126 </ProjectReference>
119 <ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj"> 127 <ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
120 <Name>OpenSim.Servers</Name> 128 <Name>OpenSim.Servers</Name>
121 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project> 129 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
122 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 130 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
123 <Private>False</Private> 131 <Private>False</Private>
124 </ProjectReference> 132 </ProjectReference>
125 <ProjectReference Include="..\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj"> 133 <ProjectReference Include="..\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj">
126 <Name>OpenSim.Terrain.BasicTerrain</Name> 134 <Name>OpenSim.Terrain.BasicTerrain</Name>
127 <Project>{2270B8FE-0000-0000-0000-000000000000}</Project> 135 <Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
128 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 136 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
129 <Private>False</Private> 137 <Private>False</Private>
130 </ProjectReference> 138 </ProjectReference>
131 <ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj"> 139 <ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
132 <Name>XMLRPC</Name> 140 <Name>XMLRPC</Name>
133 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> 141 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
134 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 142 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
135 <Private>False</Private> 143 <Private>False</Private>
136 </ProjectReference> 144 </ProjectReference>
137 </ItemGroup> 145 </ItemGroup>
138 <ItemGroup> 146 <ItemGroup>
@@ -145,6 +153,7 @@
145 <Compile Include="ParcelManager.cs"> 153 <Compile Include="ParcelManager.cs">
146 <SubType>Code</SubType> 154 <SubType>Code</SubType>
147 </Compile> 155 </Compile>
156 <Compile Include="RegionManager.cs" />
148 <Compile Include="Scenes\Entity.cs"> 157 <Compile Include="Scenes\Entity.cs">
149 <SubType>Code</SubType> 158 <SubType>Code</SubType>
150 </Compile> 159 </Compile>
@@ -204,4 +213,4 @@
204 <PostBuildEvent> 213 <PostBuildEvent>
205 </PostBuildEvent> 214 </PostBuildEvent>
206 </PropertyGroup> 215 </PropertyGroup>
207</Project> 216</Project> \ No newline at end of file
diff --git a/OpenSim/OpenSim.Region/RegionManager.cs b/OpenSim/OpenSim.Region/RegionManager.cs
new file mode 100644
index 0000000..a317f0f
--- /dev/null
+++ b/OpenSim/OpenSim.Region/RegionManager.cs
@@ -0,0 +1,30 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Communications;
5using OpenSim.Framework;
6using OpenSim.Framework.Types;
7using OpenSim.Servers;
8
9namespace OpenSim.Region
10{
11 public class RegionManager //needs renaming , but first we need to rename the namespace
12 {
13 protected AuthenticateSessionsBase authenticateHandler;
14 protected RegionCommsListener regionCommsHost;
15 protected CommunicationsManager commsManager;
16 protected List<Caps> capsHandlers = new List<Caps>();
17 protected BaseHttpServer httpListener;
18
19 protected Scenes.Scene m_Scene;
20
21 public ParcelManager parcelManager;
22 public EstateManager estateManager;
23
24 public RegionManager()
25 {
26
27 }
28
29 }
30}
diff --git a/OpenSim/OpenSim.Region/Scenes/Primitive.cs b/OpenSim/OpenSim.Region/Scenes/Primitive.cs
index 8192bf0..62f401c 100644
--- a/OpenSim/OpenSim.Region/Scenes/Primitive.cs
+++ b/OpenSim/OpenSim.Region/Scenes/Primitive.cs
@@ -273,7 +273,7 @@ namespace OpenSim.Region.Scenes
273 /// <param name="tex"></param> 273 /// <param name="tex"></param>
274 public void UpdateTexture(byte[] tex) 274 public void UpdateTexture(byte[] tex)
275 { 275 {
276 this.primData.Texture = tex; 276 this.primData.TextureEntry = tex;
277 } 277 }
278 278
279 /// <summary> 279 /// <summary>
@@ -411,7 +411,7 @@ namespace OpenSim.Region.Scenes
411 lPos = this.Pos; 411 lPos = this.Pos;
412 } 412 }
413 413
414 remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.primData, lPos, new LLUUID("00000000-0000-1000-5005-000000000018")); 414 remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.primData, lPos, new LLUUID("00000000-0000-0000-9999-000000000005"));
415 } 415 }
416 416
417 /// <summary> 417 /// <summary>
diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs
index 07f1d70..07b1ee4 100644
--- a/OpenSim/OpenSim.Region/Scenes/Scene.cs
+++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs
@@ -730,7 +730,7 @@ namespace OpenSim.Region.Scenes
730 if (agent.CapsPath != "") 730 if (agent.CapsPath != "")
731 { 731 {
732 //Console.WriteLine("new user, so creating caps handler for it"); 732 //Console.WriteLine("new user, so creating caps handler for it");
733 Caps cap = new Caps(httpListener, this.m_regInfo.IPListenAddr, 9000, agent.CapsPath, agent.AgentID); 733 Caps cap = new Caps(this.assetCache, httpListener, this.m_regInfo.IPListenAddr, 9000, agent.CapsPath, agent.AgentID);
734 cap.RegisterHandlers(); 734 cap.RegisterHandlers();
735 this.capsHandlers.Add(cap); 735 this.capsHandlers.Add(cap);
736 } 736 }
@@ -795,7 +795,7 @@ namespace OpenSim.Region.Scenes
795 { 795 {
796 List<MapBlockData> mapBlocks; 796 List<MapBlockData> mapBlocks;
797 mapBlocks = this.commsManager.GridServer.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); 797 mapBlocks = this.commsManager.GridServer.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
798 798 Console.WriteLine("number of mapblocks " + mapBlocks.Count +" in "+ minX +" , " + minY + " , "+ maxX + " , "+ maxY);
799 remoteClient.SendMapBlock(mapBlocks); 799 remoteClient.SendMapBlock(mapBlocks);
800 } 800 }
801 801
@@ -843,9 +843,9 @@ namespace OpenSim.Region.Scenes
843 /// <param name="regionhandle"></param> 843 /// <param name="regionhandle"></param>
844 /// <param name="agentID"></param> 844 /// <param name="agentID"></param>
845 /// <param name="position"></param> 845 /// <param name="position"></param>
846 public void InformNeighbourOfCrossing(ulong regionhandle, LLUUID agentID, LLVector3 position) 846 public bool InformNeighbourOfCrossing(ulong regionhandle, LLUUID agentID, LLVector3 position)
847 { 847 {
848 this.commsManager.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position); 848 return this.commsManager.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position);
849 } 849 }
850 850
851 #endregion 851 #endregion
diff --git a/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs b/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs
index 1255606..fe82130 100644
--- a/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs
+++ b/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs
@@ -43,6 +43,7 @@ namespace OpenSim.Region.Scenes
43 { 43 {
44 public static bool PhysicsEngineFlying = false; 44 public static bool PhysicsEngineFlying = false;
45 public static AvatarAnimations Animations; 45 public static AvatarAnimations Animations;
46 public static byte[] DefaultTexture;
46 public string firstname; 47 public string firstname;
47 public string lastname; 48 public string lastname;
48 public IClientAPI ControllingClient; 49 public IClientAPI ControllingClient;
@@ -324,7 +325,7 @@ namespace OpenSim.Region.Scenes
324 /// <param name="remoteAvatar"></param> 325 /// <param name="remoteAvatar"></param>
325 public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) 326 public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
326 { 327 {
327 remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.uuid, this.LocalId, this.Pos); 328 remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.uuid, this.LocalId, this.Pos, DefaultTexture);
328 } 329 }
329 330
330 /// <summary> 331 /// <summary>
@@ -332,7 +333,7 @@ namespace OpenSim.Region.Scenes
332 /// </summary> 333 /// </summary>
333 public void SendInitialData() 334 public void SendInitialData()
334 { 335 {
335 this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.uuid, this.LocalId, this.Pos); 336 this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.uuid, this.LocalId, this.Pos, DefaultTexture);
336 if (this.newAvatar) 337 if (this.newAvatar)
337 { 338 {
338 this.m_world.InformClientOfNeighbours(this.ControllingClient); 339 this.m_world.InformClientOfNeighbours(this.ControllingClient);
@@ -439,10 +440,12 @@ namespace OpenSim.Region.Scenes
439 RegionInfo neighbourRegion = this.m_world.RequestNeighbouringRegionInfo(neighbourHandle); 440 RegionInfo neighbourRegion = this.m_world.RequestNeighbouringRegionInfo(neighbourHandle);
440 if (neighbourRegion != null) 441 if (neighbourRegion != null)
441 { 442 {
442 this.m_world.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos); 443 bool res = this.m_world.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos);
443 this.MakeChildAgent(); 444 if (res)
444 this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, System.Net.IPAddress.Parse(neighbourRegion.IPListenAddr), (ushort)neighbourRegion.IPListenPort); 445 {
445 446 this.MakeChildAgent();
447 this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, System.Net.IPAddress.Parse(neighbourRegion.IPListenAddr), (ushort)neighbourRegion.IPListenPort);
448 }
446 } 449 }
447 } 450 }
448 #endregion 451 #endregion
@@ -481,6 +484,18 @@ namespace OpenSim.Region.Scenes
481 } 484 }
482 } 485 }
483 486
487 public static void LoadTextureFile(string name)
488 {
489 FileInfo fInfo = new FileInfo(name);
490 long numBytes = fInfo.Length;
491 FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read);
492 BinaryReader br = new BinaryReader(fStream);
493 byte[] data1 = br.ReadBytes((int)numBytes);
494 br.Close();
495 fStream.Close();
496 DefaultTexture = data1;
497 }
498
484 public class NewForce 499 public class NewForce
485 { 500 {
486 public float X; 501 public float X;
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index 1a03216..ca473e3 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -491,7 +491,7 @@ namespace OpenSim
491 /// <param name="avatarID"></param> 491 /// <param name="avatarID"></param>
492 /// <param name="avatarLocalID"></param> 492 /// <param name="avatarLocalID"></param>
493 /// <param name="Pos"></param> 493 /// <param name="Pos"></param>
494 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos) 494 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry)
495 { 495 {
496 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 496 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
497 //send a objectupdate packet with information about the clients avatar 497 //send a objectupdate packet with information about the clients avatar
@@ -500,7 +500,7 @@ namespace OpenSim
500 objupdate.RegionData.RegionHandle = regionHandle; 500 objupdate.RegionData.RegionHandle = regionHandle;
501 objupdate.RegionData.TimeDilation = 64096; 501 objupdate.RegionData.TimeDilation = 64096;
502 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 502 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
503 objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket(); 503 objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket(textureEntry);
504 //give this avatar object a local id and assign the user a name 504 //give this avatar object a local id and assign the user a name
505 505
506 objupdate.ObjectData[0].ID = avatarLocalID; 506 objupdate.ObjectData[0].ID = avatarLocalID;
@@ -859,7 +859,7 @@ namespace OpenSim
859 /// 859 ///
860 /// </summary> 860 /// </summary>
861 /// <returns></returns> 861 /// <returns></returns>
862 protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket() 862 protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry)
863 { 863 {
864 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); 864 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
865 865
@@ -873,6 +873,10 @@ namespace OpenSim
873 objdata.OwnerID = LLUUID.Zero; 873 objdata.OwnerID = LLUUID.Zero;
874 objdata.Scale = new LLVector3(1, 1, 1); 874 objdata.Scale = new LLVector3(1, 1, 1);
875 objdata.PCode = 47; 875 objdata.PCode = 47;
876 if (textureEntry != null)
877 {
878 objdata.TextureEntry = textureEntry;
879 }
876 System.Text.Encoding enc = System.Text.Encoding.ASCII; 880 System.Text.Encoding enc = System.Text.Encoding.ASCII;
877 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16); 881 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
878 pos.X = 100f; 882 pos.X = 100f;
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;
30using System.Text; 30using System.Text;
31using OpenSim.Assets; 31using OpenSim.Assets;
32using OpenSim.Framework.Types; 32using OpenSim.Framework.Types;
33using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Utilities; 34using OpenSim.Framework.Utilities;
34using OpenSim.Caches; 35using OpenSim.Caches;
35using libsecondlife; 36using 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}
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
index a6c2872..8e6b04d 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
@@ -97,7 +97,7 @@ namespace OpenSim.Storage.LocalStorageDb4o
97 found.ProfileHollow = prim.ProfileHollow; 97 found.ProfileHollow = prim.ProfileHollow;
98 found.Position = prim.Position; 98 found.Position = prim.Position;
99 found.Rotation = prim.Rotation; 99 found.Rotation = prim.Rotation;
100 found.Texture = prim.Texture; 100 found.TextureEntry = prim.TextureEntry;
101 db.Set(found); 101 db.Set(found);
102 db.Commit(); 102 db.Commit();
103 } 103 }
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs
index fa1abc8..8a7893e 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs
+++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs
@@ -97,7 +97,7 @@ namespace OpenSim.Storage.LocalStorageSQLite
97 sql += "\"" + prim.PathTaperY.ToString() + "\","; 97 sql += "\"" + prim.PathTaperY.ToString() + "\",";
98 sql += "\"" + prim.PathTwist.ToString() + "\","; 98 sql += "\"" + prim.PathTwist.ToString() + "\",";
99 sql += "\"" + prim.PathTwistBegin.ToString() + "\","; 99 sql += "\"" + prim.PathTwistBegin.ToString() + "\",";
100 sql += "\"" + prim.Texture.ToString() + "\","; 100 sql += "\"" + prim.TextureEntry.ToString() + "\",";
101 sql += "\"" + prim.CreationDate.ToString() + "\","; 101 sql += "\"" + prim.CreationDate.ToString() + "\",";
102 sql += "\"" + prim.OwnerMask.ToString() + "\","; 102 sql += "\"" + prim.OwnerMask.ToString() + "\",";
103 sql += "\"" + prim.NextOwnerMask.ToString() + "\","; 103 sql += "\"" + prim.NextOwnerMask.ToString() + "\",";
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs
index 66cc2ba..4e2f599 100644
--- a/OpenSim/OpenSim/OpenSimMain.cs
+++ b/OpenSim/OpenSim/OpenSimMain.cs
@@ -60,7 +60,7 @@ namespace OpenSim
60 60
61 public class OpenSimMain : RegionApplicationBase, conscmd_callback 61 public class OpenSimMain : RegionApplicationBase, conscmd_callback
62 { 62 {
63 private CheckSumServer checkServer; 63 // private CheckSumServer checkServer;
64 protected CommunicationsManager commsManager; 64 protected CommunicationsManager commsManager;
65 65
66 private bool m_silent; 66 private bool m_silent;
@@ -97,6 +97,8 @@ namespace OpenSim
97 m_log.Verbose( "Main.cs:Startup() - Loading configuration"); 97 m_log.Verbose( "Main.cs:Startup() - Loading configuration");
98 this.serversData.InitConfig(this.m_sandbox, this.localConfig); 98 this.serversData.InitConfig(this.m_sandbox, this.localConfig);
99 this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change 99 this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
100
101 ScenePresence.LoadTextureFile("avatar-texture.dat");
100 102
101 ClientView.TerrainManager = new TerrainManager(new SecondLife()); 103 ClientView.TerrainManager = new TerrainManager(new SecondLife());
102 104
@@ -104,8 +106,8 @@ namespace OpenSim
104 if (m_sandbox) 106 if (m_sandbox)
105 { 107 {
106 this.SetupLocalGridServers(); 108 this.SetupLocalGridServers();
107 this.checkServer = new CheckSumServer(12036); 109 // this.checkServer = new CheckSumServer(12036);
108 this.checkServer.ServerListener(); 110 // this.checkServer.ServerListener();
109 sandboxCommunications = new CommunicationsLocal(this.serversData.DefaultHomeLocX, this.serversData.DefaultHomeLocY); 111 sandboxCommunications = new CommunicationsLocal(this.serversData.DefaultHomeLocX, this.serversData.DefaultHomeLocY);
110 this.commsManager = sandboxCommunications; 112 this.commsManager = sandboxCommunications;
111 } 113 }