Compare commits

...

84 Commits

Author SHA1 Message Date
Diva Canto 192781e83b Added ': ' to password prompt. Mantis #4851 2010-07-22 04:01:55 -07:00
Melanie 46001809a6 Adding sample configuration to previous patch 2010-07-22 04:01:43 -07:00
Melanie adba22c29b Add sending of the avatar interests and configuration of the profiles
module as an OpenSim profile module to Simian grid services.
Patch by Dimentox, thank you.
Applied with changes.
2010-07-22 04:01:29 -07:00
Melanie 4e537a5a86 Allow Megaregions to start properly after an unclean shutdown 2010-07-20 23:24:54 +01:00
Justin Clark-Casey (justincc) 5182b9fcd2 adjust DialogModule to only send broadcast alerts to root agents 2010-07-20 15:07:09 -07:00
Melanie Thielker 8c631cfaa3 Allow communicating with blue box dialogs across a region border via a
child agent
2010-07-20 15:06:57 -07:00
Diva Canto 8641eb65b1 Restore lines that have been removed due to previous merge conflict. 2010-07-20 14:53:40 -07:00
Melanie 9c4380feb2 Remove a merge artefact 2010-07-20 14:53:27 -07:00
Melanie Thielker 3d82e79d1c When a god uses mass permission setting, the V bit is cleared from next
perms, rendering the item unmoveable for the next owenr. Make god mods
conform to the rules, too.
2010-07-20 14:53:13 -07:00
Melanie Thielker 2eadd984ab prevent hacked viewers from being able to delete arbitrary items from any
prim. Allow friends with perms and shared group members to move or copy
things out of prims
2010-07-20 14:52:50 -07:00
Melanie Thielker df55e5295f Fix a few permissions vulnerability. Owners could cause permissions
escalation on items contained in prims using a hacked viewer
2010-07-20 14:52:25 -07:00
Diva Canto d93a442483 Relaxed the ultra-conservative lock on m_items. Needs testing under linux and stress. 2010-07-20 13:26:42 -07:00
Diva Canto 257a46dfb9 Another stab at http://opensimulator.org/mantis/view.php?id=4858. Eliminated more nested locks. 2010-07-20 13:26:25 -07:00
Diva Canto 699d3b0965 One more stab at http://opensimulator.org/mantis/view.php?id=4858.
Eliminated the nested locks of m_Scripts and m_PrimObjects.
2010-07-20 13:26:08 -07:00
Diva Canto 5a8ddfe211 Deleted Snoopy's patch completely, including Thread.Sleep. Preliminary tests indicate that this is what causes deadlock. More tests needed. 2010-07-20 13:25:53 -07:00
Melanie 128da70d15 re-add the sleep lost in the revert. 2010-07-20 13:25:35 -07:00
Melanie 251740815f Revert "Thank you, Snoopy, for a patch to reduce sim script startup CPU usage"
This reverts commit c404c5fb54.
2010-07-20 13:25:17 -07:00
Justin Clark-Casey (justincc) 20c68cc531 Allow use of old angle rules PSYS_SRC_INNERANGLE and PSYS_SRC_OUTERANGLE in llParticleSystem()
This is a patch from http://opensimulator.org/mantis/view.php?id=3201
Thanks Micheil Martin!
2010-07-17 15:18:01 -07:00
Justin Clark-Casey (justincc) 4a898fdf8d Fix bugs in llRot2Euler()
Applies patch in http://opensimulator.org/mantis/view.php?id=4482.
Thanks Micheil Merlin!
2010-07-17 06:02:07 -07:00
Diva Canto 02019abf22 Fixes mantis #4872. Port for GridInfo was wrong in Robust.HG.ini.example 2010-07-15 03:34:57 -07:00
Diva Canto d843682c18 Removed a few obsolete mono addin references. Mantis #4854 2010-07-14 14:50:24 -07:00
Diva Canto 3ca3522ad1 Fixes mantis #4870. 2010-07-14 11:09:27 -07:00
Justin Clark-Casey (justincc) f13f35755c comment out obsolete assert that 'item has been passed to another user since it was last set' perms flag was set when a prim item was added to a scene object 2010-07-14 11:08:54 -07:00
Melanie Thielker 67417f6478 Fix a permissions issue 2010-07-14 10:22:56 -07:00
Justin Clark-Casey (justincc) 2167f99bde Fix obvious bug in XInventoryService.GetFolderItems() which was preventing the iar module from being able to save single item iars 2010-07-14 10:03:42 -07:00
Diva Canto 18f6ac7b86 Cleaned up a couple of things from OpenSim.ini.example: [Friends] section has been in other inis for a while, not needed here; and [Network] remoteDataPort is obsolete. 2010-07-14 08:54:09 -07:00
Diva Canto b5f87fd455 Removed some more debug messages. 2010-07-14 04:19:12 -07:00
Justin Clark-Casey (justincc) ecd46c881e uncomment a load iar code line I accidentally commented in the last commit
hooray for automated tests
2010-07-14 03:24:56 -07:00
Justin Clark-Casey (justincc) d55d6949fe comment out a lot of the debug log messages when loading an iar
these are very redundant now and cause issues when loading large iars
diva, you may want to cherry pick this for 0.7-post-fixes since it only comments out log lines and nothing else
2010-07-14 03:24:40 -07:00
Diva Canto 28b29aff45 Hopefully fixes mantis #4852 2010-07-08 16:22:48 -07:00
Melanie 94d6d9775f Handle a specific exception without spewing red ink. 2010-07-08 16:08:56 -07:00
Diva Canto 9316e0b867 These 2 files want to be committed. 2010-07-08 16:07:37 -07:00
dahlia 5f932605dc llVecNorm() now returns a zero-length vector when one is supplied as input. Addresses Mantis #4752 2010-07-08 11:12:23 -07:00
dahlia d06b75fe3b fix a potential division by zero 2010-07-08 11:10:08 -07:00
Diva Canto f5d5898964 Switched order of conditionals. 2010-07-07 02:42:48 -07:00
Kevin Cozens 68f0ab9504 Fixes problem where "Adult" regions were reported as being of type "Unknown". 2010-07-07 02:42:32 -07:00
Diva Canto 020ed93418 Fixes mantis #4845 2010-07-05 08:49:06 -07:00
Diva Canto 9e569b2a23 Fixes mantis #4842 2010-07-05 07:38:53 -07:00
Diva Canto 58508fcb83 Fixes additional bug reported in mantis #4841. 2010-07-05 07:15:03 -07:00
Diva Canto 40d169992a Don't include hyperlinks as neighbors, even if grid operators have done the mistake of placing them as neighbors. This will not prevent further mess ups coming from that unsupported action. 2010-07-05 04:20:51 -07:00
Diva Canto 60207f670f One more buglet fixed related to mantis #4841 -- auto-returns were still chocking on a null pointer exception. 2010-07-05 03:37:19 -07:00
Diva Canto 80e16907bf Got rid of all hyperassets references. Also fixed accessing textures in user's inventory in foreign grids. 2010-07-04 15:10:52 -07:00
Diva Canto 77e54747d8 Started to clean up the mess with HyperAssets in LLClientView. Fixed HG access to Notecards in user's inventory. 2010-07-04 15:10:28 -07:00
Diva Canto 863462dbb8 Fixes the obvious problem in mantis #4841. Melanie needs to look at other potential problems there, though. 2010-07-04 03:01:09 -07:00
Diva Canto ed84963ef6 Compiled Robust.32BitLaunch.exe to .Net 3.5 2010-07-03 10:41:07 -07:00
Diva Canto 1fcd0272c1 Fixes mantis #4835 2010-07-03 02:46:29 -07:00
dahlia 04e2390e0d add Micheil Merlin to CONTRIBUTORS.txt (Mantis #4784) 2010-07-02 09:45:57 -07:00
Melanie Thielker 8864e3f058 Fox another scripting nasty. Stuff no system.string objects into lists 2010-07-02 09:45:31 -07:00
Melanie 0abedae3e4 Add MapTileURL to robust to supply the url needed by snowglobe 2010-07-02 09:43:59 -07:00
Melanie Thielker 0de8291ceb Fix a dumb little sign error that makes a LSL wiki example fail 2010-07-02 09:43:38 -07:00
Diva Canto 5f49e5d320 Flipped flavor to Release. 2010-07-02 06:45:42 -07:00
Diva Canto aa8002de05 Fixes mantis #4782 2010-07-02 06:40:14 -07:00
Justin Clark-Casey (justincc) 7451b8c8ab minor: comment out high volume texture serving module debug message 2010-07-01 07:09:39 -07:00
Diva Canto bd68591371 Removed opportunity for exception in BaseHttpServer. (mantis #4825) 2010-07-01 07:03:09 -07:00
Melanie b3ce5ffc11 Fix scripts in rezzed objects not starting (Mantis #4775) 2010-06-30 21:28:32 +01:00
Melanie 21bcca4c6b Fix the XML serializationt to provide an empty script state element if
the script hasn't yet saved state, or can't save state because of a loop
2010-06-29 23:44:53 +01:00
Justin Clark-Casey (justincc) 150ccac747 Revert "stop exceptions in setting and getting state from propogating since they aren't fatal to operations"
This reverts commit f4b90b52db.
2010-06-29 23:44:37 +01:00
Diva Canto bfff39c4c0 Merge branch 'master' into 0.7-post-fixes 2010-06-29 14:25:13 -07:00
Justin Clark-Casey (justincc) f4b90b52db stop exceptions in setting and getting state from propogating since they aren't fatal to operations
this will hopefully stop "save oar" from failing if a script asset is corrupt
2010-06-29 21:03:58 +01:00
Justin Clark-Casey (justincc) 6f1b351cf4 Revert "don't report the null uuid as a missing asset on saving oars/iars"
This reverts commit 5ce119174e.

This change led to infinite timeout since the expected number of assets no longer matched requests.
Rather than introduce yet fresh bugs with another fix, just revert this since the inaccurate report is just inconvenient
2010-06-29 20:28:48 +01:00
Diva Canto dcb9da8495 This is RC2. *** Changed the MySql driver back to the old one.*** Removed Old Guids from connection strings.
Merged master onto this branch.
2010-06-29 06:55:34 -07:00
Diva Canto 1cd9118c7a Merge branch 'master' into 0.7-post-fixes
Conflicts:
	OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
2010-06-29 06:37:39 -07:00
Justin Clark-Casey (justincc) 5ce119174e don't report the null uuid as a missing asset on saving oars/iars 2010-06-25 21:49:13 +01:00
Justin Clark-Casey (justincc) 0f3d9e17c6 minor: fix spelling mistake interupt -> interrupt in migrations
This is for  mantis 4783
2010-06-25 21:20:47 +01:00
Justin Clark-Casey (justincc) 77fc48f2f9 fix web request exception reporting properly this time 2010-06-25 20:59:24 +01:00
Justin Clark-Casey (justincc) 24785e82a5 stop KeyNotFoundException() being thrown in RemoveScenePresence if the agent isn't present in the presence dictionary
the code to do this was there but was being circumvented by newmap[agentID] before the check actually took place
2010-06-25 18:57:58 +01:00
John Hurliman 31b7279095 * SimianAssetServiceConnector Delete() was expecting the wrong type of response, reporting false errors
* Fixed a typo in a WebUtil error message
2010-06-24 13:44:34 -07:00
John Hurliman 4f59a865af * Fixed SimianGrid map tile uploads not having any objects in the images 2010-06-22 16:13:14 -07:00
Diva Canto 77d892690a Merge branch 'master' into 0.7-post-fixes 2010-06-19 13:52:21 -07:00
Justin Clark-Casey (justincc) ad5d1d0458 remove link to wiki mysql-config since the page was out-of-date and actively misleading 2010-06-19 01:53:14 +01:00
Justin Clark-Casey (justincc) 672108c29d minor: correct a spelling mistake 2010-06-19 01:28:14 +01:00
Justin Clark-Casey (justincc) ab95239047 Overhaul basic README.txt for new estate setup options on first run.
Also make some minor changes for clarity.
2010-06-19 01:26:25 +01:00
Justin Clark-Casey (justincc) 4d828eb3c3 minor: try and make the explanations for the AllowScriptCrossing and TrustBinaries settings in OpenSim.ini.example clearer 2010-06-18 23:39:45 +01:00
Justin Clark-Casey (justincc) fee3b32f2f eliminate SimianGrid [Groups] section from GridCommon.ini.example as per Nebadon
this is only used by SimianGrid and is now in SimianGrid.ini
2010-06-18 23:23:18 +01:00
Justin Clark-Casey 5af0d94929 Merge branch '0.7-post-fixes' of ssh://opensimulator.org/var/git/opensim into 0.7-post-fixes 2010-06-18 23:09:35 +01:00
Justin Clark-Casey c213643ab8 Change Opensim.Servers.exe comment at top of Robust.HG.ini to Robust.exe
This addresses http://opensimulator.org/mantis/view.php?id=4772
Thanks to aiaustin for pointing this out
2010-06-18 23:07:51 +01:00
Melanie 1032e1142a Remove an error in meshing error reporting. Now doesn't double-bomb
anymore on a bad sculpt
2010-06-18 19:50:56 +01:00
Justin Clark-Casey (justincc) 165429ff4d Fix problem where iar load would duplicate huge number of folders
This was http://opensimulator.org/mantis/view.php?id=4770
Extend unit tests to check for this scenario too
2010-06-18 18:08:54 +01:00
Justin Clark-Casey (justincc) 701cc35c9f change TestPartExistingIarPath() to check appropriate folder creation
change some names in InventoryArchiveReadRequest in an effort to make the code more comprehendable
2010-06-18 18:08:47 +01:00
Justin Clark-Casey (justincc) e98109765c in IAR utils, return all folders that match a particular path rather than just the first one 2010-06-18 18:08:37 +01:00
Diva Canto c980326425 Merge branch '0.7-post-fixes' of ssh://diva@opensimulator.org/var/git/opensim into 0.7-post-fixes 2010-06-15 19:57:32 -07:00
Diva Canto 4baf59d2dd Merge branch 'master' into 0.7-post-fixes 2010-06-15 19:56:09 -07:00
John Hurliman 212a538557 * Support salted and unsalted password hashes in SimianAuthenticationServiceConnector 2010-06-15 17:55:47 -07:00
Diva Canto cf5427e810 Fixed version info again. 2010-06-14 19:13:46 -07:00
50 changed files with 920 additions and 636 deletions

View File

@ -95,6 +95,7 @@ what it is today.
* Mic Bowman * Mic Bowman
* Michelle Argus * Michelle Argus
* Michael Cortez (The Flotsam Project, http://osflotsam.org/) * Michael Cortez (The Flotsam Project, http://osflotsam.org/)
* Micheil Merlin
* Mike Osias (IBM) * Mike Osias (IBM)
* Mike Pitman (IBM) * Mike Pitman (IBM)
* mikkopa/_someone - RealXtend * mikkopa/_someone - RealXtend

View File

@ -3,19 +3,10 @@
<Import assembly="OpenSim.Data.dll" /> <Import assembly="OpenSim.Data.dll" />
<Import assembly="OpenSim.Framework.dll" /> <Import assembly="OpenSim.Framework.dll" />
</Runtime> </Runtime>
<ExtensionPoint path = "/OpenSim/GridData">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IGridDataPlugin" />
</ExtensionPoint>
<ExtensionPoint path = "/OpenSim/LogData">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.ILogDataPlugin" />
</ExtensionPoint>
<ExtensionPoint path = "/OpenSim/AssetData"> <ExtensionPoint path = "/OpenSim/AssetData">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" /> <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" />
</ExtensionPoint> </ExtensionPoint>
<ExtensionPoint path = "/OpenSim/InventoryData"> <ExtensionPoint path = "/OpenSim/InventoryData">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin" /> <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin" />
</ExtensionPoint> </ExtensionPoint>
<ExtensionPoint path = "/OpenSim/UserData">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IUserDataPlugin" />
</ExtensionPoint>
</Addin> </Addin>

View File

@ -328,7 +328,7 @@ namespace OpenSim.Data.SQLite
public EstateSettings LoadEstateSettings(int estateID) public EstateSettings LoadEstateSettings(int estateID)
{ {
string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID :EstateID"; string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID = :EstateID";
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
@ -342,7 +342,7 @@ namespace OpenSim.Data.SQLite
{ {
List<int> result = new List<int>(); List<int> result = new List<int>();
string sql = "select EstateID from estate_settings where estate_settings.EstateName :EstateName"; string sql = "select EstateID from estate_settings where estate_settings.EstateName = :EstateName";
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();

View File

@ -328,7 +328,7 @@ namespace OpenSim.Data.SQLiteLegacy
public EstateSettings LoadEstateSettings(int estateID) public EstateSettings LoadEstateSettings(int estateID)
{ {
string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID :EstateID"; string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID = :EstateID";
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
@ -342,7 +342,7 @@ namespace OpenSim.Data.SQLiteLegacy
{ {
List<int> result = new List<int>(); List<int> result = new List<int>();
string sql = "select EstateID from estate_settings where estate_settings.EstateName :EstateName"; string sql = "select EstateID from estate_settings where estate_settings.EstateName = :EstateName";
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();

View File

@ -781,7 +781,7 @@ namespace OpenSim.Data.Tests
// Ownership changes when you drop an object into an object // Ownership changes when you drop an object into an object
// owned by someone else // owned by someone else
Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID), "Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID))"); Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID), "Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID))");
Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8), "Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8))"); // Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 16), "Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8))");
Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))"); Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))");
Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))"); Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))");
} }

