aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-08-20 15:49:06 +0000
committerMW2007-08-20 15:49:06 +0000
commit31a81e17be6e59111deb484650fbb1cfa1eb6c5c (patch)
tree01b3f226cd207db1768d33a65fd5931e070e8247
parentInstant Messages between users in the same region should actually now work. (diff)
downloadopensim-SC_OLD-31a81e17be6e59111deb484650fbb1cfa1eb6c5c.zip
opensim-SC_OLD-31a81e17be6e59111deb484650fbb1cfa1eb6c5c.tar.gz
opensim-SC_OLD-31a81e17be6e59111deb484650fbb1cfa1eb6c5c.tar.bz2
opensim-SC_OLD-31a81e17be6e59111deb484650fbb1cfa1eb6c5c.tar.xz
The regionUUID is now being passed to the datastore calls.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs37
-rw-r--r--OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs10
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs6
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs6
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs6
9 files changed, 65 insertions, 34 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index e56d361..ff527fb 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -40,8 +40,8 @@ using OpenSim.Framework.Inventory;
40using OpenSim.Framework.Types; 40using OpenSim.Framework.Types;
41using OpenSim.Framework.Utilities; 41using OpenSim.Framework.Utilities;
42using OpenSim.Framework.Communications.Caches; 42using OpenSim.Framework.Communications.Caches;
43 43
44using Timer=System.Timers.Timer; 44using Timer = System.Timers.Timer;
45 45
46namespace OpenSim.Region.ClientStack 46namespace OpenSim.Region.ClientStack
47{ 47{
@@ -74,7 +74,7 @@ namespace OpenSim.Region.ClientStack
74 protected IScene m_scene; 74 protected IScene m_scene;
75 private Dictionary<uint, ClientView> m_clientThreads; 75 private Dictionary<uint, ClientView> m_clientThreads;
76 private AssetCache m_assetCache; 76 private AssetCache m_assetCache;
77 // private InventoryCache m_inventoryCache; 77 // private InventoryCache m_inventoryCache;
78 private int cachedtextureserial = 0; 78 private int cachedtextureserial = 0;
79 protected AgentCircuitManager m_authenticateSessionsHandler; 79 protected AgentCircuitManager m_authenticateSessionsHandler;
80 private Encoding enc = Encoding.ASCII; 80 private Encoding enc = Encoding.ASCII;
@@ -84,7 +84,7 @@ namespace OpenSim.Region.ClientStack
84 private int probesWithNoIngressPackets = 0; 84 private int probesWithNoIngressPackets = 0;
85 private int lastPacketsReceived = 0; 85 private int lastPacketsReceived = 0;
86 86
87 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions ) 87 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions)
88 { 88 {
89 m_moneyBalance = 1000; 89 m_moneyBalance = 1000;
90 90
@@ -93,10 +93,10 @@ namespace OpenSim.Region.ClientStack
93 m_assetCache = assetCache; 93 m_assetCache = assetCache;
94 94
95 m_networkServer = packServer; 95 m_networkServer = packServer;
96 // m_inventoryCache = inventoryCache; 96 // m_inventoryCache = inventoryCache;
97 m_authenticateSessionsHandler = authenSessions; 97 m_authenticateSessionsHandler = authenSessions;
98 98
99 MainLog.Instance.Verbose( "OpenSimClient.cs - Started up new client thread to handle incoming request"); 99 MainLog.Instance.Verbose("OpenSimClient.cs - Started up new client thread to handle incoming request");
100 cirpack = initialcirpack; 100 cirpack = initialcirpack;
101 userEP = remoteEP; 101 userEP = remoteEP;
102 102
@@ -121,7 +121,7 @@ namespace OpenSim.Region.ClientStack
121 public void KillClient() 121 public void KillClient()
122 { 122 {
123 clientPingTimer.Stop(); 123 clientPingTimer.Stop();
124 124
125 m_scene.RemoveClient(this.AgentId); 125 m_scene.RemoveClient(this.AgentId);
126 126
127 m_clientThreads.Remove(this.CircuitCode); 127 m_clientThreads.Remove(this.CircuitCode);
@@ -186,14 +186,15 @@ namespace OpenSim.Region.ClientStack
186 186
187 protected virtual void ClientLoop() 187 protected virtual void ClientLoop()
188 { 188 {
189 MainLog.Instance.Verbose( "OpenSimClient.cs:ClientLoop() - Entered loop"); 189 MainLog.Instance.Verbose("OpenSimClient.cs:ClientLoop() - Entered loop");
190 while (true) 190 while (true)
191 { 191 {
192 QueItem nextPacket = PacketQueue.Dequeue(); 192 QueItem nextPacket = PacketQueue.Dequeue();
193 if (nextPacket.Incoming) 193 if (nextPacket.Incoming)
194 { 194 {
195 //is a incoming packet 195 //is a incoming packet
196 if (nextPacket.Packet.Type != PacketType.AgentUpdate) { 196 if (nextPacket.Packet.Type != PacketType.AgentUpdate)
197 {
197 packetsReceived++; 198 packetsReceived++;
198 } 199 }
199 ProcessInPacket(nextPacket.Packet); 200 ProcessInPacket(nextPacket.Packet);
@@ -209,15 +210,21 @@ namespace OpenSim.Region.ClientStack
209 210
210 protected void CheckClientConnectivity(object sender, ElapsedEventArgs e) 211 protected void CheckClientConnectivity(object sender, ElapsedEventArgs e)
211 { 212 {
212 if (packetsReceived == lastPacketsReceived) { 213 if (packetsReceived == lastPacketsReceived)
214 {
213 probesWithNoIngressPackets++; 215 probesWithNoIngressPackets++;
214 if (probesWithNoIngressPackets > 30) { 216 if (probesWithNoIngressPackets > 30)
217 {
215 this.KillClient(); 218 this.KillClient();
216 } else { 219 }
220 else
221 {
217 // this will normally trigger at least one packet (ping response) 222 // this will normally trigger at least one packet (ping response)
218 SendStartPingCheck(0); 223 SendStartPingCheck(0);
219 } 224 }
220 } else { 225 }
226 else
227 {
221 // Something received in the meantime - we can reset the counters 228 // Something received in the meantime - we can reset the counters
222 probesWithNoIngressPackets = 0; 229 probesWithNoIngressPackets = 0;
223 lastPacketsReceived = packetsReceived; 230 lastPacketsReceived = packetsReceived;
@@ -232,7 +239,7 @@ namespace OpenSim.Region.ClientStack
232 clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); 239 clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
233 clientPingTimer.Enabled = true; 240 clientPingTimer.Enabled = true;
234 241
235 MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to scene"); 242 MainLog.Instance.Verbose("OpenSimClient.cs:InitNewClient() - Adding viewer agent to scene");
236 this.m_scene.AddNewClient(this, false); 243 this.m_scene.AddNewClient(this, false);
237 } 244 }
238 245
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
index 395819d..9b97fc6 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
@@ -47,10 +47,10 @@ namespace OpenSim.Region.Interfaces
47 /// <param name="dbname">The name of the database to store to (may not be applicable)</param> 47 /// <param name="dbname">The name of the database to store to (may not be applicable)</param>
48 void Initialise(string filename, string dbname); 48 void Initialise(string filename, string dbname);
49 49
50 void StoreObject(SceneObjectGroup obj); 50 void StoreObject(SceneObjectGroup obj, LLUUID regionUUID);
51 void RemoveObject(LLUUID uuid); 51 void RemoveObject(LLUUID uuid, LLUUID regionUUID);
52 52
53 List<SceneObjectGroup> LoadObjects(); 53 List<SceneObjectGroup> LoadObjects(LLUUID regionUUID);
54 54
55 void StoreTerrain(double[,] terrain); 55 void StoreTerrain(double[,] terrain);
56 double[,] LoadTerrain(); 56 double[,] LoadTerrain();
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 0ed10c0..0449cd9 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -270,7 +270,7 @@ namespace OpenSim.Region.Environment.Scenes
270 remoteClient.SendInventoryItemUpdate(item); 270 remoteClient.SendInventoryItemUpdate(item);
271 } 271 }
272 272
273 storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID); 273 storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID, m_regInfo.SimUUID);
274 ((SceneObjectGroup)selectedEnt).DeleteGroup(); 274 ((SceneObjectGroup)selectedEnt).DeleteGroup();
275 275
276 lock (Entities) 276 lock (Entities)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index d1a16e0..10be283 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -180,6 +180,8 @@ namespace OpenSim.Region.Environment.Scenes
180 ScenePresence.LoadAnims(); 180 ScenePresence.LoadAnims();
181 181
182 httpListener = httpServer; 182 httpListener = httpServer;
183
184
183 } 185 }
184 186
185 #endregion 187 #endregion
@@ -497,7 +499,7 @@ namespace OpenSim.Region.Environment.Scenes
497 public void LoadPrimsFromStorage() 499 public void LoadPrimsFromStorage()
498 { 500 {
499 MainLog.Instance.Verbose("Loading objects from datastore"); 501 MainLog.Instance.Verbose("Loading objects from datastore");
500 List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(); 502 List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(this.m_regInfo.SimUUID);
501 foreach (SceneObjectGroup prim in PrimsFromDB) 503 foreach (SceneObjectGroup prim in PrimsFromDB)
502 { 504 {
503 AddEntityFromStorage(prim); 505 AddEntityFromStorage(prim);
@@ -707,7 +709,7 @@ namespace OpenSim.Region.Environment.Scenes
707 client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory; 709 client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory;
708 client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest; 710 client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest;
709 client.OnXferReceive += commsManager.TransactionsManager.HandleXfer; 711 client.OnXferReceive += commsManager.TransactionsManager.HandleXfer;
710 // client.OnRequestXfer += RequestXfer; 712 // client.OnRequestXfer += RequestXfer;
711 713
712 client.OnRequestAvatarProperties += RequestAvatarProperty; 714 client.OnRequestAvatarProperties += RequestAvatarProperty;
713 715
@@ -919,9 +921,7 @@ namespace OpenSim.Region.Environment.Scenes
919 if (agent.CapsPath != "") 921 if (agent.CapsPath != "")
920 { 922 {
921 //Console.WriteLine("new user, so creating caps handler for it"); 923 //Console.WriteLine("new user, so creating caps handler for it");
922 Caps cap = 924 Caps cap = new Caps(assetCache, httpListener, m_regInfo.ExternalHostName, m_regInfo.ExternalEndPoint.Port, agent.CapsPath, agent.AgentID);
923 new Caps(assetCache, httpListener, m_regInfo.ExternalHostName, m_regInfo.ExternalEndPoint.Port,
924 agent.CapsPath, agent.AgentID);
925 Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + "/CAPS/" + agent.CapsPath + "0000/"); 925 Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + "/CAPS/" + agent.CapsPath + "0000/");
926 cap.RegisterHandlers(); 926 cap.RegisterHandlers();
927 cap.AddNewInventoryItem = this.AddInventoryItem; 927 cap.AddNewInventoryItem = this.AddInventoryItem;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 1e6cd8f..9042c04 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -436,12 +436,26 @@ namespace OpenSim.Region.Environment.Scenes
436 linkPart.SetParent(this); 436 linkPart.SetParent(this);
437 437
438 //TODO: rest of parts 438 //TODO: rest of parts
439 foreach (SceneObjectPart part in objectGroup.Children.Values)
440 {
441 if (part.UUID != objectGroup.m_rootPart.UUID)
442 {
443 this.LinkNonRootPart(part);
444 }
445 }
439 446
440 m_scene.EventManager.OnBackup -= objectGroup.ProcessBackup; 447 m_scene.EventManager.OnBackup -= objectGroup.ProcessBackup;
441 m_scene.DeleteEntity(objectGroup.UUID); 448 m_scene.DeleteEntity(objectGroup.UUID);
442 this.ScheduleGroupForFullUpdate(); 449 this.ScheduleGroupForFullUpdate();
443 } 450 }
444 451
452 private void LinkNonRootPart(SceneObjectPart part)
453 {
454 part.SetParent(this);
455 part.ParentID = this.m_rootPart.LocalID;
456 this.m_parts.Add(part.UUID, part);
457 }
458
445 /// <summary> 459 /// <summary>
446 /// 460 ///
447 /// </summary> 461 /// </summary>
@@ -812,7 +826,7 @@ namespace OpenSim.Region.Environment.Scenes
812 /// <param name="datastore"></param> 826 /// <param name="datastore"></param>
813 public void ProcessBackup(OpenSim.Region.Interfaces.IRegionDataStore datastore) 827 public void ProcessBackup(OpenSim.Region.Interfaces.IRegionDataStore datastore)
814 { 828 {
815 datastore.StoreObject(this); 829 datastore.StoreObject(this, m_scene.RegionInfo.SimUUID);
816 } 830 }
817 #endregion 831 #endregion
818 832
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 0393a2a..73e9d48 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -496,6 +496,16 @@ namespace OpenSim.Region.Environment.Scenes
496 496
497 this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient); 497 this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
498 this.ControllingClient.SendViewerTime(this.m_scene.TimePhase); 498 this.ControllingClient.SendViewerTime(this.m_scene.TimePhase);
499
500 //Please don't remove the following code (at least not yet), just leave it commented out
501 //gives the user god powers, should help with debuging things in the future
502 /*
503 GrantGodlikePowersPacket grant = new GrantGodlikePowersPacket();
504 grant.AgentData.AgentID = this.ControllingClient.AgentId;
505 grant.AgentData.SessionID = this.ControllingClient.SessionId;
506 grant.GrantData.GodLevel = 255;
507 grant.GrantData.Token = LLUUID.Random();
508 this.ControllingClient.OutPacket(grant);*/
499 } 509 }
500 510
501 /// <summary> 511 /// <summary>
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
index 9c5e4bc..73eb635 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
@@ -43,12 +43,12 @@ namespace OpenSim.DataStore.DB4oStorage
43 return; 43 return;
44 } 44 }
45 45
46 public void StoreObject(SceneObjectGroup obj) 46 public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
47 { 47 {
48 db.Set(obj); 48 db.Set(obj);
49 } 49 }
50 50
51 public void RemoveObject(LLUUID obj) 51 public void RemoveObject(LLUUID obj, LLUUID regionUUID)
52 { 52 {
53 IObjectSet result = db.Query(new SceneObjectQuery(obj)); 53 IObjectSet result = db.Query(new SceneObjectQuery(obj));
54 if (result.Count > 0) 54 if (result.Count > 0)
@@ -58,7 +58,7 @@ namespace OpenSim.DataStore.DB4oStorage
58 } 58 }
59 } 59 }
60 60
61 public List<SceneObjectGroup> LoadObjects() 61 public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
62 { 62 {
63 IObjectSet result = db.Get(typeof(SceneObjectGroup)); 63 IObjectSet result = db.Get(typeof(SceneObjectGroup));
64 List<SceneObjectGroup> retvals = new List<SceneObjectGroup>(); 64 List<SceneObjectGroup> retvals = new List<SceneObjectGroup>();
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
index 391ac84..b6c6c83 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
@@ -485,7 +485,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage
485 } 485 }
486 } 486 }
487 487
488 public void StoreObject(SceneObjectGroup obj) 488 public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
489 { 489 {
490 foreach (SceneObjectPart prim in obj.Children.Values) 490 foreach (SceneObjectPart prim in obj.Children.Values)
491 { 491 {
@@ -498,7 +498,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage
498 // MainLog.Instance.Verbose("Dump of prims:", ds.GetXml()); 498 // MainLog.Instance.Verbose("Dump of prims:", ds.GetXml());
499 } 499 }
500 500
501 public void RemoveObject(LLUUID obj) 501 public void RemoveObject(LLUUID obj, LLUUID regionUUID)
502 { 502 {
503 DataTable prims = ds.Tables["prims"]; 503 DataTable prims = ds.Tables["prims"];
504 DataTable shapes = ds.Tables["primshapes"]; 504 DataTable shapes = ds.Tables["primshapes"];
@@ -520,7 +520,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage
520 shapeDa.Update(ds, "primshapes"); 520 shapeDa.Update(ds, "primshapes");
521 } 521 }
522 522
523 public List<SceneObjectGroup> LoadObjects() 523 public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
524 { 524 {
525 Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>(); 525 Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>();
526 List<SceneObjectGroup> retvals = new List<SceneObjectGroup>(); 526 List<SceneObjectGroup> retvals = new List<SceneObjectGroup>();
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs
index 643508e..176a534 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs
@@ -18,17 +18,17 @@ namespace OpenSim.DataStore.NullStorage
18 return; 18 return;
19 } 19 }
20 20
21 public void StoreObject(SceneObjectGroup obj) 21 public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
22 { 22 {
23 23
24 } 24 }
25 25
26 public void RemoveObject(LLUUID obj) 26 public void RemoveObject(LLUUID obj, LLUUID regionUUID)
27 { 27 {
28 28
29 } 29 }
30 30
31 public List<SceneObjectGroup> LoadObjects() 31 public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
32 { 32 {
33 return new List<SceneObjectGroup>(); 33 return new List<SceneObjectGroup>();
34 } 34 }