diff options
Diffstat (limited to 'OpenSim/Region/Environment')
5 files changed, 34 insertions, 10 deletions
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> |