View File

@ -118,7 +118,7 @@ namespace OpenSim.Framework.Console
// (Done with no echo and suitable for passwords) // (Done with no echo and suitable for passwords)
public string PasswdPrompt(string p) public string PasswdPrompt(string p)
{ {
return ReadLine(p, false, false); return ReadLine(String.Format("{0}: ", p), false, false);
} }
public virtual string ReadLine(string p, bool isCommand, bool e) public virtual string ReadLine(string p, bool isCommand, bool e)

View File

@ -73,7 +73,18 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
{ {
StreamReader str = new StreamReader(req.Request.Body); StreamReader str;
try
{
str = new StreamReader(req.Request.Body);
}
catch (System.ArgumentException)
{
// Stream was not readable means a child agent
// was closed due to logout, leaving the
// Event Queue request orphaned.
continue;
}
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
m_server.DoHTTPGruntWork(responsedata, m_server.DoHTTPGruntWork(responsedata,
@ -106,4 +117,4 @@ namespace OpenSim.Framework.Servers.HttpServer
m_request.Enqueue(pPollServiceHttpRequest); m_request.Enqueue(pPollServiceHttpRequest);
} }
} }
} }

View File

@ -29,8 +29,8 @@ namespace OpenSim
{ {
public class VersionInfo public class VersionInfo
{ {
private const string VERSION_NUMBER = "0.7.1"; private const string VERSION_NUMBER = "0.7";
private const Flavour VERSION_FLAVOUR = Flavour.Dev; private const Flavour VERSION_FLAVOUR = Flavour.Release;
public enum Flavour public enum Flavour
{ {

View File

@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public IJ2KDecoder J2KDecoder; public IJ2KDecoder J2KDecoder;
public IAssetService AssetService; public IAssetService AssetService;
public UUID AgentID; public UUID AgentID;
public IHyperAssetService HyperAssets; public IInventoryAccessModule InventoryAccessModule;
public OpenJPEG.J2KLayerInfo[] Layers; public OpenJPEG.J2KLayerInfo[] Layers;
public bool IsDecoded; public bool IsDecoded;
public bool HasAsset; public bool HasAsset;
@ -375,14 +375,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
UUID assetID = UUID.Zero; UUID assetID = UUID.Zero;
if (asset != null) if (asset != null)
assetID = asset.FullID; assetID = asset.FullID;
else if ((HyperAssets != null) && (sender != HyperAssets)) else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule))
{ {
// Try the user's inventory, but only if it's different from the regions' // Unfortunately we need this here, there's no other way.
string userAssets = HyperAssets.GetUserAssetServer(AgentID); // This is due to the fact that textures opened directly from the agent's inventory
if ((userAssets != string.Empty) && (userAssets != HyperAssets.GetSimAssetServer())) // don't have any distinguishing feature. As such, in order to serve those when the
// foreign user is visiting, we need to try again after the first fail to the local
// asset service.
string assetServerURL = string.Empty;
if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL))
{ {
m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id);
AssetService.Get(userAssets + "/" + id, HyperAssets, AssetReceived); AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived);
return; return;
} }
} }

View File

@ -357,7 +357,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected uint m_agentFOVCounter; protected uint m_agentFOVCounter;
protected IAssetService m_assetService; protected IAssetService m_assetService;
private IHyperAssetService m_hyperAssets;
private const bool m_checkPackets = true; private const bool m_checkPackets = true;
private Timer m_propertiesPacketTimer; private Timer m_propertiesPacketTimer;
@ -432,7 +431,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// m_attachmentsSent = new HashSet<uint>(); // m_attachmentsSent = new HashSet<uint>();
m_assetService = m_scene.RequestModuleInterface<IAssetService>(); m_assetService = m_scene.RequestModuleInterface<IAssetService>();
m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>();
m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion());
@ -7196,59 +7194,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
else // Agent else // Agent
{ {
IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId); if (invAccess != null)
assetRequestItem = invService.GetItem(assetRequestItem);
if (assetRequestItem == null)
{ {
ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>(); if (!invAccess.GetAgentInventoryItem(this, itemID, requestID))
if (lib != null) return false;
assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
if (assetRequestItem == null)
return true;
}
// At this point, we need to apply perms
// only to notecards and scripts. All
// other asset types are always available
//
if (assetRequestItem.AssetType == (int)AssetType.LSLText)
{
if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId))
{
SendAgentAlertMessage("Insufficient permissions to view script", false);
return true;
}
}
else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
{
if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId))
{
SendAgentAlertMessage("Insufficient permissions to view notecard", false);
return true;
}
} }
else
return false;
if (assetRequestItem.AssetID != requestID)
{
m_log.WarnFormat(
"[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
Name, requestID, itemID, assetRequestItem.AssetID);
return true;
}
} }
} }
} }
//m_assetCache.AddAssetRequest(this, transfer);
MakeAssetRequest(transfer, taskID); MakeAssetRequest(transfer, taskID);
/* RequestAsset = OnRequestAsset;
if (RequestAsset != null)
{
RequestAsset(this, transfer);
}*/
return true; return true;
} }
@ -11459,15 +11420,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
{ {
requestID = new UUID(transferRequest.TransferInfo.Params, 80); requestID = new UUID(transferRequest.TransferInfo.Params, 80);
//m_log.Debug("[XXX] inventory asset request " + requestID);
//if (taskID == UUID.Zero) // Agent
// if (m_scene is HGScene)
// {
// m_log.Debug("[XXX] hg asset request " + requestID);
// // We may need to fetch the asset from the user's asset server into the local asset server
// HGAssetMapper mapper = ((HGScene)m_scene).AssetMapper;
// mapper.Get(requestID, AgentId);
// }
} }
// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
@ -11483,49 +11435,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="asset"></param> /// <param name="asset"></param>
protected void AssetReceived(string id, Object sender, AssetBase asset) protected void AssetReceived(string id, Object sender, AssetBase asset)
{ {
if (asset == null)
return;
TransferRequestPacket transferRequest = (TransferRequestPacket)sender; TransferRequestPacket transferRequest = (TransferRequestPacket)sender;
UUID requestID = UUID.Zero; UUID requestID = UUID.Zero;
byte source = (byte)SourceType.Asset; byte source = (byte)SourceType.Asset;
if ((transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
|| (transferRequest.TransferInfo.SourceType == 2222))
{ {
requestID = new UUID(transferRequest.TransferInfo.Params, 0); requestID = new UUID(transferRequest.TransferInfo.Params, 0);
} }
else if ((transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
|| (transferRequest.TransferInfo.SourceType == 3333))
{ {
requestID = new UUID(transferRequest.TransferInfo.Params, 80); requestID = new UUID(transferRequest.TransferInfo.Params, 80);
source = (byte)SourceType.SimInventoryItem; source = (byte)SourceType.SimInventoryItem;
//m_log.Debug("asset request " + requestID); //m_log.Debug("asset request " + requestID);
} }
if (null == asset)
{
if ((m_hyperAssets != null) && (transferRequest.TransferInfo.SourceType < 2000))
{
// Try the user's inventory, but only if it's different from the regions'
string userAssets = m_hyperAssets.GetUserAssetServer(AgentId);
if ((userAssets != string.Empty) && (userAssets != m_hyperAssets.GetSimAssetServer()))
{
m_log.DebugFormat("[CLIENT]: asset {0} not found in local asset storage. Trying user's storage.", id);
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
transferRequest.TransferInfo.SourceType = 2222; // marker
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
transferRequest.TransferInfo.SourceType = 3333; // marker
m_assetService.Get(userAssets + "/" + id, transferRequest, AssetReceived);
return;
}
}
//m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID);
// FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right.
return;
}
// Scripts cannot be retrieved by direct request // Scripts cannot be retrieved by direct request
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10) if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10)
return; return;

View File

@ -58,8 +58,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer()); private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer());
private object m_syncRoot = new object(); private object m_syncRoot = new object();
private IHyperAssetService m_hyperAssets;
public LLClientView Client { get { return m_client; } } public LLClientView Client { get { return m_client; } }
public AssetBase MissingImage { get { return m_missingImage; } } public AssetBase MissingImage { get { return m_missingImage; } }
@ -75,7 +73,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client"); m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client");
m_j2kDecodeModule = pJ2kDecodeModule; m_j2kDecodeModule = pJ2kDecodeModule;
m_hyperAssets = client.Scene.RequestModuleInterface<IHyperAssetService>();
} }
/// <summary> /// <summary>
@ -149,7 +146,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
imgrequest.J2KDecoder = m_j2kDecodeModule; imgrequest.J2KDecoder = m_j2kDecodeModule;
imgrequest.AssetService = m_assetCache; imgrequest.AssetService = m_assetCache;
imgrequest.AgentID = m_client.AgentId; imgrequest.AgentID = m_client.AgentId;
imgrequest.HyperAssets = m_hyperAssets; imgrequest.InventoryAccessModule = m_client.Scene.RequestModuleInterface<IInventoryAccessModule>();
imgrequest.DiscardLevel = newRequest.DiscardLevel; imgrequest.DiscardLevel = newRequest.DiscardLevel;
imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber); imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber);
imgrequest.Priority = newRequest.Priority; imgrequest.Priority = newRequest.Priority;

