diff --git a/OpenSim/Data/IXInventoryData.cs b/OpenSim/Data/IXInventoryData.cs index 690913670a..d85a7efb8f 100644 --- a/OpenSim/Data/IXInventoryData.cs +++ b/OpenSim/Data/IXInventoryData.cs @@ -51,7 +51,7 @@ namespace OpenSim.Data public int inventoryNextPermissions; public int inventoryCurrentPermissions; public int invType; - public UUID creatorID; + public string creatorID; public int inventoryBasePermissions; public int inventoryEveryOnePermissions; public int salePrice; diff --git a/OpenSim/Data/MySQL/Resources/AssetStore.migrations b/OpenSim/Data/MySQL/Resources/AssetStore.migrations index 9c5563038f..e0526fed9c 100644 --- a/OpenSim/Data/MySQL/Resources/AssetStore.migrations +++ b/OpenSim/Data/MySQL/Resources/AssetStore.migrations @@ -73,5 +73,5 @@ ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0; :VERSION 8 -ALTER TABLE assets ADD COLUMN CreatorID varchar(36) NOT NULL DEFAULT ''; +ALTER TABLE assets ADD COLUMN CreatorID varchar(128) NOT NULL DEFAULT ''; diff --git a/OpenSim/Data/MySQL/Resources/InventoryStore.migrations b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations index 8c5864e97d..3e9bad5f95 100644 --- a/OpenSim/Data/MySQL/Resources/InventoryStore.migrations +++ b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations @@ -91,3 +91,11 @@ update inventoryitems set creatorID = '00000000-0000-0000-0000-000000000000' whe alter table inventoryitems modify column creatorID varchar(36) not NULL default '00000000-0000-0000-0000-000000000000'; COMMIT; + +:VERSION 5 # ------------ + +BEGIN; + +alter table inventoryitems modify column creatorID varchar(128) not NULL default '00000000-0000-0000-0000-000000000000'; + +COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql b/OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql deleted file mode 100644 index 7e21996ed9..0000000000 --- a/OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql +++ /dev/null @@ -1,38 +0,0 @@ -BEGIN TRANSACTION; - -CREATE TABLE inventoryfolders( - folderName varchar(255), - type integer, - version integer, - folderID varchar(255) primary key, - agentID varchar(255) not null default '00000000-0000-0000-0000-000000000000', - parentFolderID varchar(255) not null default '00000000-0000-0000-0000-000000000000'); - -CREATE TABLE inventoryitems( - assetID varchar(255), - assetType integer, - inventoryName varchar(255), - inventoryDescription varchar(255), - inventoryNextPermissions integer, - inventoryCurrentPermissions integer, - invType integer, - creatorID varchar(255), - inventoryBasePermissions integer, - inventoryEveryOnePermissions integer, - salePrice integer default 99, - saleType integer default 0, - creationDate integer default 2000, - groupID varchar(255) default '00000000-0000-0000-0000-000000000000', - groupOwned integer default 0, - flags integer default 0, - inventoryID varchar(255) primary key, - parentFolderID varchar(255) not null default '00000000-0000-0000-0000-000000000000', - avatarID varchar(255) not null default '00000000-0000-0000-0000-000000000000', - inventoryGroupPermissions integer not null default 0); - -create index inventoryfolders_agentid on inventoryfolders(agentID); -create index inventoryfolders_parentid on inventoryfolders(parentFolderID); -create index inventoryitems_parentfolderid on inventoryitems(parentFolderID); -create index inventoryitems_avatarid on inventoryitems(avatarID); - -COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql b/OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql deleted file mode 100644 index d38e2b77cc..0000000000 --- a/OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql +++ /dev/null @@ -1,8 +0,0 @@ -ATTACH 'inventoryStore.db' AS old; - -BEGIN TRANSACTION; - -INSERT INTO inventoryfolders (folderName, type, version, folderID, agentID, parentFolderID) SELECT `name` AS folderName, `type` AS type, `version` AS version, `UUID` AS folderID, `agentID` AS agentID, `parentID` AS parentFolderID from old.inventoryfolders; -INSERT INTO inventoryitems (assetID, assetType, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryID, parentFolderID, avatarID, inventoryGroupPermissions) SELECT `assetID`, `assetType` AS assetType, `inventoryName` AS inventoryName, `inventoryDescription` AS inventoryDescription, `inventoryNextPermissions` AS inventoryNextPermissions, `inventoryCurrentPermissions` AS inventoryCurrentPermissions, `invType` AS invType, `creatorsID` AS creatorID, `inventoryBasePermissions` AS inventoryBasePermissions, `inventoryEveryOnePermissions` AS inventoryEveryOnePermissions, `salePrice` AS salePrice, `saleType` AS saleType, `creationDate` AS creationDate, `groupID` AS groupID, `groupOwned` AS groupOwned, `flags` AS flags, `UUID` AS inventoryID, `parentFolderID` AS parentFolderID, `avatarID` AS avatarID, `inventoryGroupPermissions` AS inventoryGroupPermissions FROM old.inventoryitems; - -COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/005_AssetStore.sql b/OpenSim/Data/SQLite/Resources/005_AssetStore.sql deleted file mode 100644 index f06121abc1..0000000000 --- a/OpenSim/Data/SQLite/Resources/005_AssetStore.sql +++ /dev/null @@ -1,5 +0,0 @@ -BEGIN; - -ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0; - -COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/AssetStore.migrations b/OpenSim/Data/SQLite/Resources/AssetStore.migrations index bc11e13d38..f20631cc14 100644 --- a/OpenSim/Data/SQLite/Resources/AssetStore.migrations +++ b/OpenSim/Data/SQLite/Resources/AssetStore.migrations @@ -55,7 +55,7 @@ CREATE TABLE assets( Local, Temporary, asset_flags INTEGER NOT NULL DEFAULT 0, - CreatorID varchar(36) default '', + CreatorID varchar(128) default '', Data); INSERT INTO assets(UUID,Name,Description,Type,Local,Temporary,Data) @@ -64,3 +64,4 @@ DROP TABLE assets_backup; COMMIT; + diff --git a/OpenSim/Data/SQLite/Resources/XInventoryStore.migrations b/OpenSim/Data/SQLite/Resources/XInventoryStore.migrations new file mode 100644 index 0000000000..d5b3019c76 --- /dev/null +++ b/OpenSim/Data/SQLite/Resources/XInventoryStore.migrations @@ -0,0 +1,51 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE inventoryfolders( + folderName varchar(64), + type integer, + version integer, + folderID varchar(36) primary key, + agentID varchar(36) not null default '00000000-0000-0000-0000-000000000000', + parentFolderID varchar(36) not null default '00000000-0000-0000-0000-000000000000'); + +CREATE TABLE inventoryitems( + assetID varchar(36), + assetType integer, + inventoryName varchar(64), + inventoryDescription varchar(128), + inventoryNextPermissions integer, + inventoryCurrentPermissions integer, + invType integer, + creatorID varchar(128), + inventoryBasePermissions integer, + inventoryEveryOnePermissions integer, + salePrice integer default 99, + saleType integer default 0, + creationDate integer default 2000, + groupID varchar(36) default '00000000-0000-0000-0000-000000000000', + groupOwned integer default 0, + flags integer default 0, + inventoryID varchar(36) primary key, + parentFolderID varchar(36) not null default '00000000-0000-0000-0000-000000000000', + avatarID varchar(36) not null default '00000000-0000-0000-0000-000000000000', + inventoryGroupPermissions integer not null default 0); + +create index inventoryfolders_agentid on inventoryfolders(agentID); +create index inventoryfolders_parentid on inventoryfolders(parentFolderID); +create index inventoryitems_parentfolderid on inventoryitems(parentFolderID); +create index inventoryitems_avatarid on inventoryitems(avatarID); + +COMMIT; + +:VERSION 2 + +ATTACH 'inventoryStore.db' AS old; + +BEGIN TRANSACTION; + +INSERT INTO inventoryfolders (folderName, type, version, folderID, agentID, parentFolderID) SELECT `name` AS folderName, `type` AS type, `version` AS version, `UUID` AS folderID, `agentID` AS agentID, `parentID` AS parentFolderID from old.inventoryfolders; +INSERT INTO inventoryitems (assetID, assetType, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryID, parentFolderID, avatarID, inventoryGroupPermissions) SELECT `assetID`, `assetType` AS assetType, `inventoryName` AS inventoryName, `inventoryDescription` AS inventoryDescription, `inventoryNextPermissions` AS inventoryNextPermissions, `inventoryCurrentPermissions` AS inventoryCurrentPermissions, `invType` AS invType, `creatorsID` AS creatorID, `inventoryBasePermissions` AS inventoryBasePermissions, `inventoryEveryOnePermissions` AS inventoryEveryOnePermissions, `salePrice` AS salePrice, `saleType` AS saleType, `creationDate` AS creationDate, `groupID` AS groupID, `groupOwned` AS groupOwned, `flags` AS flags, `UUID` AS inventoryID, `parentFolderID` AS parentFolderID, `avatarID` AS avatarID, `inventoryGroupPermissions` AS inventoryGroupPermissions FROM old.inventoryitems; + +COMMIT; \ No newline at end of file diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 709085508b..b2df0bdb3a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3426,7 +3426,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); loc.Header.Reliable = false; - // Each packet can only hold around 62 avatar positions and the client clears the mini-map each time + // Each packet can only hold around 60 avatar positions and the client clears the mini-map each time // a CoarseLocationUpdate packet is received. Oh well. int total = Math.Min(CoarseLocations.Count, 60); diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 66c5a7215b..266621f924 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -869,9 +869,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); - // m_scene.SendKillObject(m_localId); - - agent.Scene.NotifyMyCoarseLocationChange(); // the user may change their profile information in other region, // so the userinfo in UserProfileCache is not reliable any more, delete it // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 58ce550773..c1e92f59a2 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -95,6 +95,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess try { asset1.ID = url + "/" + asset.ID; + UUID temp = UUID.Zero; + // TODO: if the creator is local, stick this grid's URL in front + //if (UUID.TryParse(asset.Metadata.CreatorID, out temp)) + // asset1.Metadata.CreatorID = ??? + "/" + asset.Metadata.CreatorID; } catch { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 48ffbce236..e80dff756e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -362,6 +362,7 @@ namespace OpenSim.Region.Framework.Scenes private int m_update_backup = 200; private int m_update_terrain = 50; private int m_update_land = 1; + private int m_update_coarse_locations = 50; private int frameMS; private int physicsMS2; @@ -1445,6 +1446,18 @@ namespace OpenSim.Region.Framework.Scenes if (m_frame % m_update_objects == 0) m_sceneGraph.UpdateObjectGroups(); + if (m_frame % m_update_coarse_locations == 0) + { + List coarseLocations; + List avatarUUIDs; + SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60); + // Send coarse locations to clients + ForEachScenePresence(delegate(ScenePresence presence) + { + presence.SendCoarseLocations(coarseLocations, avatarUUIDs); + }); + } + int tmpPhysicsMS2 = Util.EnvironmentTickCount(); if ((m_frame % m_update_physics == 0) && m_physics_enabled) m_sceneGraph.UpdatePreparePhysics(); @@ -3329,9 +3342,6 @@ namespace OpenSim.Region.Framework.Scenes catch (NullReferenceException) { } }); - ForEachScenePresence( - delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); - IAgentAssetTransactions agentTransactions = this.RequestModuleInterface(); if (agentTransactions != null) { @@ -3383,14 +3393,6 @@ namespace OpenSim.Region.Framework.Scenes } } - /// - /// Inform all other ScenePresences on this Scene that someone else has changed position on the minimap. - /// - public void NotifyMyCoarseLocationChange() - { - ForEachScenePresence(delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); - } - #endregion #region Entities diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1dab4df8a8..80f9114bfd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -211,6 +211,43 @@ namespace OpenSim.Region.Framework.Scenes }); } + public void GetCoarseLocations(out List coarseLocations, out List avatarUUIDs, uint maxLocations) + { + coarseLocations = new List(); + avatarUUIDs = new List(); + + List presences = GetScenePresences(); + for (int i = 0; i < Math.Min(presences.Count, maxLocations); ++i) + { + ScenePresence sp = presences[i]; + // If this presence is a child agent, we don't want its coarse locations + if (sp.IsChildAgent) + return; + + if (sp.ParentID != 0) + { + // sitting avatar + SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID); + if (sop != null) + { + coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition); + avatarUUIDs.Add(sp.UUID); + } + else + { + // we can't find the parent.. ! arg! + coarseLocations.Add(sp.AbsolutePosition); + avatarUUIDs.Add(sp.UUID); + } + } + else + { + coarseLocations.Add(sp.AbsolutePosition); + avatarUUIDs.Add(sp.UUID); + } + } + } + #endregion #region Entity Methods diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e3bbe8a089..8cd3ac6d76 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes public ScriptControlled eventControls; } - public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence); + public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence, List coarseLocations, List avatarUUIDs); public class ScenePresence : EntityBase, ISceneEntity { @@ -178,8 +178,6 @@ namespace OpenSim.Region.Framework.Scenes public string JID = String.Empty; - // Agent moves with a PID controller causing a force to be exerted. - private bool m_newCoarseLocations = true; private float m_health = 100f; // Default AV Height @@ -2548,12 +2546,6 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); - if (m_newCoarseLocations) - { - SendCoarseLocations(); - m_newCoarseLocations = false; - } - if (m_isChildAgent == false) { // PhysicsActor actor = m_physicsActor; @@ -2630,12 +2622,12 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } - public void SendCoarseLocations() + public void SendCoarseLocations(List coarseLocations, List avatarUUIDs) { SendCourseLocationsMethod d = m_sendCourseLocationsMethod; if (d != null) { - d.Invoke(m_scene.RegionInfo.originRegionID, this); + d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs); } } @@ -2645,50 +2637,13 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); m_sendCourseLocationsMethod = d; } - public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p) + public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List coarseLocations, List avatarUUIDs) { m_perfMonMS = Util.EnvironmentTickCount(); - - List CoarseLocations = new List(); - List AvatarUUIDs = new List(); - m_scene.ForEachScenePresence(delegate(ScenePresence sp) - { - if (sp.IsChildAgent) - return; - - if (sp.ParentID != 0) - { - // sitting avatar - SceneObjectPart sop = m_scene.GetSceneObjectPart(sp.ParentID); - if (sop != null) - { - CoarseLocations.Add(sop.AbsolutePosition + sp.m_pos); - AvatarUUIDs.Add(sp.UUID); - } - else - { - // we can't find the parent.. ! arg! - CoarseLocations.Add(sp.m_pos); - AvatarUUIDs.Add(sp.UUID); - } - } - else - { - CoarseLocations.Add(sp.m_pos); - AvatarUUIDs.Add(sp.UUID); - } - }); - - m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); - + m_controllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } - public void CoarseLocationChange() - { - m_newCoarseLocations = true; - } - /// /// Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar) /// @@ -2923,7 +2878,6 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); { posLastSignificantMove = AbsolutePosition; m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient); - m_scene.NotifyMyCoarseLocationChange(); } // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index b42d3bfb32..d854176126 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -614,7 +614,9 @@ namespace OpenSim.Region.RegionCombinerModule presence.SetSendCourseLocationMethod(SendCourseLocationUpdates); } - private void SendCourseLocationUpdates(UUID sceneId, ScenePresence presence) + // This delegate was refactored for non-combined regions. + // This combined region version will not use the pre-compiled lists of locations and ids + private void SendCourseLocationUpdates(UUID sceneId, ScenePresence presence, List coarseLocations, List avatarUUIDs) { RegionConnections connectiondata = null; lock (m_regions) diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 463b0523f4..30e127d19b 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -125,6 +125,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine private ScriptCompileQueue m_CompileQueue = new ScriptCompileQueue(); IWorkItemResult m_CurrentCompile = null; + private Dictionary m_CompileDict = new Dictionary(); private void lockScriptsForRead(bool locked) { @@ -560,6 +561,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine else { m_CompileQueue.Enqueue(parms); + lock (m_CompileDict) + { + m_CompileDict[itemID] = 0; + } if (m_CurrentCompile == null) { @@ -622,6 +627,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine bool postOnRez = (bool)p[4]; StateSource stateSource = (StateSource)p[5]; + lock(m_CompileDict) + { + if (!m_CompileDict.ContainsKey(itemID)) + return false; + m_CompileDict.Remove(itemID); + } + // Get the asset ID of the script, so we can check if we // already have it. @@ -868,6 +880,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine public void OnRemoveScript(uint localID, UUID itemID) { + // If it's not yet been compiled, make sure we don't try + lock (m_CompileDict) + { + if (m_CompileDict.ContainsKey(itemID)) + m_CompileDict.Remove(itemID); + } + lockScriptsForRead(true); // Do we even have it? if (!m_Scripts.ContainsKey(itemID)) diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 974caf0d7e..af831fdf94 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -460,7 +460,7 @@ namespace OpenSim.Services.InventoryService newItem.ID = item.inventoryID; newItem.InvType = item.invType; newItem.Folder = item.parentFolderID; - newItem.CreatorId = item.creatorID.ToString(); + newItem.CreatorId = item.creatorID; newItem.Description = item.inventoryDescription; newItem.NextPermissions = (uint)item.inventoryNextPermissions; newItem.CurrentPermissions = (uint)item.inventoryCurrentPermissions; @@ -491,7 +491,7 @@ namespace OpenSim.Services.InventoryService newItem.inventoryID = item.ID; newItem.invType = item.InvType; newItem.parentFolderID = item.Folder; - newItem.creatorID = item.CreatorIdAsUuid; + newItem.creatorID = item.CreatorId; newItem.inventoryDescription = item.Description; newItem.inventoryNextPermissions = (int)item.NextPermissions; newItem.inventoryCurrentPermissions = (int)item.CurrentPermissions;