View File

@ -182,7 +182,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
if (part.Inventory.UpdateInventoryItem(item)) if (part.Inventory.UpdateInventoryItem(item))
{ {
remoteClient.SendAgentAlertMessage("Notecard saved", false); if ((InventoryType)item.InvType == InventoryType.Notecard)
remoteClient.SendAgentAlertMessage("Notecard saved", false);
else if ((InventoryType)item.InvType == InventoryType.LSL)
remoteClient.SendAgentAlertMessage("Script saved", false);
else
remoteClient.SendAgentAlertMessage("Item saved", false);
part.GetProperties(remoteClient); part.GetProperties(remoteClient);
} }
} }

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
end = Utils.Clamp(end, 1, texture.Data.Length); end = Utils.Clamp(end, 1, texture.Data.Length);
start = Utils.Clamp(start, 0, end - 1); start = Utils.Clamp(start, 0, end - 1);
m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
if (end - start < texture.Data.Length) if (end - start < texture.Data.Length)
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent; response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;

View File

@ -81,14 +81,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
{ {
ScenePresence sp = m_scene.GetScenePresence(agentID); ScenePresence sp = m_scene.GetScenePresence(agentID);
if (sp != null && !sp.IsChildAgent) if (sp != null)
sp.ControllingClient.SendAgentAlertMessage(message, modal); sp.ControllingClient.SendAgentAlertMessage(message, modal);
} }
public void SendAlertToUser(string firstName, string lastName, string message, bool modal) public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
{ {
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName); ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
if (presence != null && !presence.IsChildAgent) if (presence != null)
presence.ControllingClient.SendAgentAlertMessage(message, modal); presence.ControllingClient.SendAgentAlertMessage(message, modal);
} }
@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
} }
ScenePresence sp = m_scene.GetScenePresence(avatarID); ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null && !sp.IsChildAgent) if (sp != null)
sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels); sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
} }
@ -128,7 +128,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
{ {
ScenePresence sp = m_scene.GetScenePresence(avatarID); ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null && !sp.IsChildAgent) if (sp != null)
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
} }
@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
ScenePresence sp = m_scene.GetScenePresence(avatarid); ScenePresence sp = m_scene.GetScenePresence(avatarid);
if (sp != null && !sp.IsChildAgent) if (sp != null)
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid); sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
} }

View File

@ -212,9 +212,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders);
m_log.DebugFormat( // m_log.DebugFormat(
"[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", // "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]",
iarPath, iarPathExisting); // iarPath, iarPathExisting);
string iarPathToCreate = iarPath.Substring(iarPathExisting.Length); string iarPathToCreate = iarPath.Substring(iarPathExisting.Length);
CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes); CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes);
@ -255,12 +255,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{ {
while (null == destFolder && archivePath.Length > 0) while (null == destFolder && archivePath.Length > 0)
{ {
m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); // m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath);
if (resolvedFolders.ContainsKey(archivePath)) if (resolvedFolders.ContainsKey(archivePath))
{ {
m_log.DebugFormat( // m_log.DebugFormat(
"[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath); // "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath);
destFolder = resolvedFolders[archivePath]; destFolder = resolvedFolders[archivePath];
} }
else else
@ -275,9 +275,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
} }
else else
{ {
m_log.DebugFormat( // m_log.DebugFormat(
"[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}", // "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}",
originalArchivePath); // originalArchivePath);
archivePath = string.Empty; archivePath = string.Empty;
destFolder = rootDestFolder; destFolder = rootDestFolder;
} }

View File

@ -206,11 +206,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (components.Length == 1) if (components.Length == 1)
{ {
// m_log.DebugFormat("FOUND SINGLE COMPONENT [{0}]", components[0]); // m_log.DebugFormat(
// "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}",
// components[0], startFolder.Name, startFolder.ID);
List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID); List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID);
// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count);
foreach (InventoryItemBase item in items) foreach (InventoryItemBase item in items)
{ {
// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Inspecting item {0} {1}", item.Name, item.ID);
if (item.Name == components[0]) if (item.Name == components[0])
return item; return item;
} }

View File

@ -63,13 +63,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
} }
/// <summary> /// <summary>
/// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). /// Test saving an inventory path to a V0.1 OpenSim Inventory Archive
/// (subject to change since there is no fixed format yet).
/// </summary> /// </summary>
// Commenting for now! The mock inventory service needs more beef, at least for
// GetFolderForType
// REFACTORING PROBLEM. This needs to be rewritten.
[Test] [Test]
public void TestSaveIarV0_1() public void TestSavePathToIarV0_1()
{ {
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
@ -181,6 +179,123 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// TODO: Test presence of more files and contents of files. // TODO: Test presence of more files and contents of files.
} }
/// <summary>
/// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive
/// (subject to change since there is no fixed format yet).
/// </summary>
[Test]
public void TestSaveItemToIarV0_1()
{
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
Scene scene = SceneSetupHelpers.SetupScene("Inventory");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
// Create user
string userFirstName = "Jock";
string userLastName = "Stirrup";
string userPassword = "troll";
UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword);
// Create asset
SceneObjectGroup object1;
SceneObjectPart part1;
{
string partName = "My Little Dog Object";
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
Vector3 groupPosition = new Vector3(10, 20, 30);
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
Vector3 offsetPosition = new Vector3(5, 10, 15);
part1
= new SceneObjectPart(
ownerId, shape, groupPosition, rotationOffset, offsetPosition);
part1.Name = partName;
object1 = new SceneObjectGroup(part1);
scene.AddNewSceneObject(object1, false);
}
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
scene.AssetService.Store(asset1);
// Create item
UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080");
string item1Name = "My Little Dog";
InventoryItemBase item1 = new InventoryItemBase();
item1.Name = item1Name;
item1.AssetID = asset1.FullID;
item1.ID = item1Id;
InventoryFolderBase objsFolder
= InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0];
item1.Folder = objsFolder.ID;
scene.AddInventoryItem(userId, item1);
MemoryStream archiveWriteStream = new MemoryStream();
archiverModule.OnInventoryArchiveSaved += SaveCompleted;
mre.Reset();
archiverModule.ArchiveInventory(
Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream);
mre.WaitOne(60000, false);
byte[] archive = archiveWriteStream.ToArray();
MemoryStream archiveReadStream = new MemoryStream(archive);
TarArchiveReader tar = new TarArchiveReader(archiveReadStream);
//bool gotControlFile = false;
bool gotObject1File = false;
//bool gotObject2File = false;
string expectedObject1FileName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1);
string expectedObject1FilePath = string.Format(
"{0}{1}",
ArchiveConstants.INVENTORY_PATH,
expectedObject1FileName);
string filePath;
TarArchiveReader.TarEntryType tarEntryType;
// Console.WriteLine("Reading archive");
while (tar.ReadEntry(out filePath, out tarEntryType) != null)
{
Console.WriteLine("Got {0}", filePath);
// if (ArchiveConstants.CONTROL_FILE_PATH == filePath)
// {
// gotControlFile = true;
// }
if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml"))
{
// string fileName = filePath.Remove(0, "Objects/".Length);
//
// if (fileName.StartsWith(part1.Name))
// {
Assert.That(expectedObject1FilePath, Is.EqualTo(filePath));
gotObject1File = true;
// }
// else if (fileName.StartsWith(part2.Name))
// {
// Assert.That(fileName, Is.EqualTo(expectedObject2FileName));
// gotObject2File = true;
// }
}
}
// Assert.That(gotControlFile, Is.True, "No control file in archive");
Assert.That(gotObject1File, Is.True, "No item1 file in archive");
// Assert.That(gotObject2File, Is.True, "No object2 file in archive");
// TODO: Test presence of more files and contents of files.
}
/// <summary> /// <summary>
/// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where
/// an account exists with the creator name. /// an account exists with the creator name.

View File

@ -157,6 +157,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>();
HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL);
uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids);
if (ids.ContainsKey(assetID))
ids.Remove(assetID);
foreach (UUID uuid in ids.Keys) foreach (UUID uuid in ids.Keys)
FetchAsset(userAssetURL, uuid); FetchAsset(userAssetURL, uuid);

View File

@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return ret; return ret;
} }
// DO NOT OVERRIDE THIS METHOD // DO NOT OVERRIDE THE BASE METHOD
public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
SceneObjectGroup objectGroup, IClientAPI remoteClient) SceneObjectGroup objectGroup, IClientAPI remoteClient)
{ {
@ -139,7 +139,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (!assetID.Equals(UUID.Zero)) if (!assetID.Equals(UUID.Zero))
{ {
UploadInventoryItem(remoteClient.AgentId, assetID, "", 0); if (remoteClient != null)
UploadInventoryItem(remoteClient.AgentId, assetID, "", 0);
} }
else else
m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
@ -192,9 +193,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
m_assMapper.Post(item.AssetID, receiver, userAssetServer); m_assMapper.Post(item.AssetID, receiver, userAssetServer);
} }
#endregion public override bool IsForeignUser(UUID userID, out string assetServerURL)
public bool IsForeignUser(UUID userID, out string assetServerURL)
{ {
assetServerURL = string.Empty; assetServerURL = string.Empty;
UserAccount account = null; UserAccount account = null;
@ -217,5 +216,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return false; return false;
} }
#endregion
protected override InventoryItemBase GetItem(UUID agentID, UUID itemID)
{
InventoryItemBase item = base.GetItem(agentID, itemID);
string userAssetServer = string.Empty;
if (IsForeignUser(agentID, out userAssetServer))
m_assMapper.Get(item.AssetID, agentID, userAssetServer);
return item;
}
} }
} }

View File

@ -639,6 +639,57 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{ {
} }
public virtual bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
{
InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID);
if (assetRequestItem == null)
{
ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>();
if (lib != null)
assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
if (assetRequestItem == null)
return false;
}
// At this point, we need to apply perms
// only to notecards and scripts. All
// other asset types are always available
//
if (assetRequestItem.AssetType == (int)AssetType.LSLText)
{
if (!m_Scene.Permissions.CanViewScript(itemID, UUID.Zero, remoteClient.AgentId))
{
remoteClient.SendAgentAlertMessage("Insufficient permissions to view script", false);
return false;
}
}
else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
{
if (!m_Scene.Permissions.CanViewNotecard(itemID, UUID.Zero, remoteClient.AgentId))
{
remoteClient.SendAgentAlertMessage("Insufficient permissions to view notecard", false);
return false;
}
}
if (assetRequestItem.AssetID != requestID)
{
m_log.WarnFormat(
"[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
Name, requestID, itemID, assetRequestItem.AssetID);
return false;
}
return true;
}
public virtual bool IsForeignUser(UUID userID, out string assetServerURL)
{
assetServerURL = string.Empty;
return false;
}
#endregion #endregion
#region Misc #region Misc
@ -661,6 +712,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return asset; return asset;
} }
protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID)
{
IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>();
InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, agentID);
assetRequestItem = invService.GetItem(assetRequestItem);
return assetRequestItem;
}
#endregion #endregion
} }
} }

View File

@ -41,7 +41,7 @@ using OpenMetaverse;
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
{ {
public class HGAssetBroker : public class HGAssetBroker :
ISharedRegionModule, IAssetService, IHyperAssetService ISharedRegionModule, IAssetService
{ {
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger( LogManager.GetLogger(
@ -150,7 +150,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
m_aScene = scene; m_aScene = scene;
scene.RegisterModuleInterface<IAssetService>(this); scene.RegisterModuleInterface<IAssetService>(this);
scene.RegisterModuleInterface<IHyperAssetService>(this);
} }
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)

View File

@ -202,9 +202,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
} }
} }
} }
// else put a null; it means that the methods should forward to local grid's inventory
m_InventoryURLs.Add(userID, null);
} }
private void DropInventoryServiceURL(UUID userID) private void DropInventoryServiceURL(UUID userID)
@ -223,10 +220,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (m_InventoryURLs.ContainsKey(userID)) if (m_InventoryURLs.ContainsKey(userID))
return m_InventoryURLs[userID]; return m_InventoryURLs[userID];
else CacheInventoryServiceURL(userID);
CacheInventoryServiceURL(userID);
return m_InventoryURLs[userID]; if (m_InventoryURLs.ContainsKey(userID))
return m_InventoryURLs[userID];
return null; //it means that the methods should forward to local grid's inventory
} }
#endregion #endregion
@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public InventoryFolderBase GetRootFolder(UUID userID) public InventoryFolderBase GetRootFolder(UUID userID)
{ {
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID); //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID);
string invURL = GetInventoryServiceURL(userID); string invURL = GetInventoryServiceURL(userID);
@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
{ {
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type);
string invURL = GetInventoryServiceURL(userID); string invURL = GetInventoryServiceURL(userID);
@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public InventoryCollection GetFolderContent(UUID userID, UUID folderID) public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
{ {
m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID); //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID);
string invURL = GetInventoryServiceURL(userID); string invURL = GetInventoryServiceURL(userID);
@ -296,7 +296,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
{ {
m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID); //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID);
string invURL = GetInventoryServiceURL(userID); string invURL = GetInventoryServiceURL(userID);
@ -314,7 +314,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == null) if (folder == null)
return false; return false;
m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID); //m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID);
string invURL = GetInventoryServiceURL(folder.Owner); string invURL = GetInventoryServiceURL(folder.Owner);
@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == null) if (folder == null)
return false; return false;
m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID); //m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID);
string invURL = GetInventoryServiceURL(folder.Owner); string invURL = GetInventoryServiceURL(folder.Owner);
@ -350,7 +350,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folderIDs.Count == 0) if (folderIDs.Count == 0)
return false; return false;
m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID); //m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID);
string invURL = GetInventoryServiceURL(ownerID); string invURL = GetInventoryServiceURL(ownerID);
@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == null) if (folder == null)
return false; return false;
m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner); //m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner);
string invURL = GetInventoryServiceURL(folder.Owner); string invURL = GetInventoryServiceURL(folder.Owner);
@ -384,7 +384,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == null) if (folder == null)
return false; return false;
m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner); //m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner);
string invURL = GetInventoryServiceURL(folder.Owner); string invURL = GetInventoryServiceURL(folder.Owner);
@ -401,7 +401,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (item == null) if (item == null)
return false; return false;
m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID); //m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID);
string invURL = GetInventoryServiceURL(item.Owner); string invURL = GetInventoryServiceURL(item.Owner);
@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (item == null) if (item == null)
return false; return false;
m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID); //m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID);
string invURL = GetInventoryServiceURL(item.Owner); string invURL = GetInventoryServiceURL(item.Owner);
@ -437,7 +437,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (items.Count == 0) if (items.Count == 0)
return true; return true;
m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID); //m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID);
string invURL = GetInventoryServiceURL(ownerID); string invURL = GetInventoryServiceURL(ownerID);
@ -451,15 +451,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public bool DeleteItems(UUID ownerID, List<UUID> itemIDs) public bool DeleteItems(UUID ownerID, List<UUID> itemIDs)
{ {
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID);
if (itemIDs == null) if (itemIDs == null)
return false; return false;
if (itemIDs.Count == 0) if (itemIDs.Count == 0)
return true; return true;
m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteItems for " + ownerID);
string invURL = GetInventoryServiceURL(ownerID); string invURL = GetInventoryServiceURL(ownerID);
if (invURL == null) // not there, forward to local inventory connector to resolve if (invURL == null) // not there, forward to local inventory connector to resolve
@ -474,7 +472,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
{ {
if (item == null) if (item == null)
return null; return null;
m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID); //m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID);
string invURL = GetInventoryServiceURL(item.Owner); string invURL = GetInventoryServiceURL(item.Owner);
@ -491,7 +489,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == null) if (folder == null)
return null; return null;
m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID); //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID);
string invURL = GetInventoryServiceURL(folder.Owner); string invURL = GetInventoryServiceURL(folder.Owner);
@ -515,7 +513,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public int GetAssetPermissions(UUID userID, UUID assetID) public int GetAssetPermissions(UUID userID, UUID assetID)
{ {
m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID); //m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID);
string invURL = GetInventoryServiceURL(userID); string invURL = GetInventoryServiceURL(userID);

View File

@ -805,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
imgstream = new MemoryStream(); imgstream = new MemoryStream();
// non-async because we know we have the asset immediately. // non-async because we know we have the asset immediately.
AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.lastMapUUID.ToString()); AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.RegionSettings.TerrainImageID.ToString());
// Decode image to System.Drawing.Image // Decode image to System.Drawing.Image
if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image)) if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image))

View File

@ -258,21 +258,16 @@ namespace OpenSim.Region.DataSnapshot
private String GetRegionCategory(Scene scene) private String GetRegionCategory(Scene scene)
{ {
//Boolean choice between: if (scene.RegionInfo.RegionSettings.Maturity == 0)
// "PG" - Mormontown
// "Mature" - Sodom and Gomorrah
if (scene.RegionInfo.RegionSettings.Maturity == 1)
{
return "Mature";
}
else if (scene.RegionInfo.RegionSettings.Maturity == 0)
{
return "PG"; return "PG";
}
else if (scene.RegionInfo.RegionSettings.Maturity == 1)
{ return "Mature";
return "Unknown";
} if (scene.RegionInfo.RegionSettings.Maturity == 2)
return "Adult";
return "Unknown";
} }
private XmlNode GetGridSnapshotData(XmlDocument factory) private XmlNode GetGridSnapshotData(XmlDocument factory)

View File

@ -1,37 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using OpenMetaverse;
namespace OpenSim.Region.Framework.Interfaces
{
public interface IHyperAssetService
{
string GetUserAssetServer(UUID userID);
string GetSimAssetServer();
}
}

View File

@ -43,5 +43,9 @@ namespace OpenSim.Region.Framework.Interfaces
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);
void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver); void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver);
bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID);
// Must be here because of textures in user's inventory
bool IsForeignUser(UUID userID, out string assetServerURL);
} }
} }

View File

@ -384,29 +384,105 @@ namespace OpenSim.Region.Framework.Scenes
if (Permissions.PropagatePermissions() && recipient != senderId) if (Permissions.PropagatePermissions() && recipient != senderId)
{ {
// First, make sore base is limited to the next perms // Trying to do this right this time. This is evil. If
itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move); // you believe in Good, go elsewhere. Vampires and other
// By default, current equals base // evil creatores only beyond this point. You have been
itemCopy.CurrentPermissions = itemCopy.BasePermissions & item.CurrentPermissions; // warned.
// If this is an object, replace current perms // We're going to mask a lot of things by the next perms
// with folded perms // Tweak the next perms to be nicer to our data
//
// In this mask, all the bits we do NOT want to mess
// with are set. These are:
//
// Transfer
// Copy
// Modufy
uint permsMask = ~ ((uint)PermissionMask.Copy |
(uint)PermissionMask.Transfer |
(uint)PermissionMask.Modify);
// Now, reduce the next perms to the mask bits
// relevant to the operation
uint nextPerms = permsMask | (item.NextPermissions &
((uint)PermissionMask.Copy |
(uint)PermissionMask.Transfer |
(uint)PermissionMask.Modify));
// nextPerms now has all bits set, except for the actual
// next permission bits.
// This checks for no mod, no copy, no trans.
// This indicates an error or messed up item. Do it like
// SL and assume trans
if (nextPerms == permsMask)
nextPerms |= (uint)PermissionMask.Transfer;
// Inventory owner perms are the logical AND of the
// folded perms and the root prim perms, however, if
// the root prim is mod, the inventory perms will be
// mod. This happens on "take" and is of little concern
// here, save for preventing escalation
// This hack ensures that items previously permalocked
// get unlocked when they're passed or rezzed
uint basePerms = item.BasePermissions |
(uint)PermissionMask.Move;
uint ownerPerms = item.CurrentPermissions;
// If this is an object, root prim perms may be more
// permissive than folded perms. Use folded perms as
// a mask
if (item.InvType == (int)InventoryType.Object) if (item.InvType == (int)InventoryType.Object)
{ {
itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); // Create a safe mask for the current perms
itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13; uint foldedPerms = (item.CurrentPermissions & 7) << 13;
foldedPerms |= permsMask;
bool isRootMod = (item.CurrentPermissions &
(uint)PermissionMask.Modify) != 0 ?
true : false;
// Mask the owner perms to the folded perms
ownerPerms &= foldedPerms;
basePerms &= foldedPerms;
// If the root was mod, let the mask reflect that
// We also need to adjust the base here, because
// we should be able to edit in-inventory perms
// for the root prim, if it's mod.
if (isRootMod)
{
ownerPerms |= (uint)PermissionMask.Modify;
basePerms |= (uint)PermissionMask.Modify;
}
} }
// Ensure there is no escalation // These will be applied to the root prim at next rez.
itemCopy.CurrentPermissions &= (item.NextPermissions | (uint)PermissionMask.Move); // The slam bit (bit 3) and folded permission (bits 0-2)
// are preserved due to the above mangling
ownerPerms &= nextPerms;
// Need slam bit on xfer // Mask the base permissions. This is a conservative
itemCopy.CurrentPermissions |= 8; // approach altering only the three main perms
basePerms &= nextPerms;
// Assign to the actual item. Make sure the slam bit is
// set, if it wasn't set before.
itemCopy.BasePermissions = basePerms;
itemCopy.CurrentPermissions = ownerPerms | 16; // Slam
itemCopy.NextPermissions = item.NextPermissions; itemCopy.NextPermissions = item.NextPermissions;
itemCopy.EveryOnePermissions = 0; // This preserves "everyone can move"
itemCopy.EveryOnePermissions = item.EveryOnePermissions &
nextPerms;
// Intentionally killing "share with group" here, as
// the recipient will not have the group this is
// set to
itemCopy.GroupPermissions = 0; itemCopy.GroupPermissions = 0;
} }
else else
{ {
@ -839,6 +915,9 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup group = part.ParentGroup; SceneObjectGroup group = part.ParentGroup;
if (group != null) if (group != null)
{ {
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
return;
TaskInventoryItem item = group.GetInventoryItem(localID, itemID); TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
if (item == null) if (item == null)
return; return;
@ -978,9 +1057,21 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
} }
// Only owner can copy TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId);
if (remoteClient.AgentId != taskItem.OwnerID) if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
return; {
// If the item to be moved is no copy, we need to be able to
// edit the prim.
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
return;
}
else
{
// If the item is copiable, then we just need to have perms
// on it. The delete check is a pure rights check
if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId))
return;
}
MoveTaskInventoryItem(remoteClient, folderId, part, itemId); MoveTaskInventoryItem(remoteClient, folderId, part, itemId);
} }
@ -1263,10 +1354,48 @@ namespace OpenSim.Region.Framework.Scenes
{ {
agentTransactions.HandleTaskItemUpdateFromTransaction( agentTransactions.HandleTaskItemUpdateFromTransaction(
remoteClient, part, transactionID, currentItem); remoteClient, part, transactionID, currentItem);
if ((InventoryType)itemInfo.InvType == InventoryType.Notecard)
remoteClient.SendAgentAlertMessage("Notecard saved", false);
else if ((InventoryType)itemInfo.InvType == InventoryType.LSL)
remoteClient.SendAgentAlertMessage("Script saved", false);
else
remoteClient.SendAgentAlertMessage("Item saved", false);
} }
// Base ALWAYS has move
currentItem.BasePermissions |= (uint)PermissionMask.Move;
// Check if we're allowed to mess with permissions
if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god
{
if (remoteClient.AgentId != part.OwnerID) // Not owner
{
// Friends and group members can't change any perms
itemInfo.BasePermissions = currentItem.BasePermissions;
itemInfo.EveryonePermissions = currentItem.EveryonePermissions;
itemInfo.GroupPermissions = currentItem.GroupPermissions;
itemInfo.NextPermissions = currentItem.NextPermissions;
itemInfo.CurrentPermissions = currentItem.CurrentPermissions;
}
else
{
// Owner can't change base, and can change other
// only up to base
itemInfo.BasePermissions = currentItem.BasePermissions;
itemInfo.EveryonePermissions &= currentItem.BasePermissions;
itemInfo.GroupPermissions &= currentItem.BasePermissions;
itemInfo.CurrentPermissions &= currentItem.BasePermissions;
itemInfo.NextPermissions &= currentItem.BasePermissions;
}
}
// Next ALWAYS has move
itemInfo.NextPermissions |= (uint)PermissionMask.Move;
if (part.Inventory.UpdateInventoryItem(itemInfo)) if (part.Inventory.UpdateInventoryItem(itemInfo))
{ {
remoteClient.SendAgentAlertMessage("Notecard saved", false);
part.GetProperties(remoteClient); part.GetProperties(remoteClient);
} }
} }
@ -1597,7 +1726,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
// Handle god perms // Handle god perms
if (Permissions.IsGod(remoteClient.AgentId)) if ((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId))
{ {
permissionToTake = true; permissionToTake = true;
permissionToTakeCopy = true; permissionToTakeCopy = true;
@ -1608,7 +1737,7 @@ namespace OpenSim.Region.Framework.Scenes
if (action == DeRezAction.SaveToExistingUserInventoryItem) if (action == DeRezAction.SaveToExistingUserInventoryItem)
permissionToDelete = false; permissionToDelete = false;
// if we want to take a copy,, we also don't want to delete // if we want to take a copy, we also don't want to delete
// Note: after this point, the permissionToTakeCopy flag // Note: after this point, the permissionToTakeCopy flag
// becomes irrelevant. It already includes the permissionToTake // becomes irrelevant. It already includes the permissionToTake
// permission and after excluding no copy items here, we can // permission and after excluding no copy items here, we can
@ -1619,6 +1748,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!permissionToTakeCopy) if (!permissionToTakeCopy)
return; return;
permissionToTake = true;
// Don't delete // Don't delete
permissionToDelete = false; permissionToDelete = false;
} }

View File

@ -136,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes
protected SceneCommunicationService m_sceneGridService; protected SceneCommunicationService m_sceneGridService;
public bool LoginsDisabled = true; public bool LoginsDisabled = true;
public bool LoadingPrims = false;
public new float TimeDilation public new float TimeDilation
{ {
@ -1879,6 +1880,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public virtual void LoadPrimsFromStorage(UUID regionID) public virtual void LoadPrimsFromStorage(UUID regionID)
{ {
LoadingPrims = true;
m_log.Info("[SCENE]: Loading objects from datastore"); m_log.Info("[SCENE]: Loading objects from datastore");
List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID);
@ -1902,6 +1904,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
LoadingPrims = false;
} }

View File

@ -281,7 +281,7 @@ namespace OpenSim.Region.Framework.Scenes
PermissionMask.Move | PermissionMask.Move |
PermissionMask.Transfer) | 7; PermissionMask.Transfer) | 7;
uint ownerMask = 0x7ffffff; uint ownerMask = 0x7fffffff;
foreach (SceneObjectPart part in m_parts.Values) foreach (SceneObjectPart part in m_parts.Values)
{ {
ownerMask &= part.OwnerMask; ownerMask &= part.OwnerMask;
@ -295,12 +295,16 @@ namespace OpenSim.Region.Framework.Scenes
if ((ownerMask & (uint)PermissionMask.Transfer) == 0) if ((ownerMask & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer; perms &= ~(uint)PermissionMask.Transfer;
if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0) // If root prim permissions are applied here, this would screw
perms &= ~((uint)PermissionMask.Modify >> 13); // with in-inventory manipulation of the next owner perms
if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0) // in a major way. So, let's move this to the give itself.
perms &= ~((uint)PermissionMask.Copy >> 13); // Yes. I know. Evil.
if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) // if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
perms &= ~((uint)PermissionMask.Transfer >> 13); // perms &= ~((uint)PermissionMask.Modify >> 13);
// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
// perms &= ~((uint)PermissionMask.Copy >> 13);
// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
// perms &= ~((uint)PermissionMask.Transfer >> 13);
return perms; return perms;
} }

View File

@ -294,7 +294,7 @@ namespace OpenSim.Region.Framework.Scenes
if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
|| m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
&& !IsAttachmentCheckFull()) && !IsAttachmentCheckFull() && (!m_scene.LoadingPrims))
{ {
m_scene.CrossPrimGroupIntoNewRegion(val, this, true); m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
} }

View File

@ -4137,6 +4137,13 @@ namespace OpenSim.Region.Framework.Scenes
case 16: case 16:
_nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) & _nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) &
baseMask; baseMask;
// Prevent the client from creating no mod, no copy
// objects
if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0)
_nextOwnerMask |= (uint)PermissionMask.Transfer;
_nextOwnerMask |= (uint)PermissionMask.Move;
break; break;
} }
SendFullUpdateToAllClients(); SendFullUpdateToAllClients();

View File

@ -118,20 +118,20 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="linkNum">Link number for the part</param> /// <param name="linkNum">Link number for the part</param>
public void ResetInventoryIDs() public void ResetInventoryIDs()
{ {
lock (Items) lock (m_items)
{ {
if (0 == Items.Count) if (0 == m_items.Count)
return; return;
HasInventoryChanged = true; HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true; m_part.ParentGroup.HasGroupChanged = true;
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); IList<TaskInventoryItem> items = GetInventoryItems();
Items.Clear(); m_items.Clear();
foreach (TaskInventoryItem item in items) foreach (TaskInventoryItem item in items)
{ {
item.ResetIDs(m_part.UUID); item.ResetIDs(m_part.UUID);
Items.Add(item.ItemID, item); m_items.Add(item.ItemID, item);
} }
} }
} }
@ -148,17 +148,17 @@ namespace OpenSim.Region.Framework.Scenes
{ {
return; return;
} }
}
HasInventoryChanged = true; HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true; m_part.ParentGroup.HasGroupChanged = true;
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); List<TaskInventoryItem> items = GetInventoryItems();
foreach (TaskInventoryItem item in items) foreach (TaskInventoryItem item in items)
{
if (ownerId != item.OwnerID)
{ {
if (ownerId != item.OwnerID) item.LastOwnerID = item.OwnerID;
{ item.OwnerID = ownerId;
item.LastOwnerID = item.OwnerID;
item.OwnerID = ownerId;
}
} }
} }
} }
@ -175,17 +175,15 @@ namespace OpenSim.Region.Framework.Scenes
{ {
return; return;
} }
}
HasInventoryChanged = true; HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true; m_part.ParentGroup.HasGroupChanged = true;
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); List<TaskInventoryItem> items = GetInventoryItems();
foreach (TaskInventoryItem item in items) foreach (TaskInventoryItem item in items)
{ {
if (groupID != item.GroupID) if (groupID != item.GroupID)
{ item.GroupID = groupID;
item.GroupID = groupID;
}
}
} }
} }
@ -194,17 +192,9 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource) public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
{ {
lock (m_items) List<TaskInventoryItem> scripts = GetInventoryScripts();
{ foreach (TaskInventoryItem item in scripts)
foreach (TaskInventoryItem item in Items.Values) CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
{
if ((int)InventoryType.LSL == item.InvType)
{
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug
}
}
}
} }
public ArrayList GetScriptErrors(UUID itemID) public ArrayList GetScriptErrors(UUID itemID)
@ -218,7 +208,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (IScriptModule e in engines) foreach (IScriptModule e in engines)
{ {
if (e != null) if (e != null)
{ {
ArrayList errors = e.GetScriptErrors(itemID); ArrayList errors = e.GetScriptErrors(itemID);
foreach (Object line in errors) foreach (Object line in errors)
ret.Add(line); ret.Add(line);
@ -237,16 +227,9 @@ namespace OpenSim.Region.Framework.Scenes
/// </param> /// </param>
public void RemoveScriptInstances(bool sceneObjectBeingDeleted) public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
{ {
lock (Items) List<TaskInventoryItem> scripts = GetInventoryScripts();
{ foreach (TaskInventoryItem item in scripts)
foreach (TaskInventoryItem item in Items.Values) RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
{
if ((int)InventoryType.LSL == item.InvType)
{
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
}
}
}
} }
/// <summary> /// <summary>
@ -259,7 +242,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.InfoFormat( // m_log.InfoFormat(
// "[PRIM INVENTORY]: " + // "[PRIM INVENTORY]: " +
// "Starting script {0}, {1} in prim {2}, {3}", // "Starting script {0}, {1} in prim {2}, {3}",
// item.Name, item.ItemID, m_part.Name, m_part.UUID); // item.Name, item.ItemID, Name, UUID);
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
return; return;
@ -295,20 +278,20 @@ namespace OpenSim.Region.Framework.Scenes
} }
else else
{ {
if (m_part.ParentGroup.m_savedScriptState != null)
RestoreSavedScriptState(item.OldItemID, item.ItemID);
lock (m_items) lock (m_items)
{ {
if (m_part.ParentGroup.m_savedScriptState != null)
RestoreSavedScriptState(item.OldItemID, item.ItemID);
m_items[item.ItemID].PermsMask = 0; m_items[item.ItemID].PermsMask = 0;
m_items[item.ItemID].PermsGranter = UUID.Zero; m_items[item.ItemID].PermsGranter = UUID.Zero;
string script = Utils.BytesToString(asset.Data);
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate();
} }
string script = Utils.BytesToString(asset.Data);
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate();
} }
} }
} }
@ -356,26 +339,14 @@ namespace OpenSim.Region.Framework.Scenes
m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml;
} }
foreach (IScriptModule e in engines) foreach (IScriptModule e in engines)
{ {
if (e != null) if (e != null)
{ {
// Stop an exception in setting saved state from propogating since this is not fatal. if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID]))
try break;
{
if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID]))
break;
}
catch (Exception ex)
{
m_log.WarnFormat(
"[PRIM INVENTORY]: Could not set script state for old key {0}, new key {1} in prim {2} {3}. Exception {4}{5}",
oldID, newID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
}
} }
} }
m_part.ParentGroup.m_savedScriptState.Remove(oldID); m_part.ParentGroup.m_savedScriptState.Remove(oldID);
} }
} }
@ -388,21 +359,15 @@ namespace OpenSim.Region.Framework.Scenes
/// </param> /// </param>
public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource) public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
{ {
lock (m_items) TaskInventoryItem item = GetInventoryItem(itemId);
{ if (item != null)
if (m_items.ContainsKey(itemId)) CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
{ else
CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource); m_log.ErrorFormat(
} "[PRIM INVENTORY]: " +
else "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
{ itemId, m_part.Name, m_part.UUID,
m_log.ErrorFormat( m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
"[PRIM INVENTORY]: " +
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
itemId, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
}
}
} }
/// <summary> /// <summary>
@ -443,16 +408,18 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary> /// <summary>
/// Check if the inventory holds an item with a given name. /// Check if the inventory holds an item with a given name.
/// This method assumes that the task inventory is already locked.
/// </summary> /// </summary>
/// <param name="name"></param> /// <param name="name"></param>
/// <returns></returns> /// <returns></returns>
private bool InventoryContainsName(string name) private bool InventoryContainsName(string name)
{ {
foreach (TaskInventoryItem item in Items.Values) lock (m_items)
{ {
if (item.Name == name) foreach (TaskInventoryItem item in m_items.Values)
return true; {
if (item.Name == name)
return true;
}
} }
return false; return false;
} }
@ -495,12 +462,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="item"></param> /// <param name="item"></param>
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop) public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
{ {
List<TaskInventoryItem> il; List<TaskInventoryItem> il = GetInventoryItems();
lock (m_items)
{
il = new List<TaskInventoryItem>(m_items.Values);
}
foreach (TaskInventoryItem i in il) foreach (TaskInventoryItem i in il)
{ {
@ -540,14 +502,12 @@ namespace OpenSim.Region.Framework.Scenes
item.GroupID = m_part.GroupID; item.GroupID = m_part.GroupID;
lock (m_items) lock (m_items)
{
m_items.Add(item.ItemID, item); m_items.Add(item.ItemID, item);
if (allowedDrop) if (allowedDrop)
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP); m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
else else
m_part.TriggerScriptChangedEvent(Changed.INVENTORY); m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
}
m_inventorySerial++; m_inventorySerial++;
//m_inventorySerial += 2; //m_inventorySerial += 2;
@ -571,9 +531,8 @@ namespace OpenSim.Region.Framework.Scenes
m_items.Add(item.ItemID, item); m_items.Add(item.ItemID, item);
// m_part.TriggerScriptChangedEvent(Changed.INVENTORY); // m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
} }
m_inventorySerial++;
} }
m_inventorySerial++;
} }
/// <summary> /// <summary>
@ -628,45 +587,44 @@ namespace OpenSim.Region.Framework.Scenes
public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents) public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
{ {
lock(m_items) TaskInventoryItem it = GetInventoryItem(item.ItemID);
if (it != null)
{ {
if (m_items.ContainsKey(item.ItemID)) item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID;
item.Flags = m_items[item.ItemID].Flags;
// If group permissions have been set on, check that the groupID is up to date in case it has
// changed since permissions were last set.
if (item.GroupPermissions != (uint)PermissionMask.None)
item.GroupID = m_part.GroupID;
if (item.AssetID == UUID.Zero)
item.AssetID = it.AssetID;
lock (m_items)
{ {
if (m_items.ContainsKey(item.ItemID)) m_items[item.ItemID] = item;
{ m_inventorySerial++;
item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID;
item.Flags = m_items[item.ItemID].Flags;
// If group permissions have been set on, check that the groupID is up to date in case it has
// changed since permissions were last set.
if (item.GroupPermissions != (uint)PermissionMask.None)
item.GroupID = m_part.GroupID;
if (item.AssetID == UUID.Zero)
{
item.AssetID = m_items[item.ItemID].AssetID;
}
m_items[item.ItemID] = item;
m_inventorySerial++;
if (fireScriptEvents)
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
return true;
}
else
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
item.ItemID, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
}
} }
return false;
if (fireScriptEvents)
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
return true;
} }
else
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
item.ItemID, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
}
return false;
} }
/// <summary> /// <summary>
@ -677,52 +635,37 @@ namespace OpenSim.Region.Framework.Scenes
/// in this prim's inventory.</returns> /// in this prim's inventory.</returns>
public int RemoveInventoryItem(UUID itemID) public int RemoveInventoryItem(UUID itemID)
{ {
lock (m_items) TaskInventoryItem item = GetInventoryItem(itemID);
if (item != null)
{ {
if (m_items.ContainsKey(itemID)) int type = m_items[itemID].InvType;
if (type == 10) // Script
{ {
int type = m_items[itemID].InvType; m_part.RemoveScriptEvents(itemID);
if (type == 10) // Script m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
{
m_part.RemoveScriptEvents(itemID);
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
}
m_items.Remove(itemID);
m_inventorySerial++;
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
int scriptcount = 0;
lock (m_items)
{
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.Type == 10)
{
scriptcount++;
}
}
}
if (scriptcount <= 0)
{
m_part.RemFlag(PrimFlags.Scripted);
}
m_part.ScheduleFullUpdate();
return type;
}
else
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
itemID, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
} }
m_items.Remove(itemID);
m_inventorySerial++;
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
if (!ContainsScripts())
m_part.RemFlag(PrimFlags.Scripted);
m_part.ScheduleFullUpdate();
return type;
}
else
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
itemID, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
} }
return -1; return -1;
@ -776,52 +719,50 @@ namespace OpenSim.Region.Framework.Scenes
// isn't available (such as drag from prim inventory to agent inventory) // isn't available (such as drag from prim inventory to agent inventory)
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
lock (m_items) List<TaskInventoryItem> items = GetInventoryItems();
foreach (TaskInventoryItem item in items)
{ {
foreach (TaskInventoryItem item in m_items.Values) UUID ownerID = item.OwnerID;
{ uint everyoneMask = 0;
UUID ownerID = item.OwnerID; uint baseMask = item.BasePermissions;
uint everyoneMask = 0; uint ownerMask = item.CurrentPermissions;
uint baseMask = item.BasePermissions; uint groupMask = item.GroupPermissions;
uint ownerMask = item.CurrentPermissions;
uint groupMask = item.GroupPermissions;
invString.AddItemStart(); invString.AddItemStart();
invString.AddNameValueLine("item_id", item.ItemID.ToString()); invString.AddNameValueLine("item_id", item.ItemID.ToString());
invString.AddNameValueLine("parent_id", m_part.UUID.ToString()); invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
invString.AddPermissionsStart(); invString.AddPermissionsStart();
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask)); invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask)); invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask)); invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask)); invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
invString.AddNameValueLine("owner_id", ownerID.ToString()); invString.AddNameValueLine("owner_id", ownerID.ToString());
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
invString.AddNameValueLine("group_id", item.GroupID.ToString()); invString.AddNameValueLine("group_id", item.GroupID.ToString());
invString.AddSectionEnd(); invString.AddSectionEnd();
invString.AddNameValueLine("asset_id", item.AssetID.ToString()); invString.AddNameValueLine("asset_id", item.AssetID.ToString());
invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags)); invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
invString.AddSaleStart(); invString.AddSaleStart();
invString.AddNameValueLine("sale_type", "not"); invString.AddNameValueLine("sale_type", "not");
invString.AddNameValueLine("sale_price", "0"); invString.AddNameValueLine("sale_price", "0");
invString.AddSectionEnd(); invString.AddSectionEnd();
invString.AddNameValueLine("name", item.Name + "|"); invString.AddNameValueLine("name", item.Name + "|");
invString.AddNameValueLine("desc", item.Description + "|"); invString.AddNameValueLine("desc", item.Description + "|");
invString.AddNameValueLine("creation_date", item.CreationDate.ToString()); invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
invString.AddSectionEnd(); invString.AddSectionEnd();
}
} }
fileData = Utils.StringToBytes(invString.BuildString); fileData = Utils.StringToBytes(invString.BuildString);
@ -843,12 +784,10 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (HasInventoryChanged) if (HasInventoryChanged)
{ {
lock (Items)
{
datastore.StorePrimInventory(m_part.UUID, Items.Values);
}
HasInventoryChanged = false; HasInventoryChanged = false;
List<TaskInventoryItem> items = GetInventoryItems();
datastore.StorePrimInventory(m_part.UUID, items);
} }
} }
@ -1014,6 +953,30 @@ namespace OpenSim.Region.Framework.Scenes
return ret; return ret;
} }
public List<TaskInventoryItem> GetInventoryItems()
{
List<TaskInventoryItem> ret = new List<TaskInventoryItem>();
lock (m_items)
ret = new List<TaskInventoryItem>(m_items.Values);
return ret;
}
public List<TaskInventoryItem> GetInventoryScripts()
{
List<TaskInventoryItem> ret = new List<TaskInventoryItem>();
lock (m_items)
{
foreach (TaskInventoryItem item in m_items.Values)
if (item.InvType == (int)InventoryType.LSL)
ret.Add(item);
}
return ret;
}
public Dictionary<UUID, string> GetScriptStates() public Dictionary<UUID, string> GetScriptStates()
{ {
@ -1023,35 +986,20 @@ namespace OpenSim.Region.Framework.Scenes
if (engines == null) // No engine at all if (engines == null) // No engine at all
return ret; return ret;
lock (m_items) List<TaskInventoryItem> scripts = GetInventoryScripts();
foreach (TaskInventoryItem item in scripts)
{ {
foreach (TaskInventoryItem item in m_items.Values) foreach (IScriptModule e in engines)
{ {
if (item.InvType == (int)InventoryType.LSL) if (e != null)
{ {
foreach (IScriptModule e in engines) string n = e.GetXMLState(item.ItemID);
if (n != String.Empty)
{ {
if (e != null) if (!ret.ContainsKey(item.ItemID))
{ ret[item.ItemID] = n;
// Stop any exception from the script engine from propogating since setting state break;
// isn't essential.
try
{
string n = e.GetXMLState(item.ItemID);
if (n != String.Empty)
{
if (!ret.ContainsKey(item.ItemID))
ret[item.ItemID] = n;
break;
}
}
catch (Exception ex)
{
m_log.WarnFormat(
"[PRIM INVENTORY]: Could not retrieve script state for item {0} {1} in prim {2} {3}. Exception {4}{5}",
item.Name, item.ItemID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
}
}
} }
} }
} }
@ -1066,25 +1014,22 @@ namespace OpenSim.Region.Framework.Scenes
if (engines == null) if (engines == null)
return; return;
lock (m_items) List<TaskInventoryItem> scripts = GetInventoryScripts();
foreach (TaskInventoryItem item in scripts)
{ {
foreach (TaskInventoryItem item in m_items.Values) foreach (IScriptModule engine in engines)
{ {
if (item.InvType == (int)InventoryType.LSL) if (engine != null)
{ {
foreach (IScriptModule engine in engines) if (item.OwnerChanged)
{ engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
if (engine != null) item.OwnerChanged = false;
{ engine.ResumeScript(item.ItemID);
if (item.OwnerChanged)
engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
item.OwnerChanged = false;
engine.ResumeScript(item.ItemID);
}
}
} }
} }
} }
} }
} }
} }

View File

@ -451,12 +451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Vector llVecNorm(LSL_Vector v) public LSL_Vector llVecNorm(LSL_Vector v)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
double mag = LSL_Vector.Mag(v); return LSL_Vector.Norm(v);
LSL_Vector nor = new LSL_Vector();
nor.x = v.x / mag;
nor.y = v.y / mag;
nor.z = v.z / mag;
return nor;
} }
public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b) public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b)
@ -470,22 +465,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
//Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke
// Utility function for llRot2Euler // Old implementation of llRot2Euler. Normalization not required as Atan2 function will
// only return values >= -PI (-180 degrees) and <= PI (180 degrees).
// normalize an angle between -PI and PI (-180 to +180 degrees)
protected double NormalizeAngle(double angle)
{
if (angle > -Math.PI && angle < Math.PI)
return angle;
int numPis = (int)(Math.PI / angle);
double remainder = angle - Math.PI * numPis;
if (numPis % 2 == 1)
return Math.PI - angle;
return remainder;
}
// Old implementation of llRot2Euler, now normalized
public LSL_Vector llRot2Euler(LSL_Rotation r) public LSL_Vector llRot2Euler(LSL_Rotation r)
{ {
@ -497,13 +478,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
double n = 2 * (r.y * r.s + r.x * r.z); double n = 2 * (r.y * r.s + r.x * r.z);
double p = m * m - n * n; double p = m * m - n * n;
if (p > 0) if (p > 0)
return new LSL_Vector(NormalizeAngle(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s))), return new LSL_Vector(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s)),
NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), Math.Atan2(n, Math.Sqrt(p)),
NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)))); Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)));
else if (n > 0) else if (n > 0)
return new LSL_Vector(0.0, Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); return new LSL_Vector(0.0, Math.PI * 0.5, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z));
else else
return new LSL_Vector(0.0, -Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); return new LSL_Vector(0.0, -Math.PI * 0.5, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z));
} }
/* From wiki: /* From wiki:
@ -4950,7 +4931,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case ',': case ',':
if (parens == 0) if (parens == 0)
{ {
result.Add(src.Substring(start,length).Trim()); result.Add(new LSL_String(src.Substring(start,length).Trim()));
start += length+1; start += length+1;
length = 0; length = 0;
} }
@ -5879,6 +5860,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
PSYS_PART_MAX_AGE = 7, PSYS_PART_MAX_AGE = 7,
PSYS_SRC_ACCEL = 8, PSYS_SRC_ACCEL = 8,
PSYS_SRC_PATTERN = 9, PSYS_SRC_PATTERN = 9,
PSYS_SRC_INNERANGLE = 10,
PSYS_SRC_OUTERANGLE = 11,
PSYS_SRC_TEXTURE = 12, PSYS_SRC_TEXTURE = 12,
PSYS_SRC_BURST_RATE = 13, PSYS_SRC_BURST_RATE = 13,
PSYS_SRC_BURST_PART_COUNT = 15, PSYS_SRC_BURST_PART_COUNT = 15,
@ -6011,6 +5994,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi; prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
break; break;
// PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The
// PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The
// client tells the difference between the two by looking at the 0x02 bit in
// the PartFlags variable.
case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.InnerAngle = (float)tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
break;
case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.OuterAngle = (float)tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
break;
case (int)ScriptBaseClass.PSYS_SRC_TEXTURE: case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1)); prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
break; break;
@ -6067,11 +6066,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN: case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN:
tempf = (float)rules.GetLSLFloatItem(i + 1); tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.InnerAngle = (float)tempf; prules.InnerAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
break; break;
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END: case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END:
tempf = (float)rules.GetLSLFloatItem(i + 1); tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.OuterAngle = (float)tempf; prules.OuterAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
break; break;
} }

View File

@ -262,7 +262,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
public static Vector3 Norm(Vector3 vector) public static Vector3 Norm(Vector3 vector)
{ {
double mag = Mag(vector); double mag = Mag(vector);
return new Vector3(vector.x / mag, vector.y / mag, vector.z / mag); if (mag > 0.0)
{
double invMag = 1.0 / mag;
return vector * invMag;
}
return new Vector3(0, 0, 0);
} }
#endregion #endregion
@ -663,13 +668,13 @@ namespace OpenSim.Region.ScriptEngine.Shared
Object[] ret; Object[] ret;
if (start < 0) if (start < 0)
start=m_data.Length-start; start=m_data.Length+start;
if (start < 0) if (start < 0)
start=0; start=0;
if (end < 0) if (end < 0)
end=m_data.Length-end; end=m_data.Length+end;
if (end < 0) if (end < 0)
end=0; end=0;

View File

@ -488,6 +488,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (stateSource == (int)StateSource.ScriptedRez) if (stateSource == (int)StateSource.ScriptedRez)
{ {
lock (m_CompileDict)
{
m_CompileDict[itemID] = 0;
}
DoOnRezScript(parms); DoOnRezScript(parms);
} }
else else
@ -696,9 +701,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
} }
ScriptInstance instance = null;
lock (m_Scripts) lock (m_Scripts)
{ {
ScriptInstance instance = null;
// Create the object record // Create the object record
if ((!m_Scripts.ContainsKey(itemID)) || if ((!m_Scripts.ContainsKey(itemID)) ||
@ -779,28 +784,29 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_Scripts[itemID] = instance; m_Scripts[itemID] = instance;
} }
lock (m_PrimObjects)
{
if (!m_PrimObjects.ContainsKey(localID))
m_PrimObjects[localID] = new List<UUID>();
if (!m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Add(itemID);
}
if (!m_Assemblies.ContainsKey(assetID))
m_Assemblies[assetID] = assembly;
lock (m_AddingAssemblies)
{
m_AddingAssemblies[assembly]--;
}
if (instance!=null)
instance.Init();
} }
lock (m_PrimObjects)
{
if (!m_PrimObjects.ContainsKey(localID))
m_PrimObjects[localID] = new List<UUID>();
if (!m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Add(itemID);
}
if (!m_Assemblies.ContainsKey(assetID))
m_Assemblies[assetID] = assembly;
lock (m_AddingAssemblies)
{
m_AddingAssemblies[assembly]--;
}
if (instance != null)
instance.Init();
return true; return true;
} }
@ -813,60 +819,60 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_CompileDict.Remove(itemID); m_CompileDict.Remove(itemID);
} }
IScriptInstance instance = null;
lock (m_Scripts) lock (m_Scripts)
{ {
// Do we even have it? // Do we even have it?
if (!m_Scripts.ContainsKey(itemID)) if (!m_Scripts.ContainsKey(itemID))
return; return;
IScriptInstance instance=m_Scripts[itemID]; instance=m_Scripts[itemID];
m_Scripts.Remove(itemID); m_Scripts.Remove(itemID);
}
instance.ClearQueue(); instance.ClearQueue();
instance.Stop(0); instance.Stop(0);
// bool objectRemoved = false; // bool objectRemoved = false;
lock (m_PrimObjects) lock (m_PrimObjects)
{
// Remove the script from it's prim
if (m_PrimObjects.ContainsKey(localID))
{ {
// Remove the script from it's prim // Remove inventory item record
if (m_PrimObjects.ContainsKey(localID)) if (m_PrimObjects[localID].Contains(itemID))
{ m_PrimObjects[localID].Remove(itemID);
// Remove inventory item record
if (m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Remove(itemID);
// If there are no more scripts, remove prim // If there are no more scripts, remove prim
if (m_PrimObjects[localID].Count == 0) if (m_PrimObjects[localID].Count == 0)
{ {
m_PrimObjects.Remove(localID); m_PrimObjects.Remove(localID);
// objectRemoved = true; // objectRemoved = true;
}
} }
} }
instance.RemoveState();
instance.DestroyScriptInstance();
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
if (m_DomainScripts[instance.AppDomain].Count == 0)
{
m_DomainScripts.Remove(instance.AppDomain);
UnloadAppDomain(instance.AppDomain);
}
instance = null;
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
if (handlerObjectRemoved != null)
{
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
handlerObjectRemoved(part.UUID);
}
CleanAssemblies();
} }
instance.RemoveState();
instance.DestroyScriptInstance();
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
if (m_DomainScripts[instance.AppDomain].Count == 0)
{
m_DomainScripts.Remove(instance.AppDomain);
UnloadAppDomain(instance.AppDomain);
}
instance = null;
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
if (handlerObjectRemoved != null)
{
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
handlerObjectRemoved(part.UUID);
}
ScriptRemoved handlerScriptRemoved = OnScriptRemoved; ScriptRemoved handlerScriptRemoved = OnScriptRemoved;
if (handlerScriptRemoved != null) if (handlerScriptRemoved != null)
handlerScriptRemoved(itemID); handlerScriptRemoved(itemID);
@ -1000,26 +1006,33 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public bool PostObjectEvent(uint localID, EventParams p) public bool PostObjectEvent(uint localID, EventParams p)
{ {
bool result = false; bool result = false;
List<UUID> uuids = null;
lock (m_PrimObjects) lock (m_PrimObjects)
{ {
if (!m_PrimObjects.ContainsKey(localID)) if (!m_PrimObjects.ContainsKey(localID))
return false; return false;
uuids = m_PrimObjects[localID];
foreach (UUID itemID in m_PrimObjects[localID]) }
foreach (UUID itemID in uuids)
{
IScriptInstance instance = null;
try
{ {
if (m_Scripts.ContainsKey(itemID)) if (m_Scripts.ContainsKey(itemID))
{ instance = m_Scripts[itemID];
IScriptInstance instance = m_Scripts[itemID]; }
if (instance != null) catch { /* ignore race conditions */ }
{
instance.PostEvent(p); if (instance != null)
result = true; {
} instance.PostEvent(p);
} result = true;
} }
} }
return result; return result;
} }
@ -1274,9 +1287,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string xml = instance.GetXMLState(); string xml = instance.GetXMLState();
XmlDocument sdoc = new XmlDocument(); XmlDocument sdoc = new XmlDocument();
sdoc.LoadXml(xml); bool loadedState = true;
XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState"); try
XmlNode rootNode = rootL[0]; {
sdoc.LoadXml(xml);
}
catch (System.Xml.XmlException e)
{
loadedState = false;
}
XmlNodeList rootL = null;
XmlNode rootNode = null;
if (loadedState)
{
rootL = sdoc.GetElementsByTagName("ScriptState");
rootNode = rootL[0];
}
// Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"> // Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
XmlDocument doc = new XmlDocument(); XmlDocument doc = new XmlDocument();
@ -1292,8 +1319,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
stateData.Attributes.Append(engineName); stateData.Attributes.Append(engineName);
doc.AppendChild(stateData); doc.AppendChild(stateData);
XmlNode xmlstate = null;
// Add <ScriptState>...</ScriptState> // Add <ScriptState>...</ScriptState>
XmlNode xmlstate = doc.ImportNode(rootNode, true); if (loadedState)
{
xmlstate = doc.ImportNode(rootNode, true);
}
else
{
xmlstate = doc.CreateElement("", "ScriptState", "");
}
stateData.AppendChild(xmlstate); stateData.AppendChild(xmlstate);
string assemName = instance.GetAssemblyName(); string assemName = instance.GetAssemblyName();

View File

@ -283,6 +283,10 @@ namespace OpenSim.Server.Handlers.Simulation
if (m_SimulationService == null) if (m_SimulationService == null)
{ {
m_log.Debug("[AGENT HANDLER]: Agent GET called. Harmless but useless."); m_log.Debug("[AGENT HANDLER]: Agent GET called. Harmless but useless.");
responsedata["content_type"] = "application/json";
responsedata["int_response_code"] = HttpStatusCode.NotImplemented;
responsedata["str_response_string"] = string.Empty;
return; return;
} }

View File

@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector"))
{ {
IConfig gridConfig = source.Configs["UserAccountService"]; IConfig gridConfig = source.Configs["UserAccountService"];
if (gridConfig == null) if (gridConfig == null)
@ -108,6 +108,23 @@ namespace OpenSim.Services.Connectors.SimianGrid
serviceUrl = serviceUrl + '/'; serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl; m_serverUrl = serviceUrl;
IConfig profilesConfig = source.Configs["Profiles"];
if (profilesConfig == null)
{
// Do not run this module by default.
return;
}
else
{
// if profiles aren't enabled, we're not needed.
// if we're not specified as the connector to use, then we're not wanted
if (profilesConfig.GetString("Module", String.Empty) != Name)
{
return;
}
m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name);
}
} }
} }
@ -135,6 +152,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
// Profiles // Profiles
client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler; client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler;
client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler; client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler;
client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler; client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler;
client.OnUserInfoRequest += UserInfoRequestHandler; client.OnUserInfoRequest += UserInfoRequestHandler;
@ -302,12 +320,25 @@ namespace OpenSim.Services.Connectors.SimianGrid
System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags, System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags,
about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID()); about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID());
OSDMap interests = null;
if (user.ContainsKey("LLInterests"))
{
try
{
interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap;
client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["languages"].AsString());
}
catch { }
}
if (about == null)
about = new OSDMap(0);
} }
else else
{ {
m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values"); m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values");
client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes, client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes,
String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero); String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero);
} }
} }

View File

@ -278,7 +278,11 @@ namespace OpenSim.Services.GridService
foreach (RegionData rdata in rdatas) foreach (RegionData rdata in rdatas)
if (rdata.RegionID != regionID) if (rdata.RegionID != regionID)
rinfos.Add(RegionData2RegionInfo(rdata)); {
int flags = Convert.ToInt32(rdata.Data["flags"]);
if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours
rinfos.Add(RegionData2RegionInfo(rdata));
}
} }
m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count); m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count);

View File

@ -259,13 +259,15 @@ namespace OpenSim.Services.InventoryService
public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID)
{ {
// m_log.DebugFormat("[XINVENTORY]: Fetch items for folder {0}", folderID);
// Since we probably don't get a valid principal here, either ... // Since we probably don't get a valid principal here, either ...
// //
List<InventoryItemBase> invItems = new List<InventoryItemBase>(); List<InventoryItemBase> invItems = new List<InventoryItemBase>();
XInventoryItem[] items = m_Database.GetItems( XInventoryItem[] items = m_Database.GetItems(
new string[] { "parentFolderID"}, new string[] { "parentFolderID" },
new string[] { UUID.Zero.ToString() }); new string[] { folderID.ToString() });
foreach (XInventoryItem i in items) foreach (XInventoryItem i in items)
invItems.Add(ConvertToOpenSim(i)); invItems.Add(ConvertToOpenSim(i));

View File

@ -170,6 +170,9 @@ namespace OpenSim.Services.LLLoginService
private string firstname; private string firstname;
private string lastname; private string lastname;
// Web map
private string mapTileURL;
// Error Flags // Error Flags
private string errorReason; private string errorReason;
private string errorMessage; private string errorMessage;
@ -218,7 +221,7 @@ namespace OpenSim.Services.LLLoginService
public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
GridRegion home, IPEndPoint clientIP) GridRegion home, IPEndPoint clientIP, string mapTileURL)
: this() : this()
{ {
FillOutInventoryData(invSkel, libService); FillOutInventoryData(invSkel, libService);
@ -234,6 +237,7 @@ namespace OpenSim.Services.LLLoginService
Message = message; Message = message;
BuddList = ConvertFriendListItem(friendsList); BuddList = ConvertFriendListItem(friendsList);
StartLocation = where; StartLocation = where;
MapTileURL = mapTileURL;
FillOutHomeData(pinfo, home); FillOutHomeData(pinfo, home);
LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z);
@ -405,6 +409,7 @@ namespace OpenSim.Services.LLLoginService
InitialOutfitHash["folder_name"] = "Nightclub Female"; InitialOutfitHash["folder_name"] = "Nightclub Female";
InitialOutfitHash["gender"] = "female"; InitialOutfitHash["gender"] = "female";
initialOutfit.Add(InitialOutfitHash); initialOutfit.Add(InitialOutfitHash);
mapTileURL = String.Empty;
} }
@ -468,6 +473,9 @@ namespace OpenSim.Services.LLLoginService
responseData["region_x"] = (Int32)(RegionX); responseData["region_x"] = (Int32)(RegionX);
responseData["region_y"] = (Int32)(RegionY); responseData["region_y"] = (Int32)(RegionY);
if (mapTileURL != String.Empty)
responseData["map-server-url"] = mapTileURL;
if (m_buddyList != null) if (m_buddyList != null)
{ {
responseData["buddy-list"] = m_buddyList.ToArray(); responseData["buddy-list"] = m_buddyList.ToArray();
@ -564,6 +572,9 @@ namespace OpenSim.Services.LLLoginService
map["region_x"] = OSD.FromInteger(RegionX); map["region_x"] = OSD.FromInteger(RegionX);
map["region_y"] = OSD.FromInteger(RegionY); map["region_y"] = OSD.FromInteger(RegionY);
if (mapTileURL != String.Empty)
map["map-server-url"] = OSD.FromString(mapTileURL);
if (m_buddyList != null) if (m_buddyList != null)
{ {
map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray());
@ -647,7 +658,7 @@ namespace OpenSim.Services.LLLoginService
Hashtable TempHash; Hashtable TempHash;
foreach (InventoryFolderBase InvFolder in folders) foreach (InventoryFolderBase InvFolder in folders)
{ {
if (InvFolder.ParentID == UUID.Zero) if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory")
{ {
rootID = InvFolder.ID; rootID = InvFolder.ID;
} }
@ -915,6 +926,12 @@ namespace OpenSim.Services.LLLoginService
set { home = value; } set { home = value; }
} }
public string MapTileURL
{
get { return mapTileURL; }
set { mapTileURL = value; }
}
public string Message public string Message
{ {
get { return welcomeMessage; } get { return welcomeMessage; }

View File

@ -73,6 +73,7 @@ namespace OpenSim.Services.LLLoginService
protected int m_MinLoginLevel; protected int m_MinLoginLevel;
protected string m_GatekeeperURL; protected string m_GatekeeperURL;
protected bool m_AllowRemoteSetLoginLevel; protected bool m_AllowRemoteSetLoginLevel;
protected string m_MapTileURL;
IConfig m_LoginServerConfig; IConfig m_LoginServerConfig;
@ -100,6 +101,7 @@ namespace OpenSim.Services.LLLoginService
m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false);
m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
// These are required; the others aren't // These are required; the others aren't
if (accountService == string.Empty || authService == string.Empty) if (accountService == string.Empty || authService == string.Empty)
@ -356,7 +358,7 @@ namespace OpenSim.Services.LLLoginService
// Finally, fill out the response and return it // Finally, fill out the response and return it
// //
LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP); where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL);
m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
return response; return response;

Binary file not shown.

View File

@ -128,7 +128,7 @@
; -->>> There are multiple connection strings defined in several places. Check it carefully! ; -->>> There are multiple connection strings defined in several places. Check it carefully!
; ;
; storage_plugin="OpenSim.Data.MySQL.dll" ; storage_plugin="OpenSim.Data.MySQL.dll"
; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;"; ; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"
; If you want to use a different database/server for estate data, then ; If you want to use a different database/server for estate data, then
; uncomment and change this connect string. Defaults to the above if not set ; uncomment and change this connect string. Defaults to the above if not set
; estate_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"; ; estate_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;";
@ -288,9 +288,6 @@
; if not defined - default machine name is being used ; if not defined - default machine name is being used
; (on Windows this mean NETBIOS name - useably only inside local network) ; (on Windows this mean NETBIOS name - useably only inside local network)
; ExternalHostNameForLSL=127.0.0.1 ; ExternalHostNameForLSL=127.0.0.1
; Uncomment below to enable llRemoteData/remote channels
; remoteDataPort = 20800
; What is reported as the "X-Secondlife-Shard" ; What is reported as the "X-Secondlife-Shard"
; Defaults to the user server url if not set ; Defaults to the user server url if not set
@ -1303,12 +1300,3 @@
;XmlRpcRouterModule = "XmlRpcRouterModule" ;XmlRpcRouterModule = "XmlRpcRouterModule"
;XmlRpcPort = 20800 ;XmlRpcPort = 20800
[Friends]
; The port the friendslist interregion comms will listen on
; Defaults to the simulator's TCP port
;Port = 0
; Uncomment one of the lines below. Use FriendsService for local
; operation, Connectors for remote operation
;Connector = "OpenSim.Services.FriendsService.dll"
Connector = "OpenSim.Services.Connectors.dll"

Binary file not shown.

View File

@ -11,7 +11,7 @@
;; ;;
[Startup] [Startup]
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8003/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector" ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector"
; * This is common for all services, it's the network setup for the entire ; * This is common for all services, it's the network setup for the entire
; * server instance, if none if specified above ; * server instance, if none if specified above
@ -28,7 +28,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[DatabaseService] [DatabaseService]
StorageProvider = "OpenSim.Data.MySQL.dll" StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"
; * As an example, the below configuration precisely mimicks the legacy ; * As an example, the below configuration precisely mimicks the legacy
; * asset server. It is read by the asset IN connector (defined above) ; * asset server. It is read by the asset IN connector (defined above)

View File

@ -28,7 +28,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[DatabaseService] [DatabaseService]
StorageProvider = "OpenSim.Data.MySQL.dll" StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"
; * As an example, the below configuration precisely mimicks the legacy ; * As an example, the below configuration precisely mimicks the legacy
@ -134,6 +134,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
WelcomeMessage = "Welcome, Avatar!" WelcomeMessage = "Welcome, Avatar!"
AllowRemoteSetLoginLevel = "false" AllowRemoteSetLoginLevel = "false"
; For snowglobe's web map
; MapTileURL = "";
[GridInfoService] [GridInfoService]
; These settings are used to return information on a get_grid_info call. ; These settings are used to return information on a get_grid_info call.

View File

@ -7,6 +7,9 @@
[Includes] [Includes]
Include-Common = "config-include/GridCommon.ini" Include-Common = "config-include/GridCommon.ini"
[Startup]
WorldMapModule = "HGWorldMap"
[Modules] [Modules]
AssetServices = "HGAssetBroker" AssetServices = "HGAssetBroker"
InventoryServices = "HGInventoryBroker" InventoryServices = "HGInventoryBroker"

View File

@ -65,3 +65,6 @@
MessagingModule = GroupsMessagingModule MessagingModule = GroupsMessagingModule
MessagingEnabled = true MessagingEnabled = true
ServicesConnectorModule = SimianGroupsServicesConnector ServicesConnectorModule = SimianGroupsServicesConnector
[Profiles]
Module = SimianProfiles

View File

@ -17,7 +17,7 @@
; Uncomment these lines if you want to use mysql storage ; Uncomment these lines if you want to use mysql storage
; Change the connection string to your db details ; Change the connection string to your db details
;StorageProvider = "OpenSim.Data.MySQL.dll" ;StorageProvider = "OpenSim.Data.MySQL.dll"
;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;"
[AssetService] [AssetService]
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"

View File

@ -3,7 +3,10 @@
;; All optional settings are in StandaloneCommon.ini.example, ;; All optional settings are in StandaloneCommon.ini.example,
;; which you can copy and change. ;; which you can copy and change.
;; ;;
[Startup]
WorldMapModule = "HGWorldMap"
[Modules] [Modules]
AssetServices = "HGAssetBroker" AssetServices = "HGAssetBroker"
InventoryServices = "HGInventoryBroker" InventoryServices = "HGInventoryBroker"